Skip to content

PM-6392 Sales report: per-bucket amounts and a stage drilldown - #162

Merged
jmgasper merged 1 commit into
developfrom
PM-6392
Sep 22, 2026
Merged

jmgasper merged 1 commit into
developfrom
PM-6392

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-6392

What's in this PR?

Two additions the redesigned Sales dashboard needs from the report contract. Both are backward compatible; the WIN endpoint's existing fields are unchanged.

summary.groups[].buckets[].amounts[]

Each bucket now carries a total per numeric column, in the same shape and order as summary.amounts, so a stage tile can show its Amount beside its Expected Revenue rather than only the one primary total. total and amountColumnId keep their current meaning.

drilldownColumn / drilldownValue

Matches a column's displayed value exactly, ignoring case and surrounding whitespace, and is applied after aggregation: it narrows rows, total and totalPages but never summary.

That is the difference from filterColumn/filterValue, which narrow both. It lets the dashboard drill into one buckets[] entry while every bucket stays on screen to be clicked next, so the stage breakdown does not collapse to the stage being examined. A drilldown therefore makes summary.recordCount larger than total.

Half a pair, or a column the report does not define, returns 400.

SALES.md documents both.

Testing

  • pnpm lint — clean.
  • pnpm build — clean.
  • npx jest src/reports/sales --runInBand — 41 passed, including new specs for per-bucket amounts across several currency columns, the drilldown narrowing rows while the summary stays complete, and the 400s.
  • Full suite: 443 passed. The 20 failures in src/reports/sfdc/* are pre-existing on develop and untouched by this PR (its diff is confined to src/reports/sales and SALES.md).

🤖 Generated with Claude Code

The redesigned Sales dashboard needs two things the report contract did not
provide:

- Every stage tile shows its Amount beside its Expected Revenue, so a bucket's
  single primary total is not enough. `summary.groups[].buckets[]` now carries
  an `amounts[]` entry per numeric column, in the same shape and order as
  `summary.amounts`. `total` and `amountColumnId` are unchanged for WIN.
- Clicking a stage must narrow the table while the breakdown it was clicked in
  stays on screen. `drilldownColumn`/`drilldownValue` match a column's displayed
  value exactly, ignoring case and surrounding whitespace, and are applied after
  aggregation: they narrow `rows`, `total` and `totalPages` but never `summary`.
  A drilldown therefore makes `summary.recordCount` larger than `total`.

Half a drilldown pair, or a column the report does not define, returns 400.
SALES.md documents both additions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jmgasper
jmgasper merged commit 66a2d7a into develop Sep 22, 2026
5 checks passed
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.

1 participant