From 4e704e721a1a8d7e4033988b7575c4cdbfd75a42 Mon Sep 17 00:00:00 2001 From: Marcus Aspin Date: Mon, 16 Oct 2023 14:24:58 +0100 Subject: [PATCH] PI-1561 Handle multiple Duty to Refer NSIs (#2390) --- .../main/kotlin/uk/gov/justice/digital/hmpps/entity/Nsi.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/resettlement-passport-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/Nsi.kt b/projects/resettlement-passport-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/Nsi.kt index aa7cb1ed9c..346823dca7 100644 --- a/projects/resettlement-passport-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/Nsi.kt +++ b/projects/resettlement-passport-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/entity/Nsi.kt @@ -10,6 +10,7 @@ import jakarta.persistence.Table import org.hibernate.annotations.Immutable import org.hibernate.annotations.Where import org.springframework.data.annotation.CreatedDate +import org.springframework.data.domain.PageRequest import org.springframework.data.jpa.repository.JpaRepository import org.springframework.data.jpa.repository.Query import java.time.LocalDate @@ -100,7 +101,7 @@ interface NsiRepository : JpaRepository { order by nsi.createdDatetime desc """ ) - fun findDutyToReferByCrn(crn: String): Nsi? + fun findDutyToReferByCrn(crn: String, page: PageRequest = PageRequest.of(0, 1)): Nsi? @Query( """ @@ -113,5 +114,5 @@ interface NsiRepository : JpaRepository { order by nsi.createdDatetime desc """ ) - fun findDutyToReferByNoms(noms: String): Nsi? + fun findDutyToReferByNoms(noms: String, page: PageRequest = PageRequest.of(0, 1)): Nsi? }