From 9f25e9a9d4ffd3b83012b106554b9e52115d274f Mon Sep 17 00:00:00 2001 From: SujitMBRDI Date: Tue, 24 Sep 2024 09:56:35 +0530 Subject: [PATCH] fix(bpdm-clearing): refactored construction logic for legal entity states. --- CHANGELOG.md | 1 + .../tractusx/bpdm/cleaning/service/CleaningServiceDummy.kt | 2 +- .../tractusx/bpdm/gate/service/BusinessPartnerMappings.kt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca4cf6cc5..ae2c0aec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For changes to the BPDM Helm charts please consult the [changelog](charts/bpdm/C - BPDM Gate: Improved error response by adding external id details and reduced csv columns by removing support for uncategorized fields in csv file for partner upload process([#700](https://github.com/eclipse-tractusx/sig-release/issues/700)) - BPDM Cleaning Service Dummy: Added a null check for name parts to ensure proper whitespace handling when constructing the legal name from them. - BPDM Gate: Enabled Tax Jurisdiction code to save it to the Output. +- BPDM Cleaning Service Dummy: Removed assignment of uncategorized states while performing cleaning legal entity process. ## [6.1.0] - [2024-07-15] 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 32e59bfa9..2ad0dc326 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 @@ -110,7 +110,7 @@ class CleaningServiceDummy( bpnReference = bpnReference.toRequestIfNotBpn(businessPartner.legalEntityReference()), legalName = legalName ?: businessPartner.uncategorized.nameParts.takeIf { it.isNotEmpty() }?.joinToString(" "), identifiers = identifiers.takeIf { it.isNotEmpty() } ?: businessPartner.uncategorized.identifiers, - states = states.takeIf { it.isNotEmpty() } ?: businessPartner.uncategorized.states, + states = states, confidenceCriteria = dummyConfidenceCriteria.copy(sharedByOwner = sharedByOwner), hasChanged = businessPartner.type == GoldenRecordType.LegalEntity, isCatenaXMemberData = sharedByOwner, 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 17d31da7a..81cf621e3 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 @@ -40,7 +40,7 @@ class BusinessPartnerMappings { externalId = entity.sharingState.externalId, nameParts = entity.nameParts, identifiers = entity.identifiers.map(::toIdentifierDto), - states = entity.states.map(::toStateDto), + states = entity.states.filter { it.businessPartnerTyp == BusinessPartnerType.GENERIC }.map(::toStateDto), roles = entity.roles, isOwnCompanyData = entity.isOwnCompanyData, legalEntity = toLegalEntityComponentInputDto(entity),