Skip to content

Commit

Permalink
PI-1679 Changes to notes (#2747)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevomcallister authored Nov 27, 2023
1 parent 5b9c800 commit f64c565
Showing 1 changed file with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand All @@ -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
}

Expand All @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit f64c565

Please sign in to comment.