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
Build and Push Docker Image / build-and-push (pull_request) Successful in 1m5s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 17s

This commit is contained in:
Brian Bjarke Jensen
2025-11-09 11:54:28 +01:00
parent 1950b600cf
commit 16e7153f5f
10 changed files with 656 additions and 2 deletions
+23
View File
@@ -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