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

31 lines
478 B
Python

from pydantic import BaseModel
from typing import List
class Product(BaseModel):
"""Product."""
id: int
name: str
calories: float
protein: float
carb: float
fat: float
class Config:
orm_mode = True
class CreateProductPayload(BaseModel):
"""ProductCreatePayload."""
name: str
protein: float
carb: float
fat: float
class ListProductPayload(BaseModel):
"""ProductListPayload."""
products: List[Product]