mitai-jinkendo/backend/calculations
Lars 4817fd2b29
All checks were successful
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
fix: Phase 0b - correct all SQL column names in calculation engine
Schema corrections applied:
- weight_log: weight_kg → weight
- nutrition_log: calories → kcal
- activity_log: duration → duration_min, avg_heart_rate → hr_avg, max_heart_rate → hr_max
- rest_days: rest_type → type (aliased for backward compat)
- vitals_baseline: resting_heart_rate → resting_hr
- sleep_log: total_sleep_min → duration_minutes, deep_min → deep_minutes, rem_min → rem_minutes, waketime → wake_time
- focus_area_definitions: fa.focus_area_id → fa.key (proper join column)

Affected files:
- body_metrics.py: weight column (all queries)
- nutrition_metrics.py: kcal column + weight
- activity_metrics.py: duration_min, hr_avg, hr_max, quality via RPE mapping
- recovery_metrics.py: sleep + vitals columns
- correlation_metrics.py: kcal, weight
- scores.py: focus_area key selection

All 100+ Phase 0b placeholders should now calculate correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 08:28:20 +01:00
..
__init__.py feat: Phase 0b - Calculation Engine for 120+ Goal-Aware Placeholders 2026-03-28 07:20:40 +01:00
activity_metrics.py fix: Phase 0b - correct all SQL column names in calculation engine 2026-03-28 08:28:20 +01:00
body_metrics.py fix: Phase 0b - correct all SQL column names in calculation engine 2026-03-28 08:28:20 +01:00
correlation_metrics.py fix: Phase 0b - correct all SQL column names in calculation engine 2026-03-28 08:28:20 +01:00
nutrition_metrics.py fix: Phase 0b - correct all SQL column names in calculation engine 2026-03-28 08:28:20 +01:00
recovery_metrics.py fix: Phase 0b - correct all SQL column names in calculation engine 2026-03-28 08:28:20 +01:00
scores.py fix: Phase 0b - correct all SQL column names in calculation engine 2026-03-28 08:28:20 +01:00