items.py 404 B

12345678910111213
  1. from typing import List, Optional
  2. from pydantic import BaseModel
  3. class Product(BaseModel):
  4. """Product model matching the database schema"""
  5. id: int
  6. name: str
  7. type: Optional[str] = None
  8. description: Optional[str] = None
  9. price: float
  10. image: Optional[str] = None
  11. status: int = 1 # 0: Inactive, 1: Active
  12. quantity: Optional[int] = 1 # Optional quantity for the product