feat: add cumulative checkin tracking mode for goals
Goals can now choose between milestone-based progress (existing) and cumulative checkin-based progress (new). Cumulative mode supports cross-unit conversion (e.g. kcal → g fat) via a configurable conversion rate. New GoalCheckin model stores daily inputs; progress auto-recalculates on every checkin C/U/D. Backup import/export covers the new table. Frontend GoalDialog, GoalDetailPage and GoalPage cards adapt to show cumulative progress or milestone progress based on track_type. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -18,14 +18,14 @@ EXPORT_TABLES = [
|
||||
"categories", "tags", "user_settings", "sync_settings",
|
||||
"habit_groups", "anniversary_categories", "certificate_categories",
|
||||
"goals", "tasks", "habits", "anniversaries", "certificates",
|
||||
"goal_steps", "goal_reviews", "habit_checkins",
|
||||
"goal_steps", "goal_reviews", "goal_checkins", "habit_checkins",
|
||||
"task_tags", "goal_tasks",
|
||||
]
|
||||
|
||||
# 导入时的清表顺序:子表先删(避免 FK 约束报错)
|
||||
TRUNCATE_ORDER = [
|
||||
"task_tags", "goal_tasks",
|
||||
"habit_checkins",
|
||||
"habit_checkins", "goal_checkins",
|
||||
"goal_reviews", "goal_steps",
|
||||
"tasks", "habits", "anniversaries", "certificates",
|
||||
"goals", "categories", "tags",
|
||||
@@ -38,7 +38,7 @@ INSERT_ORDER = [
|
||||
"categories", "tags", "user_settings", "sync_settings",
|
||||
"habit_groups", "anniversary_categories", "certificate_categories",
|
||||
"goals", "tasks", "habits", "anniversaries", "certificates",
|
||||
"goal_steps", "goal_reviews", "habit_checkins",
|
||||
"goal_steps", "goal_reviews", "goal_checkins", "habit_checkins",
|
||||
"task_tags", "goal_tasks",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user