aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java b/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java
index b3ad044..26deea7 100644
--- a/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java
+++ b/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java
@@ -29,6 +29,7 @@ import org.springframework.stereotype.Component;
import javax.xml.bind.JAXBElement;
import java.util.List;
+import static at.gv.egiz.moazs.MoaZSException.moaZSException;
import static at.gv.zustellung.msg.xsd.AttachmentType.attachmentTypeBuilder;
import static at.gv.zustellung.msg.xsd.AttachmentsType.attachmentsTypeBuilder;
import static at.gv.zustellung.msg.xsd.ConfirmationAddress.confirmationAddressBuilder;
@@ -91,6 +92,7 @@ public class Mzs2MsgConverter {
.withLogo(sender.getLogo())
.withAdditionalCriteria(sender.getAdditionalCriteria())
.withConfirmationAddress(convertConfirmationAddress(sender))
+ .withClearingProfilID(sender.getClearingProfilID())
.build();
}
@@ -160,12 +162,20 @@ public class Mzs2MsgConverter {
private Receiver.ReceiverBuilder setupReceiverBuilder(at.gv.zustellung.app2mzs.xsd.DeliveryRequestType.Receiver receiver) {
var builder = receiverBuilder()
.withPreAdviceNote(receiver.getPreAdviceNote())
- .withAdditionalCriteria(receiver.getAdditionalCriteria())
- .withPerson(convertReceiverPerson(receiver.getPerson()))
- .withAddress(convertAddresses(receiver.getAddress()));
+ .withAdditionalCriteria(receiver.getAdditionalCriteria());
- if (receiver.getIdentification() != null) builder.withIdentification(convert(receiver.getIdentification()));
+ if (receiver.getIdentification() != null) {
+ builder.withIdentification(convert(receiver.getIdentification()));
+ } else if (receiver.getPerson() != null){
+ builder.withPerson(convertReceiverPerson(receiver.getPerson()))
+ .withAustrianAddressesOnly(receiver.getAustrianAddressesOnly());
+ if (receiver.getAddress() != null) {
+ builder.withAddress(convertAddresses(receiver.getAddress()));
+ }
+ } else {
+ throw moaZSException("Cannot create msg:Receiver. Neither Person nor Identification specified.");
+ }
return builder;
}