aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java21
1 files changed, 19 insertions, 2 deletions
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<byte[]> signedNotification) {
+
+ return ERVConfirmedDeliveryTypeBuilder()
+ .withAppDeliveryID(msgNotification.getAppDeliveryID())
+ .withDeliverySystem(msgNotification.getDeliverySystem())
+ .withZSDeliveryID(msgNotification.getZSDeliveryID())
+ .withGZ(msgNotification.getGZ())
+ .withSignedDeliveryRequestStatus(signedNotification.orElse(null))
+ .withERVConfirmedDelivery(ervConfirmed)
+ .build();
+ }
+
+
private List<DeliveryNotificationType.AdditionalFormat> convert(
List<at.gv.zustellung.msg.xsd.DeliveryNotificationType.AdditionalFormat> additionalFormat) {
return additionalFormat.stream()