Add JSON roster API endpoint for playground dashboard #63

Closed
opened 2026-03-13 18:24:50 +00:00 by forgejo_admin · 0 comments

Lineage

plan-2026-03-08-tryout-prep → Phase 4 → Phase 4l (playground dashboard)

Repo

forgejo_admin/basketball-api

User Story

As a frontend developer
I want a JSON API endpoint returning all player/parent/registration data
So that the playground SvelteKit dashboard can fetch live data

Context

The playground westside dashboard needs live data instead of mock data. The basketball-api currently only serves HTML. We need a single JSON endpoint that returns the full roster with parent info, payment status, and waiver status.

File Targets

Files the agent should modify:

  • src/basketball_api/routes/tryouts.py — add GET /api/roster/{tenant_slug} returning JSON
  • src/basketball_api/routes/__init__.py — if needed to register new route

Files the agent should NOT touch:

  • Everything else — this is a single endpoint addition

Acceptance Criteria

  • GET /api/roster/westside-kings-queens returns JSON array of players
  • Each player object includes: id, name, tryout_number, division, graduating_class, height, position, current_school, photo_url, date_of_birth, checked_in, parent_name, parent_email, parent_phone, waiver_signed, registration_token, payment_status
  • No auth required (public, unlisted like the roster)
  • photo_url values prefixed with base_url for absolute URLs

Test Expectations

  • Existing tests pass: pytest tests/ -v
  • Run command: pytest tests/ -v

Constraints

  • Add to existing tryouts.py router — one new function
  • Return list of dicts, not ORM objects
  • Match the SQL query pattern already used in admin_dashboard()

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-westside-basketball
### Lineage `plan-2026-03-08-tryout-prep` → Phase 4 → Phase 4l (playground dashboard) ### Repo `forgejo_admin/basketball-api` ### User Story As a frontend developer I want a JSON API endpoint returning all player/parent/registration data So that the playground SvelteKit dashboard can fetch live data ### Context The playground westside dashboard needs live data instead of mock data. The basketball-api currently only serves HTML. We need a single JSON endpoint that returns the full roster with parent info, payment status, and waiver status. ### File Targets Files the agent should modify: - `src/basketball_api/routes/tryouts.py` — add GET /api/roster/{tenant_slug} returning JSON - `src/basketball_api/routes/__init__.py` — if needed to register new route Files the agent should NOT touch: - Everything else — this is a single endpoint addition ### Acceptance Criteria - [ ] `GET /api/roster/westside-kings-queens` returns JSON array of players - [ ] Each player object includes: id, name, tryout_number, division, graduating_class, height, position, current_school, photo_url, date_of_birth, checked_in, parent_name, parent_email, parent_phone, waiver_signed, registration_token, payment_status - [ ] No auth required (public, unlisted like the roster) - [ ] photo_url values prefixed with base_url for absolute URLs ### Test Expectations - [ ] Existing tests pass: `pytest tests/ -v` - Run command: `pytest tests/ -v` ### Constraints - Add to existing tryouts.py router — one new function - Return list of dicts, not ORM objects - Match the SQL query pattern already used in admin_dashboard() ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-westside-basketball`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/basketball-api#63
No description provided.