mitai-jinkendo/backend/calculations
Lars 8da577fe58
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s
fix: Phase 0b - body_progress_score + placeholder formatting
Fixed remaining placeholder calculation issues:

1. body_progress_score returning 0:
   - When start_value is NULL, query oldest weight from last 90 days
   - Prevents progress = 0% when start equals current

2. focus_areas_weighted_json empty:
   - Changed from goal_utils.get_focus_weights_v2() to scores.get_user_focus_weights()
   - Now uses same function as focus_area_weights_json

3. Implemented 5 TODO markdown formatting functions:
   - _format_goals_as_markdown() - table with progress bars
   - _format_focus_areas_as_markdown() - weighted list
   - _format_top_focus_areas() - top N by weight
   - _format_goals_behind() - lowest progress goals
   - _format_goals_on_track() - goals >= 50% progress

All placeholders should now return proper values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:34:24 +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 - score functions use English focus area keys 2026-03-28 10:59:37 +01:00
body_metrics.py fix: Phase 0b - body_progress_score + placeholder formatting 2026-03-28 12:34:24 +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 - complete Decimal/float conversion in nutrition_metrics 2026-03-28 11:32:07 +01:00
recovery_metrics.py fix: Phase 0b - fix remaining calculation bugs from log analysis 2026-03-28 08:50:55 +01:00
scores.py feat: Phase 0b - add nutrition focus areas to score mapping 2026-03-28 10:20:46 +01:00