From 35a9ce48c7d225e24226980413837c9b1739472e Mon Sep 17 00:00:00 2001 From: gj0dcsa <135594855+gj0dcsa@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:20:34 +0100 Subject: [PATCH] SD-1888 Correct displayedAddress line limit in electronic BL --- .../standards/ebl/checks/EBLChecks.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java b/ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java index fd8371f3..8622b308 100644 --- a/ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java +++ b/ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java @@ -275,22 +275,22 @@ public class EBLChecks { JsonAttribute.unique("countryCode", "type") ); - - - private static final JsonRebaseableContentCheck EBL_DISPLAYED_ADDRESS_LIMIT = JsonAttribute.ifThen( - "Validate displayed address length for EBLs", - td -> td.path("isElectronic").asBoolean(false), - JsonAttribute.allIndividualMatchesMustBeValid( - "(not used)", + private static final Consumer DISPLAYED_ADDRESS_MAV_CONSUMER = mav -> { mav.submitAllMatching("documentParties.shipper.displayedAddress"); mav.submitAllMatching("documentParties.consignee.displayedAddress"); mav.submitAllMatching("documentParties.endorsee.displayedAddress"); mav.submitAllMatching("documentParties.notifyParties.*.displayedAddress"); - }, - JsonAttribute.matchedMaxLength(2) - ) - ); + }; + + private static final JsonRebaseableContentCheck EBL_DISPLAYED_ADDRESS_LIMIT = + JsonAttribute.ifThenElse( + "Validate displayed address length for EBLs", + td -> td.path("isElectronic").asBoolean(true), + JsonAttribute.allIndividualMatchesMustBeValid( + "(not used)", DISPLAYED_ADDRESS_MAV_CONSUMER, JsonAttribute.matchedMaxLength(6)), + JsonAttribute.allIndividualMatchesMustBeValid( + "(not used)", DISPLAYED_ADDRESS_MAV_CONSUMER, JsonAttribute.matchedMaxLength(2))); private static final Consumer ALL_UTE = mav -> mav.submitAllMatching("utilizedTransportEquipments.*");