added child endpoint, ability to add and edit child as well as auto redirect to add-child page when user without child accesses home page
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"""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
|
||||
user_id: int
|
||||
created_at: datetime
|
||||
Reference in New Issue
Block a user