2025-03-28 16:01:01 +00:00

18 lines
622 B
Python

from pydantic import BaseModel, Field
from uuid import UUID
class FoodBase(BaseModel):
name: str = Field(..., description="Name of the food item")
address: str = Field(..., description="Address of the restaurant")
description: str | None = Field(None, description="Description of the food item")
price: float = Field(..., description="Price of the food item")
restaurant_id: UUID = Field(..., description="ID of the restaurant")
class FoodCreate(FoodBase):
pass
class FoodResponse(FoodBase):
id: UUID = Field(..., description="ID of the food item")
class Config:
orm_mode = True