from pydantic import BaseModel, Field


class DocumentTypeDigitizationBase(BaseModel):
    """Base schema for Document Type Digitization"""

    code: str = Field(..., max_length=10, description="Código del tipo de documento")
    description: str = Field(..., description="Descripción del tipo de documento")
    active: bool = Field(default=True, description="Indica si el tipo está activo")


class DocumentTypeDigitizationCreate(DocumentTypeDigitizationBase):
    """Schema for creating a Document Type Digitization"""

    pass


class DocumentTypeDigitizationUpdate(BaseModel):
    """Schema for updating a Document Type Digitization"""

    code: str | None = Field(None, max_length=10)
    description: str | None = None
    active: bool | None = None


class DocumentTypeDigitizationResponse(DocumentTypeDigitizationBase):
    """Schema for Document Type Digitization response"""

    id: int

    class Config:
        from_attributes = True
