Skip to content

Commit

Permalink
APS-2021: Cas1 offender entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
vbala-moj committed Mar 4, 2025
1 parent 6003ae1 commit dbc6ff6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
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,

)
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)
);

0 comments on commit dbc6ff6

Please # to comment.