fix(py): parity coercions — amount/message types + junior '?' sticky #25

Merged
kacerr merged 3 commits from fix/py-parity-coercions into main 2026-05-08 00:26:39 +02:00
Showing only changes of commit 58973473c9 - Show all commits

View File

@@ -310,8 +310,9 @@ def build_juniors_view_model(
cell_text = "-"
amount_to_pay = 0
if expected == "?" or (isinstance(expected, int) and expected > 0):
if expected == "?":
is_unknown = original_expected == "?"
if is_unknown or (isinstance(expected, int) and expected > 0):
if is_unknown:
status = "empty"
cell_text = f"?{count_str}"
elif paid >= expected:
@@ -339,7 +340,7 @@ def build_juniors_view_model(
status = "surplus"
cell_text = f"PAID {paid}"
if (isinstance(expected, int) and expected > 0) or paid > 0:
if (not is_unknown and isinstance(expected, int) and expected > 0) or paid > 0:
tooltip = f"Received: {paid}, Expected: {expected}"
else:
tooltip = ""