feat: Update nutrition metrics and energy balance calculations
Deploy Development / deploy (push) Successful in 59s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s

- Introduced a single TDEE calculation based on current weight, replacing the fixed 2500 kcal value.
- Updated `get_energy_balance_data` to use daily totals for intake calculations and improved energy balance logic.
- Enhanced `get_nutrition_average_data` to calculate averages over calendar days instead of raw log entries.
- Adjusted placeholder resolution to ensure consistent metadata usage across requests.
- Fixed issues in the charts router to reflect the new energy balance logic and TDEE calculations.

These changes improve the accuracy of nutritional assessments and streamline data handling in the application.
This commit is contained in:
Lars committed 2026-04-11 19:04:27 +02:00
1 parent 549c31431e
commit 61a5bb39ae
7 files changed
+305 -231

No files matched your search

+4
View File
@@ -14,6 +14,10 @@ from slowapi.errors import RateLimitExceeded
from db import init_db
# Placeholder registry: load all register_placeholder() side-effects before any request
# so get_placeholder_catalog() and exports see consistent metadata (see Phase A plan).
import placeholder_registrations # noqa: F401
# Import routers
from routers import auth, profiles, weight, circumference, caliper
from routers import activity, nutrition, photos, insights, prompts