From 87e539e7388ac406bb25d837fef6cad62e042ab0 Mon Sep 17 00:00:00 2001 From: Giuseppe-La-Manna Date: Mon, 28 Oct 2024 12:31:16 +0100 Subject: [PATCH] P4PU-590 updated Mapper with convertToZonedDateTimeAndTruncateSeconds --- .../PullPaymentInstallmentDTO2InstallmentDTOMapper.java | 6 ++++-- .../PullPaymentNoticeDTO2PaymentNoticeDTOMapper.java | 6 +++--- .../PullPaymentOptionDTO2PaymentOptionDTOMapper.java | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentInstallmentDTO2InstallmentDTOMapper.java b/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentInstallmentDTO2InstallmentDTOMapper.java index d9a8771b..e3fb24dc 100644 --- a/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentInstallmentDTO2InstallmentDTOMapper.java +++ b/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentInstallmentDTO2InstallmentDTOMapper.java @@ -10,7 +10,9 @@ @Mapper(componentModel = "spring", uses = {PullPaymentOptionStatus2PaymentOptionStatusMapper.class, MapperUtilities.class}) public interface PullPaymentInstallmentDTO2InstallmentDTOMapper { - @Mapping(source = "insertedDate", target = "insertedDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "truncateToSeconds") - @Mapping(source = "lastUpdatedDate", target = "lastUpdatedDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "truncateToSeconds") + @Mapping(source = "insertedDate", target = "insertedDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") + @Mapping(source = "lastUpdatedDate", target = "lastUpdatedDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") + @Mapping(source = "dueDate", target = "dueDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") + @Mapping(source = "retentionDate", target = "retentionDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") InstallmentDTO toInstallmentDTO(PullPaymentInstallmentDTO pullPaymentInstallmentDTOSource); } diff --git a/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentNoticeDTO2PaymentNoticeDTOMapper.java b/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentNoticeDTO2PaymentNoticeDTOMapper.java index b28209dd..457bf9d5 100644 --- a/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentNoticeDTO2PaymentNoticeDTOMapper.java +++ b/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentNoticeDTO2PaymentNoticeDTOMapper.java @@ -10,9 +10,9 @@ @Mapper(componentModel = "spring", uses = {PullPaymentNoticeStatus2PaymentNoticeStatusMapper.class, PullPaymentOptionDTO2PaymentOptionDTOMapper.class, MapperUtilities.class}) public interface PullPaymentNoticeDTO2PaymentNoticeDTOMapper { - @Mapping(source = "insertedDate", target = "insertedDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "truncateToSeconds") - @Mapping(source = "publishDate", target = "publishDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "truncateToSeconds") - @Mapping(source = "validityDate", target = "validityDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "truncateToSeconds") + @Mapping(source = "insertedDate", target = "insertedDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") + @Mapping(source = "publishDate", target = "publishDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") + @Mapping(source = "validityDate", target = "validityDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") PaymentNoticeDTO toPaymentNoticeDTO(PullPaymentNoticeDTO source); } diff --git a/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentOptionDTO2PaymentOptionDTOMapper.java b/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentOptionDTO2PaymentOptionDTOMapper.java index fd3b8d78..1419e787 100644 --- a/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentOptionDTO2PaymentOptionDTOMapper.java +++ b/src/main/java/it/gov/pagopa/arc/dto/mapper/pullpayment/PullPaymentOptionDTO2PaymentOptionDTOMapper.java @@ -1,10 +1,14 @@ package it.gov.pagopa.arc.dto.mapper.pullpayment; import it.gov.pagopa.arc.connector.pullpayment.dto.PullPaymentOptionDTO; +import it.gov.pagopa.arc.dto.mapper.MapperUtilities; import it.gov.pagopa.arc.model.generated.PaymentOptionDTO; import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.NullValueCheckStrategy; -@Mapper(componentModel = "spring", uses = PullPaymentInstallmentDTO2InstallmentDTOMapper.class) +@Mapper(componentModel = "spring", uses = {PullPaymentInstallmentDTO2InstallmentDTOMapper.class, MapperUtilities.class}) public interface PullPaymentOptionDTO2PaymentOptionDTOMapper { + @Mapping(source = "dueDate", target = "dueDate", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, qualifiedByName = "convertToZonedDateTimeAndTruncateSeconds") PaymentOptionDTO toPaymentOptionDTO(PullPaymentOptionDTO pullPaymentOptionDTOSource); }