fooder-api/fooder/model/preset.py
2023-10-27 15:12:48 +02:00

30 lines
486 B
Python

from pydantic import BaseModel
from typing import List
from .preset_entry import PresetEntry
class Preset(BaseModel):
"""Preset."""
id: int
name: str
calories: float
protein: float
carb: float
fat: float
fiber: float
class Config:
from_attributes = True
class PresetDetails(Preset):
"""PresetDetails."""
entries: List[PresetEntry]
class ListPresetsPayload(BaseModel):
"""ListPresetsPayload."""
presets: List[Preset]