mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-01 19:23:27 +00:00
Seven selects in overview.repository sum payments with a literal currency filter, one column for ETB and one for USD: COALESCE(SUM(payment.amount) FILTER (WHERE payment.currency = 'USD'), 0) Anything else is summed nowhere. A DJF payment would not appear as a separate figure — it would simply be absent from revenue MTD, the payment trend, the per-method breakdown and the direction and freight-type splits, with no error and nothing to notice. Adds the third column at each site, the matching response fields, and the tiles and stacked bar that render them. The payment chart's tooltip now derives the label from the series key instead of a ternary on "amountUsd", so it does not need touching again. ponytail: a third hardcoded currency is still the shorter diff. A fourth should force these seven into a GROUP BY payment.currency returning IOverviewCurrencyAmount[] — the shape getRevenueByCurrency already uses a few lines below. Note the ordering dependency: the DJF enum label must exist before these run. payments.currency is enum-typed, so `= 'DJF'` against a database where the migration has not been applied is a runtime error, not an empty result. All three query shapes were EXPLAIN-checked against the dev database.