From 21f3ded4b424e05308a2567d2d9ee9ef5c2c556b Mon Sep 17 00:00:00 2001 From: achimber-moj <161360519+achimber-moj@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:23:24 +0100 Subject: [PATCH] PI-2383 - add arrival and departure date to contact record (#4146) * PI-2383 - add arrival and departure date to contact record * Formatting changes * Update projects/approved-premises-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/ReferralService.kt Co-authored-by: Marcus Aspin * Formatting changes * PI-2383 - add arrival and departure date to contact record --------- Co-authored-by: probation-integration-bot[bot] <177347787+probation-integration-bot[bot]@users.noreply.github.com> Co-authored-by: Marcus Aspin --- .../digital/hmpps/MessagingIntegrationInactiveTest.kt | 9 ++++++++- .../justice/digital/hmpps/MessagingIntegrationTest.kt | 9 ++++++++- .../gov/justice/digital/hmpps/service/ReferralService.kt | 7 ++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationInactiveTest.kt b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationInactiveTest.kt index 0f8ad4c6f2..6c2cf40881 100644 --- a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationInactiveTest.kt +++ b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationInactiveTest.kt @@ -150,7 +150,14 @@ internal class MessagingIntegrationInactiveTest { assertThat(contact.description, equalTo("Approved Premises Booking for Hope House")) assertThat( contact.notes, - equalTo("To view details of the Approved Premises booking, click here: https://approved-premises-dev.hmpps.service.justice.gov.uk/applications/484b8b5e-6c3b-4400-b200-425bbe410713") + equalTo( + """ + Expected arrival: 30/01/2023 + Expected departure: 30/04/2023 + + To view details of the Approved Premises booking, click here: https://approved-premises-dev.hmpps.service.justice.gov.uk/applications/484b8b5e-6c3b-4400-b200-425bbe410713 + """.trimIndent() + ) ) assertThat(contact.locationId, equalTo(OfficeLocationGenerator.DEFAULT.id)) assertThat(contact.eventId, equalTo(PersonGenerator.INACTIVE_EVENT.id)) diff --git a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt index 92023075f3..5c8c6830ca 100644 --- a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt +++ b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt @@ -150,7 +150,14 @@ internal class MessagingIntegrationTest { assertThat(contact.description, equalTo("Approved Premises Booking for Hope House")) assertThat( contact.notes, - equalTo("To view details of the Approved Premises booking, click here: https://approved-premises-dev.hmpps.service.justice.gov.uk/applications/484b8b5e-6c3b-4400-b200-425bbe410713") + equalTo( + """ + Expected arrival: 30/01/2023 + Expected departure: 30/04/2023 + + To view details of the Approved Premises booking, click here: https://approved-premises-dev.hmpps.service.justice.gov.uk/applications/484b8b5e-6c3b-4400-b200-425bbe410713 + """.trimIndent() + ) ) assertThat(contact.locationId, equalTo(OfficeLocationGenerator.DEFAULT.id)) assertThat(contact.eventId, equalTo(PersonGenerator.EVENT.id)) 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 5a2bda9e33..6be6a9bb37 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 @@ -70,7 +70,12 @@ class ReferralService( ContactDetails( date = details.bookingMadeAt, type = ContactTypeCode.BOOKING_MADE, - notes = "To view details of the Approved Premises booking, click here: ${details.applicationUrl}", + notes = """ + Expected arrival: ${DeliusDateFormatter.format(details.arrivalOn)} + Expected departure: ${DeliusDateFormatter.format(details.departureOn)} + + To view details of the Approved Premises booking, click here: ${details.applicationUrl} + """.trimIndent(), description = "Approved Premises Booking for ${details.premises.name}", locationCode = ap.locationCode() ),