From cf90865ce21f246a0358fd291324f511c5ed6e90 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Thu, 5 Dec 2019 09:16:36 +0100 Subject: Fix Missing Parameters in ERVDeliveryConfirmed Notification - mzs Schema Change: Introduce new type mzs:ERVConfirmedDelivery (which is a mzs:MessageType extension) and replace mzs:DeliveryNotification/msg:ERVConfirmedDelivery with mzs:ERVConfirmedDelivery. Reason: Necessary to provide all parameters to sender application (AppDeliveryID, DeliverySystem, ZSDeliveryID, a.o.). - Adapt Msg2MzsConverter accordingly. --- .../at/gv/egiz/moazs/scheme/Msg2MzsConverter.java | 21 +++++++++++++++++++-- src/main/resources/mzs/app2mzs.xsd | 12 +++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java b/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java index f7d14cd..1390986 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java @@ -24,6 +24,7 @@ package at.gv.egiz.moazs.scheme; import at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType; import at.gv.zustellung.app2mzs.xsd.*; import at.gv.zustellung.msg.xsd.*; +import at.gv.zustellung.msg.xsd.ERVConfirmedDeliveryType; import org.springframework.stereotype.Component; import javax.xml.bind.JAXBElement; @@ -34,6 +35,7 @@ import static at.gv.egiz.moazs.MoaZSException.moaZSException; import static at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType.AdditionalFormat.additionalFormatBuilder; import static at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType.deliveryNotificationTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.DeliveryResponseType.deliveryResponseTypeBuilder; +import static at.gv.zustellung.app2mzs.xsd.ERVConfirmedDeliveryType.ERVConfirmedDeliveryTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.ErrorType.errorTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.PartialSuccessType.partialSuccessTypeBuilder; import static at.gv.zustellung.app2mzs.xsd.SuccessType.successTypeBuilder; @@ -120,8 +122,8 @@ public class Msg2MzsConverter { builder.withError(extractError(msgNotification, error, signedNotification)) .withNotificationsPerformed(error.getNotificationsPerformed()); } else if(answer.getValue() instanceof ERVConfirmedDeliveryType) { - ERVConfirmedDeliveryType ervConfirmed = (ERVConfirmedDeliveryType) answer.getValue(); - builder.withERVConfirmedDelivery(ervConfirmed); + var ervConfirmed = (ERVConfirmedDeliveryType) answer.getValue(); + builder.withERVConfirmedDelivery(extractERVconfirmedDelivery(msgNotification, ervConfirmed, signedNotification)); } else { throw moaZSException(UNKNOWN_ANSWER_ERROR_MSG); } @@ -159,6 +161,21 @@ public class Msg2MzsConverter { .build(); } + private at.gv.zustellung.app2mzs.xsd.ERVConfirmedDeliveryType extractERVconfirmedDelivery( + at.gv.zustellung.msg.xsd.DeliveryNotificationType msgNotification, + ERVConfirmedDeliveryType ervConfirmed,Optional signedNotification) { + + return ERVConfirmedDeliveryTypeBuilder() + .withAppDeliveryID(msgNotification.getAppDeliveryID()) + .withDeliverySystem(msgNotification.getDeliverySystem()) + .withZSDeliveryID(msgNotification.getZSDeliveryID()) + .withGZ(msgNotification.getGZ()) + .withSignedDeliveryRequestStatus(signedNotification.orElse(null)) + .withERVConfirmedDelivery(ervConfirmed) + .build(); + } + + private List convert( List additionalFormat) { return additionalFormat.stream() diff --git a/src/main/resources/mzs/app2mzs.xsd b/src/main/resources/mzs/app2mzs.xsd index 6a4ffda..4b22a63 100644 --- a/src/main/resources/mzs/app2mzs.xsd +++ b/src/main/resources/mzs/app2mzs.xsd @@ -169,7 +169,7 @@ - + @@ -245,6 +245,16 @@ + + + + + + + + + + abstract message type -- cgit v1.2.3