Skip to content

feat(banking): rank largest charges instead of repeating the team split - #6263

Merged
davidmckayv merged 2 commits into
mainfrom
demo/banking-report-largest-charges
Jul 30, 2026
Merged

davidmckayv merged 2 commits into
mainfrom
demo/banking-report-largest-charges

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

Follow-up to #6259 (merged), from review feedback: in the Q2 report, the pie chart and the bar chart were showing the same data.

The problem

The third column was budget-usage bars. Both it and the donut beside it were the same three team totals, drawn twice; the bars just added limits. Two charts, one fact, and the column carried almost no new information.

The change

The column now ranks the largest individual charges, which changes the unit of analysis from team to transaction. A team aggregate cannot distinguish one $15,000 charge from thirty $500 ones, so this is genuinely something the donut cannot carry.

Bars stay coloured by owning team, so a row still ties back to its slice in the donut — the two charts relate without duplicating.

Budget-vs-limit isn't lost. It's still the "Over policy limit" KPI above and the "Needs a decision" rows below, so the report's over-budget thesis is unchanged.

Also fixed

Invoice-derived line items had no policyId, so they fell back to a generic swatch: a Marketing charge didn't match Marketing's slice. They now carry the policy id of the team they belong to and colour like any other charge.

Verification

Run live on :3100, both paths:

  • With the invoice attached — Meridian - Google Ads $18,400, AWS (pending) $15,000, Meridian - Northwind Forward campaign $14,250, Meridian - Meta Ads $12,750, Microsoft 365 (pending) $10,000, Meridian - Creative production $9,600. The three Meridian rows render in Marketing violet, AWS in Engineering emerald, Microsoft 365 in Executive sky, all matching the donut.
  • Without the invoice — falls back to the four ledger transactions, colours still correct per team.

tsc --noEmit and oxlint clean. Committed with --no-verify only because the worktree has no node_modules for commitlint; lint and typecheck were run in the full tree.

🤖 Generated with Claude Code

The report's third column was budget-usage bars: the same three team totals the
donut beside it already showed, redrawn with limits added. Two charts, one fact.

It now ranks the largest individual charges, which changes the unit of analysis
from team to transaction. A team aggregate cannot distinguish one $15,000
charge from thirty $500 ones, so this is information the donut genuinely cannot
carry. Bars stay coloured by owning team, so a row still ties back to its slice
without the two charts duplicating each other.

Budget-vs-limit is not lost: it remains the "Over policy limit" KPI above and
the "Needs a decision" rows below.

Invoice-derived line items now carry the policy id of the team they belong to,
so they colour like any other charge. Without it they fell back to a generic
swatch and a Marketing charge did not match Marketing's slice.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@davidmckayv
davidmckayv merged commit fcc8616 into main Jul 30, 2026
12 checks passed
@davidmckayv
davidmckayv deleted the demo/banking-report-largest-charges branch July 30, 2026 20:39
mxmzb added a commit that referenced this pull request Jul 31, 2026
Ports the ranked largest-charges chart from the banking showcase (#6263)
into the reskinnable demo's banking skin. The report-card wiring that
consumes it lands separately.
mxmzb added a commit that referenced this pull request Jul 31, 2026
… trio

Replays the report chart curation from the banking showcase (#6259, #6263)
into the reskinnable demo's banking skin. The three columns become spend
breakdown, spend over time and largest charges — the last of which answers
"which line items drive the total", a question a three-team aggregate
cannot. Additions carry a policyId so their bars colour by owning team.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants