feat: add contract signing backend (status, endpoints, migration) #97
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#97
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 (Program Contract Flow)Repo
forgejo_admin/basketball-apiUser Story
As a parent
I want to digitally sign my child's program contract
So that my child can be activated for the basketball program
Context
Phase 14 introduces a digital contract signing flow for player program enrollment. Parents must sign a contract before their child's subscription can be activated. This issue covers only the backend: model changes, migration, and API endpoints. The frontend UI and Stripe subscription activation are separate steps.
The contract signing follows the same digital signature pattern already established by
Parent.waiver_signed/waiver_signed_at/waiver_signed_ipandCoach.contractor_agreement_signed/OnboardingStatus. Thecontract_statusfield uses a three-state enum (none, offered, signed) to track the contract lifecycle.File Targets
Files to modify or create:
src/basketball_api/models.py-- add ContractStatus enum, add contract fields to Playeralembic/versions/010_add_contract_fields.py-- migration for new columnssrc/basketball_api/routes/players.py-- add POST/GET contract endpointssrc/basketball_api/routes/account.py-- add contract_status to AccountPlayerResponsesrc/basketball_api/routes/admin.py-- add contract_status to AdminPlayerItemtests/test_contract.py-- new test file for contract endpointsAcceptance Criteria
contract_status(enum: none, offered, signed),contract_signed_at,contract_signed_by,contract_signed_ipfieldsPOST /players/{id}/contractaccepts{signature_name, accepted}, sets contract_status to signed, records timestamp/signer/IPPOST /players/{id}/contractrequires auth: must be the player's parent (email match) or adminGET /players/{id}/contractreturns contract status for any authenticated user/account/playersresponse includescontract_status/admin/playersresponse includescontract_statusTest Expectations
pytest tests/ -vConstraints
get_current_userdependency for auth, matching existing route patterns009Checklist
Related
westside-app-- frontend project consuming these endpoints