From b2cde8b6f50c707e4df5c21ca081e4896d51905a Mon Sep 17 00:00:00 2001 From: scopesorting Date: Fri, 10 Nov 2023 17:50:01 +0100 Subject: [PATCH] correcting the open issues from 09.11.2023 (0001 A-M was previously commited, 0006A+B are corrected herein) --- .../validators/validation_rule_functions.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/server/BreCal/validators/validation_rule_functions.py b/src/server/BreCal/validators/validation_rule_functions.py index 9e51eaf..b7f2662 100644 --- a/src/server/BreCal/validators/validation_rule_functions.py +++ b/src/server/BreCal/validators/validation_rule_functions.py @@ -800,7 +800,15 @@ class ValidationRuleFunctions(ValidationRuleBaseFunctions): # when one of the two values is null, the state is GREEN if (times_agency.berth_id is None) or (times_terminal.berth_id is None): return (StatusFlags.GREEN, None) + + # when one of the two values is null, the state is GREEN + if (pd.isnull(times_agency.berth_id)) or (pd.isnull(times_terminal.berth_id)): + return (StatusFlags.GREEN, None) + + if shipcall.type in [ShipcallType.OUTGOING.value, ShipcallType.SHIFTING.value]: + return (StatusFlags.GREEN, None) + # only incoming shipcalls matter. The other ones are not relevant for the berth selection violation_state = times_agency.berth_id!=times_terminal.berth_id if violation_state: @@ -825,6 +833,14 @@ class ValidationRuleFunctions(ValidationRuleBaseFunctions): # when one of the two values is null, the state is GREEN if (times_agency.pier_side is None) or (times_terminal.pier_side is None): return (StatusFlags.GREEN, None) + + # when one of the two values is null, the state is GREEN + if (pd.isnull(times_agency.pier_side)) or (pd.isnull(times_terminal.pier_side)): + return (StatusFlags.GREEN, None) + + # only incoming shipcalls matter. The other ones are not relevant for the pier_side selection + if shipcall.type in [ShipcallType.OUTGOING.value, ShipcallType.SHIFTING.value]: + return (StatusFlags.GREEN, None) violation_state = times_agency.pier_side!=times_terminal.pier_side