diff --git a/projects/manage-supervision-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/PersonGenerator.kt b/projects/manage-supervision-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/PersonGenerator.kt index dc7aa3bd38..f426852e3b 100644 --- a/projects/manage-supervision-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/PersonGenerator.kt +++ b/projects/manage-supervision-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/PersonGenerator.kt @@ -121,14 +121,17 @@ object PersonGenerator { IdGenerator.getAndIncrement(), id, ReferenceData(IdGenerator.getAndIncrement(), "E01", "Employment"), - ReferenceData(IdGenerator.getAndIncrement(), "FT01", "Full-time employed (30 or more hours per week)"), + PersonalCircumstanceSubType( + IdGenerator.getAndIncrement(), + "Full-time employed (30 or more hours per week" + ), LocalDate.now() ), PersonalCircumstance( IdGenerator.getAndIncrement(), id, ReferenceData(IdGenerator.getAndIncrement(), "A02", "Accommodation"), - ReferenceData(IdGenerator.getAndIncrement(), "FM01", "Friends/Family (settled)"), + PersonalCircumstanceSubType(IdGenerator.getAndIncrement(), "Friends/Family (settled)"), LocalDate.now() ) ), diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/PersonalCircumstance.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/PersonalCircumstance.kt index 9cb79630e9..834bfbed9f 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/PersonalCircumstance.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/PersonalCircumstance.kt @@ -28,7 +28,7 @@ class PersonalCircumstance( @ManyToOne @Fetch(FetchMode.JOIN) @JoinColumn(name = "circumstance_sub_type_id") - val subType: ReferenceData, + val subType: PersonalCircumstanceSubType, val startDate: LocalDate, @@ -39,3 +39,14 @@ class PersonalCircumstance( ) +@Immutable +@Entity +@Table(name = "r_circumstance_sub_type") +class PersonalCircumstanceSubType( + @Id + @Column(name = "circumstance_sub_type_id") + val id: Long, + + @Column(name = "code_description") + val description: String, +) \ No newline at end of file