Skip to content

Commit

Permalink
SD-554 Update ebl si issuetoparty (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
palatsangeetha authored Nov 19, 2024
1 parent 9784a0a commit 40c3383
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class EBLChecks {

private static final JsonPointer SI_REQUEST_INVOICE_PAYABLE_AT_UN_LOCATION_CODE = JsonPointer.compile("/invoicePayableAt/UNLocationCode");
private static final JsonPointer SI_REQUEST_SEND_TO_PLATFORM = JsonPointer.compile("/documentParties/issueTo/sendToPlatform");
private static final JsonPointer ISSUE_TO_PARTY = JsonPointer.compile("/documentParties/issueTo");

private static final JsonPointer TD_TDR = JsonPointer.compile("/transportDocumentReference");
private static final JsonPointer TD_TRANSPORT_DOCUMENT_STATUS = JsonPointer.compile("/transportDocumentStatus");
Expand Down Expand Up @@ -454,11 +453,25 @@ private static Consumer<MultiAttributeValidator> allDg(Consumer<MultiAttributeVa
JsonAttribute.unique("countryCode", "manifestTypeCode")
);

private static final JsonRebaseableContentCheck SEND_TO_PLATFORM_CONDITIONAL_CHECK =
JsonAttribute.ifThenElse(
"'isElectronic' and 'transportDocumentTypeCode' BOL implies 'sendToPlatform'",
JsonAttribute.isTrue(JsonPointer.compile("/isElectronic")),
JsonAttribute.ifThenElse(
"'transportDocumentTypeCode' is BOL",
JsonAttribute.isEqualTo("/transportDocumentTypeCode", "BOL"),
JsonAttribute.mustBePresent(SI_REQUEST_SEND_TO_PLATFORM),
JsonAttribute.mustBeAbsent(SI_REQUEST_SEND_TO_PLATFORM)
),
JsonAttribute.mustBeAbsent(SI_REQUEST_SEND_TO_PLATFORM)
);

private static final List<JsonContentCheck> STATIC_SI_CHECKS = Arrays.asList(
JsonAttribute.mustBeDatasetKeywordIfPresent(
SI_REQUEST_SEND_TO_PLATFORM,
EblDatasets.EBL_PLATFORMS_DATASET
),
SEND_TO_PLATFORM_CONDITIONAL_CHECK,
ONLY_EBLS_CAN_BE_NEGOTIABLE,
EBL_AT_MOST_ONE_COPY_WITHOUT_CHARGES,
EBL_AT_MOST_ONE_COPY_WITH_CHARGES,
Expand All @@ -468,12 +481,6 @@ private static Consumer<MultiAttributeValidator> allDg(Consumer<MultiAttributeVa
EBLS_CANNOT_HAVE_ORIGINALS_WITHOUT_CHARGES,
E_SWBS_CANNOT_HAVE_ORIGINALS_WITH_CHARGES,
E_SWBS_CANNOT_HAVE_COPIES_WITHOUT_CHARGES,
JsonAttribute.ifThenElse(
"'isElectronic' implies 'issueTo' party",
JsonAttribute.isTrue(JsonPointer.compile("/isElectronic")),
JsonAttribute.mustBePresent(ISSUE_TO_PARTY),
JsonAttribute.mustBeAbsent(ISSUE_TO_PARTY)
),
DOCUMENTATION_PARTIES_CODE_LIST_PROVIDERS,
VALID_WOOD_DECLARATIONS,
NATIONAL_COMMODITY_CODE_IS_VALID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
},
"issueTo": {
"partyName": "DCSA CTK",
"sendToPlatform": "BOLE",
"identifyingCodes" : [
{
"codeListProvider": "W3C",
Expand Down

0 comments on commit 40c3383

Please sign in to comment.