From 8a1ec60f9531640ad8c4275c1c143ee29d915fe0 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 13 Jun 2014 19:02:24 +0200 Subject: company status --- .../moa/id/protocols/stork2/MandateRetrievalRequest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'id/server/idserverlib/src') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java index 72dc81b35..29a4c23a4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java @@ -129,6 +129,13 @@ public class MandateRetrievalRequest implements IAction { } else { attributeList.add(new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(type), AttributeStatusType.NOT_AVAILABLE.value())); } + } else if (currentAttribute.getName().equals("status")) { + String status = getCompanyStatus(mandateContainer, currentAttribute); + if (status.length() > 0) { + attributeList.add(new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(status), AttributeStatusType.AVAILABLE.value())); + } else { + attributeList.add(new PersonalAttribute(currentAttribute.getName(), currentAttribute.isRequired(), Arrays.asList(status), AttributeStatusType.NOT_AVAILABLE.value())); + } } else if (currentAttribute.getName().equals("translatableType")) { String translatableType = getCompanyTranslatableType(mandateContainer, currentAttribute); if (translatableType.length() > 0) { @@ -264,6 +271,15 @@ public class MandateRetrievalRequest implements IAction { return ""; } + private String getCompanyStatus(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException { + String legalName = getLegalName(mandateContainer, sourceAttribute); + if (legalName.contains("in Liquidation") || legalName.contains("in Liqu.")) { + return "L"; // liqudation + } + return "R"; + } + + private String getCompanyType(MandateContainer mandateContainer, PersonalAttribute sourceAttribute) throws MOAIDException { // retrieve the registered subject name String legalName = getLegalName(mandateContainer, sourceAttribute); -- cgit v1.2.3