Skip to content

PM-5043: Provide billing line item member subtotals#19

Merged
jmgasper merged 1 commit into
developfrom
PM-5043
May 20, 2026
Merged

PM-5043: Provide billing line item member subtotals#19
jmgasper merged 1 commit into
developfrom
PM-5043

Conversation

@jmgasper

Copy link
Copy Markdown
Contributor

What was broken
The prior platform-ui fixes could use memberPaymentAmount when the billing account API returned it, but the API only guaranteed those subtotals for copilot-only responses. PM/TM views could still receive consumed challenge ledger amounts without a reliable member-payment subtotal.

Root cause
Billing-account detail serialization exposed the ledger amount, which includes markup, while memberPaymentAmount was added only during copilot sanitization and used billing-account markup for every row. Consumed challenge rows need the challenge-specific markup when available, and locked challenge rows already store the member-payment subtotal.

What was changed
Billing-account detail responses now add memberPaymentAmount to locked and consumed line items before auth-specific sanitization. Challenge markup is resolved from the challenge database, consumed challenge rows use that markup to reverse the ledger amount, locked challenge rows keep their stored amount, and copilot sanitization preserves precomputed subtotals.

Any added/updated tests
No automated tests were added because this service does not define a test script or include a test runner. Validation run: pnpm lint passed, pnpm build passed.

What was broken
The prior platform-ui fixes could use memberPaymentAmount when the billing account API returned it, but the API only guaranteed those subtotals for copilot-only responses. PM/TM views could still receive consumed challenge ledger amounts without a reliable member-payment subtotal.

Root cause
Billing-account detail serialization exposed the ledger amount, which includes markup, while memberPaymentAmount was added only during copilot sanitization and used billing-account markup for every row. Consumed challenge rows need the challenge-specific markup when available, and locked challenge rows already store the member-payment subtotal.

What was changed
Billing-account detail responses now add memberPaymentAmount to locked and consumed line items before auth-specific sanitization. Challenge markup is resolved from the challenge database, consumed challenge rows use that markup to reverse the ledger amount, locked challenge rows keep their stored amount, and copilot sanitization preserves precomputed subtotals.

Any added/updated tests
No automated tests were added because this service does not define a test script or include a test runner. Validation was covered by lint and build.
@jmgasper
jmgasper merged commit dfa9709 into develop May 20, 2026
3 of 4 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