refactor: consolidate points leaderboard endpoints and remove /today
Summary
- Removed
GET /points/today— strict subset of/points/stats/{user}, no unique value;points_todayalready present in stats response - Removed
GET /points/leaderboard/globalandGET /points/leaderboard/category/{category_id}— ~80% identical query logic - Added unified
GET /points/leaderboardwith optional?category_idquery param — omit for global leaderboard, provide to filter by category - Removed
PointsTodayResponseschema — no longer referenced anywhere - Updated tests in
test_points_schemas.pyandtest_points_coverage.pyto removePointsTodayResponsereferences - No changes to
GET /points/stats/{user}orGET /points/streak
Test plan
-
GET /points/leaderboard→ global top 10 withcurrent_user_rank -
GET /points/leaderboard?category_id=<id>→ category-filtered top 10 -
GET /points/leaderboard/global→404 Not Found -
GET /points/leaderboard/category/<id>→404 Not Found -
GET /points/today→404 Not Found -
GET /points/stats/admin_user→200 OK, no regression
Checklist
-
Code follows project API guidelines -
Documentation is updated (OpenAPI docs reflect removed endpoints and new param) -
Code adheres to project coding standards
Closes #124