From 18c190fdace16857e99b8d3e862cc20335033d01 Mon Sep 17 00:00:00 2001 From: peggy-quartech Date: Wed, 15 Jan 2025 10:28:39 -0800 Subject: [PATCH] change --- .../ControllingMemberCrcAppManager.cs | 19 ++++++++++--------- src/Spd.Manager.Licence/Mappings.cs | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Spd.Manager.Licence/ControllingMemberCrcAppManager.cs b/src/Spd.Manager.Licence/ControllingMemberCrcAppManager.cs index 07fdeef97..67350b8f2 100644 --- a/src/Spd.Manager.Licence/ControllingMemberCrcAppManager.cs +++ b/src/Spd.Manager.Licence/ControllingMemberCrcAppManager.cs @@ -198,15 +198,16 @@ private async Task UpdateApplicantProfile(ControllingMemberCrcAppUpdateRequest r UpdateContactCmd updateCmd = _mapper.Map(request); updateCmd.Id = (Guid)request.ApplicantId; - //once they have submitted they have Criminal histroy or mental health condition, we won't change the flags back to false - if (contact.HasCriminalHistory == true) - updateCmd.HasCriminalHistory = true; - if (contact.IsTreatedForMHC == true) - updateCmd.IsTreatedForMHC = true; - - //concat new crminal history detail with old ones. - if (request.HasNewCriminalRecordCharge == true && !string.IsNullOrEmpty(contact.CriminalChargeDescription) && !string.IsNullOrEmpty(request.CriminalHistoryDetail)) - updateCmd.CriminalChargeDescription = $"{contact.CriminalChargeDescription}\n\n*Updated at: {DateTime.Now}\n{request.CriminalHistoryDetail}"; + //Jan.14, 2025 Open door session, we decide: contact always updated with the latest application info, no need to keep history. + //once they have submitted they have Criminal histroy or mental health condition, we won't change the flags back to false - not valid anymore + //if (contact.HasCriminalHistory == true) + // updateCmd.HasCriminalHistory = true; + //if (contact.IsTreatedForMHC == true) + // updateCmd.IsTreatedForMHC = true; + + ////concat new crminal history detail with old ones. - not valid any more. + //if (request.HasNewCriminalRecordCharge == true && !string.IsNullOrEmpty(contact.CriminalChargeDescription) && !string.IsNullOrEmpty(request.CriminalHistoryDetail)) + // updateCmd.CriminalChargeDescription = $"{contact.CriminalChargeDescription}\n\n*Updated at: {DateTime.Now}\n{request.CriminalHistoryDetail}"; await _contactRepository.ManageAsync(updateCmd, ct); } diff --git a/src/Spd.Manager.Licence/Mappings.cs b/src/Spd.Manager.Licence/Mappings.cs index a4c5108c9..43ce525c7 100644 --- a/src/Spd.Manager.Licence/Mappings.cs +++ b/src/Spd.Manager.Licence/Mappings.cs @@ -148,6 +148,7 @@ public Mappings() .ForMember(d => d.LastName, opt => opt.MapFrom(s => s.Surname)) .ForMember(d => d.Gender, opt => opt.MapFrom(s => s.GenderCode)) .ForMember(d => d.BirthDate, opt => opt.MapFrom(s => s.DateOfBirth)) + .ForMember(d => d.CriminalChargeDescription, opt => opt.MapFrom(s => s.HasNewCriminalRecordCharge == true ? s.CriminalHistoryDetail : string.Empty)) .ForPath(d => d.ResidentialAddress.AddressLine1, opt => opt.MapFrom(s => s.ResidentialAddress.AddressLine1)) .ForPath(d => d.ResidentialAddress.AddressLine2, opt => opt.MapFrom(s => s.ResidentialAddress.AddressLine2)) .ForPath(d => d.ResidentialAddress.Province, opt => opt.MapFrom(s => s.ResidentialAddress.Province))