Move 3 Strikes from Admin to Dashboard, add strikes feature
- Adds strikes (0-3) to Child model with migration
- New PATCH /api/children/{id}/strikes endpoint with WebSocket broadcast
- TV dashboard shows red ✕ marks next to child name when strikes > 0
- 3 Strikes card on Dashboard page (removed from Admin)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from datetime import date
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class ChildCreate(BaseModel):
|
||||
@@ -13,6 +13,7 @@ class ChildUpdate(BaseModel):
|
||||
birth_date: date | None = None
|
||||
color: str | None = None
|
||||
is_active: bool | None = None
|
||||
strikes: int | None = Field(None, ge=0, le=3)
|
||||
|
||||
|
||||
class ChildOut(BaseModel):
|
||||
@@ -21,5 +22,6 @@ class ChildOut(BaseModel):
|
||||
birth_date: date | None
|
||||
is_active: bool
|
||||
color: str
|
||||
strikes: int = 0
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
Reference in New Issue
Block a user