Conversation
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.
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.
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.