diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Constants.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Constants.cs index 5f2e018f1..1b6684973 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Constants.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/Constants.cs @@ -4,7 +4,6 @@ public static class Constants { public static IReadOnlyCollection LegacyExposableSanctionCodes { get; } = new[] { - "G1", "A18", "A7", "A3", diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/FindTeachersTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/FindTeachersTests.cs index 579b07674..0e7690db2 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/FindTeachersTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/FindTeachersTests.cs @@ -85,8 +85,8 @@ public async Task Get_ValidRequestWithMatchesOnLastName_ReturnsMappedContacts() var lastName = "Smith"; var dateOfBirth = new DateOnly(1990, 1, 1); - var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); - var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); + var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); + var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); var request = new HttpRequestMessage( HttpMethod.Get, @@ -155,8 +155,8 @@ public async Task Get_ValidRequestWithMatchOnPreviousName_ReturnsMappedContacts( var lastName = TestData.GenerateLastName(); var dateOfBirth = new DateOnly(1990, 1, 1); - var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); - var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); + var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); + var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); var person3 = await TestData.CreatePerson(b => b.WithLastName(TestData.GenerateChangedLastName(lastName)).WithDateOfBirth(dateOfBirth)); var updatedLastName = TestData.GenerateChangedLastName(lastName); await TestData.UpdatePerson(b => b.WithPersonId(person2.PersonId).WithUpdatedName(person2.FirstName, person2.MiddleName, updatedLastName)); diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/GetTeacherTestBase.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/GetTeacherTestBase.cs index e5be392b3..1a7f8e436 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/GetTeacherTestBase.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240101/GetTeacherTestBase.cs @@ -412,7 +412,7 @@ protected async Task ValidRequestWithSanctions_ReturnsExpectedSanctionsContent( var sanctions = new (string SanctionCode, DateOnly? StartDate)[] { new("A18", null), - new("G1", new DateOnly(2022, 4, 1)), + new("A21B", new DateOnly(2022, 4, 1)), }; Debug.Assert(sanctions.Select(s => s.SanctionCode).All(TeachingRecordSystem.Api.V3.Constants.LegacyExposableSanctionCodes.Contains)); @@ -452,8 +452,8 @@ protected async Task ValidRequestWithAlerts_ReturnsExpectedSanctionsContent( // Arrange var sanctions = new (string SanctionCode, DateOnly? StartDate)[] { - new("B1", null), - new("G1", new DateOnly(2022, 4, 1)), + new("A21B", null), + new("A21B", new DateOnly(2022, 4, 1)), }; Debug.Assert(sanctions.Select(s => s.SanctionCode).All(TeachingRecordSystem.Api.V3.Constants.LegacyProhibitionSanctionCodes.Contains)); diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/FindPersonByLastNameAndDateOfBirthTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/FindPersonByLastNameAndDateOfBirthTests.cs index 7845277e8..15a0cee5d 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/FindPersonByLastNameAndDateOfBirthTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/FindPersonByLastNameAndDateOfBirthTests.cs @@ -85,8 +85,8 @@ public async Task Get_ValidRequestWithMatchesOnLastName_ReturnsMappedContacts() var lastName = "Smith"; var dateOfBirth = new DateOnly(1990, 1, 1); - var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); - var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); + var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); + var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); var request = new HttpRequestMessage( HttpMethod.Get, @@ -155,8 +155,8 @@ public async Task Get_ValidRequestWithMatchOnPreviousName_ReturnsMappedContacts( var lastName = TestData.GenerateLastName(); var dateOfBirth = new DateOnly(1990, 1, 1); - var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); - var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("G1")); + var person1 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); + var person2 = await TestData.CreatePerson(b => b.WithLastName(lastName).WithDateOfBirth(dateOfBirth).WithSanction("A21B")); var person3 = await TestData.CreatePerson(b => b.WithLastName(TestData.GenerateChangedLastName(lastName)).WithDateOfBirth(dateOfBirth)); var updatedLastName = TestData.GenerateChangedLastName(lastName); await TestData.UpdatePerson(b => b.WithPersonId(person2.PersonId).WithUpdatedName(person2.FirstName, person2.MiddleName, updatedLastName)); diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/GetPersonTestBase.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/GetPersonTestBase.cs index fa17d8763..a87bc7ecd 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/GetPersonTestBase.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240606/GetPersonTestBase.cs @@ -412,7 +412,7 @@ protected async Task ValidRequestWithSanctions_ReturnsExpectedSanctionsContent( var sanctions = new (string SanctionCode, DateOnly? StartDate)[] { new("A18", null), - new("G1", new DateOnly(2022, 4, 1)), + new("A21B", new DateOnly(2022, 4, 1)), }; Debug.Assert(sanctions.Select(s => s.SanctionCode).All(Api.V3.Constants.LegacyExposableSanctionCodes.Contains)); diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonByLastNameAndDateOfBirthTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonByLastNameAndDateOfBirthTests.cs index 68cb146e6..c1672f29d 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonByLastNameAndDateOfBirthTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonByLastNameAndDateOfBirthTests.cs @@ -88,7 +88,7 @@ public async Task Get_ValidRequestWithMatchesOnLastName_ReturnsExpectedResponse( var person1 = await TestData.CreatePerson(b => b .WithLastName(lastName) .WithDateOfBirth(dateOfBirth) - .WithSanction("G1") + .WithSanction("A21B") .WithInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1)) .WithQts(qtsDate: new(2021, 7, 1)) .WithEyts(eytsDate: new(2021, 8, 1), eytsStatusValue: "222")); @@ -96,7 +96,7 @@ public async Task Get_ValidRequestWithMatchesOnLastName_ReturnsExpectedResponse( var person2 = await TestData.CreatePerson(b => b .WithLastName(lastName) .WithDateOfBirth(dateOfBirth) - .WithSanction("G1")); + .WithSanction("A21B")); var request = new HttpRequestMessage( HttpMethod.Get, diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonsByTrnAndDateOfBirthTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonsByTrnAndDateOfBirthTests.cs index 2f21c05e1..5bd1c3052 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonsByTrnAndDateOfBirthTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests/V3/V20240814/FindPersonsByTrnAndDateOfBirthTests.cs @@ -122,7 +122,7 @@ public async Task Get_ValidRequest_ReturnsMatchedRecord() var person = await TestData.CreatePerson(b => b .WithDateOfBirth(dateOfBirth) - .WithSanction("G1") + .WithSanction("A21B") .WithInduction(dfeta_InductionStatus.Pass, inductionExemptionReason: null, inductionStartDate: new(2022, 1, 1), completedDate: new DateOnly(2023, 1, 1)) .WithQts(qtsDate: new(2021, 7, 1)) .WithEyts(eytsDate: new(2021, 8, 1), eytsStatusValue: "222")); diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/SeedCrmReferenceData.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/SeedCrmReferenceData.cs index 689f04775..514ec7f4a 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/SeedCrmReferenceData.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/SeedCrmReferenceData.cs @@ -70,6 +70,12 @@ private void AddSanctionCodes() dfeta_Value = "B1", dfeta_name = "B1 Description" }); + + _xrmFakedContext.CreateEntity(new dfeta_sanctioncode() + { + dfeta_Value = "A21B", + dfeta_name = "A21B Description" + }); } private void AddTeacherStatuses()