From 3c94d59ce92b797a83c66f928c748f56644d5c2d Mon Sep 17 00:00:00 2001 From: pmcphee77 <150798161+pmcphee77@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:05:01 +0100 Subject: [PATCH] PI-2065: Only return teams where team end date is not set (#3690) --- .../digital/hmpps/integrations/delius/user/entity/User.kt | 6 ++++++ 1 file changed, 6 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 817826799b..1b7fd46cd4 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 @@ -133,6 +133,10 @@ class Team( @JoinColumn(name = "probation_area_id") @ManyToOne val provider: Provider, + + @Column(name = "end_date") + val endDate: LocalDate? = null + ) interface TeamRepository : JpaRepository { @@ -141,6 +145,7 @@ interface TeamRepository : JpaRepository { select t.staff from Team t where t.code = :teamCode + and (t.endDate is null or t.endDate > current_date) """ ) fun findStaffByTeamCode(teamCode: String): List @@ -150,6 +155,7 @@ interface TeamRepository : JpaRepository { select t.provider.description from Team t where t.code = :teamCode + and (t.endDate is null or t.endDate > current_date) """ ) fun findProviderByTeamCode(teamCode: String): String?