diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt index c1d43336d1..6543aa6f5e 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt @@ -13,7 +13,8 @@ interface EventSentenceRepository : JpaRepository { "LEFT JOIN FETCH m.offence mo " + "LEFT JOIN FETCH ao.offence aoo " + "WHERE e.personId = :id " + - "AND e.active = true " + "AND e.active = true " + + "ORDER BY e.eventNumber DESC " ) fun findActiveSentencesByPersonId(id: Long): List }