From 8de016c89b3bbbdea7e6d83ba3fc88b0bc4e9b31 Mon Sep 17 00:00:00 2001 From: SangeethaPalat Date: Thu, 8 Feb 2024 11:14:54 +0100 Subject: [PATCH] build failure --- .../service/mapping/TransportEventMapper.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/commercialschedules-service/src/main/java/org/dcsa/commercialschedules/service/mapping/TransportEventMapper.java b/commercialschedules-service/src/main/java/org/dcsa/commercialschedules/service/mapping/TransportEventMapper.java index 48c994f..5295fdc 100644 --- a/commercialschedules-service/src/main/java/org/dcsa/commercialschedules/service/mapping/TransportEventMapper.java +++ b/commercialschedules-service/src/main/java/org/dcsa/commercialschedules/service/mapping/TransportEventMapper.java @@ -6,6 +6,9 @@ import org.mapstruct.Mapping; import org.mapstruct.Mappings; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + @Mapper(componentModel = "spring") public interface TransportEventMapper { @Mappings( @@ -15,11 +18,8 @@ public interface TransportEventMapper { }) TimestampTO toTO(TransportEvent transportEvent); - @Mappings( - value = { - @Mapping(target = "transportEventTypeCode", source = "eventTypeCode"), - @Mapping(target = "eventClassifierCode", source = "eventClassifierCode"), - @Mapping(target = "eventCreatedDateTime", source = "eventCreatedDateTime"), - }) - TransportEvent toEntity(TimestampTO timestampTO); + default String map(OffsetDateTime value){ + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssXXX"); + return value.format(formatter); + } }