import uuid
from datetime import datetime
from pydantic import BaseModel
from app.domains.media.models import MediaAssetType


class MediaAssetOut(BaseModel):
    id: uuid.UUID
    tenant_id: uuid.UUID | None
    product_id: uuid.UUID | None
    cad_file_id: uuid.UUID | None
    order_line_id: uuid.UUID | None
    workflow_run_id: uuid.UUID | None
    asset_type: MediaAssetType
    storage_key: str
    file_size_bytes: int | None
    mime_type: str | None
    width: int | None
    height: int | None
    duration_s: float | None
    render_config: dict | None
    is_archived: bool
    created_at: datetime
    download_url: str | None = None
    thumbnail_url: str | None = None

    model_config = {"from_attributes": True}
