mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Both callers already hand the provider a major-currency amount before this call — freight sends invoice.balanceAmount (e.g. 700 for $700), passenger sends CurrencyService's converted charge amount — with the target currency's own decimal precision already applied (0dp DJF, 2dp USD/ETB). CAC's toMajorAmount then divided anything that wasn't DJF by 100 on top of that, so a USD 700 charge reached the bank as 7.00. This never surfaced because CAC has only ever been wired for DJF (passenger) until now. Also scoped the bank's documented 10-100,000 bound to DJF — it's the only currency the spec states bounds for, so a USD amount outside that DJF-shaped range is no longer rejected locally; an amount genuinely out of range still comes back as a bank rejection. Passenger is unaffected: its CAC currency has always been DJF, and the DJF branch's behavior (amount unchanged, bounds enforced) is untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>