feat(admin): add Billing Platform admin page with invoice comparison#116269
Open
armcknight wants to merge 5 commits into
Open
feat(admin): add Billing Platform admin page with invoice comparison#116269armcknight wants to merge 5 commits into
armcknight wants to merge 5 commits into
Conversation
Contributor
📊 Type Coverage Diff
🔍 5 new type safety issues introduced
This is informational only and does not block the PR. |
Member
Author
|
@sentry review |
Member
Author
|
@sentry review |
d91b0ed to
c89cc4e
Compare
brendanhsentry
approved these changes
May 27, 2026
c89cc4e to
8750267
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8750267. Configure here.
8750267 to
a8f90aa
Compare
…G-86) Adds a new "Billing Platform" sidebar entry hosting an Invoice Comparison tool that calls the new GET /api/0/_admin/cells/<cell_id>/invoice-comparison/ endpoint (getsentry-side change in a paired PR). The page lets staff pick a region + datetime-local time window and renders per-org totals comparing legacy Invoice vs PlatformInvoice records generated in the window, plus summary counts/totals/delta. Rows are sorted by absolute $ delta desc. datetime-local inputs are converted to UTC ISO on submit so the wire format is unambiguous regardless of the operator's timezone. The Billing Platform page is the landing spot for future milestone-1 verification tooling — invoice comparison is the first section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pairs with the getsentry-side switch to percent-based sorting. Adds a "Δ %" column showing percent delta relative to legacy (or ∞ when there's no legacy baseline). Keeps the "Δ $" column so absolute-dollar context remains visible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Table descendant rule (`th, td { text-align: left }`) had
specificity (0,1,1) which beat the single-class RightHeader/RightCell
selectors at (0,1,0), so Legacy/Platform/Δ %/Δ $ columns silently
rendered left-aligned. Wrap the right-align rule in `&&` to double the
class selector and win specificity.
Addresses Cursor Bugbot finding.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces custom styled() helpers with scraps primitives per AGENTS.md frontend guidelines: - Raw <h3> → <Heading as="h3"> from @sentry/scraps/text - SummaryGrid (display: grid) → Grid columns="repeat(6, 1fr)" - SummaryCell, Field (flex column) → Flex direction="column" - SummaryLabel (font-size: sm + muted color) → Text size="sm" variant="muted" - SummaryValue (font-size: lg + bold) → Text size="lg" bold - SecondaryText, Count (small + muted color) → Text size="sm" variant="muted" Kept FieldLabel and TruncatedNote as thin wrappers since they layer small layout-only tweaks (color on a <label>, margin on a <Text>) that don't have a direct primitive equivalent. Right-align CSS specificity fix on RightHeader/RightCell stays as-is. Addresses Cursor Bugbot finding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces deprecated `useApiQuery` (flagged by static/AGENTS.md frontend guide) with the new pattern: `apiOptions.as<T>()` composed into `useQuery` from TanStack Query. Uses `skipToken` for the path arg to disable the query before the user submits, matching the previous `enabled` semantics. Addresses Cursor Bugbot finding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
795c6a2 to
30b04ee
Compare
Member
Author
|
Tried force-pushing a clean history on top of base to make jest tests happy. 🤞🏻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Milestone-1 (consumer billing) ships invoices through the new platform code path in shadow mode alongside the legacy generator. Staff have no in-product way to spot-check parity between the two — confirming counts, dollar totals, and biggest divergences for invoices generated in a given window. Needed before we can confidently flip a population to platform-issued invoices.
Paired backend PR: getsentry#20425.
Solution
New "Billing Platform" page under `/_admin/billing-platform/`, surfaced as a sidebar entry between Invoices and Spike Projection Generation. First section is an Invoice Comparison tool; the page is intentionally a container for future milestone-1 verification tooling.
The tool itself:
Notes
REVENG-86