feat: add admin schedule API endpoints for practices and events #236
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
forgejo_admin/basketball-api!236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "233-schedule-api-endpoints"
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 9 admin CRUD endpoints under
/admin/schedulefor managing practice schedules and events. All endpoints are tenant-scoped and admin-authenticated, with division/event_type filters and program label mapping (boys→Kings, girls→Queens) for frontend convenience.Changes
src/basketball_api/routes/schedule.py— NEW file. Admin CRUD endpoints with inline Pydantic schemas: combined GET, practice list/create/update/delete, event list/create/update/delete.src/basketball_api/main.py— Register schedule router at/admin/schedule.tests/test_schedule.py— Added 25 endpoint tests covering happy paths, filters, tenant isolation, 404s, validation, and unauthenticated access (39 total with existing model tests).Test Plan
pytest tests/test_schedule.py -v— 39 passedpytest tests/ -v— 680 passed (full suite, no regressions)ruff format+ruff check— cleanReview Checklist
Related Notes
Related
QA Review -- PR #236
Summary
9 admin CRUD endpoints for schedule management (practices + events). 3 files changed, +1058/-1. Parent issue: #233.
Checklist
_get_tenant()+DEFAULT_TENANT_SLUG(matches admin.py pattern)require_admindependency on every endpointevent_typefilter on eventsis_activefilter on practices_DIVISION_LABELSmodel_dump(exclude_unset=True)for partial updates -- correct pattern/admin/schedulein main.pyjersey.pyfile structure pattern (inline schemas, APIRouter, dependency injection)test_coaches_api.pyconventionFindings
No issues found. Clean implementation that follows established codebase conventions exactly.
VERDICT: APPROVED