fooder-api/fooder/model/meal.py

29 lines
454 B
Python
Raw Normal View History

2023-04-01 16:19:12 +02:00
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