feat: jersey number selection in checkout flow #143
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#143
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?
Type
Feature
Lineage
plan-wkq→ Phase 11 (Girls Tryout) → discovered during jersey email blast 2026-03-21Repo
forgejo_admin/basketball-apiUser Story
As a parent, I want to pick a jersey number during checkout so that my child's jersey is personalized
As an admin, I want no duplicate numbers within a division so that game officials can identify players
Context
Jersey checkout has no number selection. Per AAU rules (NFHS 2025-2026), all numbers 0, 00, and 1-99 are legal. Numbers must be unique per division (boys/girls) — two girls can't share a number, but a boy and girl can. Duplicate validation checks against all players in the same division who already have a jersey_number set.
File Targets
Files the agent should modify:
src/basketball_api/models.py— addjersey_numbercolumn (String, nullable) to Player modelsrc/basketball_api/routes/jersey.py— acceptnumberparam inPOST /jersey/checkout, validate 0/00/1-99, check uniqueness within division, pass as Stripe metadatajersey_number. AddGET /jersey/taken-numbers?division=girlsendpoint returning already-claimed numbers.src/basketball_api/routes/webhooks.py— readjersey_numberfrom Stripe metadata, save to playeralembic/versions/— new migration addingjersey_numbercolumnFiles the agent should NOT touch:
src/basketball_api/services/email.py— unrelatedsrc/basketball_api/routes/admin.py— unrelatedAcceptance Criteria
POST /jersey/checkoutacceptsnumberparam (string: "0", "00", "1"-"99")POST /jersey/checkoutrejects number outside valid rangePOST /jersey/checkoutrejects duplicate number within same division (query players where division matches AND jersey_number matches)POST /jersey/checkoutdoes not require number for opt-outGET /jersey/taken-numbers?division=girlsreturns list of numbers already claimed in that divisionjersey_numberfrom Stripe metadata and saves to playerjersey_numbercolumnTest Expectations
pytest tests/ -k jerseyConstraints
Checklist
Related
plan-wkq— Phase 11project-westside-basketball