Commit Graph

3 Commits

Author SHA1 Message Date
2bc1ca4daf feat: Phase 0c - migrate recovery_metrics calculations to data_layer (16 functions)
All checks were successful
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
- Migrated all 16 calculation functions from calculations/recovery_metrics.py to data_layer/recovery_metrics.py
- Functions: Recovery score v2 (main + 7 helper scorers)
- Functions: HRV vs baseline (percentage calculation)
- Functions: RHR vs baseline (percentage calculation)
- Functions: Sleep metrics (avg duration 7d, sleep debt, regularity proxy, quality 7d)
- Functions: Load balance (recent 3d)
- Functions: Data quality assessment
- Updated data_layer/__init__.py with 9 new exports
- Refactored placeholder_resolver.py to import recovery_metrics from data_layer

Module 4/6 complete. Single Source of Truth for recovery metrics established.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 20:24:27 +01:00
26110d44b4 fix: rest_days schema - use 'focus' column instead of 'rest_type'
All checks were successful
Deploy Development / deploy (push) Successful in 52s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s
Problem: get_rest_days_data() queried non-existent 'rest_type' column
Fix: Changed to 'focus' column with correct values (muscle_recovery, cardio_recovery, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 19:28:46 +01:00
432f7ba49f feat: Phase 0c - recovery_metrics.py module complete
All checks were successful
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 15s
Data Layer:
- get_sleep_duration_data() - avg duration with hours/minutes breakdown
- get_sleep_quality_data() - Deep+REM percentage with phase breakdown
- get_rest_days_data() - total count + breakdown by rest type

Placeholder Layer:
- get_sleep_avg_duration() - refactored to use data layer
- get_sleep_avg_quality() - refactored to use data layer
- get_rest_days_count() - refactored to use data layer

All 3 recovery data functions + 3 placeholder refactors complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 19:13:59 +01:00