fooder-api/fooder/model/product.py

32 lines
478 B
Python
Raw Normal View History

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