From 3f7b250cf3ed7be50860b3ce6184a79107564bfd Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Wed, 20 Dec 2023 15:26:59 +0800 Subject: [PATCH] doc(Gate-Api): adjust openApi documentation for new generic business partner model to standard --- .../cleaning/service/CleaningServiceDummy.kt | 8 +-- .../service/CleaningServiceDummyTest.kt | 10 ++-- .../bpdm/cleaning/testdata/CommonValues.kt | 12 ++-- .../common/dto/IBaseBusinessPartnerDto.kt | 47 ++++++++++----- .../api/model/BusinessPartnerIdentifierDto.kt | 4 ++ .../api/model/IBaseBusinessPartnerGateDto.kt | 2 +- .../request/BusinessPartnerInputRequest.kt | 12 ++-- .../api/model/response/BusinessPartnerDto.kt | 24 ++++---- .../response/BusinessPartnerOutputDto.kt | 20 +++---- .../gate/service/BusinessPartnerMappings.kt | 40 ++++++------- .../bpdm/gate/service/OrchestratorMappings.kt | 20 +++---- .../controller/BusinessPartnerControllerIT.kt | 8 +-- .../gate/util/BusinessPartnerGenericValues.kt | 12 ++-- .../util/BusinessPartnerNonVerboseValues.kt | 4 +- .../gate/util/BusinessPartnerVerboseValues.kt | 58 +++++++++---------- .../api/model/BusinessPartnerGenericDto.kt | 24 ++++---- .../GoldenRecordTaskControllerIT.kt | 2 +- .../testdata/BusinessPartnerTestValues.kt | 24 ++++---- .../bpdm/pool/service/TaskStepBuildService.kt | 6 +- .../TaskStepFetchAndReserveServiceTest.kt | 8 +-- 20 files changed, 182 insertions(+), 163 deletions(-) diff --git a/bpdm-cleaning-service-dummy/src/main/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummy.kt b/bpdm-cleaning-service-dummy/src/main/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummy.kt index aa5555f1a..2238c5a21 100644 --- a/bpdm-cleaning-service-dummy/src/main/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummy.kt +++ b/bpdm-cleaning-service-dummy/src/main/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummy.kt @@ -121,20 +121,20 @@ class CleaningServiceDummy( val legalAddress = addressPartner.copy(bpnAReference = legalAddressBpnReference) - val bpnReferenceDto = createBpnReference(genericPartner.legalEntity.bpnL) + val bpnReferenceDto = createBpnReference(genericPartner.legalEntity.legalEntityBpn) return genericPartner.toLegalEntityDto(bpnReferenceDto, legalAddress) } fun createAddressRepresentation(genericPartner: BusinessPartnerGenericDto): LogisticAddressDto { - val bpnReferenceDto = createBpnReference(genericPartner.address.bpnA) + val bpnReferenceDto = createBpnReference(genericPartner.address.addressBpn) return genericPartner.toLogisticAddressDto(bpnReferenceDto) } fun createSiteRepresentation(genericPartner: BusinessPartnerGenericDto, siteAddressReference: LogisticAddressDto): SiteDto { val legalName = genericPartner.nameParts.joinToString(" ") - val bpnReferenceDto = createBpnReference(genericPartner.site.bpnS) + val bpnReferenceDto = createBpnReference(genericPartner.site.siteBpn) return genericPartner.toSiteDto(bpnReferenceDto, legalName, siteAddressReference) } @@ -152,7 +152,7 @@ class CleaningServiceDummy( fun shouldCreateSite(genericPartner: BusinessPartnerGenericDto): Boolean { return genericPartner.address.addressType == AddressType.SiteMainAddress || genericPartner.address.addressType == AddressType.LegalAndSiteMainAddress || - genericPartner.site.bpnS != null + genericPartner.site.siteBpn != null } diff --git a/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummyTest.kt b/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummyTest.kt index a1a541fce..6c37723b9 100644 --- a/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummyTest.kt +++ b/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/service/CleaningServiceDummyTest.kt @@ -51,7 +51,7 @@ class CleaningServiceDummyTest @Autowired constructor( val result = cleaningServiceDummy.processCleaningTask(taskStepReservationEntryDto) - val expectedBpnA = taskStepReservationEntryDto.businessPartner.generic.address.bpnA + val expectedBpnA = taskStepReservationEntryDto.businessPartner.generic.address.addressBpn val resultedAddress = result.businessPartner?.address @@ -112,9 +112,9 @@ class CleaningServiceDummyTest @Autowired constructor( val result = cleaningServiceDummy.processCleaningTask(taskStepReservationEntryDto) - val expectedBpnA = taskStepReservationEntryDto.businessPartner.generic.address.bpnA + val expectedBpnA = taskStepReservationEntryDto.businessPartner.generic.address.addressBpn - val expectedBpnL = taskStepReservationEntryDto.businessPartner.generic.legalEntity.bpnL + val expectedBpnL = taskStepReservationEntryDto.businessPartner.generic.legalEntity.legalEntityBpn val resultedAddress = result.businessPartner?.address @@ -153,9 +153,9 @@ class CleaningServiceDummyTest @Autowired constructor( val resultedSite = result.businessPartner?.site - val expectedBpnA = taskStepReservationResponse.businessPartner.generic.address.bpnA + val expectedBpnA = taskStepReservationResponse.businessPartner.generic.address.addressBpn - val expectedBpnS = taskStepReservationResponse.businessPartner.generic.site.bpnS + val expectedBpnS = taskStepReservationResponse.businessPartner.generic.site.siteBpn // legalEntity should Generate new bpnL and legalAddress should use passed bpnA since address type is LegalAndSiteMainAddress diff --git a/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/testdata/CommonValues.kt b/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/testdata/CommonValues.kt index a296aeae8..86ad150d2 100644 --- a/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/testdata/CommonValues.kt +++ b/bpdm-cleaning-service-dummy/src/test/kotlin/org/eclipse/tractusx/bpdm/cleaning/testdata/CommonValues.kt @@ -105,7 +105,7 @@ object CommonValues { states = states, roles = roles, ownerBpnL = "ownerBpnL2", - legalEntity = LegalEntityComponent( + legalEntity = LegalEntityRepresentation( shortName = shortName, legalForm = legalForm, classifications = classifications @@ -116,7 +116,7 @@ object CommonValues { val businessPartnerWithBpnA = with(businessPartnerWithEmptyBpns) { copy( address = address.copy( - bpnA = "FixedBPNA", + addressBpn = "FixedBPNA", addressType = postalAddressForAdditional.addressType, physicalPostalAddress = postalAddressForAdditional.physicalPostalAddress, alternativePostalAddress = postalAddressForAdditional.alternativePostalAddress @@ -128,13 +128,13 @@ object CommonValues { val businessPartnerWithBpnLAndBpnAAndLegalAddressType = with(businessPartnerWithEmptyBpns) { copy( address = address.copy( - bpnA = "FixedBPNA", + addressBpn = "FixedBPNA", addressType = postalAddressForLegal.addressType, physicalPostalAddress = postalAddressForLegal.physicalPostalAddress, alternativePostalAddress = postalAddressForLegal.alternativePostalAddress ), legalEntity = legalEntity.copy( - bpnL = "FixedBPNL" + legalEntityBpn = "FixedBPNL" ) ) } @@ -152,13 +152,13 @@ object CommonValues { val businessPartnerWithBpnSAndBpnAAndLegalAndSiteMainAddressType = with(businessPartnerWithEmptyBpns) { copy( address = address.copy( - bpnA = "FixedBPNA", + addressBpn = "FixedBPNA", addressType = postalAddressForLegalAndSite.addressType, physicalPostalAddress = postalAddressForLegalAndSite.physicalPostalAddress, alternativePostalAddress = postalAddressForLegalAndSite.alternativePostalAddress ), site = site.copy( - bpnS = "FixedBPNS" + siteBpn = "FixedBPNS" ) ) } diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt index b84166e6e..f63096d6d 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt @@ -33,40 +33,55 @@ interface IBaseBusinessPartnerDto { @get:ArraySchema(arraySchema = Schema(description = "The list of (temporary) states of the business partner. Sorted and duplicates removed by the service.")) val states: Collection - @get:ArraySchema(arraySchema = Schema(description = "Roles this business partner takes in relation to the sharing member. Sorted and duplicates removed by the service.")) + @get:ArraySchema(arraySchema = Schema(description = "One or more of the roles, the business partner assumes with respect to the sharing member: Supplier, Customer. Sorted and duplicates removed by the service.")) val roles: Collection - val legalEntity: IBaseLegalEntityComponent + @get:Schema(description = "The legal entity, on which the business partner provides a view.") + val legalEntity: IBaseLegalEntityRepresentation - val site: IBaseSiteComponent + @get:Schema(description = "The site, on which the business partner provides a view.") + val site: IBaseSiteRepresentation - val address: IBaseAddressComponent + @get:Schema(description = "The address, on which the business partner provides a view. ") + val address: IBaseAddressRepresentation } -interface IBaseLegalEntityComponent { +@Schema(description = "A legal entity representation adds context information to the legal entity, on which the business partner provides a view. Additionally, it contains some of the information from the assigned legal entity.") +interface IBaseLegalEntityRepresentation { - @get:Schema(description = "BPNL of the golden record legal entity this business partner refers to") - val bpnL: String? + @get:Schema(description = "The BPNL of the legal entity, on which the business partner provides a view.") + val legalEntityBpn: String? - @get:Schema(description = "The name according to official registers.") + @get:Schema(description = "The name of the legal entity, on which the business partner provides a view, according to official registers.") val legalName: String? - @get:Schema(description = "Abbreviated name or shorthand.") + @get:Schema(description = "The abbreviated name of the legal entity, on which the business partner provides a view.") val shortName: String? - @get:Schema(description = "Technical key of the legal form.") + @get:Schema(description = "The legal form of the legal entity, on which the business partner provides a view.") val legalForm: String? @get:ArraySchema(arraySchema = Schema(description = "The list of classifications of the business partner, such as a specific industry. Sorted and duplicates removed by the service.")) val classifications: Collection } -interface IBaseSiteComponent { - @get:Schema(description = "BPNS of the golden record site this business partner refers to") - val bpnS: String? +@Schema(description = "A site representation adds context information to the site, on which the business partner provides a view. Additionally, it contains some of the information from the assigned site.") +interface IBaseSiteRepresentation { + @get:Schema(description = "The BPNS of the site, on which the business partner provides a view.") + val siteBpn: String? } -interface IBaseAddressComponent : IBaseBusinessPartnerPostalAddressDto { - @get:Schema(description = "BPNA of the golden record address this business partner refers to") - val bpnA: String? +@Schema(description = "An address representation adds context information to the address, on which the business partner provides a view. Additionally, it contains most of the information from the assigned address.") +interface IBaseAddressRepresentation : IBaseBusinessPartnerPostalAddressDto { + @get:Schema(description = "The BPNA of the address, on which the business partner provides a view.") + val addressBpn: String? + + @get:Schema(description = "One of the address types: Legal Address, Site Main Address, Legal and Site Main Address, Additional Address. ") + override val addressType: AddressType? + + @get:Schema(description = "The physical postal address of the address, on which the business partner provides a view, such as an office, warehouse, gate, etc.") + override val physicalPostalAddress: IBasePhysicalPostalAddressDto? + + @get:Schema(description = "The alternative postal address of the address, on which the business partner provides a view, for example if the goods are to be picked up somewhere else.") + override val alternativePostalAddress: IBaseAlternativePostalAddressDto? } \ No newline at end of file diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt index 0b2cb184c..1e9c0b553 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt @@ -19,12 +19,16 @@ package org.eclipse.tractusx.bpdm.gate.api.model +import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.IBusinessPartnerIdentifierDto data class BusinessPartnerIdentifierDto( + @get:Schema(description = "The type of the identifier.") override val type: String?, + @get:Schema(description = "The value of the identifier like “DE123465789.") override val value: String?, + @get:Schema(description = "The name of the official register, where the identifier is registered. For example, a Handelsregisternummer in Germany is only valid with its corresponding Registergericht and Registerart.") override val issuingBody: String? ) : IBusinessPartnerIdentifierDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt index 35c4b5470..7239a6de8 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt @@ -28,7 +28,7 @@ interface IBaseBusinessPartnerGateDto : IBaseBusinessPartnerDto { @get:Schema(description = CommonDescription.externalId) val externalId: String - @get:Schema(description = "True if the sharing member declares itself as the owner of the business partner.") + @get:Schema(description = "Indicates whether the sharing member claims (in the initial upload) the business partner to belong to the company data of the sharing member.") val isOwnCompanyData: Boolean } diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt index 2e112d39e..eb83f59ac 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt @@ -24,9 +24,9 @@ import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerIdentifierDto import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerStateDto import org.eclipse.tractusx.bpdm.gate.api.model.IBaseBusinessPartnerGateDto -import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressComponentInputDto -import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityComponentInputDto -import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteComponentInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressRepresentationInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityRepresentationInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteRepresentationInputDto @Schema( description = "Generic business partner with external id", @@ -40,8 +40,8 @@ data class BusinessPartnerInputRequest( override val states: Collection = emptyList(), override val roles: Collection = emptyList(), override val isOwnCompanyData: Boolean = false, - override val legalEntity: LegalEntityComponentInputDto = LegalEntityComponentInputDto(), - override val site: SiteComponentInputDto = SiteComponentInputDto(), - override val address: AddressComponentInputDto = AddressComponentInputDto() + override val legalEntity: LegalEntityRepresentationInputDto = LegalEntityRepresentationInputDto(), + override val site: SiteRepresentationInputDto = SiteRepresentationInputDto(), + override val address: AddressRepresentationInputDto = AddressRepresentationInputDto() ) : IBaseBusinessPartnerGateDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerDto.kt index 0619de09f..a621c762c 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerDto.kt @@ -38,9 +38,9 @@ data class BusinessPartnerInputDto( override val states: Collection = emptyList(), override val roles: Collection = emptyList(), override val isOwnCompanyData: Boolean = false, - override val legalEntity: LegalEntityComponentInputDto = LegalEntityComponentInputDto(), - override val site: SiteComponentInputDto = SiteComponentInputDto(), - override val address: AddressComponentInputDto = AddressComponentInputDto(), + override val legalEntity: LegalEntityRepresentationInputDto = LegalEntityRepresentationInputDto(), + override val site: SiteRepresentationInputDto = SiteRepresentationInputDto(), + override val address: AddressRepresentationInputDto = AddressRepresentationInputDto(), @get:Schema(description = CommonDescription.createdAt) val createdAt: Instant, @@ -50,21 +50,21 @@ data class BusinessPartnerInputDto( ) : IBaseBusinessPartnerGateDto -data class LegalEntityComponentInputDto( - override val bpnL: String? = null, +data class LegalEntityRepresentationInputDto( + override val legalEntityBpn: String? = null, override val legalName: String? = null, override val shortName: String? = null, override val legalForm: String? = null, override val classifications: Collection = emptyList() -) : IBaseLegalEntityComponent +) : IBaseLegalEntityRepresentation -data class SiteComponentInputDto( - override val bpnS: String? = null -) : IBaseSiteComponent +data class SiteRepresentationInputDto( + override val siteBpn: String? = null +) : IBaseSiteRepresentation -data class AddressComponentInputDto( - override val bpnA: String? = null, +data class AddressRepresentationInputDto( + override val addressBpn: String? = null, override val addressType: AddressType? = null, override val physicalPostalAddress: PhysicalPostalAddressDto = PhysicalPostalAddressDto(), override val alternativePostalAddress: AlternativePostalAddressDto = AlternativePostalAddressDto() -) : IBaseAddressComponent \ No newline at end of file +) : IBaseAddressRepresentation \ No newline at end of file diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt index ac02c1144..191941069 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt @@ -37,8 +37,8 @@ data class BusinessPartnerOutputDto( override val states: Collection = emptyList(), override val roles: Collection = emptyList(), override val isOwnCompanyData: Boolean = false, - override val legalEntity: LegalEntityComponentOutputDto, - override val site: SiteComponentOutputDto = SiteComponentOutputDto(), + override val legalEntity: LegalEntityRepresentationOutputDto, + override val site: SiteRepresentationOutputDto = SiteRepresentationOutputDto(), override val address: AddressComponentOutputDto, @get:Schema(description = CommonDescription.createdAt) @@ -53,28 +53,28 @@ data class BusinessPartnerOutputDto( description = "Legal Entity properties of business partner output data", requiredProperties = ["bpnL"] ) -data class LegalEntityComponentOutputDto( - override val bpnL: String, +data class LegalEntityRepresentationOutputDto( + override val legalEntityBpn: String, override val legalName: String? = null, override val shortName: String? = null, override val legalForm: String? = null, override val classifications: Collection = emptyList() -) : IBaseLegalEntityComponent +) : IBaseLegalEntityRepresentation @Schema( description = "Site properties of business partner output data" ) -data class SiteComponentOutputDto( - override val bpnS: String? = null -) : IBaseSiteComponent +data class SiteRepresentationOutputDto( + override val siteBpn: String? = null +) : IBaseSiteRepresentation @Schema( description = "Address properties of business partner output data", requiredProperties = ["bpnA"] ) data class AddressComponentOutputDto( - override val bpnA: String, + override val addressBpn: String, override val addressType: AddressType? = null, override val physicalPostalAddress: PhysicalPostalAddressDto = PhysicalPostalAddressDto(), override val alternativePostalAddress: AlternativePostalAddressDto = AlternativePostalAddressDto() -) : IBaseAddressComponent +) : IBaseAddressRepresentation diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt index 62dd1f938..fb9ec178a 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt @@ -81,16 +81,16 @@ class BusinessPartnerMappings { legalName = dto.legalEntity.legalName, legalForm = dto.legalEntity.legalForm, isOwnCompanyData = dto.isOwnCompanyData, - bpnL = dto.legalEntity.bpnL, - bpnS = dto.site.bpnS, - bpnA = dto.address.bpnA, + bpnL = dto.legalEntity.legalEntityBpn, + bpnS = dto.site.siteBpn, + bpnA = dto.address.addressBpn, postalAddress = toPostalAddress(dto.address) ) } - private fun toLegalEntityComponentInputDto(entity: BusinessPartner): LegalEntityComponentInputDto { - return LegalEntityComponentInputDto( - bpnL = entity.bpnL, + private fun toLegalEntityComponentInputDto(entity: BusinessPartner): LegalEntityRepresentationInputDto { + return LegalEntityRepresentationInputDto( + legalEntityBpn = entity.bpnL, legalName = entity.legalName, shortName = entity.shortName, legalForm = entity.legalForm, @@ -98,24 +98,24 @@ class BusinessPartnerMappings { ) } - private fun toSiteComponentInputDto(entity: BusinessPartner): SiteComponentInputDto { - return SiteComponentInputDto( - bpnS = entity.bpnS + private fun toSiteComponentInputDto(entity: BusinessPartner): SiteRepresentationInputDto { + return SiteRepresentationInputDto( + siteBpn = entity.bpnS ) } - private fun toAddressComponentInputDto(entity: BusinessPartner): AddressComponentInputDto { - return AddressComponentInputDto( - bpnA = entity.bpnA, + private fun toAddressComponentInputDto(entity: BusinessPartner): AddressRepresentationInputDto { + return AddressRepresentationInputDto( + addressBpn = entity.bpnA, addressType = entity.postalAddress.addressType, physicalPostalAddress = entity.postalAddress.physicalPostalAddress?.toPhysicalPostalAddress() ?: PhysicalPostalAddressDto(), alternativePostalAddress = entity.postalAddress.alternativePostalAddress?.toAlternativePostalAddressDto() ?: AlternativePostalAddressDto() ) } - private fun toLegalEntityComponentOutputDto(entity: BusinessPartner): LegalEntityComponentOutputDto { - return LegalEntityComponentOutputDto( - bpnL = entity.bpnL ?: throw BpdmNullMappingException( + private fun toLegalEntityComponentOutputDto(entity: BusinessPartner): LegalEntityRepresentationOutputDto { + return LegalEntityRepresentationOutputDto( + legalEntityBpn = entity.bpnL ?: throw BpdmNullMappingException( BusinessPartner::class, BusinessPartnerOutputDto::class, BusinessPartner::bpnL, @@ -128,15 +128,15 @@ class BusinessPartnerMappings { ) } - private fun toSiteComponentOutputDto(entity: BusinessPartner): SiteComponentOutputDto { - return SiteComponentOutputDto( - bpnS = entity.bpnS + private fun toSiteComponentOutputDto(entity: BusinessPartner): SiteRepresentationOutputDto { + return SiteRepresentationOutputDto( + siteBpn = entity.bpnS ) } private fun toAddressComponentOutputDto(entity: BusinessPartner): AddressComponentOutputDto { return AddressComponentOutputDto( - bpnA = entity.bpnA ?: throw BpdmNullMappingException( + addressBpn = entity.bpnA ?: throw BpdmNullMappingException( BusinessPartner::class, BusinessPartnerOutputDto::class, BusinessPartner::bpnA, @@ -149,7 +149,7 @@ class BusinessPartnerMappings { } - private fun toPostalAddress(dto: AddressComponentInputDto) = + private fun toPostalAddress(dto: AddressRepresentationInputDto) = PostalAddress( addressType = dto.addressType, physicalPostalAddress = normalize(dto.physicalPostalAddress)?.let(::toPhysicalPostalAddress), diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt index 187e637d0..da2a09202 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/OrchestratorMappings.kt @@ -50,20 +50,20 @@ class OrchestratorMappings( ) - private fun toLegalEntityComponentDto(entity: BusinessPartner) = LegalEntityComponent( - bpnL = entity.bpnL, + private fun toLegalEntityComponentDto(entity: BusinessPartner) = LegalEntityRepresentation( + legalEntityBpn = entity.bpnL, legalName = entity.legalName, shortName = entity.shortName, legalForm = entity.legalForm, classifications = entity.classifications.map { toClassificationDto(it) } ) - private fun toSiteComponentDto(entity: BusinessPartner) = SiteComponent( - bpnS = entity.bpnS, + private fun toSiteComponentDto(entity: BusinessPartner) = SiteRepresentation( + siteBpn = entity.bpnS, ) - private fun toAddressComponentDto(bpnA: String?, entity: PostalAddress) = AddressComponent( - bpnA = bpnA, + private fun toAddressComponentDto(bpnA: String?, entity: PostalAddress) = AddressRepresentation( + addressBpn = bpnA, addressType = entity.addressType, physicalPostalAddress = entity.physicalPostalAddress?.let(::toPhysicalPostalAddressDto), alternativePostalAddress = entity.alternativePostalAddress?.let(this::toAlternativePostalAddressDto) @@ -155,9 +155,9 @@ class OrchestratorMappings( classifications = dto.legalEntity.classifications.map { toClassification(it) }.toSortedSet(), roles = dto.roles.toSortedSet(), postalAddress = toPostalAddress(dto.address), - bpnL = dto.legalEntity.bpnL, - bpnS = dto.site.bpnS, - bpnA = dto.address.bpnA, + bpnL = dto.legalEntity.legalEntityBpn, + bpnS = dto.site.siteBpn, + bpnA = dto.address.addressBpn, stage = StageType.Output ) @@ -174,7 +174,7 @@ class OrchestratorMappings( private fun toClassification(dto: BusinessPartnerClassificationDto) = Classification(type = dto.type, code = dto.code, value = dto.value) - private fun toPostalAddress(dto: AddressComponent) = + private fun toPostalAddress(dto: AddressRepresentation) = PostalAddress( addressType = dto.addressType, physicalPostalAddress = dto.physicalPostalAddress?.let(::toPhysicalPostalAddress), diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt index d07042e4b..c44b1f938 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt @@ -473,19 +473,19 @@ class BusinessPartnerControllerIT @Autowired constructor( contentSize = 3, content = listOf( ChangelogEntryVerboseDto( - bpn = BusinessPartnerVerboseValues.bpOutputDtoCleaned.legalEntity.bpnL, + bpn = BusinessPartnerVerboseValues.bpOutputDtoCleaned.legalEntity.legalEntityBpn, businessPartnerType = BusinessPartnerType.LEGAL_ENTITY, timestamp = Instant.now(), changelogType = ChangelogType.UPDATE ), ChangelogEntryVerboseDto( - bpn = BusinessPartnerVerboseValues.bpOutputDtoCleaned.address.bpnA, + bpn = BusinessPartnerVerboseValues.bpOutputDtoCleaned.address.addressBpn, businessPartnerType = BusinessPartnerType.ADDRESS, timestamp = Instant.now(), changelogType = ChangelogType.UPDATE ), ChangelogEntryVerboseDto( - bpn = BusinessPartnerVerboseValues.bpOutputDtoCleaned.site.bpnS!!, + bpn = BusinessPartnerVerboseValues.bpOutputDtoCleaned.site.siteBpn!!, businessPartnerType = BusinessPartnerType.SITE, timestamp = Instant.now(), changelogType = ChangelogType.UPDATE @@ -565,7 +565,7 @@ class BusinessPartnerControllerIT @Autowired constructor( sharingStateType = SharingStateType.Success, sharingErrorCode = null, sharingErrorMessage = null, - bpn = BusinessPartnerGenericValues.businessPartner1.address.bpnA, + bpn = BusinessPartnerGenericValues.businessPartner1.address.addressBpn, sharingProcessStarted = null, taskId = "0" ), diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerGenericValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerGenericValues.kt index b6f34db17..b370a5f94 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerGenericValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerGenericValues.kt @@ -65,8 +65,8 @@ object BusinessPartnerGenericValues { BusinessPartnerRole.SUPPLIER ), ownerBpnL = "BPNL_CLEANED_VALUES", - legalEntity = LegalEntityComponent( - bpnL = "000000123AAA123", + legalEntity = LegalEntityRepresentation( + legalEntityBpn = "000000123AAA123", legalName = "legal-name-cleaned", shortName = "shot-name-cleaned", legalForm = "legal-form-cleaned", @@ -83,11 +83,11 @@ object BusinessPartnerGenericValues { ), ) ), - site = SiteComponent( - bpnS = "000000123BBB222", + site = SiteRepresentation( + siteBpn = "000000123BBB222", ), - address = AddressComponent( - bpnA = "000000123CCC333", + address = AddressRepresentation( + addressBpn = "000000123CCC333", addressType = AddressType.AdditionalAddress, physicalPostalAddress = PhysicalPostalAddressDto( geographicCoordinates = GeoCoordinateDto(0.5f, 0.5f, 0.5f), diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerNonVerboseValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerNonVerboseValues.kt index 6a4d1d135..b96701358 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerNonVerboseValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerNonVerboseValues.kt @@ -22,13 +22,13 @@ package org.eclipse.tractusx.bpdm.gate.util import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateOutputChildRequest import org.eclipse.tractusx.bpdm.gate.api.model.AddressIdentifierDto import org.eclipse.tractusx.bpdm.gate.api.model.request.* -import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressComponentInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressRepresentationInputDto object BusinessPartnerNonVerboseValues { val physicalAddressMinimal = BusinessPartnerVerboseValues.physicalAddressMinimal - val bpPostalAddressInputDtoMinimal = AddressComponentInputDto( + val bpPostalAddressInputDtoMinimal = AddressRepresentationInputDto( addressType = null, physicalPostalAddress = physicalAddressMinimal ) diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt index 4b9fb7d08..409f754a7 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt @@ -312,18 +312,18 @@ object BusinessPartnerVerboseValues { identifiers = listOf(bpIdentifier1, bpIdentifier2, bpIdentifier3), states = listOf(bpState1, bpState2), roles = listOf(BusinessPartnerRole.SUPPLIER), - legalEntity = LegalEntityComponentInputDto( - bpnL = "BPNL0000000000XY", + legalEntity = LegalEntityRepresentationInputDto( + legalEntityBpn = "BPNL0000000000XY", shortName = "short1", legalName = "Limited Liability Company Name", legalForm = "Limited Liability Company", classifications = listOf(bpClassification1, bpClassification2, bpClassification3) ), - site = SiteComponentInputDto( - bpnS = null + site = SiteRepresentationInputDto( + siteBpn = null ), - address = AddressComponentInputDto( - bpnA = "BPNA0000000001XY", + address = AddressRepresentationInputDto( + addressBpn = "BPNA0000000001XY", addressType = AddressType.LegalAddress, physicalPostalAddress = postalAddress2, alternativePostalAddress = alternativeAddressFull @@ -611,8 +611,8 @@ object BusinessPartnerVerboseValues { ), // duplicate, but they are eliminated states = listOf(bpState2, bpState1), roles = listOf(BusinessPartnerRole.CUSTOMER, BusinessPartnerRole.SUPPLIER), - legalEntity = LegalEntityComponentInputDto( - bpnL = "BPNL0000000002XY", + legalEntity = LegalEntityRepresentationInputDto( + legalEntityBpn = "BPNL0000000002XY", shortName = "short3", legalName = "姓名测试", legalForm = "股份有限", @@ -620,11 +620,11 @@ object BusinessPartnerVerboseValues { bpClassificationChina, bpClassification3, bpClassificationChina ) // duplicate, but they are eliminated ), - site = SiteComponentInputDto( - bpnS = "BPNS0000000003X9", + site = SiteRepresentationInputDto( + siteBpn = "BPNS0000000003X9", ), - address = AddressComponentInputDto( - bpnA = "BPNA0000000001XY", + address = AddressRepresentationInputDto( + addressBpn = "BPNA0000000001XY", addressType = AddressType.LegalAndSiteMainAddress, physicalPostalAddress = physicalAddressChina, alternativePostalAddress = AlternativePostalAddressDto() @@ -640,8 +640,8 @@ object BusinessPartnerVerboseValues { ), states = listOf(bpState2, bpState1), roles = listOf(BusinessPartnerRole.CUSTOMER, BusinessPartnerRole.SUPPLIER), - legalEntity = LegalEntityComponentInputDto( - bpnL = "BPNL0000000002XY", + legalEntity = LegalEntityRepresentationInputDto( + legalEntityBpn = "BPNL0000000002XY", shortName = "Random Short Name", legalName = "Random Name Value", legalForm = "Random Form Value", @@ -649,11 +649,11 @@ object BusinessPartnerVerboseValues { bpClassification1, bpClassification3 ) ), - site = SiteComponentInputDto( - bpnS = "BPNS0000000003X9", + site = SiteRepresentationInputDto( + siteBpn = "BPNS0000000003X9", ), - address = AddressComponentInputDto( - bpnA = "BPNA0000000001XY", + address = AddressRepresentationInputDto( + addressBpn = "BPNA0000000001XY", addressType = AddressType.LegalAddress, physicalPostalAddress = postalAddress2, alternativePostalAddress = alternativeAddressFull @@ -669,8 +669,8 @@ object BusinessPartnerVerboseValues { ), states = listOf(bpState2, bpState1), roles = listOf(BusinessPartnerRole.CUSTOMER, BusinessPartnerRole.SUPPLIER), - legalEntity = LegalEntityComponentInputDto( - bpnL = "BPNL0000000002XY", + legalEntity = LegalEntityRepresentationInputDto( + legalEntityBpn = "BPNL0000000002XY", shortName = "Random Short Name", legalName = "Random Name Value", legalForm = "Random Form Value", @@ -678,11 +678,11 @@ object BusinessPartnerVerboseValues { bpClassification1, bpClassification3 ) ), - site = SiteComponentInputDto( - bpnS = "BPNS0000000003X9", + site = SiteRepresentationInputDto( + siteBpn = "BPNS0000000003X9", ), - address = AddressComponentInputDto( - bpnA = "BPNA0000000001XY", + address = AddressRepresentationInputDto( + addressBpn = "BPNA0000000001XY", addressType = AddressType.LegalAddress, physicalPostalAddress = postalAddress2, alternativePostalAddress = alternativeAddressFull @@ -722,8 +722,8 @@ object BusinessPartnerVerboseValues { BusinessPartnerRole.CUSTOMER, BusinessPartnerRole.SUPPLIER ), - legalEntity = LegalEntityComponentOutputDto( - bpnL = "000000123AAA123", + legalEntity = LegalEntityRepresentationOutputDto( + legalEntityBpn = "000000123AAA123", shortName = "shot-name-cleaned", legalName = "legal-name-cleaned", legalForm = "legal-form-cleaned", @@ -740,11 +740,11 @@ object BusinessPartnerVerboseValues { ), ) ), - site = SiteComponentOutputDto( - bpnS = "000000123BBB222" + site = SiteRepresentationOutputDto( + siteBpn = "000000123BBB222" ), address = AddressComponentOutputDto( - bpnA = "000000123CCC333", + addressBpn = "000000123CCC333", addressType = AddressType.AdditionalAddress, physicalPostalAddress = PhysicalPostalAddressDto( geographicCoordinates = GeoCoordinateDto(0.5f, 0.5f, 0.5f), diff --git a/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/BusinessPartnerGenericDto.kt b/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/BusinessPartnerGenericDto.kt index e86aeaeb7..29bef55c5 100644 --- a/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/BusinessPartnerGenericDto.kt +++ b/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/BusinessPartnerGenericDto.kt @@ -31,30 +31,30 @@ data class BusinessPartnerGenericDto( override val identifiers: Collection = emptyList(), override val states: Collection = emptyList(), override val roles: Collection = emptyList(), - override val legalEntity: LegalEntityComponent = LegalEntityComponent(), - override val site: SiteComponent = SiteComponent(), - override val address: AddressComponent = AddressComponent(), + override val legalEntity: LegalEntityRepresentation = LegalEntityRepresentation(), + override val site: SiteRepresentation = SiteRepresentation(), + override val address: AddressRepresentation = AddressRepresentation(), @get:Schema(description = "The BPNL of the company sharing and claiming this business partner as its own") val ownerBpnL: String? = null ) : IBaseBusinessPartnerDto -data class LegalEntityComponent( - override val bpnL: String? = null, +data class LegalEntityRepresentation( + override val legalEntityBpn: String? = null, override val legalName: String? = null, override val shortName: String? = null, override val legalForm: String? = null, override val classifications: Collection = emptyList() -) : IBaseLegalEntityComponent +) : IBaseLegalEntityRepresentation -data class SiteComponent( - override val bpnS: String? = null -) : IBaseSiteComponent +data class SiteRepresentation( + override val siteBpn: String? = null +) : IBaseSiteRepresentation -data class AddressComponent( - override val bpnA: String? = null, +data class AddressRepresentation( + override val addressBpn: String? = null, override val addressType: AddressType? = null, override val physicalPostalAddress: PhysicalPostalAddressDto? = null, override val alternativePostalAddress: AlternativePostalAddressDto? = null -) : IBaseAddressComponent +) : IBaseAddressRepresentation diff --git a/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/controller/GoldenRecordTaskControllerIT.kt b/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/controller/GoldenRecordTaskControllerIT.kt index 5b79750eb..0625dd1fe 100644 --- a/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/controller/GoldenRecordTaskControllerIT.kt +++ b/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/controller/GoldenRecordTaskControllerIT.kt @@ -225,7 +225,7 @@ class GoldenRecordTaskControllerIT @Autowired constructor( val businessPartnerFull2 = businessPartnerFull1.copy( generic = with(businessPartnerFull1.generic) { copy( - legalEntity = legalEntity.copy(bpnL = "BPNL-test") + legalEntity = legalEntity.copy(legalEntityBpn = "BPNL-test") ) } ) diff --git a/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/testdata/BusinessPartnerTestValues.kt b/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/testdata/BusinessPartnerTestValues.kt index aa67d1a19..e9deb58fc 100644 --- a/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/testdata/BusinessPartnerTestValues.kt +++ b/bpdm-orchestrator/src/test/kotlin/org/eclipse/tractusx/bpdm/orchestrator/testdata/BusinessPartnerTestValues.kt @@ -68,8 +68,8 @@ object BusinessPartnerTestValues { BusinessPartnerRole.CUSTOMER, BusinessPartnerRole.SUPPLIER ), - legalEntity = LegalEntityComponent( - bpnL = "BPNLTEST", + legalEntity = LegalEntityRepresentation( + legalEntityBpn = "BPNLTEST", legalName = "legal-name", shortName = "shortname", legalForm = "legal-form", @@ -86,11 +86,11 @@ object BusinessPartnerTestValues { ), ) ), - site = SiteComponent( - bpnS = "BPNSTEST" + site = SiteRepresentation( + siteBpn = "BPNSTEST" ), - address = AddressComponent( - bpnA = "BPNATEST", + address = AddressRepresentation( + addressBpn = "BPNATEST", addressType = AddressType.AdditionalAddress, physicalPostalAddress = PhysicalPostalAddressDto( geographicCoordinates = GeoCoordinateDto(0.5f, 0.5f, 0.5f), @@ -153,8 +153,8 @@ object BusinessPartnerTestValues { roles = listOf( BusinessPartnerRole.CUSTOMER ), - legalEntity = LegalEntityComponent( - bpnL = "BPNLTEST-2", + legalEntity = LegalEntityRepresentation( + legalEntityBpn = "BPNLTEST-2", legalName = "legal-name-2", shortName = "shortname-2", legalForm = "legal-form-2", @@ -166,11 +166,11 @@ object BusinessPartnerTestValues { ) ) ), - site = SiteComponent( - bpnS = "BPNSTEST-2" + site = SiteRepresentation( + siteBpn = "BPNSTEST-2" ), - address = AddressComponent( - bpnA = "BPNATEST-2", + address = AddressRepresentation( + addressBpn = "BPNATEST-2", addressType = AddressType.LegalAddress, physicalPostalAddress = PhysicalPostalAddressDto( geographicCoordinates = GeoCoordinateDto(0.4f, 0.4f, 0.4f), diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepBuildService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepBuildService.kt index fe45599dc..41bcbd1e9 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepBuildService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepBuildService.kt @@ -94,9 +94,9 @@ class TaskStepBuildService( businessPartner = BusinessPartnerFullDto( generic = with(businessPartnerDto.generic) { copy( - legalEntity = this.legalEntity.copy(bpnL = legalEntity.bpn), - site = this.site.copy(bpnS = siteEntity?.bpn), - address = this.address.copy(bpnA = genericBpnA) + legalEntity = this.legalEntity.copy(legalEntityBpn = legalEntity.bpn), + site = this.site.copy(siteBpn = siteEntity?.bpn), + address = this.address.copy(addressBpn = genericBpnA) ) }, legalEntity = businessPartnerDto.legalEntity!!.copy( diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt index 1e4ee9178..d5226c887 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt @@ -112,7 +112,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( val createdLegalEntity = poolClient.legalEntities.getLegalEntity(createResult[0].businessPartner?.legalEntity?.bpnLReference?.referenceValue!!) assertThat(createdLegalEntity.legalAddress.bpnLegalEntity).isNotNull() - assertThat(createResult[0].businessPartner?.generic?.legalEntity?.bpnL).isEqualTo(createdLegalEntity.legalEntity.bpnl) + assertThat(createResult[0].businessPartner?.generic?.legalEntity?.legalEntityBpn).isEqualTo(createdLegalEntity.legalEntity.bpnl) compareLegalEntity(createdLegalEntity, createResult[0].businessPartner?.legalEntity) } @@ -136,7 +136,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( val createdLegalEntity = poolClient.legalEntities.getLegalEntity(createResult[0].businessPartner?.legalEntity?.bpnLReference?.referenceValue!!) assertThat(createdLegalEntity.legalAddress.bpnLegalEntity).isNotNull() - assertThat(createResult[0].businessPartner?.generic?.legalEntity?.bpnL).isEqualTo(createdLegalEntity.legalEntity.bpnl) + assertThat(createResult[0].businessPartner?.generic?.legalEntity?.legalEntityBpn).isEqualTo(createdLegalEntity.legalEntity.bpnl) compareLegalEntity(createdLegalEntity, createResult[0].businessPartner?.legalEntity) } @@ -165,7 +165,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( assertThat(createdLegalEntity.legalAddress.bpnLegalEntity).isEqualTo(createdLegalEntity.legalEntity.bpnl) assertThat(createdLegalEntity.legalAddress.isLegalAddress).isTrue() assertThat(createdLegalEntity.legalAddress.isMainAddress).isFalse() - assertThat(createResult[0].businessPartner?.generic?.legalEntity?.bpnL).isEqualTo(createdLegalEntity.legalEntity.bpnl) + assertThat(createResult[0].businessPartner?.generic?.legalEntity?.legalEntityBpn).isEqualTo(createdLegalEntity.legalEntity.bpnl) compareLegalEntity(createdLegalEntity, createResult[0].businessPartner?.legalEntity) val createdAdditionalAddress = poolClient.addresses.getAddress(createResult[0].businessPartner?.address?.bpnAReference?.referenceValue!!) assertThat(createdAdditionalAddress.bpnLegalEntity).isEqualTo(createdLegalEntity.legalEntity.bpnl) @@ -393,7 +393,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( assertThat(resultSteps2[0].errors.size).isEqualTo(0) assertThat(createdLegalEntity1.legalEntity.bpnl).isNotEqualTo(resultSteps2[0].businessPartner?.legalEntity?.bpnLReference?.referenceValue!!) val createdLegalEntity2 = poolClient.legalEntities.getLegalEntity(resultSteps2[0].businessPartner?.legalEntity?.bpnLReference?.referenceValue!!) - assertThat(resultSteps2[0].businessPartner?.generic?.legalEntity?.bpnL).isEqualTo(createdLegalEntity2.legalEntity.bpnl) + assertThat(resultSteps2[0].businessPartner?.generic?.legalEntity?.legalEntityBpn).isEqualTo(createdLegalEntity2.legalEntity.bpnl) } @Test