diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt index d79a8e11a..8da1877f2 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt @@ -41,7 +41,7 @@ class GateUpdateService( ) { for (entity in responseWrapper.entities) { val externalId = entity.index - buildSuccessSharingStateDto(LsaType.LegalEntity, externalId, entity.legalEntity.bpnl, true) + buildSuccessSharingStateDto(LsaType.LegalEntity, externalId, entity.poolLegalEntity.bpnl, true) ?.let { gateClient.sharingState().upsertSharingState(it) } } for (errorInfo in responseWrapper.errors) { @@ -57,7 +57,7 @@ class GateUpdateService( externalIdByBpn: Map ) { for (entity in responseWrapper.entities) { - val bpn = entity.legalEntity.bpnl + val bpn = entity.poolLegalEntity.bpnl val externalId = externalIdByBpn[bpn] buildSuccessSharingStateDto(LsaType.LegalEntity, externalId, bpn, false) ?.let { gateClient.sharingState().upsertSharingState(it) } diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt index 8565e6070..2571e47e2 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LegalEntityResponse.kt @@ -47,6 +47,9 @@ data class LegalEntityResponse( @ArraySchema(arraySchema = Schema(description = "Relations to other business partners")) val relations: Collection = emptyList(), + @get:Schema(description = "Address of the official seat of this legal entity") + val legalAddress: LogisticAddressResponse, + @get:Schema(description = "The timestamp the business partner data was last indicated to be still current") val currentness: Instant, @@ -54,5 +57,6 @@ data class LegalEntityResponse( val createdAt: Instant, @get:Schema(description = "The timestamp the business partner data was last updated") - val updatedAt: Instant -) + val updatedAt: Instant, + + ) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PoolLegalEntityResponse.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PoolLegalEntityResponse.kt index 5eee89e06..b5c6db780 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PoolLegalEntityResponse.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PoolLegalEntityResponse.kt @@ -19,42 +19,14 @@ package org.eclipse.tractusx.bpdm.common.dto.response -import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema -import java.time.Instant @Schema(name = "PoolLegalEntityResponse", description = "Legal entity record") data class PoolLegalEntityResponse( - @get:Schema(description = "Business Partner Number of this legal entity") - val bpnl: String, - - @ArraySchema(arraySchema = Schema(description = "All identifiers of the business partner, including BPN information")) - val identifiers: Collection = emptyList(), @get:Schema(description = "Legal name the partner goes by") val legalName: String, - @get:Schema(description = "Abbreviated name or shorthand") - val legalShortName: String? = null, - - @get:Schema(description = "Legal form of the business partner") - val legalForm: LegalFormResponse? = null, - - @ArraySchema(arraySchema = Schema(description = "Business status")) - val states: Collection = emptyList(), - - @ArraySchema(arraySchema = Schema(description = "Classifications")) - val classifications: Collection = emptyList(), - - @ArraySchema(arraySchema = Schema(description = "Relations to other business partners")) - val relations: Collection = emptyList(), - - @get:Schema(description = "The timestamp the business partner data was last indicated to be still current") - val currentness: Instant, - - @get:Schema(description = "The timestamp the business partner data was created") - val createdAt: Instant, - - @get:Schema(description = "The timestamp the business partner data was last updated") - val updatedAt: Instant + @Schema(description = "Legal Entity") + val legalEntity: LegalEntityResponse, ) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateInputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateInputRequest.kt index 214da1c51..b9571200e 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateInputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateInputRequest.kt @@ -19,7 +19,6 @@ package org.eclipse.tractusx.bpdm.gate.api.model -import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.LegalEntityDto @@ -31,7 +30,7 @@ data class LegalEntityGateInputRequest( val legalNameParts: Array = emptyArray(), - @field:JsonUnwrapped + @Schema(description = "legal Enity") val legalEntity: LegalEntityDto, @Schema(description = "ID the record has in the external system where the record originates from", required = true) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateOutput.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateOutput.kt index 1c53115ba..6cdbcf9ed 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateOutput.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LegalEntityGateOutput.kt @@ -20,11 +20,9 @@ package org.eclipse.tractusx.bpdm.gate.api.model -import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressResponse import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @@ -33,12 +31,9 @@ data class LegalEntityGateOutput( val legalNameParts: Array = emptyArray(), - @field:JsonUnwrapped + @Schema(description = "Legal Entity") val legalEntity: LegalEntityResponse, - @Schema(description = "Address of the official seat of this legal entity") - val legalAddress: LogisticAddressResponse, - @Schema(description = "ID the record has in the external system where the record originates from") val externalId: String ) diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt index fe1dbc3f1..cfe6772a8 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt @@ -99,7 +99,7 @@ class LegalEntityService( //Search entries in the pool with BPNs found in the local mirror val bpnSet = partnersWithLocalBpn.map { it.bpn }.toSet() - val legalEntitiesByBpnMap = poolClient.searchLegalEntities(bpnSet).associateBy { it.bpnl } + val legalEntitiesByBpnMap = poolClient.searchLegalEntities(bpnSet).associateBy { it.legalEntity.bpnl } val legalAddressesByBpnMap = poolClient.searchLegalAddresses(bpnSet).associateBy { it.bpnLegalEntity } if (bpnSet.size > legalEntitiesByBpnMap.size) { @@ -136,19 +136,19 @@ class LegalEntityService( fun toLegalEntityOutput(externalId: String, legalEntityPool: PoolLegalEntityResponse, legalAddress: LogisticAddressResponse): LegalEntityGateOutput = LegalEntityGateOutput( legalEntity = LegalEntityResponse( - bpnl = legalEntityPool.bpnl, - identifiers = legalEntityPool.identifiers, - legalShortName = legalEntityPool.legalShortName, - legalForm = legalEntityPool.legalForm, - states = legalEntityPool.states, - classifications = legalEntityPool.classifications, - relations = legalEntityPool.relations, - currentness = legalEntityPool.currentness, - createdAt = legalEntityPool.createdAt, - updatedAt = legalEntityPool.updatedAt, + bpnl = legalEntityPool.legalEntity.bpnl, + identifiers = legalEntityPool.legalEntity.identifiers, + legalShortName = legalEntityPool.legalEntity.legalShortName, + legalForm = legalEntityPool.legalEntity.legalForm, + states = legalEntityPool.legalEntity.states, + classifications = legalEntityPool.legalEntity.classifications, + relations = legalEntityPool.legalEntity.relations, + currentness = legalEntityPool.legalEntity.currentness, + createdAt = legalEntityPool.legalEntity.createdAt, + updatedAt = legalEntityPool.legalEntity.updatedAt, + legalAddress = legalEntityPool.legalEntity.legalAddress, ), legalNameParts = arrayOf(legalEntityPool.legalName), - legalAddress = legalAddress, externalId = externalId ) diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt index bc9bef591..8a68726b5 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/ResponseValues.kt @@ -201,29 +201,36 @@ object ResponseValues { ) val legalEntityResponsePool1 = PoolLegalEntityResponse( - bpnl = CommonValues.bpn1, - identifiers = listOf(identifier1, identifier2), - legalShortName = CommonValues.shortName1, legalName = CommonValues.name1, - legalForm = legalForm1, - states = listOf(leBusinessStatus1), - classifications = listOf(classification1, classification2), - currentness = CommonValues.now, - createdAt = CommonValues.now, - updatedAt = CommonValues.now + LegalEntityResponse( + bpnl = CommonValues.bpn1, + identifiers = listOf(identifier1, identifier2), + legalShortName = CommonValues.shortName1, + legalForm = legalForm1, + states = listOf(leBusinessStatus1), + classifications = listOf(classification1, classification2), + currentness = CommonValues.now, + createdAt = CommonValues.now, + updatedAt = CommonValues.now, + legalAddress = logisticAddress1 + ) + ) val legalEntityResponsePool2 = PoolLegalEntityResponse( - bpnl = CommonValues.bpn2, - identifiers = listOf(identifier3, identifier4), - legalShortName = CommonValues.shortName3, legalName = CommonValues.name3, - legalForm = legalForm2, - states = listOf(leBusinessStatus2), - classifications = listOf(classification3, classification4), - currentness = CommonValues.now, - createdAt = CommonValues.now, - updatedAt = CommonValues.now + LegalEntityResponse( + bpnl = CommonValues.bpn2, + identifiers = listOf(identifier3, identifier4), + legalShortName = CommonValues.shortName3, + legalForm = legalForm2, + states = listOf(leBusinessStatus2), + classifications = listOf(classification3, classification4), + currentness = CommonValues.now, + createdAt = CommonValues.now, + updatedAt = CommonValues.now, + legalAddress = logisticAddress2 + ) ) val legalEntityResponseGate1 = LegalEntityResponse( @@ -235,7 +242,8 @@ object ResponseValues { classifications = listOf(classification1, classification2), currentness = CommonValues.now, createdAt = CommonValues.now, - updatedAt = CommonValues.now + updatedAt = CommonValues.now, + legalAddress = logisticAddress1, ) val legalEntityResponseGate2 = LegalEntityResponse( @@ -247,7 +255,8 @@ object ResponseValues { classifications = listOf(classification3, classification4), currentness = CommonValues.now, createdAt = CommonValues.now, - updatedAt = CommonValues.now + updatedAt = CommonValues.now, + legalAddress = logisticAddress2, ) val legalEntityGateInputResponse1 = LegalEntityGateInputResponse( @@ -288,14 +297,12 @@ object ResponseValues { val legalEntityGateOutput1 = LegalEntityGateOutput( legalEntity = legalEntityResponseGate1, legalNameParts = arrayOf(CommonValues.name1), - legalAddress = logisticAddress1, externalId = CommonValues.externalId1 ) val legalEntityGateOutput2 = LegalEntityGateOutput( legalEntity = legalEntityResponseGate2, legalNameParts = arrayOf(CommonValues.name3), - legalAddress = logisticAddress2, externalId = CommonValues.externalId2 ) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt index c31930cab..f7969d077 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt @@ -27,7 +27,7 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) -@Schema(name = "LegalEntityUpdateRequest", description = "Request for updating a business partner record of type legal entity") +@Schema(name = "LegalEntityPartnerUpdateRequest", description = "Request for updating a business partner record of type legal entity") data class LegalEntityPartnerUpdateRequest( @Schema(description = "Business Partner Number") val bpnl: String, diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerResponse.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerResponse.kt index 94e6f6324..ee5abed1f 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerResponse.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerResponse.kt @@ -19,11 +19,10 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response -import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressResponse -import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse import org.eclipse.tractusx.bpdm.common.dto.response.SiteResponse import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer @@ -32,8 +31,11 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ data class BusinessPartnerResponse( val uuid: String, - @field:JsonUnwrapped - val legalEntity: PoolLegalEntityResponse, + @get:Schema(description = "Legal name the partner goes by") + val legalName: String, + + @Schema(description = "Legal Entity") + val legalEntity: LegalEntityResponse, val addresses: Collection, diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchResponse.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchResponse.kt index 2f92ce040..e1dd9a46c 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchResponse.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchResponse.kt @@ -20,13 +20,16 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse +import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse @Schema(name = "LegalEntityMatchResponse", description = "Match with score for a business partner record of type legal entity") data class LegalEntityMatchResponse( @Schema(description = "Relative quality score of the match. The higher the better") val score: Float, - @Schema(description = "Matched legal entity business partner record") - val legalEntity: PoolLegalEntityResponse + @get:Schema(description = "Legal name the partner goes by") + val legalName: String, + + @Schema(description = "Legal Entity") + val legalEntity: LegalEntityResponse ) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateResponse.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateResponse.kt index 1ffecbfd5..f473ba586 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateResponse.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateResponse.kt @@ -19,21 +19,20 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response -import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressResponse -import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse +import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(name = "LegalEntityPartnerCreateResponse", description = "Created business partner of type legal entity") data class LegalEntityPartnerCreateResponse( - @field:JsonUnwrapped - val legalEntity: PoolLegalEntityResponse, - @Schema(description = "Address of the official seat of this of the legal entity") - val legalAddress: LogisticAddressResponse, + @get:Schema(description = "Legal name the partner goes by") + val legalName: String, + + @Schema(description = "Legal Entity") + val legalEntity: LegalEntityResponse, @Schema(description = "User defined index to conveniently match this entry to the corresponding entry from the request") val index: String? diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt index 3ba817d1a..d79ce5502 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt @@ -52,7 +52,7 @@ class BusinessPartnerFetchService( * Fetch a business partner by [bpn] and return as [PoolLegalEntityResponse] */ fun findLegalEntityIgnoreCase(bpn: String): PoolLegalEntityResponse { - return findLegalEntityOrThrow(bpn).toDto() + return findLegalEntityOrThrow(bpn).toPoolLegalEntity() } fun findBusinessPartnerIgnoreCase(bpn: String): BusinessPartnerResponse { @@ -65,7 +65,7 @@ class BusinessPartnerFetchService( */ @Transactional fun findLegalEntityIgnoreCase(identifierType: String, identifierValue: String): PoolLegalEntityResponse { - return findLegalEntityOrThrow(identifierType, identifierValue).toDto() + return findLegalEntityOrThrow(identifierType, identifierValue).toPoolLegalEntity() } @@ -87,7 +87,7 @@ class BusinessPartnerFetchService( */ @Transactional fun fetchDtosByBpns(bpns: Collection): Collection { - return fetchByBpns(bpns).map { it.toDto() } + return fetchByBpns(bpns).map { it.toPoolLegalEntity() } } /** diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt index 5097dcfef..a48ee5490 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt @@ -33,7 +33,7 @@ fun Page.toDto(dtoContent: Collection): PageResponse { } fun LegalEntity.toMatchDto(score: Float): LegalEntityMatchResponse { - return LegalEntityMatchResponse(score, this.toDto()) + return LegalEntityMatchResponse(score = score, legalEntity = this.toDto(), legalName = this.legalName.value) } fun LegalEntity.toBusinessPartnerMatchDto(score: Float): BusinessPartnerMatchResponse { @@ -43,16 +43,34 @@ fun LegalEntity.toBusinessPartnerMatchDto(score: Float): BusinessPartnerMatchRes fun LegalEntity.toUpsertDto(entryId: String?): LegalEntityPartnerCreateResponse { return LegalEntityPartnerCreateResponse( legalEntity = toDto(), - legalAddress = legalAddress.toDto(), - index = entryId + index = entryId, + legalName = legalName.value, ) } -fun LegalEntity.toDto(): PoolLegalEntityResponse { +fun LegalEntity.toPoolLegalEntity(): PoolLegalEntityResponse { return PoolLegalEntityResponse( + legalName = legalName.value, + LegalEntityResponse( + bpnl = bpn, + identifiers = identifiers.map { it.toDto() }, + legalShortName = legalName.shortName, + legalForm = legalForm?.toDto(), + states = states.map { it.toDto() }, + classifications = classifications.map { it.toDto() }, + relations = startNodeRelations.plus(endNodeRelations).map { it.toDto() }, + currentness = currentness, + createdAt = createdAt, + updatedAt = updatedAt, + legalAddress = legalAddress.toDto() + ) + ) +} + +fun LegalEntity.toDto(): LegalEntityResponse { + return LegalEntityResponse( bpnl = bpn, identifiers = identifiers.map { it.toDto() }, - legalName = legalName.value, legalShortName = legalName.shortName, legalForm = legalForm?.toDto(), states = states.map { it.toDto() }, @@ -60,7 +78,8 @@ fun LegalEntity.toDto(): PoolLegalEntityResponse { relations = startNodeRelations.plus(endNodeRelations).map { it.toDto() }, currentness = currentness, createdAt = createdAt, - updatedAt = updatedAt + updatedAt = updatedAt, + legalAddress = legalAddress.toDto() ) } @@ -70,6 +89,7 @@ fun LegalEntity.toBusinessPartnerDto(): BusinessPartnerResponse { legalEntity = toDto(), addresses = listOf(legalAddress.toDto()), sites = emptyList(), + legalName = legalName.value, ) } diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt index 6717be619..a56c1f19d 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/component/opensearch/controller/OpenSearchControllerIT.kt @@ -223,7 +223,7 @@ class OpenSearchControllerIT @Autowired constructor( val pageResult = searchBusinessPartnerByName(name) assertThat(pageResult.content).isNotEmpty - assertThat(pageResult.content.first()).matches { it.legalEntity.legalName == name } + assertThat(pageResult.content.first()).matches { it.legalName == name } } } diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt index c5fd62105..ba8efbaff 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BusinessPartnerLegacyControllerIT.kt @@ -150,10 +150,11 @@ class BusinessPartnerLegacyControllerIT @Autowired constructor( private fun convertCreateResponse(toConvert: LegalEntityPartnerCreateResponse): BusinessPartnerResponse { return BusinessPartnerResponse( - "", - toConvert.legalEntity, - listOf(toConvert.legalAddress), - emptyList() + uuid = "", + legalName = toConvert.legalName, + legalEntity = toConvert.legalEntity, + addresses = listOf(toConvert.legalEntity.legalAddress), + sites = emptyList() ) } } \ No newline at end of file diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt index db7d4dc01..9e9afa5e4 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt @@ -22,6 +22,7 @@ package org.eclipse.tractusx.bpdm.pool.controller import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat +import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressResponse import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse import org.eclipse.tractusx.bpdm.pool.Application @@ -152,17 +153,17 @@ class LegalEntityControllerIT @Autowired constructor( val createResponse = poolClient.legalEntities().createBusinessPartners(given) .entities.single() val givenBpnL = createResponse.legalEntity.bpnl - val givenBpnA = createResponse.legalAddress.bpna + val givenBpnA = createResponse.legalEntity.legalAddress.bpna val expected = with(ResponseValues.legalEntityUpsert3) { copy( legalEntity = legalEntity.copy( - bpnl = givenBpnL + bpnl = givenBpnL, + legalAddress = legalEntity.legalAddress.copy( + bpna = givenBpnA, + bpnLegalEntity = givenBpnL + ) ), - legalAddress = legalAddress.copy( - bpna = givenBpnA, - bpnLegalEntity = givenBpnL - ) ) } @@ -187,7 +188,7 @@ class LegalEntityControllerIT @Autowired constructor( val createResponse = poolClient.legalEntities().createBusinessPartners(given) val createdEntity = createResponse.entities.toList()[1] val bpnL = createdEntity.legalEntity.bpnl - val bpnA = createdEntity.legalAddress.bpna + val bpnA = createdEntity.legalEntity.legalAddress.bpna val toUpdate = listOf( RequestValues.legalEntityUpdate3.copy(bpnl = "NONEXISTENT"), @@ -197,13 +198,14 @@ class LegalEntityControllerIT @Autowired constructor( val expected = with(ResponseValues.legalEntityUpsert3) { copy( legalEntity = legalEntity.copy( - bpnl = bpnL + bpnl = bpnL, + legalAddress = legalEntity.legalAddress.copy( + bpna = bpnA, + bpnLegalEntity = bpnL + ) ), - legalAddress = legalAddress.copy( - bpna = bpnA, - bpnLegalEntity = bpnL + ) - ) } val response = poolClient.legalEntities().updateBusinessPartners(toUpdate) @@ -231,7 +233,7 @@ class LegalEntityControllerIT @Autowired constructor( val givenLegalEntities = testHelpers.createBusinessPartnerStructure(givenStructures).map { it.legalEntity } val expected = givenLegalEntities - .map { toLegalAddressResponse(it.legalAddress) } + .map { toLegalAddressResponse(it.legalEntity.legalAddress) } val bpnsToSearch = givenLegalEntities.map { it.legalEntity.bpnl } val response = poolClient.legalEntities().searchLegalAddresses(bpnsToSearch) @@ -259,7 +261,7 @@ class LegalEntityControllerIT @Autowired constructor( val givenLegalEntities = testHelpers.createBusinessPartnerStructure(givenStructures).map { it.legalEntity } val expected = givenLegalEntities - .map { toLegalAddressResponse(it.legalAddress) } + .map { toLegalAddressResponse(it.legalEntity.legalAddress) } .take(2) val bpnsToSearch = expected.map { it.bpnLegalEntity }.plus("NONEXISTENT") @@ -292,7 +294,7 @@ class LegalEntityControllerIT @Autowired constructor( .take(2) // only search for a subset of the existing legal entities val bpnsToSearch = expected.map { it.bpnl } - val response = poolClient.legalEntities().searchSites(bpnsToSearch).body + val response = poolClient.legalEntities().searchSites(bpnsToSearch).body?.map { it.legalEntity } assertThat(response) .usingRecursiveComparison() @@ -320,7 +322,7 @@ class LegalEntityControllerIT @Autowired constructor( .first() // search for first val identifierToFind = expected.identifiers.first() - val response = poolClient.legalEntities().getLegalEntity(identifierToFind.value, identifierToFind.type.technicalKey) + val response = poolClient.legalEntities().getLegalEntity(identifierToFind.value, identifierToFind.type.technicalKey).legalEntity assertThat(response) .usingRecursiveComparison() @@ -350,7 +352,7 @@ class LegalEntityControllerIT @Autowired constructor( var identifierToFind = expected.identifiers.first() identifierToFind = identifierToFind.copy(value = changeCase(identifierToFind.value)) - val response = poolClient.legalEntities().getLegalEntity(identifierToFind.value, identifierToFind.type.technicalKey) + val response = poolClient.legalEntities().getLegalEntity(identifierToFind.value, identifierToFind.type.technicalKey).legalEntity assertThat(response) .usingRecursiveComparison() @@ -379,7 +381,7 @@ class LegalEntityControllerIT @Autowired constructor( val bpnToFind = expected.bpnl - val response = poolClient.legalEntities().getLegalEntity(bpnToFind) + val response = poolClient.legalEntities().getLegalEntity(bpnToFind).legalEntity assertThat(response) .usingRecursiveComparison() @@ -407,7 +409,7 @@ class LegalEntityControllerIT @Autowired constructor( .first() // search for first val bpnToFind = changeCase(expected.bpnl) - val response = poolClient.legalEntities().getLegalEntity(bpnToFind) + val response = poolClient.legalEntities().getLegalEntity(bpnToFind).legalEntity assertThat(response) .usingRecursiveComparison() @@ -436,7 +438,7 @@ class LegalEntityControllerIT @Autowired constructor( .take(2) // only search for a subset of the existing legal entities val bpnsToSearch = expected.map { it.bpnl }.plus("NONEXISTENT") // also search for nonexistent BPN - val response = poolClient.legalEntities().searchSites(bpnsToSearch).body + val response = poolClient.legalEntities().searchSites(bpnsToSearch).body?.map { it.legalEntity } assertThat(response) .usingRecursiveComparison() @@ -464,7 +466,7 @@ class LegalEntityControllerIT @Autowired constructor( poolClient.legalEntities().setLegalEntityCurrentness(bpnL) - val updatedCurrentness = poolClient.legalEntities().getLegalEntity(bpnL).currentness + val updatedCurrentness = poolClient.legalEntities().getLegalEntity(bpnL).legalEntity.currentness assertThat(updatedCurrentness).isBetween(instantBeforeCurrentnessUpdate, Instant.now()) } @@ -488,7 +490,7 @@ class LegalEntityControllerIT @Autowired constructor( testHelpers.assertRecursively(actuals) .ignoringFieldsOfTypes(Instant::class.java) - .ignoringFieldsMatchingRegexes(".*${PoolLegalEntityResponse::bpnl.name}") + .ignoringFieldsMatchingRegexes(".*${LegalEntityResponse::bpnl.name}") .isEqualTo(expected) } @@ -509,7 +511,7 @@ class LegalEntityControllerIT @Autowired constructor( .exchange().expectStatus().isOk .returnResult() .responseBody - .blockFirst()!!.currentness + .blockFirst()!!.legalEntity.currentness private fun changeCase(value: String): String { return if (value.uppercase() != value) diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt index 54e2d63bc..c2fc976e3 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse import org.eclipse.tractusx.bpdm.common.dto.response.PageResponse -import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPropertiesSearchRequest @@ -66,8 +66,10 @@ class LegalEntityControllerSearchIT @Autowired constructor( ) ) - private lateinit var givenPartner1: PoolLegalEntityResponse - private lateinit var givenPartner2: PoolLegalEntityResponse + private lateinit var givenPartner1: LegalEntityResponse + private lateinit var givenPartner2: LegalEntityResponse + private lateinit var legalName1: String + private lateinit var legalName2: String @BeforeEach fun beforeEach() { @@ -78,6 +80,8 @@ class LegalEntityControllerSearchIT @Autowired constructor( val givenStructure = testHelpers.createBusinessPartnerStructure(listOf(partnerStructure1, partnerStructure2)) givenPartner1 = with(givenStructure[0].legalEntity) { legalEntity } givenPartner2 = with(givenStructure[1].legalEntity) { legalEntity } + legalName1 = givenStructure[0].legalEntity.legalName + legalName2 = givenStructure[1].legalEntity.legalName testHelpers.startSyncAndAwaitSuccess(webTestClient, EndpointValues.OPENSEARCH_SYNC_PATH) } @@ -93,8 +97,8 @@ class LegalEntityControllerSearchIT @Autowired constructor( val expected = PageResponse( 2, 1, 0, 2, listOf( - LegalEntityMatchResponse(0f, givenPartner1), - LegalEntityMatchResponse(0f, givenPartner2) + LegalEntityMatchResponse(score = 0f, legalEntity = givenPartner1, legalName = legalName1), + LegalEntityMatchResponse(score = 0f, legalEntity = givenPartner2, legalName = legalName2) ) ) @@ -113,12 +117,12 @@ class LegalEntityControllerSearchIT @Autowired constructor( val expectedFirstPage = PageResponse( 2, 2, 0, 1, listOf( - LegalEntityMatchResponse(0f, givenPartner1) + LegalEntityMatchResponse(score = 0f, legalEntity = givenPartner1, legalName = legalName1) ) ) val expectedSecondPage = PageResponse( 2, 2, 1, 1, listOf( - LegalEntityMatchResponse(0f, givenPartner2) + LegalEntityMatchResponse(score = 0f, legalEntity = givenPartner2, legalName = legalName2) ) ) @@ -139,7 +143,7 @@ class LegalEntityControllerSearchIT @Autowired constructor( val expected = PageResponse( 1, 1, 0, 1, listOf( - LegalEntityMatchResponse(0f, givenPartner2) + LegalEntityMatchResponse(score = 0f, legalEntity = givenPartner2, legalName = legalName2) ) ) diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt index ed6808a9d..345f9c760 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SuggestionControllerIT.kt @@ -69,12 +69,12 @@ class SuggestionControllerIT @Autowired constructor( .build() private val expectedLegalEntity = ResponseValues.legalEntityUpsert1.legalEntity - private val expectedLegalEntityName = expectedLegalEntity.legalName - private val expectedLegalAddress = ResponseValues.legalEntityUpsert1.legalAddress + private val expectedLegalEntityName = ResponseValues.legalEntityUpsert1.legalName + private val expectedLegalAddress = ResponseValues.legalEntityUpsert1.legalEntity.legalAddress private val expectedSite = ResponseValues.siteUpsert2 private val nonlatinLegalEntity = ResponseValues.legalEntityUpsert3.legalEntity - private val nonlatinLegalAddress = ResponseValues.legalEntityUpsert3.legalAddress + private val nonlatinLegalAddress = ResponseValues.legalEntityUpsert3.legalEntity.legalAddress private val nonlatinSite = ResponseValues.siteUpsert3 @JvmStatic @@ -94,7 +94,7 @@ class SuggestionControllerIT @Autowired constructor( Arguments.of( expectedLegalEntity.legalForm!!.name, EndpointValues.CATENA_SUGGESTION_LE_LEGAL_FORM_PATH, - expectedLegalEntity.legalName + expectedLegalEntityName ), Arguments.of( expectedLegalEntity.states.first().officialDenotation, @@ -147,7 +147,7 @@ class SuggestionControllerIT @Autowired constructor( @JvmStatic fun argumentsSuggestPropertyValuesNonLatin(): Stream = Stream.of( - Arguments.of(nonlatinLegalEntity.legalName, EndpointValues.CATENA_SUGGESTION_LE_NAME_PATH), + Arguments.of(ResponseValues.legalEntityUpsert3.legalName, EndpointValues.CATENA_SUGGESTION_LE_NAME_PATH), Arguments.of(nonlatinLegalEntity.legalForm!!.name, EndpointValues.CATENA_SUGGESTION_LE_LEGAL_FORM_PATH), Arguments.of(nonlatinSite.site.name, EndpointValues.CATENA_SUGGESTION_SITE_NAME_PATH), Arguments.of( diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt index f2d29739e..9ae6784fb 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/ResponseValues.kt @@ -243,94 +243,178 @@ object ResponseValues { val legalEntity1 = PoolLegalEntityResponse( - bpnl = CommonValues.bpnL1, legalName = CommonValues.name1, - identifiers = listOf(identifier1), - legalForm = legalForm1, - states = listOf(leStatus1), - classifications = listOf(classification1, classification2), - currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), - createdAt = CommonValues.now, - updatedAt = CommonValues.now + LegalEntityResponse( + bpnl = CommonValues.bpnL1, + identifiers = listOf(identifier1), + legalForm = legalForm1, + states = listOf(leStatus1), + classifications = listOf(classification1, classification2), + currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), + createdAt = CommonValues.now, + updatedAt = CommonValues.now, + legalAddress = LogisticAddressResponse( + bpna = CommonValues.bpnA1, + physicalPostalAddress = PhysicalPostalAddressResponse( + companyPostalCode = null, + industrialZone = null, + building = null, + floor = null, + door = null, + areaPart = AreaDistrictResponse( + administrativeAreaLevel1 = null, + administrativeAreaLevel2 = null, + district = null, + ), + street = null, + baseAddress = BasePostalAddressResponse( + geographicCoordinates = null, + country = country1, + postalCode = null, + city = CommonValues.locality1, + ) + ), + bpnLegalEntity = null, + bpnSite = null, + createdAt = Instant.now(), + updatedAt = Instant.now() + ) + ) ) val legalEntity2 = PoolLegalEntityResponse( - bpnl = CommonValues.bpnL2, legalName = CommonValues.name3, - identifiers = listOf(identifier2), - legalForm = legalForm2, - states = listOf(leStatus2), - classifications = listOf(classification3, classification4), - currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), - createdAt = CommonValues.now, - updatedAt = CommonValues.now + LegalEntityResponse( + bpnl = CommonValues.bpnL2, + identifiers = listOf(identifier2), + legalForm = legalForm2, + states = listOf(leStatus2), + classifications = listOf(classification3, classification4), + currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), + createdAt = CommonValues.now, + updatedAt = CommonValues.now, + legalAddress = LogisticAddressResponse( + bpna = CommonValues.bpnA1, + physicalPostalAddress = PhysicalPostalAddressResponse( + companyPostalCode = null, + industrialZone = null, + building = null, + floor = null, + door = null, + areaPart = AreaDistrictResponse( + administrativeAreaLevel1 = null, + administrativeAreaLevel2 = null, + district = null, + ), + street = null, + baseAddress = BasePostalAddressResponse( + geographicCoordinates = null, + country = country2, + postalCode = null, + city = CommonValues.locality3, + ) + ), + bpnLegalEntity = null, + bpnSite = null, + createdAt = Instant.now(), + updatedAt = Instant.now() + ) + ) ) val legalEntity3 = PoolLegalEntityResponse( - bpnl = CommonValues.bpnL3, legalName = CommonValues.name5, - identifiers = listOf(identifier3), - legalForm = legalForm3, - states = listOf(leStatus3), - classifications = listOf(classification5), - currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), - createdAt = CommonValues.now, - updatedAt = CommonValues.now + LegalEntityResponse( + bpnl = CommonValues.bpnL3, + identifiers = listOf(identifier3), + legalForm = legalForm3, + states = listOf(leStatus3), + classifications = listOf(classification5), + currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), + createdAt = CommonValues.now, + updatedAt = CommonValues.now, + legalAddress = LogisticAddressResponse( + bpna = CommonValues.bpnA1, + physicalPostalAddress = PhysicalPostalAddressResponse( + companyPostalCode = null, + industrialZone = null, + building = null, + floor = null, + door = null, + areaPart = AreaDistrictResponse( + administrativeAreaLevel1 = null, + administrativeAreaLevel2 = null, + district = null, + ), + street = null, + baseAddress = BasePostalAddressResponse( + geographicCoordinates = null, + country = country3, + postalCode = null, + city = CommonValues.locality5, + ) + ), + bpnLegalEntity = null, + bpnSite = null, + createdAt = Instant.now(), + updatedAt = Instant.now() + ) + ) ) val legalEntityUpsert1 = LegalEntityPartnerCreateResponse( - legalEntity = PoolLegalEntityResponse( + legalName = CommonValues.name1, + legalEntity = LegalEntityResponse( bpnl = CommonValues.bpnL1, - legalName = CommonValues.name1, identifiers = listOf(LegalEntityIdentifierResponse(CommonValues.identifierValue1, RequestValues.identifierType1, CommonValues.issuingBody1)), legalForm = legalForm1, states = listOf(leStatus1), classifications = listOf(classification1, classification2), currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), createdAt = CommonValues.now, - updatedAt = CommonValues.now - ), - legalAddress = addressPartner1.copy( - bpnLegalEntity = legalEntity1.bpnl, - isLegalAddress = true + updatedAt = CommonValues.now, + legalAddress = addressPartner1.copy( + bpnLegalEntity = legalEntity1.legalEntity.bpnl, + isLegalAddress = true + ), ), index = CommonValues.index1 ) val legalEntityUpsert2 = LegalEntityPartnerCreateResponse( - legalEntity = PoolLegalEntityResponse( + legalName = CommonValues.name3, + legalEntity = LegalEntityResponse( bpnl = CommonValues.bpnL2, - legalName = CommonValues.name3, identifiers = listOf(LegalEntityIdentifierResponse(CommonValues.identifierValue2, RequestValues.identifierType2, CommonValues.issuingBody2)), legalForm = legalForm2, states = listOf(leStatus2), classifications = listOf(classification3, classification4), currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), createdAt = CommonValues.now, - updatedAt = CommonValues.now - ), - legalAddress = addressPartner2.copy( - bpnLegalEntity = legalEntity2.bpnl, - isLegalAddress = true + updatedAt = CommonValues.now, + legalAddress = addressPartner2.copy( + bpnLegalEntity = legalEntity2.legalEntity.bpnl, + isLegalAddress = true + ), ), index = CommonValues.index2 ) val legalEntityUpsert3 = LegalEntityPartnerCreateResponse( - legalEntity = PoolLegalEntityResponse( + legalName = CommonValues.name5, + legalEntity = LegalEntityResponse( bpnl = CommonValues.bpnL3, - legalName = CommonValues.name5, identifiers = listOf(LegalEntityIdentifierResponse(CommonValues.identifierValue3, RequestValues.identifierType3, CommonValues.issuingBody3)), legalForm = legalForm3, states = listOf(leStatus3), classifications = listOf(classification5), currentness = SaasValues.createdTime1.toInstant(ZoneOffset.UTC), createdAt = CommonValues.now, - updatedAt = CommonValues.now - ), - legalAddress = addressPartner3.copy( - bpnLegalEntity = legalEntity3.bpnl, - isLegalAddress = true + updatedAt = CommonValues.now, + legalAddress = addressPartner3.copy( + bpnLegalEntity = legalEntity3.legalEntity.bpnl, + isLegalAddress = true + ) ), index = CommonValues.index3 )