Skip to content

Commit

Permalink
Formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
probation-integration-bot[bot] authored Jan 29, 2025
1 parent 5c7afa2 commit e1713b5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Dataset(
val code: String,
)

interface ReferenceDataRepository : JpaRepository<ReferenceData, Long>{
interface ReferenceDataRepository : JpaRepository<ReferenceData, Long> {

@Query(
"""
Expand All @@ -59,12 +59,15 @@ interface ReferenceDataRepository : JpaRepository<ReferenceData, Long>{
"""
)
fun findByDatasetCode(datasetCode: String): List<ReferenceData>

}

fun ReferenceDataRepository.getAddressTypeByCode(code: String) =
findByCodeAndDatasetCode(code, "ADDRESS TYPE") ?: throw InvalidRequestException("address type code", code)

fun ReferenceDataRepository.getMainAddressType() =
findByCodeAndDatasetCode("M", "ADDRESS STATUS") ?: throw NotFoundException("ReferenceData", "address status code", "M")
findByCodeAndDatasetCode("M", "ADDRESS STATUS") ?: throw NotFoundException(
"ReferenceData",
"address status code",
"M"
)

0 comments on commit e1713b5

Please sign in to comment.