diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/sentence/MainOffence.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/sentence/MainOffence.kt index e36218e034..0ff83bf9ae 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/sentence/MainOffence.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/sentence/MainOffence.kt @@ -5,6 +5,6 @@ import java.time.LocalDate data class MainOffence( val offence: Offence, val dateOfOffence: LocalDate, - val notes: String, + val notes: String?, val additionalOffences: List ) diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/Event.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/Event.kt index 9684e82ccb..b0a04e36da 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/Event.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/overview/entity/Event.kt @@ -37,8 +37,8 @@ class Event( @OneToMany(mappedBy = "event") val additionalOffences: List = emptyList(), - @Column(name = "notes") - val notes: String, + @Column(name = "notes", columnDefinition = "clob") + val notes: String?, @Column(columnDefinition = "number") val softDeleted: Boolean = false @@ -152,7 +152,7 @@ class AdditionalOffence( val id: Long, @Column(name = "offence_count") - val offenceCount: Long, + val offenceCount: Long?, @ManyToOne @JoinColumn(name = "event_id", nullable = false) diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt index 72eb0663b5..37e140ec14 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt @@ -25,7 +25,7 @@ class SentenceService( notes = notes, additionalOffences = additionalOffences.map { Offence( - description = it.offence.description, count = it.offenceCount + description = it.offence.description, count = it.offenceCount ?: 0 ) } )