kanban-app/backend/app/schemas/checklist.py

41 lines
978 B
Python

"""Pydantic schemas for Checklist model"""
from pydantic import BaseModel, ConfigDict, Field
class ChecklistCreateRequest(BaseModel):
"""Schema for creating a new checklist"""
model_config = ConfigDict(
json_schema_extra={
"example": {
"name": "Steps to complete",
"pos": 0,
}
}
)
name: str = Field(..., min_length=1, max_length=200, description="Checklist name")
pos: int = Field(default=0, description="Checklist position")
class ChecklistResponse(BaseModel):
"""Schema for checklist response"""
model_config = ConfigDict(
from_attributes=True,
json_schema_extra={
"example": {
"id": 1,
"name": "Steps to complete",
"pos": 0,
"card_id": 1,
"board_id": 1,
}
},
)
id: int
name: str
pos: int
card_id: int
board_id: int