fix: Include start_value in get_active_goals query
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s

Goal progress placeholders were filtering out all goals because
start_value was missing from the SELECT statement.

Added start_value to both:
- get_active_goals() - for placeholder formatters
- get_goal_by_id() - for consistency

This will fix:
- active_goals_md progress column (was all "-")
- top_3_goals_behind_schedule (was "keine Ziele")
- top_3_goals_on_track (was "keine Ziele")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-28 13:02:43 +01:00
parent befc310958
commit a6701bf7b2

View File

@ -542,7 +542,7 @@ def get_active_goals(profile_id: str) -> List[Dict]:
cur = get_cursor(conn)
cur.execute("""
SELECT id, goal_type, name, target_value, target_date,
current_value, progress_pct, status, is_primary
current_value, start_value, progress_pct, status, is_primary
FROM goals
WHERE profile_id = %s
AND status IN ('active', 'in_progress')
@ -558,7 +558,7 @@ def get_goal_by_id(goal_id: str) -> Optional[Dict]:
cur = get_cursor(conn)
cur.execute("""
SELECT id, profile_id, goal_type, target_value, target_date,
current_value, progress_pct, status, is_primary
current_value, start_value, progress_pct, status, is_primary
FROM goals
WHERE id = %s
""", (goal_id,))