API: GET /api/stats endpoint #4
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
Standalone — scoped from Daily 100 design spec.
Repo
forgejo_admin/daily-100-apiUser Story
As a user
I want computed stats about my progress
So that I can see streaks, level, and completion rate
Context
GET /api/stats returns all derived statistics computed from daily_entries. Fields: perfect_days (count of 8/8 days), current_streak (consecutive days with score > 0), best_streak, perfect_streak (consecutive 8/8 days), best_perfect_streak, completion_rate (checked items / total possible * 100), level, level_title, next_level, next_level_at, level_progress. Level thresholds by perfect days: 1=Rookie, 7=Regular, 21=Committed, 50=Warrior, 100=Machine, 200=Legend, 365=Immortal.
File Targets
Files the agent should modify or create:
app/routes/stats.py-- GET endpoint handlerapp/services/stats.py-- stats computation logicFiles the agent should NOT touch:
app/models.py-- already definedapp/routes/today.py-- separate concernAcceptance Criteria
Test Expectations
pytest tests/test_stats.pyConstraints
Checklist
Related
daily-100-- project