diff --git a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt index f7e0745a42..23902a317e 100644 --- a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt +++ b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt @@ -12,6 +12,7 @@ import uk.gov.justice.digital.hmpps.data.generator.* import uk.gov.justice.digital.hmpps.datetime.EuropeLondon import uk.gov.justice.digital.hmpps.user.AuditUserRepository import java.time.LocalDate +import java.time.LocalDateTime import java.time.LocalTime import java.time.ZonedDateTime @@ -135,7 +136,7 @@ class DataLoader( ZonedDateTime.of(LocalDate.now().minusDays(1), LocalTime.NOON, EuropeLondon) ) val outcome = SentenceGenerator.OUTCOME - val courtAppearance = SentenceGenerator.generateCourtAppearance(noSentenceEvent, outcome, ZonedDateTime.now()) + val courtAppearance = SentenceGenerator.generateCourtAppearance(noSentenceEvent, outcome, LocalDateTime.now()) em.saveAll(noSentenceEvent, noSentenceManager, outcome, courtAppearance) val newEvent = SentenceGenerator.generateEvent(PersonGenerator.NEW_TO_PROBATION, referralDate = LocalDate.now()) diff --git a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt index ea8e664a76..2b9d5011d6 100644 --- a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt +++ b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt @@ -69,7 +69,7 @@ object SentenceGenerator { val COURT_APPEARANCE = generateCourtAppearance( CURRENTLY_MANAGED, OUTCOME, - ZonedDateTime.of(LocalDate.now(), LocalTime.NOON, EuropeLondon) + LocalDateTime.now() ) val CURRENT_ORDER_MANAGER = generateOrderManager( @@ -182,7 +182,7 @@ object SentenceGenerator { fun generateCourtAppearance( event: Event, outcome: Outcome, - appearanceDate: ZonedDateTime, + appearanceDate: LocalDateTime, softDeleted: Boolean = false, id: Long = IdGenerator.getAndIncrement() ) = CourtAppearance( diff --git a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnAndEventIdIntegrationTest.kt b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnAndEventIdIntegrationTest.kt index ffba580394..4a23dbc796 100644 --- a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnAndEventIdIntegrationTest.kt +++ b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnAndEventIdIntegrationTest.kt @@ -229,7 +229,7 @@ internal class ConvictionByCrnAndEventIdIntegrationTest { ), CourtAppearanceBasic( COURT_APPEARANCE.id, - COURT_APPEARANCE.appearanceDate.toLocalDateTime(), + COURT_APPEARANCE.appearanceDate, COURT_APPEARANCE.court.code, COURT_APPEARANCE.court.courtName, KeyValue(COURT_APPEARANCE.appearanceType.code, COURT_APPEARANCE.appearanceType.description), diff --git a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnIntegrationTest.kt b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnIntegrationTest.kt index 30c5b2a686..f7e8649480 100644 --- a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnIntegrationTest.kt +++ b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ConvictionByCrnIntegrationTest.kt @@ -213,7 +213,7 @@ internal class ConvictionByCrnIntegrationTest { ), CourtAppearanceBasic( COURT_APPEARANCE.id, - COURT_APPEARANCE.appearanceDate.toLocalDateTime(), + COURT_APPEARANCE.appearanceDate, COURT_APPEARANCE.court.code, COURT_APPEARANCE.court.courtName, KeyValue(COURT_APPEARANCE.appearanceType.code, COURT_APPEARANCE.appearanceType.description), diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/courtappearance/entity/CourtAppearance.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/courtappearance/entity/CourtAppearance.kt index 1edc656b49..d81296dcd8 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/courtappearance/entity/CourtAppearance.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/courtappearance/entity/CourtAppearance.kt @@ -11,7 +11,7 @@ import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.Co import uk.gov.justice.digital.hmpps.integrations.delius.person.entity.Person import uk.gov.justice.digital.hmpps.integrations.delius.provider.entity.Staff import java.time.LocalDate -import java.time.ZonedDateTime +import java.time.LocalDateTime @Entity @Immutable @@ -26,7 +26,7 @@ class CourtAppearance( @JoinColumn(name = "outcome_id") val outcome: Outcome?, - val appearanceDate: ZonedDateTime, + val appearanceDate: LocalDateTime, @Column(name = "soft_deleted", columnDefinition = "number") val softDeleted: Boolean, diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/ConvictionService.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/ConvictionService.kt index 8ccd686d12..4e5adf7ab4 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/ConvictionService.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/ConvictionService.kt @@ -84,7 +84,7 @@ class ConvictionService( fun CourtAppearance.toCourtAppearanceBasic(): CourtAppearanceBasic = CourtAppearanceBasic( id, - appearanceDate.toLocalDateTime(), + appearanceDate, court.code, court.courtName, KeyValue(appearanceType.code, appearanceType.description), diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/CourtAppearanceService.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/CourtAppearanceService.kt index fd3d87903b..3d6370da00 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/CourtAppearanceService.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/CourtAppearanceService.kt @@ -30,7 +30,7 @@ class CourtAppearanceService( fun CourtAppearance.toCourtAppearance() = CourtAppearanceBasic( courtAppearanceId = id, - appearanceDate = appearanceDate.toLocalDateTime(), + appearanceDate = appearanceDate, courtCode = court.code, courtName = court.courtName, appearanceType = KeyValue(court.courtType.code, court.courtType.description),