feat: Phase 0c - migrate scores calculations to data_layer (14 functions)
Deploy Development / deploy (push) Successful in 45s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

- Created NEW data_layer/scores.py with all 14 scoring functions
- Functions: Focus weights & mapping (get_user_focus_weights, get_focus_area_category, map_focus_to_score_components, map_category_de_to_en)
- Functions: Category weight calculation
- Functions: Progress scores (goal progress, health stability)
- Functions: Health score helpers (blood pressure, sleep quality scorers)
- Functions: Data quality score
- Functions: Top priority/focus (get_top_priority_goal, get_top_focus_area, calculate_focus_area_progress)
- Functions: Category progress
- Updated data_layer/__init__.py to import scores module and export 12 functions
- Refactored placeholder_resolver.py to import scores from data_layer

Module 5/6 complete. Single Source of Truth for scoring metrics established.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 4.6 committed 2026-03-28 20:26:23 +01:00
1 parent 2bc1ca4daf
commit dba6814bc2
3 files changed
+601 -4

No files matched your search

+15
View File
@@ -34,6 +34,7 @@ from .nutrition_metrics import *
from .activity_metrics import *
from .recovery_metrics import *
from .health_metrics import *
from .scores import *
# Future imports (will be added as modules are created):
# from .goals import *
@@ -134,4 +135,18 @@ __all__ = [
'get_resting_heart_rate_data',
'get_heart_rate_variability_data',
'get_vo2_max_data',
# Scoring Metrics
'get_user_focus_weights',
'get_focus_area_category',
'map_focus_to_score_components',
'map_category_de_to_en',
'calculate_category_weight',
'calculate_goal_progress_score',
'calculate_health_stability_score',
'calculate_data_quality_score',
'get_top_priority_goal',
'get_top_focus_area',
'calculate_focus_area_progress',
'calculate_category_progress',
]