Skip to content

Commit

Permalink
Merge pull request #751 from bcgov/bugs/ecer-3827
Browse files Browse the repository at this point in the history
Bugs/ecer 3827
  • Loading branch information
farzadnadiri authored Nov 28, 2024
2 parents 50107d4 + eced909 commit 830ee49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageVersion Include="Bogus" Version="35.6.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.301" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.408" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.408.1" />
<PackageVersion Include="HtmlSanitizer" Version="8.1.870" />
<PackageVersion Include="IdentityModel" Version="7.0.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
Expand All @@ -21,7 +21,7 @@
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.Extensions" Version="8.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.OutputCaching.StackExchangeRedis" Version="8.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.SpaProxy" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.SpaProxy" Version="8.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private async Task UpdateCharacterReferences(ecer_Application application, List<
context.DeleteObject(reference);
}
}

// Update Existing Character References
foreach (var reference in updatedEntities.Where(d => d.ecer_CharacterReferenceId != null))
{
Expand All @@ -28,7 +28,7 @@ private async Task UpdateCharacterReferences(ecer_Application application, List<
context.Detach(oldReference);
reference.StatusCode = oldReference.StatusCode;
}

reference.ecer_Origin = ecer_Origin.Portal;
context.Attach(reference);
context.UpdateObject(reference);
}
Expand All @@ -37,6 +37,7 @@ private async Task UpdateCharacterReferences(ecer_Application application, List<
{
reference.ecer_CharacterReferenceId = Guid.NewGuid();
reference.StatusCode = ecer_CharacterReference_StatusCode.Draft;
reference.ecer_Origin = ecer_Origin.Portal;
context.AddObject(reference);
context.AddLink(application, ecer_Application.Fields.ecer_characterreference_Applicationid, reference);
}
Expand Down Expand Up @@ -114,6 +115,7 @@ public async Task<string> UpdateCharacterReferenceForSubmittedApplication(Charac
ecerCharacterReference.ecer_CharacterReferenceId = Guid.NewGuid();
ecerCharacterReference.StatusCode = ecer_CharacterReference_StatusCode.ApplicationSubmitted;
ecerCharacterReference.ecer_IsAdditional = true;
ecerCharacterReference.ecer_Origin = ecer_Origin.Portal;
context.AddObject(ecerCharacterReference);
context.AddLink(application, ecer_Application.Fields.ecer_characterreference_Applicationid, ecerCharacterReference);
context.SaveChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private async Task UpdateWorkExperienceReferences(ecer_Application application,
context.Detach(oldReference);
reference.StatusCode = oldReference.StatusCode;
}
reference.ecer_Origin = ecer_Origin.Portal;
context.Attach(reference);
context.UpdateObject(reference);
}
Expand All @@ -35,6 +36,7 @@ private async Task UpdateWorkExperienceReferences(ecer_Application application,
{
reference.ecer_WorkExperienceRefId = Guid.NewGuid();
reference.StatusCode = ecer_WorkExperienceRef_StatusCode.Draft;
reference.ecer_Origin = ecer_Origin.Portal;
context.AddObject(reference);
context.AddLink(application, ecer_Application.Fields.ecer_workexperienceref_Applicationid_ecer, reference);
}
Expand Down Expand Up @@ -140,6 +142,7 @@ public async Task<string> UpdateWorkExReferenceForSubmittedApplication(WorkExper
ecerWorkExperienceReference.ecer_Type = firstExistingWorkExp.ecer_Type; // setting ecer_type of new work experience reference to be same as existing ones
}
}
ecerWorkExperienceReference.ecer_Origin = ecer_Origin.Portal;
context.AddObject(ecerWorkExperienceReference);
context.AddLink(application, ecer_Application.Fields.ecer_workexperienceref_Applicationid_ecer, ecerWorkExperienceReference);
context.SaveChanges();
Expand Down

0 comments on commit 830ee49

Please sign in to comment.