Skip to content

Commit 7cb6c51

Browse files
fix: Updating process caas file to make sure we update or add a record if it does not exist (#1710)
fix: Updating process caas file to make sure we update or add a new record for delete
1 parent e112625 commit 7cb6c51

File tree

1 file changed

+5
-2
lines changed
  • application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses

1 file changed

+5
-2
lines changed

application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses/ProcessCaasFile.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ private async Task AddRecordToBatch(Participant participant, Batch currentBatch,
121121
{
122122

123123
case Actions.New:
124-
var DemographicRecordUpdated = await UpdateOldDemographicRecord(basicParticipantCsvRecord, fileName);
125124
currentBatch.AddRecords.Enqueue(basicParticipantCsvRecord);
126-
if (DemographicRecordUpdated)
125+
if (await UpdateOldDemographicRecord(basicParticipantCsvRecord, fileName))
127126
{
128127
break;
129128
}
@@ -140,6 +139,10 @@ private async Task AddRecordToBatch(Participant participant, Batch currentBatch,
140139
currentBatch.UpdateRecords.Enqueue(basicParticipantCsvRecord);
141140
break;
142141
case Actions.Removed:
142+
if (!await UpdateOldDemographicRecord(basicParticipantCsvRecord, fileName))
143+
{
144+
currentBatch.DemographicData.Enqueue(participant.ToParticipantDemographic());
145+
}
143146
currentBatch.DeleteRecords.Enqueue(basicParticipantCsvRecord);
144147
break;
145148
default:

0 commit comments

Comments
 (0)