diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Core/Operations/CreateTrnRequest.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Core/Operations/CreateTrnRequest.cs index 67a015c41..f298d6ce0 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Core/Operations/CreateTrnRequest.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Core/Operations/CreateTrnRequest.cs @@ -144,6 +144,7 @@ await crmQueryDispatcher.ExecuteQueryAsync(new CreateContactQuery() StatedMiddleName = command.MiddleName ?? "", StatedLastName = command.LastName, DateOfBirth = command.DateOfBirth, + Gender = Contact_GenderCode.Notavailable, EmailAddress = emailAddress, NationalInsuranceNumber = NationalInsuranceNumberHelper.Normalize(command.NationalInsuranceNumber), PotentialDuplicates = potentialDuplicates.Select(d => (Duplicate: d, HasActiveAlert: resultsWithActiveAlerts.Contains(d.ContactId))).ToArray(), diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/CreateTeacherQuery.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/CreateTeacherQuery.cs index f6707ef69..2c70b6a39 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/CreateTeacherQuery.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/Queries/CreateTeacherQuery.cs @@ -9,6 +9,7 @@ public class CreateContactQuery : ICrmQuery public required string StatedMiddleName { get; init; } public required string StatedLastName { get; init; } public required DateOnly DateOfBirth { get; init; } + public required Contact_GenderCode Gender { get; init; } public required string? EmailAddress { get; init; } public required string? NationalInsuranceNumber { get; init; } public required IReadOnlyCollection<(FindPotentialDuplicateContactsResult Duplicate, bool HasActiveAlert)> PotentialDuplicates { get; init; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs index 2cf2eb1ee..48ea3842b 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Dqt/QueryHandlers/CreateContactHandler.cs @@ -26,6 +26,7 @@ public async Task ExecuteAsync(CreateContactQuery query, IOrganizationServ dfeta_StatedMiddleName = query.StatedMiddleName, dfeta_StatedLastName = query.StatedLastName, BirthDate = query.DateOfBirth.ToDateTimeWithDqtBstFix(isLocalTime: false), + GenderCode = query.Gender, dfeta_NINumber = query.NationalInsuranceNumber, EMailAddress1 = query.EmailAddress, dfeta_AllowPiiUpdatesFromRegister = false, diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs index bf1725c93..f0250b999 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Core.Dqt.CrmIntegrationTests/QueryTests/CreateContactTests.cs @@ -41,6 +41,7 @@ public async Task QueryExecutesSuccessfully() EmailAddress = email, NationalInsuranceNumber = nino, DateOfBirth = dateOfBirth, + Gender = Contact_GenderCode.Notavailable, Trn = trn, PotentialDuplicates = [], ApplicationUserName = "Tests", @@ -100,6 +101,7 @@ await _dataScope.OrganizationService.CreateAsync(new Contact() EmailAddress = email, NationalInsuranceNumber = nino, DateOfBirth = dateOfBirth, + Gender = Contact_GenderCode.Notavailable, Trn = null, PotentialDuplicates = [