Narong Next-Phase — the "Ranking of POS" bug. nix-cafe staging 3f94812 — no migration, no backend.
Verified locally on lumiere 4/4 + on get-coffee.staging + staging smoke 5/5.
New DAO aggregateRevenueByBranch sums every paid order per shop (GROUP BY shop_id) → one row
per branch. The old aggregateRevenueByPosConfig is kept (a regression probe hits it) but
the card no longer uses it. Crucially the old per-register DAO INNER JOINed pos_configs and
filtered pos_config_id IS NOT NULL — so orders not tied to a register were silently dropped.
On lumiere, 3 of 4 branches have such orders, so the old card showed almost nothing; the new branch DAO counts them all.
Card title → "Branch Performance", rows labeled by branch name. One DAO added; no schema change.


Verified on the deployed staging Worker via a real SSO login. get-coffee is single-branch, so the card shows one branch row — proving it renders branch-level on the live deploy.

get-coffee.staging — one branch, its registers summed.| Card titled "Branch Performance" (was "Ranking of POS") | pass |
| One row per branch, registers summed (4 branch rows on lumiere) | pass |
| Rows labeled by branch name (not "Register —") | pass |
| Register-less orders now counted (old card dropped 3/4 branches) | pass |
Per-register DAO + ranking-of-pos testid kept → r7 / r-followups green | pass |
| tsc --noEmit | clean |
| Staging smoke | 5/5 |
No schema change. Parked on staging for the scheduled prod promote.