Files
baby-monitor/src/baby_monitor/models/child.py
T
Brian Bjarke Jensen 402b5898bb
Build and Push Docker Image / build-and-push (pull_request) Successful in 59s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 17s
updated admin page with more functionality, simplified burger menu and added many-to-many parent-child relationship
2025-11-10 22:58:52 +01:00

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