23 lines
542 B
Python
23 lines
542 B
Python
"""Child-related request and response models."""
|
|
|
|
from datetime import datetime
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class CreateChildRequest(BaseModel):
|
|
"""Request model for creating a child."""
|
|
|
|
name: str = Field(..., min_length=1, max_length=100)
|
|
birth_time: datetime
|
|
birth_weight: float = Field(..., gt=0, description="Birth weight in grams")
|
|
|
|
|
|
class ChildResponse(BaseModel):
|
|
"""Response model for child data."""
|
|
|
|
id: int
|
|
name: str
|
|
birth_time: datetime
|
|
birth_weight: float
|
|
created_at: datetime
|