fix: add start_date and created_at to get_active_goals query
ROOT CAUSE: get_active_goals() SELECT was missing start_date and created_at IMPACT: Time-based deviation calculation failed silently for all goals Now returns: - start_date: Required for accurate time-based progress calculation - created_at: Fallback when start_date is not set This fixes: - Zielgewicht (weight) should now show +7% ahead - Körperfett should show time deviation - All goals with target_date now have time-based tracking
This commit is contained in:
parent
eb8b503faa
commit
0e89850df8
|
|
@ -542,7 +542,8 @@ def get_active_goals(profile_id: str) -> List[Dict]:
|
||||||
cur = get_cursor(conn)
|
cur = get_cursor(conn)
|
||||||
cur.execute("""
|
cur.execute("""
|
||||||
SELECT id, goal_type, name, target_value, target_date,
|
SELECT id, goal_type, name, target_value, target_date,
|
||||||
current_value, start_value, progress_pct, status, is_primary
|
current_value, start_value, start_date, progress_pct,
|
||||||
|
status, is_primary, created_at
|
||||||
FROM goals
|
FROM goals
|
||||||
WHERE profile_id = %s
|
WHERE profile_id = %s
|
||||||
AND status IN ('active', 'in_progress')
|
AND status IN ('active', 'in_progress')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user