aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz')
-rw-r--r--src/main/java/at/gv/egiz/moazs/mzs/MzsValidator.java6
-rw-r--r--src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java2
-rw-r--r--src/main/java/at/gv/egiz/moazs/tnvz/TnvzHelper.java11
3 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/mzs/MzsValidator.java b/src/main/java/at/gv/egiz/moazs/mzs/MzsValidator.java
index c5b73bb..26ea7dc 100644
--- a/src/main/java/at/gv/egiz/moazs/mzs/MzsValidator.java
+++ b/src/main/java/at/gv/egiz/moazs/mzs/MzsValidator.java
@@ -16,7 +16,11 @@ public class MzsValidator {
* @return true if mandatory fields are present.
*/
public boolean isTnvzComplete(DeliveryRequestType request) {
- return (!request.getConfig().isPerformQueryPersonRequest()) || request.getTnvzMetaData() != null;
+ return !request.getConfig().isPerformQueryPersonRequest() ||
+ (request.getTnvzMetaData() != null
+ && request.getSender().getCorporateBody() != null);
+
+
}
/**
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 fdb2ab8..6976738 100644
--- a/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java
+++ b/src/main/java/at/gv/egiz/moazs/scheme/Mzs2MsgConverter.java
@@ -61,7 +61,7 @@ public class Mzs2MsgConverter {
//------------- SENDER ------------------
- public Sender convert(at.gv.zustellung.app2mzs.xsd.DeliveryRequestType.Sender sender) {
+ private Sender convert(at.gv.zustellung.app2mzs.xsd.DeliveryRequestType.Sender sender) {
return senderBuilder()
.withSenderPerson(extractSenderPerson(sender))
.withLogo(sender.getLogo())
diff --git a/src/main/java/at/gv/egiz/moazs/tnvz/TnvzHelper.java b/src/main/java/at/gv/egiz/moazs/tnvz/TnvzHelper.java
index 3599362..f71b992 100644
--- a/src/main/java/at/gv/egiz/moazs/tnvz/TnvzHelper.java
+++ b/src/main/java/at/gv/egiz/moazs/tnvz/TnvzHelper.java
@@ -115,11 +115,6 @@ public class TnvzHelper {
private Sender extractSender(DeliveryRequestType.Sender sender) {
var corporateBody = sender.getCorporateBody();
- if (corporateBody == null) {
- //todo! implement this case
- throw MoaZSException.moaZSException("Not Implemented.");
- }
-
var mzsIdentification = corporateBody.getIdentification().get(0);
var msgIdentification = converter.convert(mzsIdentification);
@@ -135,9 +130,7 @@ public class TnvzHelper {
var builder = receiverBuilder();
- if (receiver.getIdentification() != null) {
- builder.withIdentification(converter.convert(receiver.getIdentification()));
- } else {
+ if (receiver.getIdentification() == null) {
builder
.withPerson(converter.convert(receiver.getPerson()))
.withAustrianAddressesOnly(receiver.getAustrianAddressesOnly());
@@ -149,6 +142,8 @@ public class TnvzHelper {
if (receiver.getPreAdviceNote() != null) {
builder.withNotificationAddressList(receiver.getPreAdviceNote().getNotificationAddressList());
}
+ } else {
+ builder.withIdentification(converter.convert(receiver.getIdentification()));
}
return builder.build();