"""
DTOs (Data Transfer Objects) para módulo de localización
"""

from typing import Optional

from pydantic import BaseModel, Field


class LocationCreateDTO(BaseModel):
    """DTO para crear una localización"""

    code: str = Field(..., max_length=5, description="Location code")
    description: Optional[str] = Field(
        None, max_length=200, description="Location description"
    )

    class Config:
        from_attributes = True


class LocationUpdateDTO(BaseModel):
    """DTO para actualizar una localización"""

    code: Optional[str] = Field(
        None, max_length=5, description="Location code")
    description: Optional[str] = Field(
        None, max_length=200, description="Location description"
    )

    class Config:
        from_attributes = True


class LocationResponseDTO(BaseModel):
    """DTO para responder con datos de una localización"""

    id: int
    code: str
    description: Optional[str] = None

    class Config:
        from_attributes = True
