fooder-api/fooder/model/meal.py
2023-04-01 16:19:12 +02:00

28 lines
454 B
Python

from pydantic import BaseModel
from typing import List, Optional
from .entry import Entry
class Meal(BaseModel):
"""Meal."""
id: int
name: str
order: int
calories: float
protein: float
carb: float
fat: float
entries: List[Entry]
diary_id: int
class Config:
orm_mode = True
class CreateMealPayload(BaseModel):
"""CreateMealPayload."""
name: Optional[str]
order: int
diary_id: int