From 5448799a14c7fc5f0faba71ae4e1f918621d8cf5 Mon Sep 17 00:00:00 2001 From: Anthony Britton <105213050+anthony-britton-moj@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:26:04 +0000 Subject: [PATCH] PI-1690 updated field for application submitted (#2764) --- .../digital/hmpps/data/generator/EventDetailsGenerator.kt | 2 +- .../simulations/__files/approved-premises-booking-made.json | 2 +- .../digital/hmpps/integrations/approvedpremises/EventDetails.kt | 2 +- .../uk/gov/justice/digital/hmpps/service/ReferralService.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/EventDetailsGenerator.kt b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/EventDetailsGenerator.kt index f60fa174c0..d224fd839d 100644 --- a/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/EventDetailsGenerator.kt +++ b/projects/approved-premises-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/EventDetailsGenerator.kt @@ -63,7 +63,7 @@ object EventDetailsGenerator { eventNumber = "23", arrivalOn = LocalDate.now(), departureOn = LocalDate.now(), - submittedAt = ZonedDateTime.now().minusDays(2), + applicationSubmittedOn = ZonedDateTime.now().minusDays(2), sentenceTypeString = SentenceType.StandardDeterminate.value, releaseTypeString = ReleaseType.Licence.value, situationString = null diff --git a/projects/approved-premises-and-delius/src/dev/resources/simulations/__files/approved-premises-booking-made.json b/projects/approved-premises-and-delius/src/dev/resources/simulations/__files/approved-premises-booking-made.json index 0de2ef2893..8c2df740f8 100644 --- a/projects/approved-premises-and-delius/src/dev/resources/simulations/__files/approved-premises-booking-made.json +++ b/projects/approved-premises-and-delius/src/dev/resources/simulations/__files/approved-premises-booking-made.json @@ -39,7 +39,7 @@ "surname": "Worker", "username": "KeyWorkerNPS" }, - "submittedAt": "2022-11-28T14:51:30", + "applicationSubmittedOn": "2022-11-28T14:51:30", "sentenceType": "nonStatutory", "releaseType": "not_applicable" } diff --git a/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremises/EventDetails.kt b/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremises/EventDetails.kt index f45d847875..099c7b1068 100644 --- a/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremises/EventDetails.kt +++ b/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremises/EventDetails.kt @@ -102,7 +102,7 @@ data class BookingMade( val premises: Premises, val arrivalOn: LocalDate, val departureOn: LocalDate, - val submittedAt: ZonedDateTime?, + val applicationSubmittedOn: ZonedDateTime?, @JsonAlias("sentenceType") private val sentenceTypeString: String?, @JsonAlias("releaseType") diff --git a/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/ReferralService.kt b/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/ReferralService.kt index ce24d42139..b8f979b7d5 100644 --- a/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/ReferralService.kt +++ b/projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/ReferralService.kt @@ -231,7 +231,7 @@ class ReferralService( personId = person.id, eventId = event.id, approvedPremisesId = ap.id, - referralDate = submittedAt?.toLocalDate() ?: bookingMadeAt.toLocalDate(), + referralDate = applicationSubmittedOn?.toLocalDate() ?: bookingMadeAt.toLocalDate(), referralDateTypeId = checkNotNull( referenceDataRepository.findByCodeAndDatasetCode( "CRC",