Skip to content

Commit

Permalink
[SPDBT-3138] fix cm-crc submit new error (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
esdd1995 authored Oct 8, 2024
1 parent 9ff1802 commit ec6ddc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public Mappings()
.IncludeBase<ControllingMemberCrcApplication, spd_application>();

_ = CreateMap<SaveControllingMemberCrcAppCmd, contact>()
.ForMember(d => d.contactid, opt => opt.MapFrom(s => s.ContactId == Guid.Empty ? Guid.NewGuid() : s.ContactId))
.IncludeBase<ControllingMemberCrcApplication, contact>();

_ = CreateMap<AliasResp, spd_alias>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ public async Task<LicenceApplicationCmdResp> CreateLicenceApplicationAsync(Creat
else
existingContact = SharedRepositoryFuncs.GetDuplicateContact(_context, contact, ct);

//for new, create a new contact if it doesn't exist with same info, or update the licence holder contact if Has expired licence.
//for new, create a new contact if it doesn't exist with same info, or update the licence holder contact if Has expired licence.
if (existingContact != null)
contact = await _context.UpdateContact(existingContact, contact, null, _mapper.Map<IEnumerable<spd_alias>>(cmd.Aliases), ct);
else
{
contact = await _context.CreateContact(contact, null, _mapper.Map<IEnumerable<spd_alias>>(cmd.Aliases), ct);
}
}
else
{
Expand Down

0 comments on commit ec6ddc8

Please sign in to comment.