# app/modules/cms/schemas/image.py
"""
Pydantic schemas for image operations.
"""

from pydantic import BaseModel


class ImageUrls(BaseModel):
    """URLs for image variants."""

    original: str
    medium: str | None = None  # 800px variant
    thumb: str | None = None  # 200px variant

    # Allow arbitrary keys for flexibility
    class Config:
        extra = "allow"


class ImageUploadResponse(BaseModel):
    """Response from image upload."""

    success: bool
    image: dict | None = None
    error: str | None = None


class ImageDeleteResponse(BaseModel):
    """Response from image deletion."""

    success: bool
    message: str


class ImageStorageStats(BaseModel):
    """Image storage statistics."""

    total_files: int
    total_size_bytes: int
    total_size_mb: float
    total_size_gb: float
    directory_count: int
    max_files_per_dir: int
    avg_files_per_dir: float
    products_estimated: int
