from typing import Optional

from pydantic import BaseModel, ConfigDict, Field


class CodePedimentoRegimenDTO(BaseModel):
    id: Optional[int] = None
    pedimento_code: str = Field(..., min_length=1, max_length=3)
    regimen_code: Optional[str] = Field(None, min_length=1, max_length=3)
    type_code: Optional[str] = Field(None, min_length=1, max_length=1)

    model_config = ConfigDict(from_attributes=True)
