Skip to content

PM-5043: Use gross challenge payments for BA sync#184

Merged
jmgasper merged 2 commits into
devfrom
PM-5043
May 27, 2026
Merged

PM-5043: Use gross challenge payments for BA sync#184
jmgasper merged 2 commits into
devfrom
PM-5043

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

What was broken
Finance rebuilt challenge billing-account lock and consume totals from payment.total_amount. Some challenge payment rows can carry a fee-inclusive total, so the billing ledger could store member payments with the challenge fee already included and then apply markup again.

Root cause
The previous UI and billing API fixes corrected how existing ledger rows were displayed, but the finance synchronization path could still write or rebuild challenge billing rows from fee-inclusive payment totals instead of the member-payment subtotal.

What was changed
Added a shared finance helper that resolves the challenge member-payment amount from gross_amount with total_amount as a fallback. Updated new winning creation sync and wallet-admin resync paths to use that member subtotal when recalculating challenge billing-account rows.

Any added/updated tests
Updated WinningsService and AdminService coverage so fee-inclusive total_amount rows still sync billing accounts from gross_amount member payments.

Validation
pnpm lint passed.
pnpm test passed.
pnpm build passed.

jmgasper added 2 commits May 21, 2026 14:03
What was broken
Finance rebuilt challenge billing-account lock and consume totals from payment.total_amount. Some challenge payment rows can carry a fee-inclusive total, so the billing ledger could store member payments with the challenge fee already included and then apply markup again.

Root cause
The previous UI and billing API fixes corrected how existing ledger rows were displayed, but the finance synchronization path could still write or rebuild challenge billing rows from fee-inclusive payment totals instead of the member-payment subtotal.

What was changed
Added a shared finance helper that resolves the challenge member-payment amount from gross_amount with total_amount as a fallback. Updated new winning creation sync and wallet-admin resync paths to use that member subtotal when recalculating challenge billing-account rows.

Any added/updated tests
Updated WinningsService and AdminService coverage so fee-inclusive total_amount rows still sync billing accounts from gross_amount member payments.
@jmgasper jmgasper merged commit 2eb260e into dev May 27, 2026
2 of 3 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