from typing import List, Optional from pydantic import BaseModel class Item(BaseModel): name: str price: float quantity: int class Order(BaseModel): """Order model matching the database schema""" customerName: str items: List[Item] totalAmount: float orderDate: str table: int class Product(BaseModel): """Product model matching the database schema""" id: int name: str type: Optional[str] = None description: Optional[str] = None price: int image: Optional[str] = None status: int = 1 # 0: Inactive, 1: Active quantity: Optional[int] = 1 # Optional quantity for the product promo_id: Optional[int] = None # ID of the promotional offer if applicable promo_price: Optional[int] = None # Promotional price if applicable promo_day: Optional[int] = None # Day of the week for promo (1-7) class ProductEditRequest(BaseModel): """Request model for editing a product""" name: Optional[str] = None type: Optional[str] = None description: Optional[str] = None price: Optional[int] = None image: Optional[str] = None status: Optional[int] = None # 0: Inactive, 1: Active quantity: Optional[int] = None # Optional quantity for the product class ProductCreateRequest(BaseModel): """Request model for creating a new product""" id: int name: str type: str description: str price: int image: str status: Optional[int] = 1 # 0: Inactive, 1: Active quantity: Optional[int] = 1 # Optional quantity for the product