Goals -System refactored - Platzhaltersystem enhanced (als draft) #53
|
|
@ -59,7 +59,7 @@ def calculate_energy_balance_7d(profile_id: str) -> Optional[float]:
|
|||
|
||||
# Simple TDEE estimate: bodyweight (kg) × 30-35
|
||||
# TODO: Improve with activity level, age, gender
|
||||
estimated_tdee = weight_row['weight'] * 32.5
|
||||
estimated_tdee = float(weight_row['weight']) * 32.5
|
||||
|
||||
balance = avg_intake - estimated_tdee
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ def calculate_protein_g_per_kg(profile_id: str) -> Optional[float]:
|
|||
if not weight_row:
|
||||
return None
|
||||
|
||||
weight = weight_row['weight']
|
||||
weight = float(weight_row['weight'])
|
||||
|
||||
# Get protein intake
|
||||
cur.execute("""
|
||||
|
|
@ -150,7 +150,7 @@ def calculate_protein_days_in_target(profile_id: str, target_low: float = 1.6, t
|
|||
if not weight_row:
|
||||
return None
|
||||
|
||||
weight = weight_row['weight']
|
||||
weight = float(weight_row['weight'])
|
||||
|
||||
# Get protein intake last 7 days
|
||||
cur.execute("""
|
||||
|
|
@ -199,7 +199,7 @@ def calculate_protein_adequacy_28d(profile_id: str) -> Optional[int]:
|
|||
if not weight_row or not weight_row['avg_weight']:
|
||||
return None
|
||||
|
||||
weight = weight_row['avg_weight']
|
||||
weight = float(weight_row['avg_weight'])
|
||||
|
||||
# Get protein intake (28d)
|
||||
cur.execute("""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user