Coach dashboard: show coach's team schedule from practice_schedules via team_id FK #213
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/westside-app#213
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
User Story
story:WS-S27As a coach, I want to see my team's practice schedule and upcoming events so I know when and where my teams practice and play.Lineage
story:WS-S27arch:landing-siteRepo
forgejo_admin/westside-landing(local checkout:~/westside-app)Context
The coach dashboard (
/coach) has a Schedule tab that currently shows "Coming soon" placeholder text. The data model already supports this:coachestable links toteamsviateams.coach_idpractice_schedulestable links toteamsviapractice_schedules.team_ideventstable links toteamsviaevents.team_idand to divisions viaevents.divisionAPI strategy (decided): Fetch
/public/scheduleand filter client-side by team IDs from/coaches/me./coaches/mereturnsteams[].id— no backend change needed/public/schedulereturns all practices withteam_idand all events withteam_id/divisionpractices.filter(p => myTeamIds.includes(p.team_id))events.filter(e => e.team_id && myTeamIds.includes(e.team_id))plus division fallbackevents.filter(e => !e.team_id && myTeamDivisions.includes(e.division))File Targets
src/routes/(app)/coach/+page.svelte— replace Schedule tab placeholder with functional schedule displayAcceptance Criteria
team_idmatch first, thendivisionmatch for unscoped events/public/scheduleTest Expectations
svelte-checkpasses with 0 errorsConstraints
/coaches/me+/public/schedule/coaches/meresponse shape before coding (teams[].id is the key field)Checklist
/coaches/meto get team IDs on mount/public/schedulefor all practices + eventsRelated
/coaches/meendpoint (src/basketball_api/routes/coaches_api.py)/public/scheduleendpoint (src/basketball_api/routes/public.py)Alignment update (2026-04-04)
Story relabel: This ticket should be
story:WS-S27(new), notstory:WS-S13.API strategy decided: Fetch
/public/scheduleand filter client-side by team IDs from/coaches/me./coaches/mealready returnsteams[].id— no backend change needed/public/schedulereturns all practices withteam_idfieldpractices.filter(p => myTeamIds.includes(p.team_id))Auth architecture updated: Coach role now includes "view team schedule and events" in arch-auth-westside-basketball.
No backend ticket needed — this is pure frontend.
Scope Review: NEEDS_REFINEMENT
Review note:
review-808-2026-04-04Well-scoped feature with thorough context and verified data model, but three issues need resolution before dispatch:
/coaches/mereturns no schedule data. Either (a) add/coaches/me/scheduleendpoint in basketball-api (cross-repo, needs decomposition) or (b) client-side filter/public/scheduleby team_id (single-repo). Commit to one approach and update File Targets.team_idFK, not division. Clarify filtering logic (team_id match? include program-wide events where team_id=NULL?).westside-landingbut file target is inwestside-app. Verify these are the same repo or fix the Repo field.arch-landing-sitearchitecture note in pal-e-docs (4+ board items reference this label).skill-decompose-ticketfor two-repo split.Scope refinement (2026-04-04)
Updated issue body to address review-808 findings:
/public/scheduleusing team IDs from/coaches/me. No backend changes. Was in comments only, now in body.team_idmatch first, thendivisionfallback for unscoped events. Matches the data model (events have bothteam_idFK anddivisionenum).westside-landing, local checkout is~/westside-app(old name). File pathsrc/routes/(app)/coach/+page.svelteis correct.Scope Review: APPROVED
Review note:
review-808-2026-04-04(updated)Re-review: all 3 prior NEEDS_REFINEMENT issues resolved. Backend approach committed (client-side filter), AC4 event filtering logic specified with code-level detail, repo naming clarified and verified via git remote.
Verified:
src/routes/(app)/coach/+page.svelteconfirmed (lines 149-157, "Coming soon" placeholder)/coaches/mereturnsteams[].id+teams[].division— both needed for filtering/public/schedulereturnspractices[].team_id+events[].team_id+events[].division— matches filter strategyRemaining [SCOPE] (non-blocking):
arch-landing-site— multiple board items reference this label with no backing note in pal-e-docsValidation: PASS
Tiers executed: Tier 3 (Production)
Validation note:
validation-213-2026-04-048 checks: 8 PASS, 0 FAIL
Route-level smoke: 9/9 routes return HTTP 200 (/, /about, /staff, /schedule, /sponsors, /tryouts, /teams, /coach, /admin).
No regressions. No discovered issues.