feat: seed team contract configs + audit player overrides #322
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#322
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
Sub-ticket of
forgejo_admin/westside-contracts#34— data-driven contract rendering system. Wave 2. Board note:board-34-data-driven-contracts.Dispatch Gate
DO NOT dispatch until basketball-api#319 (contract_config column) and basketball-api#321 (contract_overrides column) are MERGED and deployed. Both columns must exist before this data migration runs.
Repo
forgejo_admin/basketball-apiUser Story
As the contract rendering system, I need each team's contract_config populated with structured data AND every player with custom terms to have contract_overrides set, so that the frontend renders correct contracts for all players.
Context
Two-part data migration:
Part 1 — Team configs. Extract hardcoded HTML content from westside-contracts Svelte template into JSONB for all 7 teams. 3 variants: boys-travel, girls-travel, local. Queens schedule: Wednesday Granger 6:30-7:30 (not Friday BWill).
Part 2 — Player override audit. 12+ players have custom fees, notes, or non-standard deals needing structured contract_overrides.
Team Config JSON Schema
Each team gets a
contract_configJSONB value following this shape:Variant assignments:
boys-travel: 17U Elite Kings (id=1), 17U Select Kings (id=2), 16U Elite Kings (id=3)girls-travel: 17U Elite Queens (id=4), 16U Elite Queens (id=5)local: 17U Local Kings (id=6), 16U Local Kings (id=7)IMPORTANT: Read the full tournament, practice, and payment details from
src/routes/contract/[token]/+page.sveltein the westside-contracts repo. The hardcoded HTML is the source of truth. Each tournament needs a stable kebab-caseidfield.Player Override JSON Schema
Player overrides are sparse — only fields that differ from team defaults:
Players Needing Overrides
Rules:
contract_overrides= rendering config (what the page should show differently)custom_notes= display-only "Additional Terms" text (stays as-is for eligibility/stipend notes)File Targets
alembic/versions/NNN_seed_team_contract_configs.py— team config data migrationalembic/versions/NNN_set_player_contract_overrides.py— player overrides + custom_notes cleanupAcceptance Criteria
Test Expectations
alembic upgrade headcleanalembic downgrade -1clean for bothSELECT contract_config->'variant' FROM teamsSELECT contract_overrides FROM players WHERE id IN (184, 190, 107)pytest tests/Constraints
Checklist
Related
westside-basketball— parent projectforgejo_admin/westside-contracts#34— parent issuearch-contracts-westside-basketballfeat: seed team contract configs from hardcoded HTMLto feat: seed team contract configs + audit player overridesScope Review: NEEDS_REFINEMENT
Review note:
review-774-2026-04-03Ticket is well-scoped with complete template, full traceability, and verified architecture — two actionable refinements needed before dispatch.
pal-e-platform/docs/superpowers/specs/...) — inline the JSON schema into this issue body so the executing agent is self-contained in basketball-api.Scope Review: READY
Review note:
review-774-2026-04-03(updated)Re-review after refinement. Both previous issues resolved:
All traceability legs verified. Arch note
arch-contracts-westside-basketballconfirmed. Dependencies T1/T2 both merged. Ready for dispatch.Agent picked up this ticket.