From 72ae6d2b3bb68c00a36aa30e44745a78471c4e9f Mon Sep 17 00:00:00 2001 From: Anthony Britton <105213050+anthony-britton-moj@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:24:53 +0000 Subject: [PATCH] Add offender id to Licence Condition for VPD SP (#3239) --- .../integrations/delius/sentence/entity/LicenceCondition.kt | 3 +++ .../justice/digital/hmpps/service/LicenceConditionService.kt | 1 + 2 files changed, 4 insertions(+) diff --git a/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/LicenceCondition.kt b/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/LicenceCondition.kt index 082c52d101..d250e90208 100644 --- a/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/LicenceCondition.kt +++ b/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/LicenceCondition.kt @@ -29,6 +29,9 @@ import java.time.ZonedDateTime @SequenceGenerator(name = "lic_condition_id_seq", sequenceName = "lic_condition_id_seq", allocationSize = 1) class LicenceCondition( + @Column(name = "offender_id") + val personId: Long, + @Column(name = "disposal_id") val disposalId: Long, diff --git a/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/LicenceConditionService.kt b/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/LicenceConditionService.kt index f8f1b628de..956c0441e6 100644 --- a/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/LicenceConditionService.kt +++ b/projects/create-and-vary-a-licence-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/LicenceConditionService.kt @@ -28,6 +28,7 @@ class LicenceConditionService( ): LicenceCondition { val lc = licenceConditionRepository.save( LicenceCondition( + disposal.event.person.id, disposal.id, startDate, category,