Review: Stripe Connect payout + admin result (re-review)
Verdict: APPROVED
Re-review of board item #798 (forgejo_admin/twitch-2k-wager#12). Previous review flagged missing webhook file target and missing #9 dependency reference. Both issues resolved in updated issue body.
Template Completeness
- [x] Type -- Feature
- [x] Lineage -- Sub-ticket of #7. Depends on #9 + #11. Sequential.
- [x] Repo -- forgejo_admin/twitch-2k-wager
- [x] User Story -- winning challenger / Stripe payout / automatic future payouts
- [x] Context -- explains admin result flow, Connect Express deferred onboarding, revenue split
- [x] File Targets -- 4 files listed with clear descriptions
- [x] Acceptance Criteria -- 6 criteria covering both challenger-win and marcus-win paths
- [x] Test Expectations -- Stripe test mode, webhook delivery
- [x] Constraints -- Connect dashboard setting, test keys, auth requirement
- [x] Checklist -- standard PR/tests/no-unrelated
- [x] Related -- parent, dependencies, story note, arch note all linked
All required sections present. Template complete.
Traceability
- [x] story:winner-payout -- Winner Payout and Receipt
- [x] story note verified -- story-twitch-2k-wager-winner-payout exists (id 1160), listed in project-twitch-2k-wager user-stories table
- [x] arch:dataflow-twitch-2k-wager -- Data Flow: Twitch 2K Wager
- [x] arch note verified -- arch-dataflow-twitch-2k-wager exists (id 1155), active, includes Connect onboarding + transfer sequence
- [x] Forgejo issue -- forgejo_admin/twitch-2k-wager#12, open
All three traceability legs verified with backing notes.
File Targets
- [x]
src/routes/api/admin/result/+server.ts-- NEW file. Parent dir does not exist yet (SvelteKit creates on first route). Correct: this ticket creates it. - [x]
src/routes/payout/+page.svelte-- NEW file. Parent dir does not exist yet. Correct: this ticket creates it. - [x]
src/lib/stripe.ts-- EXTENDS file created by #11. Does not exist on main yet. Correct: #11 (dependency) creates it, this ticket adds Connect helpers. - [x]
src/routes/api/webhooks/stripe/+server.ts-- EXTENDS file created by #11. Does not exist on main yet. Correct: #11 creates checkout.session.completed handler, this ticket adds account.updated handler.
All file targets valid. Two new files, two extensions of #11 deliverables. Previous review flagged missing webhook target -- now present.
Repo Placement
OK. Issue filed on forgejo_admin/twitch-2k-wager. All file targets within that repo. Single-repo scope. No cross-repo work needed.
Dependencies
- [x] #9 (Postgres schema + db.ts) -- SATISFIED. Issue closed. Board item #795 in needs_approval. Previous review flagged this as undocumented -- now listed in Lineage.
- [x] #11 (Stripe Checkout + webhook) -- PENDING. Issue open. Board item #797 in next_up. Creates stripe.ts and webhook endpoint that #12 extends. Sequential ordering documented.
- [x] #7 (parent) -- OPEN. Board item #793 in backlog. Parent decomposition ticket. No blocking relationship.
Dependencies correctly documented and sequenced. #12 cannot start until #11 merges.
Acceptance Criteria
6 criteria, all testable:
- [x] Admin endpoint accepts game_id + winner -- testable via HTTP request
- [x] First-time challenger win: Connect Express account created -- verifiable via Stripe test mode API
- [x] account.updated webhook triggers transfer -- verifiable via Stripe webhook test CLI
- [x] Repeat winner: transfer without re-onboarding -- verifiable via Stripe test mode
- [x] Marcus wins: RevenueSplit record created -- verifiable via DB query
- [x] Payout status tracked in DB -- verifiable via DB query
All criteria are concrete, specific, and programmatically verifiable. No ambiguity.
Blast Radius
Low. New feature in a new codebase. No sibling services share these patterns. The webhook endpoint extension (#11 to #12) is the only overlap point and is correctly scoped with "extends existing file" notation. Stripe Connect is isolated to this project. Rollback is straightforward -- revert the single PR.
Decomposition Assessment
4 file targets in 1 repo. 6 acceptance criteria. All within the same SvelteKit app.
- Three-thing limit: 3 discrete changes (admin endpoint, payout page, Connect helpers/webhook). Passes.
- Five-minute rule: estimated 3-4 minutes for an agent. Passes.
- No independent subtasks that benefit from parallelization -- all changes are tightly coupled (admin declares result, which triggers Connect flow, which uses webhook).
No decomposition needed.
Recommendation
No action needed. Both issues from previous review are resolved:
- Webhook file target (
src/routes/api/webhooks/stripe/+server.ts) now listed in File Targets with "extends existing file from #11" annotation. - #9 dependency now documented in Lineage section.
Ticket is ready for execution once #11 merges.