feat: Goal Progress Log - backend + API (v2.1)
Implemented progress tracking system for all goals.
**Backend:**
- Migration 030: goal_progress_log table with unique constraint per day
- Trigger: Auto-update goal.current_value from latest progress
- Endpoints: GET/POST/DELETE /api/goals/{id}/progress
- Pydantic Models: GoalProgressCreate, GoalProgressUpdate
**Features:**
- Manual progress tracking for custom goals (flexibility, strength, etc.)
- Full history with date, value, note
- current_value always reflects latest progress entry
- One entry per day per goal (unique constraint)
- Cascade delete when goal is deleted
**API:**
- GET /api/goals/{goal_id}/progress - List all entries
- POST /api/goals/{goal_id}/progress - Log new progress
- DELETE /api/goals/{goal_id}/progress/{progress_id} - Delete entry
**Next:** Frontend UI (progress button, modal, history list)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ce37afb2bb
commit
7db98a4fa6
3 files changed
+191
No files matched your search
@@ -345,6 +345,11 @@ export const api = {
|
||||
updateGoal: (id,d) => req(`/goals/${id}`, jput(d)),
|
||||
deleteGoal: (id) => req(`/goals/${id}`, {method:'DELETE'}),
|
||||
|
||||
// Goal Progress (v2.1)
|
||||
listGoalProgress: (id) => req(`/goals/${id}/progress`),
|
||||
createGoalProgress: (id,d) => req(`/goals/${id}/progress`, json(d)),
|
||||
deleteGoalProgress: (gid,pid) => req(`/goals/${gid}/progress/${pid}`, {method:'DELETE'}),
|
||||
|
||||
// Goal Type Definitions (Phase 1.5)
|
||||
listGoalTypeDefinitions: () => req('/goals/goal-types'),
|
||||
createGoalType: (d) => req('/goals/goal-types', json(d)),
|
||||
|
||||
Reference in new issue
Block a user