diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/FindPotentialDuplicateContactsQuery.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/FindPotentialDuplicateContactsQuery.cs index 5416a2f65..8c87464f4 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/FindPotentialDuplicateContactsQuery.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/FindPotentialDuplicateContactsQuery.cs @@ -26,6 +26,7 @@ public record FindPotentialDuplicateContactsResult public required string? StatedFirstName { get; init; } public required string? StatedMiddleName { get; init; } public required string? StatedLastName { get; init; } + public required string? PreviousLastName { get; init; } public required DateOnly? DateOfBirth { get; init; } public required string? NationalInsuranceNumber { get; init; } public required string? EmailAddress { get; init; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs index 48ea3842b..0d0b06333 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs @@ -85,6 +85,7 @@ string GetDescription() Contact.Fields.FirstName => $" - First name: '{duplicate.FirstName}'", Contact.Fields.MiddleName => $" - Middle name: '{duplicate.MiddleName}'", Contact.Fields.LastName => $" - Last name: '{duplicate.LastName}'", + Contact.Fields.dfeta_PreviousLastName => $" - Previous last name: '{duplicate.PreviousLastName}'", Contact.Fields.BirthDate => $" - Date of birth: '{duplicate.DateOfBirth:dd/MM/yyyy}'", Contact.Fields.dfeta_NINumber => $" - National Insurance number: '{duplicate.NationalInsuranceNumber}'", Contact.Fields.EMailAddress1 => $" - Email address: '{duplicate.EmailAddress}'", diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/FindPotentialDuplicateContactsHandler.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/FindPotentialDuplicateContactsHandler.cs index 125c96c46..635ecda3c 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/FindPotentialDuplicateContactsHandler.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/FindPotentialDuplicateContactsHandler.cs @@ -129,6 +129,7 @@ public async Task ExecuteAsync(FindPoten StatedFirstName = match.dfeta_StatedFirstName, StatedMiddleName = match.dfeta_StatedMiddleName, StatedLastName = match.dfeta_StatedLastName, + PreviousLastName = match.dfeta_PreviousLastName, DateOfBirth = match.BirthDate.ToDateOnlyWithDqtBstFix(isLocalTime: false), NationalInsuranceNumber = !string.IsNullOrEmpty(match.dfeta_NINumber) ? match.dfeta_NINumber : null, EmailAddress = match.EMailAddress1 diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs index f0250b999..76b2ce21f 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs @@ -118,6 +118,7 @@ await _dataScope.OrganizationService.CreateAsync(new Contact() StatedFirstName = firstName, StatedMiddleName = middleName, StatedLastName = lastName, + PreviousLastName = null, DateOfBirth = dateOfBirth, EmailAddress = email, NationalInsuranceNumber = nino