Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPDBT-3071] No need to keep history, contact always keeps the latest data of those 3 questions from application. #2080

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/Spd.Manager.Licence/ControllingMemberCrcAppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,16 @@ private async Task UpdateApplicantProfile(ControllingMemberCrcAppUpdateRequest r
UpdateContactCmd updateCmd = _mapper.Map<UpdateContactCmd>(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);
}
Expand Down
1 change: 1 addition & 0 deletions src/Spd.Manager.Licence/Mappings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading