Skip to content

Commit

Permalink
PI-1633 updates (#2721)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj authored Nov 21, 2023
1 parent a9dc2a0 commit 548c235
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class PcstdIntegrationTest : PcstdIntegrationTestBase() {
val custody = getCustody(nomsNumber)
assertTrue(custody.isInCustody())
assertThat(custody.institution?.code, equalTo(ual.code))
assertThat(custody.status.code, equalTo(CustodialStatusCode.IN_CUSTODY.code))
assertThat(custody.status.code, equalTo(CustodialStatusCode.RECALLED.code))
assertThat(custody.statusChangeDate, isCloseTo(notification.message.occurredAt))

verifyRecall(custody, notification.message.occurredAt, RecallReason.Code.NOTIFIED_BY_CUSTODIAL_ESTABLISHMENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ class UpdateStatusAction(
private fun outboundStatusChange(context: PrisonerMovementContext): ActionResult {
val (prisonerMovement, custody) = context
val statusCode = when {
prisonerMovement.isAbsconded() -> CustodialStatusCode.IN_CUSTODY
prisonerMovement.isHospitalRelease() || prisonerMovement.isIrcRelease() -> custody.nextStatus()
prisonerMovement.isHospitalRelease() || prisonerMovement.isIrcRelease() || prisonerMovement.isAbsconded() -> custody.nextStatus()
else -> if (custody.canBeReleased()) {
CustodialStatusCode.RELEASED_ON_LICENCE
} else {
Expand All @@ -71,7 +70,7 @@ class UpdateStatusAction(
when {
prisonerMovement.isHospitalRelease() -> "Transfer to/from Hospital"
prisonerMovement.isIrcRelease() -> "Transfer to Immigration Removal Centre"
prisonerMovement.isAbsconded() -> if (custody.canBeRecalled()) "Recall added unlawfully at large " else "Absconded unlawfully at large "
prisonerMovement.isAbsconded() -> "Recall added unlawfully at large "
else -> "Released on Licence"
}
)
Expand Down

0 comments on commit 548c235

Please sign in to comment.