from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from decimal import Decimal


class ModelCreate(BaseModel):
    name: str
    category_id: int
    brand: str
    base_price: Optional[Decimal] = None
    sizes: Optional[List[str]] = []
    stock: Optional[int] = None
    description: Optional[str] = None


class ModelUpdate(BaseModel):
    name: Optional[str] = None
    category_id: Optional[int] = None
    brand: Optional[str] = None
    base_price: Optional[Decimal] = None
    sizes: Optional[List[str]] = None
    stock: Optional[int] = None
    description: Optional[str] = None


class ModelResponse(BaseModel):
    id: int
    name: str
    category_id: int
    brand: str
    base_price: Optional[Decimal]
    sizes: Optional[List[str]]
    stock: Optional[int]
    description: Optional[str]
    created_at: datetime

    class Config:
        from_attributes = True
