Add JSON roster API endpoint for playground dashboard #64
No reviewers
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!64
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "63-add-json-roster-api-endpoint-for-playgro"
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?
Summary
Adds
GET /api/roster/{tenant_slug}-- a public JSON endpoint that returns all registered players with parent info, payment status, waiver status, and registration_token. Designed for the SvelteKit playground dashboard to consume. Relativephoto_urlvalues are prefixed withsettings.base_urlto produce absolute URLs.Changes
src/basketball_api/routes/tryouts.py: AddedRosterPlayerPydantic response model andapi_roster()endpoint. Reuses the same query pattern asadmin_dashboard()(JOIN on Registration, eager-load Parent + Registrations) but returns JSON instead of HTML. No auth required.tests/test_tryouts.py: Added 16 tests inTestApiRostercovering: JSON response shape, empty roster, 404 for unknown tenant, parent info, payment status, waiver status, registration_token, photo_url prefixing (relative, absolute, null), orphan player exclusion, age/date_of_birth, and field completeness.Test Plan
ruff checkandruff format --checkpass cleanReview Checklist
Related