From f47151ece6e73ad6d19eb47a577f072a05bdc430 Mon Sep 17 00:00:00 2001 From: pmcphee77 <150798161+pmcphee77@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:37:42 +0100 Subject: [PATCH] MAN-26: Order metadata and add nameOrCrn sort (#4264) --- .../digital/hmpps/integrations/delius/user/entity/User.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt index c6e9b7ec35..c0ede46540 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt @@ -431,6 +431,7 @@ interface CaseloadRepository : JpaRepository { select distinct cont.type from Caseload c join Contact cont on cont.personId = c.person.id where c.staff.code = :staffCode and cont.type.attendanceContact = true + order by cont.type.description asc """ ) fun findContactTypesForStaff(staffCode: String): List @@ -441,6 +442,7 @@ interface CaseloadRepository : JpaRepository { join Event e on e.personId = c.person.id and e.active = true and e.softDeleted = false where e.mainOffence.offence is not null and c.staff.code = :staffCode + order by e.mainOffence.offence.description asc """ ) fun findOffenceTypesForStaff(staffCode: String): List @@ -451,6 +453,7 @@ enum class CaseloadOrderType(val sortColumn: String) { LAST_CONTACT("paType.description"), SENTENCE("moo.description"), SURNAME("p.surname"), + NAME_OR_CRN("p.surname"), DOB("p.dateOfBirth") }