Skip to content

Prod deploy - May 2026#103

Merged
kkartunov merged 34 commits into
masterfrom
develop
May 12, 2026
Merged

Prod deploy - May 2026#103
kkartunov merged 34 commits into
masterfrom
develop

Conversation

jmgasper and others added 30 commits April 27, 2026 08:32
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.
PM-4951: Include review costs in draft billing locks
…val-flow

PM-4684 - challenge approval flow
…oval-flow

PM-4684 challenge approval flow
jmgasper added 4 commits May 6, 2026 10:54
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
@kkartunov kkartunov merged commit 51d81de into master May 12, 2026
8 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.

3 participants