Wire /admin/teams GET + POST /admin/teams/save for SPA team management #121
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#121
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 11 → Girls Tryout / Team DropRepo
forgejo_admin/basketball-apiUser Story
As Coach Marcus (admin)
I want to use the admin teams page to create teams and assign players
So that coaches can see their rosters on the 7pm call tonight
Context
The SPA admin teams page at /admin/teams is fully built but calls two endpoints that don't exist on the backend:
GET /admin/teams— frontend expects{ teams: [...], players: [...] }POST /admin/teams/save— frontend sends{ assignments: [{ player_id, team_id }] }The existing team CRUD routes at
/teamsand/api/teamshave all the business logic (create, list, assign, unassign). The admin endpoints just need to adapt the response format for the frontend and auto-resolve the tenant (only one tenant exists: westside-kings-queens).Frontend team creation uses
prompt()which generates temp IDs prefixed witht(e.g.t1710878400000). The save endpoint needs to create real teams for temp IDs and persist all player assignments.File Targets
Files the agent should modify or create:
src/basketball_api/routes/admin.py— addGET /admin/teamsandPOST /admin/teams/saveendpointsFiles the agent should NOT touch:
src/basketball_api/routes/teams.py— existing team routes, leave as-isAcceptance Criteria
Test Expectations
pytest tests/ -k test_admin_teamsConstraints
t— detect and create real teams for these{ teams: [{ id, name, coaches: [...] }], players: [{ id, name, division, position, team_id, team, height, ... }] }Checklist
Related
phase-wkq-11-girls-tryout