Skip to content

Commit

Permalink
fix(gate): sending business partner data to the golden record service…
Browse files Browse the repository at this point in the history
… even when they have no changes

- now business partner service only sets the sharing state to ready or initial when the data really has been changed
  • Loading branch information
nicoprow committed Jul 5, 2024
1 parent daaafc5 commit d8901ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ For changes to the BPDM Helm charts please consult the [changelog](charts/bpdm/C
- BPDM Gate: GET endpoint to download the csv file template for business partner upload. (#700)
- Apps: Tax Jurisdiction Code to the physical address of a business partner (#955)

### Changed:

- BPDM Gate: Fix sending business partner data to the golden record service even when they have no changes


## [6.0.2] - [2024-07-03]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ class BusinessPartnerService(
val updatedData = businessPartnerMappings.toBusinessPartnerInput(request, sharingState)
val existingInput = existingInputsByExternalId[request.externalId]

sharingStateService.setInitial(sharingState)
upsertFromEntity(existingInput, updatedData).takeIf { it.hadChanges }?.businessPartner

upsertFromEntity(existingInput, updatedData)
.takeIf { it.hadChanges }
?.also { sharingStateService.setInitial(sharingState) }
?.businessPartner
}

return updatedEntities.map(businessPartnerMappings::toBusinessPartnerInputDto)
Expand Down

0 comments on commit d8901ee

Please sign in to comment.