From f64c565bd492ab739d95b7563a723ec4004b2a83 Mon Sep 17 00:00:00 2001 From: stevomcallister <78762879+stevomcallister@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:27:48 +0000 Subject: [PATCH] PI-1679 Changes to notes (#2747) --- .../approvedpremesis/EventDetails.kt | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/projects/cas3-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremesis/EventDetails.kt b/projects/cas3-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremesis/EventDetails.kt index 0ee6566531..1b0927812f 100644 --- a/projects/cas3-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremesis/EventDetails.kt +++ b/projects/cas3-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/approvedpremesis/EventDetails.kt @@ -35,7 +35,8 @@ data class BookingCancelled( val cancellationContext: String? ) : Cas3Event { override val urn = "urn:hmpps:cas3:booking-cancelled:$bookingId" - override val noteText = "$cancellationReason $cancellationContext $bookingUrl" + override val noteText = + listOfNotNull(cancellationReason, cancellationContext).joinToString(" ") + System.lineSeparator() + bookingUrl override val contactTypeCode = ContactType.BOOKING_CANCELLED } @@ -48,7 +49,12 @@ data class BookingProvisional( val notes: String ) : Cas3Event { override val urn = "urn:hmpps:cas3:booking-provisionally-made:$bookingId" - override val noteText = "${DeliusDateFormatter.format(expectedArrivedAt)} $notes $bookingUrl" + override val noteText = + listOfNotNull( + "Expected arrival date:", + DeliusDateFormatter.format(expectedArrivedAt), + notes + ).joinToString(" ") + System.lineSeparator() + bookingUrl override val contactTypeCode = ContactType.BOOKING_PROVISIONAL } @@ -61,7 +67,12 @@ data class BookingConfirmed( val notes: String ) : Cas3Event { override val urn = "urn:hmpps:cas3:booking-confirmed:$bookingId" - override val noteText = "${DeliusDateFormatter.format(expectedArrivedAt)} $notes $bookingUrl" + override val noteText = + listOfNotNull( + "Expected arrival date:", + DeliusDateFormatter.format(expectedArrivedAt), + notes + ).joinToString(" ") + System.lineSeparator() + bookingUrl override val contactTypeCode = ContactType.BOOKING_CONFIRMED } @@ -75,7 +86,12 @@ data class PersonArrived( val premises: Address ) : Cas3Event { override val urn = "urn:hmpps:cas3:person-arrived:$bookingId" - override val noteText = "${DeliusDateFormatter.format(arrivedAt)} $notes $bookingUrl" + override val noteText = + listOfNotNull( + "Arrival date:", + DeliusDateFormatter.format(arrivedAt), + notes + ).joinToString(" ") + System.lineSeparator() + bookingUrl override val contactTypeCode = ContactType.PERSON_ARRIVED } @@ -116,7 +132,13 @@ data class PersonDeparted( ) : Cas3Event { override val urn = "urn:hmpps:cas3:person-departed:$bookingId" - override val noteText = listOfNotNull(DeliusDateFormatter.format(departedAt), notes, reason, reasonDetail, moveOnCategory.description).joinToString(" ") + override val noteText = listOfNotNull( + DeliusDateFormatter.format(departedAt), + notes, + reason, + reasonDetail, + moveOnCategory.description + ).joinToString(" ") override val contactTypeCode = ContactType.PERSON_DEPARTED }