You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PM-5043: Provide billing line item member subtotals
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.
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
- Endpoints:
8
8
-`GET /billing-accounts`
9
9
-`POST /billing-accounts`
10
-
-`GET /billing-accounts/:billingAccountId` (includes locked/consumed arrays + budget totals; line items expose `amount`, `date`, `externalId`, `externalType`, `externalName`, and `challengeId` only for challenge compatibility; copilot, project-scoped, and Talent Manager callers only receive line items for projects they belong to; copilot-only callers receive `memberPaymentsRemaining` and per-line-item `memberPaymentAmount` instead of raw `markup`)
10
+
-`GET /billing-accounts/:billingAccountId` (includes locked/consumed arrays + budget totals; line items expose `amount`, `memberPaymentAmount`, `date`, `externalId`, `externalType`, `externalName`, and `challengeId` only for challenge compatibility; copilot, project-scoped, and Talent Manager callers only receive line items for projects they belong to; copilot-only callers receive `memberPaymentsRemaining` instead of raw `markup`)
11
11
-`GET /billing-accounts/users/:userId` (list billing accounts accessible by the given Topcoder user ID — resolved via Salesforce resource object)
Copy file name to clipboardExpand all lines: src/billing-accounts/billing-accounts.controller.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,7 @@ export class BillingAccountsController {
179
179
buildOperationDoc({
180
180
summary: "Get a billing account",
181
181
description:
182
-
"Fetch a billing account by its identifier, including budget, client data, and normalized locked/consumed line items. Line items include amount, date, externalId, externalType, externalName, and challengeId only for legacy challenge compatibility. Project Managers can read billing accounts granted to them or assigned to non-deleted projects; plain Topcoder User project members need an allowed project billing-account role. Copilot, Project Manager, Topcoder User, and Talent Manager callers only receive locked/consumed line items for projects they belong to. Copilot-only callers receive copilot-safe budget data without the raw markup field, including memberPaymentsRemaining and per-line-item memberPaymentAmount values.",
182
+
"Fetch a billing account by its identifier, including budget, client data, and normalized locked/consumed line items. Line items include amount, memberPaymentAmount, date, externalId, externalType, externalName, and challengeId only for legacy challenge compatibility. Project Managers can read billing accounts granted to them or assigned to non-deleted projects; plain Topcoder User project members need an allowed project billing-account role. Copilot, Project Manager, Topcoder User, and Talent Manager callers only receive locked/consumed line items for projects they belong to. Copilot-only callers receive copilot-safe budget data without the raw markup field, including memberPaymentsRemaining.",
0 commit comments