From 0d2a3193cbaea51ce76ab65b5af57a3d81ae4378 Mon Sep 17 00:00:00 2001 From: pmcphee77 <150798161+pmcphee77@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:04:48 +0000 Subject: [PATCH] PI-1878: Added DOB to MAS (#3402) --- .../uk/gov/justice/digital/hmpps/OverviewIntegrationTest.kt | 1 + .../justice/digital/hmpps/api/model/overview/PersonalDetails.kt | 2 ++ .../uk/gov/justice/digital/hmpps/service/OverviewService.kt | 1 + .../digital/hmpps/api/controller/OverviewControllerTest.kt | 2 ++ 4 files changed, 6 insertions(+) diff --git a/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/OverviewIntegrationTest.kt b/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/OverviewIntegrationTest.kt index 79b1f890e2..bde8be3a5e 100644 --- a/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/OverviewIntegrationTest.kt +++ b/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/OverviewIntegrationTest.kt @@ -76,6 +76,7 @@ internal class OverviewIntegrationTest { assertThat(res.sentences[0].rar?.completed, equalTo(1)) assertThat(res.sentences[0].rar?.scheduled, equalTo(1)) assertThat(res.sentences[0].rar?.totalDays, equalTo(2)) + assertThat(res.personalDetails.dateOfBirth, equalTo(OVERVIEW.dateOfBirth)) } @Test diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/overview/PersonalDetails.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/overview/PersonalDetails.kt index 8a4436b1b1..cdd3761609 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/overview/PersonalDetails.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/overview/PersonalDetails.kt @@ -1,10 +1,12 @@ package uk.gov.justice.digital.hmpps.api.model.overview import uk.gov.justice.digital.hmpps.api.model.Name +import java.time.LocalDate data class PersonalDetails( val name: Name, val preferredGender: String, + val dateOfBirth: LocalDate, val preferredName: String?, val telephoneNumber: String?, val mobileNumber: String?, diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/OverviewService.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/OverviewService.kt index 6ddff98468..a980bbbc29 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/OverviewService.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/OverviewService.kt @@ -64,6 +64,7 @@ class OverviewService( preferredName = preferredName, personalCircumstances = personalCircumstances.map { it.toPersonalCircumstance() }, disabilities = disabilities.map { it.toDisability() }, + dateOfBirth = dateOfBirth, provisions = provisions.map { it.toProvision() }, ) diff --git a/projects/manage-supervision-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/api/controller/OverviewControllerTest.kt b/projects/manage-supervision-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/api/controller/OverviewControllerTest.kt index 6d3d01d23f..d70377edd0 100644 --- a/projects/manage-supervision-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/api/controller/OverviewControllerTest.kt +++ b/projects/manage-supervision-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/api/controller/OverviewControllerTest.kt @@ -14,6 +14,7 @@ import uk.gov.justice.digital.hmpps.api.model.overview.PersonalDetails import uk.gov.justice.digital.hmpps.api.model.overview.PreviousOrders import uk.gov.justice.digital.hmpps.api.model.overview.Schedule import uk.gov.justice.digital.hmpps.service.OverviewService +import java.time.LocalDate @ExtendWith(MockitoExtension::class) internal class OverviewControllerTest { @@ -35,6 +36,7 @@ internal class OverviewControllerTest { preferredGender = "Prefer not to say", preferredName = "Joe", telephoneNumber = "1234", + dateOfBirth = LocalDate.now().minusYears(50), provisions = emptyList() ) val overview = Overview(