| 123456789101112131415161718 |
- from typing import List, Optional
- from pydantic import BaseModel
- class Product(BaseModel):
- """Product model matching the database schema"""
- id: int
- name: str
- type: Optional[str] = None
- description: Optional[str] = None
- price: float
- image: Optional[str] = None
- status: int = 1 # 0: Inactive, 1: Active
- class ProductWithQuantity(Product):
- """Product model with quantity field for sales"""
- cantidad: int = 1
|