feat: add GET /public/schedule endpoint #241
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
ldraney/basketball-api!241
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "239-public-schedule-endpoint"
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 an unauthenticated
GET /public/scheduleendpoint that returns active practices and all events for the default tenant. This unblocks the westside-landing public schedule page refactor.Changes
src/basketball_api/routes/public.py-- AddedGET /scheduleendpoint following the existing/teamsand/coachespattern (hardcoded tenant_id=1, no auth). Imports and reusesCombinedScheduleResponse,_practice_to_response, and_event_to_responsefromroutes/schedule.pyfor frontend compatibility. Only active practices (is_active=True) are returned; all events are returned for frontend display filtering.Test Plan
pytest tests/test_public.py tests/test_schedule.py -v-- all 60 tests passcurl /public/schedulereturns{ practices: [...], events: [...] }with no authReview Checklist
routes/public.py-- no model or admin endpoint changesruff formatandruff checkpassRelated
Closes #239
forgejo_admin/westside-landing#172(public schedule page refactor)Related Notes
QA Review -- PR #241
Acceptance Criteria Check
GET /public/schedulereturns{ practices: [...], events: [...] }CombinedScheduleResponseis_active=true).filter(PracticeSchedule.is_active.is_(True))CombinedScheduleResponse,_practice_to_response,_event_to_responseCode Quality
/public/teamsand/public/coachespattern (hardcodedtenant_id=1, no auth)routes/schedule.pyper issue instructionsday_of_week, start_time; events ordered bystart_date-- consistent with admin endpointroutes/public.py), 42 additions, 1 deletion -- minimal scoperuff formatandruff checkpassObservations (non-blocking)
PracticeScheduleResponse.is_activefield will always beTruein public responses since we filter. This is intentional for frontend schema compatibility and not a concern.VERDICT: APPROVED