Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-britton-moj authored Feb 28, 2024
1 parent 39552ef commit 42afcd7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ interface ConvictionEventRepository : JpaRepository<ConvictionEventEntity, Long>
"disposal.type"
]
)
fun getAllByConvictionEventPersonIdOrderByConvictionDateDesc(personId: Long): List<ConvictionEventEntity>
fun getAllByConvictionEventPersonIdAndActiveIsTrueOrderByConvictionDateDesc(personId: Long): List<ConvictionEventEntity>

@EntityGraph(
attributePaths = [
Expand Down Expand Up @@ -212,4 +212,4 @@ interface ConvictionEventRepository : JpaRepository<ConvictionEventEntity, Long>
}

fun ConvictionEventRepository.getLatestConviction(personId: Long) =
getAllByConvictionEventPersonIdOrderByConvictionDateDesc(personId).firstOrNull()
getAllByConvictionEventPersonIdAndActiveIsTrueOrderByConvictionDateDesc(personId).firstOrNull()

0 comments on commit 42afcd7

Please sign in to comment.