API: enrich TeamDetail — multi-coach, coach role/phone, player height/jersey #284
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#284
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
Related to forgejo_admin/basketball-api#278 (spike: audit API response contract mismatches with westside-landing frontend)
Repo
forgejo_admin/basketball-api
User Story
As an admin/coach/parent, I want the API to return complete team detail data (multiple coaches with role/phone, players with height/jersey) so that the frontend can display it without field mapping hacks.
Context
Spike Mismatch 9: The team detail API endpoint has three gaps:
TeamDetail.coachis a singularCoachBrief, but teams can have multiple coaches. Change tocoaches: list[CoachBrief].CoachBriefis missingroleandphone.PlayerBriefis missingheightandjersey_number.The frontend (westside-app
src/routes/(app)/teams/[id]/+page.svelte) already consumesteam.coaches(plural array),coach.role, andcoach.phone. The API is behind — this ticket brings the API contract in line with what the frontend expects.Scope: API-only. No frontend changes needed — the frontend already uses the plural coaches array and the enriched fields.
File Targets
Files to modify:
src/basketball_api/routes/teams.py—TeamDetailmodel: changecoach: CoachBrief | Nonetocoaches: list[CoachBrief].CoachBriefmodel: addrole: Optional[str]andphone: Optional[str].PlayerBriefmodel: addheight: Optional[str]andjersey_number: Optional[str]. Update query to populate new fields from DB relationships.Files NOT to touch:
Acceptance Criteria
TeamDetailfield changed fromcoach: CoachBrief | Nonetocoaches: list[CoachBrief]CoachBriefincludesrole: Optional[str]andphone: Optional[str]PlayerBriefincludesheight: Optional[str]andjersey_number: Optional[str]Test Expectations
pytest tests/Constraints
coach(singular) tocoaches(plural) — coordinate deploy with frontend (frontend already expects plural, so deploy API first is safe)Checklist
ruff formatandruff checkcleanRelated
src/routes/(app)/teams/[id]/+page.svelteScope Review: NEEDS_REFINEMENT
Review note:
review-744-2026-04-03Cross-repo ticket needs scope clarification before dispatch.
[BODY]Fix frontend file path:src/routes/teams/[id]/+page.svelteshould besrc/routes/(app)/teams/[id]/+page.svelte[BODY]Frontend already usesteam.coaches(plural),coach.role,coach.phone— AC #5 (frontend update) appears unnecessary. Verify and remove if confirmed, re-scope as API-only.[BODY]If frontend changes ARE needed, split into two issues (one per repo).[SCOPE]Create architecture note arch-basketball-apiEnrich team detail page: multi-coach, coach role/phone, player height/jerseyto API: enrich TeamDetail — multi-coach, coach role/phone, player height/jerseyScope Review: APPROVED (re-review after refinement)
Review note:
review-744-2026-04-03-v2Issue re-scoped to API-only. Frontend already uses
team.coaches(plural),coach.role,coach.phone. Removed frontend scope, fixed file target path, reduced AC from 6 to 5. Single-repo, single-file, <5 min.