adding new bug fixes - changed the way meals are tracked and logged to make them copies not references

This commit is contained in:
2026-01-11 07:40:27 -08:00
parent ea45b32450
commit b48a7675dd
8 changed files with 343 additions and 145 deletions

View File

@@ -18,7 +18,7 @@ from sqlalchemy.orm import sessionmaker, Session, relationship, declarative_base
from sqlalchemy.orm import joinedload
from pydantic import BaseModel, ConfigDict
from typing import List, Optional
from typing import List, Optional, Union
from datetime import date, datetime
import os
import logging
@@ -173,7 +173,7 @@ class TrackedMealFood(Base):
# Pydantic models
class FoodCreate(BaseModel):
name: str
serving_size: str
serving_size: Union[float, str]
serving_unit: str
calories: float
protein: float
@@ -189,7 +189,7 @@ class FoodCreate(BaseModel):
class FoodResponse(BaseModel):
id: int
name: str
serving_size: str
serving_size: Union[float, str]
serving_unit: str
calories: float
protein: float