SnapFeast / orders /schemas.py
Testys's picture
Update orders/schemas.py
784bc54 verified
raw
history blame
532 Bytes
from pydantic import BaseModel
class MealBase(BaseModel):
name: str
description: str
price: float
class MealCreate(MealBase):
pass
class MealUpdate(MealBase):
pass
class Meal(MealBase):
id: int
class Config:
orm_mode = True
class OrderBase(BaseModel):
quantity: int
class OrderCreate(OrderBase):
meal_id: int
class Order(OrderBase):
id: int
user_id: int # Corrected type annotation
meal_id: int # Corrected type annotation
class Config:
orm_mode = True