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