from typing import Optional
from pydantic import BaseModel, Field, ConfigDict


class ClassificationConceptBase(BaseModel):
    classification: str = Field(..., max_length=30,
                                description="Classification")
    description: Optional[str] = Field(None, max_length=255, description="Description")


class ClassificationConceptCreate(ClassificationConceptBase):
    pass


class ClassificationConceptUpdate(BaseModel):
    classification: Optional[str] = Field(None, max_length=30)
    description: Optional[str] = Field(None, max_length=255)


class ClassificationConceptResponse(ClassificationConceptBase):
    id: int

    model_config = ConfigDict(from_attributes=True)
