Phase 14: Program Contract Flow — Digital Signature + Billing Activation #39
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/westside-app#39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-wkq→ Phase 14 (Billing Tiers & Contracts)Repo
forgejo_admin/westside-app+forgejo_admin/basketball-apiUser Story
As a parent
I want to review and sign a program contract when my player is offered a team spot
So that billing starts automatically and my player's roster spot is confirmed
Context
After tryouts, Marcus places players on teams via the admin dashboard. Today there's no digital contract — billing would need to be started manually and there's no legal agreement covering the season commitment.
The contract is a state transition gate: player moves from
offered→activeonly when the parent signs. Signing triggers the Stripe subscription. No contract = no billing = no roster spot confirmed.Player lifecycle:
Two distinct legal moments exist:
File Targets
Frontend (
westside-app):src/routes/my-players/+page.svelte— add contract CTA when player status isofferedsrc/routes/players/[id]/+page.svelte— show contract status on player profilesrc/lib/api.js— add contract endpointsBackend (
basketball-api):POST /players/{id}/contract— sign contract, trigger Stripe subscriptionGET /players/{id}/contract— get contract status/termsstatusfield lifecycle (registered→offered→signed→active)Files NOT to touch:
src/routes/register/+page.svelte— registration waiver is separate, already workingAcceptance Criteria
offered/my-players, they see "Contract available" for offered playersactiveon the rosterContract Terms (Assumptions — Confirm with Marcus)
Test Expectations
/my-playersConstraints
/my-players— no new routes needed, just a state-aware sectionkeycloak-jsBearer token — same auth pattern as rest of appChecklist
/my-playersRelated
phase-wkq-14-billing-tiers— parent phase notewestside-app-user-stories— US-6, US-8