diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/person/entity/Provision.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/person/entity/Provision.kt index 7ed2436d8..0a70705a1 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/person/entity/Provision.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/person/entity/Provision.kt @@ -12,7 +12,7 @@ import java.time.LocalDate @Immutable @Entity @Table(name = "provision") -@SQLRestriction("soft_deleted = 0 and (finish_date is null or finish_date > current_date)") +@SQLRestriction("soft_deleted = 0") class Provision( @Id @Column(name = "provision_id") diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/OffenderService.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/OffenderService.kt index 81606e89d..533d39912 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/OffenderService.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/OffenderService.kt @@ -84,7 +84,7 @@ fun Person.toContactDetails() = ContactDetails( from = it.startDate, to = it.endDate, noFixedAbode = it.noFixedAbode, - notes = it.notes, + notes = it.notes?.takeIf { it.isNotBlank() }, addressNumber = it.addressNumber, buildingName = it.buildingName, streetName = it.streetName,