Skip to content

Commit

Permalink
PI-2049: Order the removed risk flags (#3587)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcphee77 authored Apr 4, 2024
1 parent 21c0d3b commit 70e871c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fun uk.gov.justice.digital.hmpps.integrations.delius.risk.RiskFlag.toRiskFlag()
nextReviewDate = nextReviewDate,
mostRecentReviewDate = reviews.filter { it.completed == true }.maxByOrNull { it.date }?.date,
removed = deRegistered,
removalHistory = deRegistrations.map { it.toRiskFlagRemoval() }
removalHistory = deRegistrations.sortedByDescending { it.deRegistrationDate }.map { it.toRiskFlagRemoval() }
)

fun DeRegistration.toRiskFlagRemoval() = RiskFlagRemoval(
Expand Down

0 comments on commit 70e871c

Please sign in to comment.