Skip to content

Commit

Permalink
fix(MissingOutputStage): Handle upsert output stage based on the shar…
Browse files Browse the repository at this point in the history
…ing state id
  • Loading branch information
dilipdhankecha2530 committed Nov 12, 2024
1 parent 5da5d96 commit 7fc2d0e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ class BusinessPartnerService(
logger.debug { "Executing upsertBusinessPartnersOutput() with parameters $requests" }

val existingOutputs = businessPartnerRepository.findBySharingStateInAndStage(requests.map { it.sharingState }, StageType.Output)
val existingOutputsByExternalId = existingOutputs.associateBy { it.sharingState.externalId }
val existingOutputsBySharingStateId = existingOutputs.associateBy { it.sharingState.id }

val updatedEntities = requests.map { request ->
val existingOutput = existingOutputsByExternalId[request.sharingState.externalId]
val existingOutput = existingOutputsBySharingStateId[request.sharingState.id]
val updatedData = outputUpsertMappings.toEntity(request.upsertData, request.sharingState)

upsertFromEntity(existingOutput, updatedData)
Expand Down

0 comments on commit 7fc2d0e

Please sign in to comment.