landing: harden GOA alt display for all three sites

Ship goa-amount.js inside each landing tree, add an inline fallback when
the asset is not yet deployed, keep CHF free of GOA unit names, fix
exchange amount_full wiring, and add test-landing-stats.sh (local + live).
This commit is contained in:
Hernâni Marques 2026-07-17 08:48:00 +02:00
parent b65018cd0b
commit 9e0f85024b
No known key found for this signature in database
10 changed files with 796 additions and 16 deletions

View file

@ -102,12 +102,24 @@ def format_amount_alt(
value_f = 0.0
base_name = alt.get("0") or cur
if val == 0:
disp = f"0 {base_name}"
# Never rename foreign currencies with a GOA alt map (merchant dual CHF+GOA).
cur_u = (cur or "").upper()
base_u = str(base_name).upper()
if cur_u and cur_u != "GOA" and (base_u == "GOA" or base_u.endswith("-GOA") or "GOA" in base_u):
return {
"amount": base,
"amount_alt": disp,
"amount_full": disp,
"amount_alt": base,
"amount_full": base,
"value": value_f,
"value_str": value_str,
}
if val == 0:
# Keep canonical CUR:0 (avoids "0 GOA" for empty foreign balances)
return {
"amount": base,
"amount_alt": base,
"amount_full": base,
"value": 0.0,
"value_str": "0",
}