From 2d08a0493b4be8b98da14b0d9699f76bf48398db Mon Sep 17 00:00:00 2001 From: David Atkins Date: Tue, 1 Oct 2024 12:19:27 +0100 Subject: [PATCH] Add Approved Premises Women's Estate Test Data (#4268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Approved Premises Womens Estate Test Data This commit adds a Female Probation Case and additional Staff Member to support testing of the Women’s Estate Solution --- .../uk/gov/justice/digital/hmpps/data/DataLoader.kt | 3 +++ .../hmpps/data/generator/ProbationCaseGenerator.kt | 13 ++++++++++++- .../hmpps/data/generator/ReferenceDataGenerator.kt | 2 ++ .../digital/hmpps/data/generator/StaffGenerator.kt | 4 ++++ .../src/dev/resources/schema.ldif | 12 +++++++++++- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt index 35f49cc8ed..35655e36cd 100644 --- a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt +++ b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt @@ -154,6 +154,9 @@ class DataLoader( staffRepository.save(StaffGenerator.LAO_RESTRICTED) staffUserRepository.save(StaffGenerator.LAO_RESTRICTED_USER) + staffRepository.save(StaffGenerator.CRU_WOMENS_ESTATE) + staffUserRepository.save(StaffGenerator.CRU_WOMENS_ESTATE_USER) + val personManagerStaff = StaffGenerator.generate(code = "N54A001") staffRepository.save(personManagerStaff) val person = PersonGenerator.DEFAULT diff --git a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ProbationCaseGenerator.kt b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ProbationCaseGenerator.kt index 93d0233b3e..5bc70182a5 100644 --- a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ProbationCaseGenerator.kt +++ b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ProbationCaseGenerator.kt @@ -32,7 +32,18 @@ object ProbationCaseGenerator { currentExclusion = true, currentRestriction = true ) - val CASE_SIMPLE = generate("S517283", "Teresa", "Green", LocalDate.of(1987, 8, 2)) + val CASE_SIMPLE = generate( + crn = "S517283", + forename = "Teresa", + surname = "Green", + dateOfBirth = LocalDate.of(1987, 8, 2), + nomsId = "A1237AI", + gender = ReferenceDataGenerator.GENDER_FEMALE, + ethnicity = ReferenceDataGenerator.ETHNICITY_WHITE, + nationality = ReferenceDataGenerator.NATIONALITY_BRITISH, + religion = ReferenceDataGenerator.RELIGION_OTHER, + genderIdentity = ReferenceDataGenerator.GENDER_IDENTITY_PNS, + ) val CASE_X320741 = generate( crn = "X320741", forename = "Aadland", diff --git a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ReferenceDataGenerator.kt b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ReferenceDataGenerator.kt index 0b5e06c284..9395dab6f6 100644 --- a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ReferenceDataGenerator.kt +++ b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/ReferenceDataGenerator.kt @@ -57,6 +57,7 @@ object ReferenceDataGenerator { val REFERRAL_COMPLETED = generate("APRC", ALL_DATASETS[DatasetCode.NSI_OUTCOME]!!.id) val ETHNICITY_WHITE = generate("W1", ETHNICITY.id, "White: British/English/Welsh/Scottish/Northern Irish") + val GENDER_FEMALE = generate("F", GENDER.id, "Female") val GENDER_MALE = generate("M", GENDER.id, "Male") val GENDER_IDENTITY_PNS = generate("GIRF", GENDER_IDENTITY.id, "Prefer not to say") val NATIONALITY_BRITISH = generate("BRIT", NATIONALITY.id, "British") @@ -98,6 +99,7 @@ object ReferenceDataGenerator { NON_ARRIVAL, REFERRAL_COMPLETED, ETHNICITY_WHITE, + GENDER_FEMALE, GENDER_MALE, GENDER_IDENTITY_PNS, NATIONALITY_BRITISH, diff --git a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/StaffGenerator.kt b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/StaffGenerator.kt index a695b1197d..ac3223b28e 100644 --- a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/StaffGenerator.kt +++ b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/StaffGenerator.kt @@ -22,11 +22,15 @@ object StaffGenerator { val LAO_RESTRICTED = generate( name = "LAO Restricted" ) + val CRU_WOMENS_ESTATE = generate( + name = "CRU Womens Estate" + ) val DEFAULT_STAFF_USER = generateStaffUser("john-smith", DEFAULT_STAFF) val JIM_SNOW_USER = generateStaffUser("JIMSNOWLDAP", JIM_SNOW) val LAO_FULL_ACCESS_USER = generateStaffUser("LAOFULLACCESS", LAO_FULL_ACCESS) val LAO_RESTRICTED_USER = generateStaffUser("LAORESTRICTED", LAO_RESTRICTED) + val CRU_WOMENS_ESTATE_USER = generateStaffUser("CRUWOMENSESTATE", CRU_WOMENS_ESTATE) fun generate( name: String = "Test", diff --git a/projects/approved-premises-and-delius/src/dev/resources/schema.ldif b/projects/approved-premises-and-delius/src/dev/resources/schema.ldif index 3c969ba7e1..a671865791 100644 --- a/projects/approved-premises-and-delius/src/dev/resources/schema.ldif +++ b/projects/approved-premises-and-delius/src/dev/resources/schema.ldif @@ -19,4 +19,14 @@ cn: jimsnowldap sn: Jim Snow givenname: Test mail: jim.snow@justice.gov.uk -telephoneNumber: 07321165374 \ No newline at end of file +telephoneNumber: 07321165374 + +dn: cn=cruwomensestate,ou=Users,dc=moj,dc=com +objectclass: top +objectclass: inetOrgPerson +cn: cruwomensestate +sn: Womens Estate +givenname: CRU +mail: cru.womens.estate@justice.gov.uk +telephoneNumber: 07321165375 +