from typing import Optional

from pydantic import BaseModel, ConfigDict, Field


class TrailerTypeListItemDTO(BaseModel):
    """Catálogo público GTipoTrailer (listado UI)."""

    trailer_type_key: str = Field(..., max_length=2)
    description: Optional[str] = None

    model_config = ConfigDict(from_attributes=True)


class TrailerTypeBaseDTO(BaseModel):
    trailer_type_key: str
    description: Optional[str]
    company_id: str
    tenant_id: str


class TrailerTypeCreateDTO(TrailerTypeBaseDTO):
    pass


class TrailerTypeResponseDTO(TrailerTypeBaseDTO):
    class Config:
        from_attributes = True
