generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...in/uk/gov/justice/digital/hmpps/approvedpremisesapi/jpa/entity/cas1/Cas1OffenderEntity.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,26 @@ | ||
package uk.gov.justice.digital.hmpps.approvedpremisesapi.jpa.entity.cas1 | ||
|
||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.Table | ||
import java.time.OffsetDateTime | ||
import java.util.UUID | ||
|
||
@Entity | ||
@Table(name = "cas1_offenders") | ||
data class Cas1OffenderEntity( | ||
@Id | ||
val id: UUID, | ||
val crn: String, | ||
val nomsNumber: String?, | ||
/** | ||
* The offender name. This should only be used for search purposes (i.e. SQL) | ||
* If returning the offender name to the user, use the [OffenderService], which | ||
* will consider any LAO restrictions | ||
*/ | ||
val name: String, | ||
val tier: String?, | ||
val createdAt: OffsetDateTime, | ||
val lastUpdatedAt: OffsetDateTime, | ||
|
||
) |
10 changes: 10 additions & 0 deletions
10
src/main/resources/db/migration/all/20250303081728__add_cas1_offender_table.sql
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,10 @@ | ||
CREATE TABLE cas1_offenders ( | ||
id UUID NOT NULL , | ||
crn TEXT NOT NULL , | ||
noms_number TEXT, | ||
tier TEXT, | ||
name TEXT NOT NULL , | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL, | ||
last_updated_at TIMESTAMP WITH TIME ZONE NOT NULL, | ||
PRIMARY KEY (id) | ||
); |