generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug/pi 2204 approved premises and delius booking cancellation (#3805)
* PI-2204 delete approved_premises_preferred record if one exists Signed-off-by: Amardeep Chimber <[email protected]> * PI-2204 update integration test Signed-off-by: Amardeep Chimber <[email protected]> * PI-2204 update integration test Signed-off-by: Amardeep Chimber <[email protected]> * Formatting changes * Empty-Commit --------- Signed-off-by: Amardeep Chimber <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c04de3b
commit 740e603
Showing
4 changed files
with
47 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../digital/hmpps/integrations/delius/approvedpremises/referral/entity/PreferredResidence.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package uk.gov.justice.digital.hmpps.integrations.delius.approvedpremises.referral.entity | ||
|
||
import jakarta.persistence.* | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
@Entity | ||
@Table(name = "approved_premises_preferred") | ||
@EntityListeners(AuditingEntityListener::class) | ||
@SequenceGenerator(name = "ap_preferred_id_seq", sequenceName = "ap_preferred_id_seq", allocationSize = 1) | ||
class PreferredResidence( | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ap_preferred_id_seq") | ||
@Column(name = "approved_premises_preferred_id") | ||
val id: Long = 0, | ||
|
||
val approvedPremisesResidenceId: Long | ||
) | ||
|
||
interface PreferredResidenceRepository : JpaRepository<PreferredResidence, Long> { | ||
fun existsByApprovedPremisesResidenceId(approvedPremisesResidenceId: Long): Boolean | ||
|
||
fun deleteByApprovedPremisesResidenceId(approvedPremisesResidenceId: Long) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters