Skip to content

Commit

Permalink
MAN-113: Return risk level (#4508)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcphee77 authored Dec 20, 2024
1 parent 46af9fc commit a357d88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
import uk.gov.justice.digital.hmpps.api.model.risk.PersonRiskFlag
import uk.gov.justice.digital.hmpps.api.model.risk.PersonRiskFlags
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator.DEREGISTRATION_1
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator.MAPPA_LEVEL
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator.OVERVIEW
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator.PERSON_2
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator.REGISTRATION_2
Expand Down Expand Up @@ -44,6 +45,10 @@ internal class RiskFlagIntegrationTest {
assertThat(res.riskFlags.size, equalTo(3))
assertThat(res.riskFlags[1].description, equalTo(REGISTRATION_2.type.description))
assertThat(res.riskFlags[1].mostRecentReviewDate, equalTo(REGISTRATION_REVIEW_2.date))
assertThat(res.riskFlags[1].levelCode, equalTo(null))
assertThat(res.riskFlags[1].levelDescription, equalTo(null))
assertThat(res.riskFlags[2].levelCode, equalTo(MAPPA_LEVEL.code))
assertThat(res.riskFlags[2].levelDescription, equalTo(MAPPA_LEVEL.description))
assertThat(res.removedRiskFlags.size, equalTo(1))
assertThat(
res.removedRiskFlags[0], equalTo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import java.time.LocalDate
data class RiskFlag(
val id: Long,
val description: String,
val levelCode: String?,
val levelDescription: String?,
val notes: String?,
val nextReviewDate: LocalDate?,
val mostRecentReviewDate: LocalDate?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ fun uk.gov.justice.digital.hmpps.integrations.delius.risk.RiskFlag.toMappa() = M
fun uk.gov.justice.digital.hmpps.integrations.delius.risk.RiskFlag.toRiskFlag() = RiskFlag(
id = id,
description = type.description,
levelCode = level?.code,
levelDescription = level?.description,
notes = notes,
createdDate = createdDate,
createdBy = Name(forename = createdBy.forename, surname = createdBy.surname),
Expand Down

0 comments on commit a357d88

Please sign in to comment.