From 4980ed57619746afd35d59bb0dfcdb349f53080f Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Fri, 16 Aug 2024 13:41:03 +0800 Subject: [PATCH] fix(Gate): setting sharing state to initial when receiving input on error state --- CHANGELOG.md | 2 ++ .../tractusx/bpdm/gate/service/BusinessPartnerService.kt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b86d8fb1..fea3c3b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ For changes to the BPDM Helm charts please consult the [changelog](charts/bpdm/C - BPDM Pool: Fix not resolving golden record tasks on exceptions +- BPDM Gate: Fixed Gate not resending business partner data to the golden record process on error sharing state when member sends the exact same business partner again + ## [6.1.0] - [2024-07-15] ### Added diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt index 00d51abe8..ac5ac5a61 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt @@ -24,6 +24,7 @@ import org.eclipse.tractusx.bpdm.common.dto.PageDto import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.common.service.toPageDto import org.eclipse.tractusx.bpdm.gate.api.model.ChangelogType +import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType import org.eclipse.tractusx.bpdm.gate.api.model.request.BusinessPartnerInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerOutputDto @@ -83,7 +84,7 @@ class BusinessPartnerService( upsertFromEntity(existingInput, updatedData) - .takeIf { it.hadChanges } + .takeIf { it.hadChanges || sharingState.sharingStateType == SharingStateType.Error } ?.also { sharingStateService.setInitial(sharingState) } ?.businessPartner }