Conversation
What was broken Cancelled challenges in Appeals Response could be saved in challenge-api-v6 without ever calling tc-finance-api, so reviewer payments were not generated and billing-account ledger rows were not updated. Root cause The challenge update flow only requested finance payment generation for task challenges transitioning to COMPLETED. Cancelled status transitions reused phase-closing logic but had no matching finance trigger. What was changed Added a shared cancelled-status helper in ChallengeService and call finance after a challenge first transitions into any cancelled terminal status. The call runs after the database transaction commits, matching the existing completed-task payment generation pattern. Any added/updated tests Added a ChallengeService unit test that stubs the finance helper and verifies a challenge transitioning to CANCELLED_CLIENT_REQUEST requests payment generation.
PM-4957: Trigger finance on challenge cancellation
What was broken Draft challenge saves persisted the challenge and its billing metadata, but they did not write a locked billing-account budget row. The Billing Account Details modal only reads locked and consumed budget rows, so newly saved draft challenge payments were missing from the list. Root cause (if identifiable) The previous PM-4951 fix handled finance-created winning/payment rows in tc-finance-api. QA reproduced the draft challenge editor flow, which saves challenge prize data through challenge-api-v6 and does not create a finance payment row at that point. What was changed challenge-api-v6 now synchronizes a billing-account lock after challenge create/update when the saved challenge is Draft, Approved, or Active. The lock amount uses the persisted member-payment total plus the challenge billing markup and writes a CHALLENGE lock row keyed by the challenge id. Finance can still replace that locked row with the finalized consumed amount when payment generation runs after completion or cancellation. Any added/updated tests Added project-helper coverage for the billing-account lock request and ChallengeService coverage that a saved Draft challenge triggers the billing lock sync with the expected billing account, challenge id, markup, and member-payment amount.
PM-4951: Lock draft challenge billing budget
What was broken Draft challenge billing locks were using the saved prize-set total but did not include estimated member-review payments. The Billing Account Details modal therefore showed a locked draft row, but its member payment amount was lower than the challenge editor's estimated challenge total breakdown. Root cause (if identifiable) The previous follow-up fixed the missing locked row and included copilot prizes, but challenge-api-v6 did not apply the same review-cost calculation that the Work challenge editor uses for draft billing estimates. What was changed The challenge billing-lock amount now adds estimated member-review cost for USD placement challenges, using the existing two-submission estimate and reviewer fixed/coefficient fields before applying billing markup. Point-based challenges continue to skip review-cost billing estimates. Any added/updated tests Updated the draft challenge billing-lock unit coverage to use the QA sample shape: placement prizes, copilot fee, and review cost now produce a member-payment lock amount of 73.10 before markup.
…tches, since they have a system review
PM-4951: Include review costs in draft billing locks
…v6 into PM-4684_challenge-approval-flow
…val-flow PM-4684 - challenge approval flow
…val-flow fix validation
…val-flow fix validation
…val-flow fix lint
…oval-flow PM-4684 challenge approval flow
…oval-flow Allow PM to approve budget
What was broken Draft challenge updates that removed skill chips left the old ChallengeSkill rows in place, so saved drafts still showed removed skills. Root cause The update path converted incoming skills to nested Prisma creates but never deleted existing ChallengeSkill records before creating the replacement set. Empty skill arrays also skipped skill validation, which could bypass the completed-challenge guard once replacement works. What was changed When an update payload includes skills, the API deletes existing ChallengeSkill rows in the same transaction before creating the submitted rows. Skill validation now treats an empty submitted array as an explicit update while still preserving skills when the field is omitted. Any added/updated tests Added unit coverage for replacing persisted challenge skills with a smaller submitted set.
PM-5021: Replace challenge skills on update
…v6 into develop # Conflicts: # src/services/ChallengeService.js
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.
https://topcoder.atlassian.net/browse/PM-4957
https://topcoder.atlassian.net/browse/PM-4951
https://topcoder.atlassian.net/browse/PM-4684
https://topcoder.atlassian.net/browse/PM-5021