Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adjustments to Generic Business Partner model #479

Merged

Conversation

martinfkaeser
Copy link
Contributor

Small improvements to the DTO model:

  • optional BPN fields are added for input
  • named bpnL/S/A instead of bpnl/s/a
  • fixed assigment for isOwner, addressType after changes to optional/mandatory
  • improved OpenAPI description (clarified sorting and de-duping behaviour)

Solves #384

- optional BPN fields for input
- bpnL/S/A naming
- fixed assigment for isOwner, addressType
Copy link
Contributor

@nicoprow nicoprow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@martinfkaeser martinfkaeser force-pushed the feat/gbpm_dto_model_adjustment branch from 394b5dd to 93f6df6 Compare September 20, 2023 14:56
bpns = entity.bpnS,
bpna = entity.bpnA ?: throw NullPointerException("bpnA is null"),
isOwner = entity.isOwner,
bpnL = entity.bpnL ?: throw NullPointerException("bpnL is null"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we throw a Bpdm...Exception here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like that:
throw BpdmNullMappingException(BusinessPartner::class, BusinessPartnerOutputDto::class, BusinessPartnerOutputDto::bpnL, entity.externalId)

val shortName: String?

@get:ArraySchema(arraySchema = Schema(description = "The list of identifiers of the business partner."))
@get:ArraySchema(arraySchema = Schema(description = "The list of identifiers of the business partner. Sorted and duplicates are removed."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is used for request and response.
The request does not have to be sorted.
Duplicates are only removed in the request. The response should not contain any duplicate entries

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to phrase it that it works for both the request and response.
But yes, it's not quite clear. What do you think about:
"Automatically sorted and duplicates removed."
Any other suggestions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: "Sorted and duplicates removed by the service."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, sounds better to me

@nicoprow nicoprow merged commit bb446b8 into eclipse-tractusx:main Sep 21, 2023
7 checks passed
@nicoprow nicoprow deleted the feat/gbpm_dto_model_adjustment branch September 21, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants