Skip to content

Commit

Permalink
PI-2065: Only return teams where team end date is not set (#3690)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcphee77 authored Apr 26, 2024
1 parent 704b06f commit 3c94d59
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Team, Long> {
Expand All @@ -141,6 +145,7 @@ interface TeamRepository : JpaRepository<Team, Long> {
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<Staff>
Expand All @@ -150,6 +155,7 @@ interface TeamRepository : JpaRepository<Team, Long> {
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?
Expand Down

0 comments on commit 3c94d59

Please sign in to comment.