Skip to content

Commit

Permalink
add mappings for new disqualification type: sanction
Browse files Browse the repository at this point in the history
  • Loading branch information
hgurung1 committed Jan 25, 2024
1 parent e5d438d commit 6a4b070
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ default void parseReason(
disqualifyingLaw.put("CDDA", "company-directors-disqualification-act-1986");
disqualifyingLaw.put("CDDO",
"company-directors-disqualification-northern-ireland-order-2002");
disqualifyingLaw.put("SAMLA", "sanctions-anti-money-laundering-act-2018");

HashMap<String, String> descriptionIdentifier = MapperUtils.createIdentifierHashMap();

Expand All @@ -79,7 +80,10 @@ default void parseReason(
reason.put("act", disqualifyingLaw.get(sectionParts[0]));
reason.put("description_identifier", descriptionIdentifier.get(sectionParts[2]));

String disqualificationReference = sectionParts[0].equals("CDDA") ? "section" : "article";
String disqualificationReference = "article";
if (sectionParts[0].equals("CDDA") || sectionParts[0].equals("SAMLA")) {
disqualificationReference = "section";
}

reason.put(disqualificationReference, sectionParts[2].substring(1));

Expand All @@ -99,6 +103,7 @@ default void parseDisqType(
HashMap<String, String> disqualificationType = new HashMap<>();
disqualificationType.put("ORDER", "court-order");
disqualificationType.put("UNDERTAKING", "undertaking");
disqualificationType.put("SANCTION", "sanction");
target.setDisqualificationType(disqualificationType.get(sourceDisq.getDisqType()));
}

Expand All @@ -116,7 +121,7 @@ default void parseHearingDetails(
if (sourceDisq.getDisqType().equals("ORDER")) {
target.setCourtName(sourceDisq.getCourtName());
target.setHeardOn(LocalDate.parse(sourceDisq.getHearingDate(), formater));
} else {
} else if (sourceDisq.getDisqType().equals("UNDERTAKING")) {
target.setUndertakenOn(LocalDate.parse(sourceDisq.getHearingDate(), formater));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static HashMap<String, String> createIdentifierHashMap() {
descriptionIdentifier.put("S9B",
"competition-and-markets-authority-disqualification-undertaking");
descriptionIdentifier.put("S10", "participation-in-wrongful-trading");
descriptionIdentifier.put("S3A", "director-disqualification-sanctions");

return descriptionIdentifier;
}
Expand Down

0 comments on commit 6a4b070

Please sign in to comment.