Skip to content

Commit

Permalink
Merge pull request bcgov#2085 from ytqsl/release/R3.1.0
Browse files Browse the repository at this point in the history
EMBCESSMOD-5096: fixed bug in saving non bcsc registrant
  • Loading branch information
ytqsl authored Apr 24, 2024
2 parents 20d18ad + 505e716 commit 31bf4ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ internal record Geometry
internal record Properties2
{
public string? accessNotes { get; set; }
public string? blockID { get; set; }
// public string? blockID { get; set; }
public string? changeDate { get; set; }
public string? civicNumber { get; set; }
//public string? civicNumber { get; set; }
public string? civicNumberSuffix { get; set; }
public string? electoralArea { get; set; }
public object[]? faults { get; set; }
Expand Down
9 changes: 6 additions & 3 deletions ess/src/API/EMBC.ESS/Managers/Events/EventsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ public async Task<string> Handle(SaveRegistrantCommand cmd)
{
var ct = CancellationToken.None;
var evacuee = mapper.Map<Evacuee>(cmd.Profile);
var existingEvacuee = evacuee.Id == null && evacuee.UserId != null
? (await evacueesRepository.Query(new EvacueeQuery { UserId = evacuee.UserId })).Items.SingleOrDefault()
: (await evacueesRepository.Query(new EvacueeQuery { EvacueeId = evacuee.Id })).Items.SingleOrDefault();

Evacuee existingEvacuee = null;
if (evacuee.Id == null && evacuee.UserId != null)
existingEvacuee = (await evacueesRepository.Query(new EvacueeQuery { UserId = evacuee.UserId })).Items.SingleOrDefault();
else if (evacuee.Id != null)
existingEvacuee = (await evacueesRepository.Query(new EvacueeQuery { EvacueeId = evacuee.Id })).Items.SingleOrDefault();

evacuee.Id ??= existingEvacuee?.Id;
//fill last login for new registrants from registrants portal - need to split this command into separate use cases
Expand Down

0 comments on commit 31bf4ad

Please sign in to comment.