Add contract_token and contract_signature_url columns to Player model #152
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#152
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 14 (Billing Tiers & Contracts) → E-Sign Contract Page prerequisiteRepo
forgejo_admin/basketball-apiUser Story
As the contract signing system
I want a
contract_tokenon the Player model to resolve tokenized email links, and acontract_signature_urlto store the drawn signature imageSo that the westside-contracts service can authenticate and record e-signatures without Keycloak login
Context
The new westside-contracts SvelteKit service (westside-app #72) needs two columns that don't exist yet:
contract_token— asecrets.token_urlsafe(32)string, same pattern asParent.registration_tokenandCoach.invite_token. Used in email links so parents can access the contract page without logging in. One token per player. No expiry needed (contract is a one-time sign).contract_signature_url— stores the MinIO URL of the drawn signature image (PNG). Written by westside-contracts after the parent signs.This is a blocking prerequisite for westside-app #72.
File Targets
Files to modify:
src/basketball_api/models.py— addcontract_token(String(100), unique, nullable) andcontract_signature_url(String(500), nullable) to Player modelalembic/versions/NNN_add_contract_token_and_signature_url.py— new migrationFiles NOT to touch:
src/basketball_api/routes/players.py— existing contract endpoints stay as-is, westside-contracts handles the new token flowsrc/basketball_api/routes/admin.py— token generation will be triggered by westside-contracts or a future admin endpoint, not this ticketAcceptance Criteria
contract_tokencolumn exists on players table (String(100), unique, nullable)contract_signature_urlcolumn exists on players table (String(500), nullable)registration_token,invite_token)Test Expectations
alembic upgrade headandalembic downgrade -1pytest tests/test_contract.pypytest tests/pytest tests/ -vConstraints
String(100), unique=True, nullable=Truecontract_signature_urlisString(500)to accommodate MinIO URLsChecklist
Related
project-westside-basketball— projectplan-wkq→ Phase 14 — Billing Tiers & ContractsQA review in progress for PR #153.
Scope Update
monthly_fee(Integer, nullable) was added to this ticket during the session at Lucas's direction. Per-player monthly fee supports tiered pricing ($200 standard, $180 LCA, $160 Cyprus girls). Contract page reads this field to render the correct amount.This is not scope creep — it was a deliberate addition during contract design. Updating issue description would require re-creation; documenting here instead.