- Add 📝 Agenda button to each block in Today's Schedule on the Dashboard - Dialog allows setting a free-text activity/note for that block for the current day - Agenda replaces subject options in the TV center panel while set; clears on session end - Backend: new SessionBlockAgenda model, PUT /api/sessions/{id}/blocks/{block_id}/agenda - Agendas included in dashboard snapshot and session_update WS broadcast - New agenda_update WS event keeps TV in sync live when agenda is saved or cleared - Update README with feature description, project structure, and WS event table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
from datetime import date, datetime
|
|
from pydantic import BaseModel
|
|
from app.schemas.schedule import ScheduleBlockOut
|
|
from app.schemas.child import ChildOut
|
|
|
|
|
|
class SessionStart(BaseModel):
|
|
child_id: int
|
|
template_id: int | None = None
|
|
session_date: date | None = None # defaults to today
|
|
|
|
|
|
class TimerAction(BaseModel):
|
|
event_type: str # start | pause | resume | complete | skip
|
|
block_id: int | None = None
|
|
|
|
|
|
class TimerEventOut(BaseModel):
|
|
id: int
|
|
block_id: int | None
|
|
event_type: str
|
|
occurred_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class DailySessionOut(BaseModel):
|
|
id: int
|
|
child_id: int
|
|
template_id: int | None
|
|
session_date: date
|
|
is_active: bool
|
|
current_block_id: int | None
|
|
current_block: ScheduleBlockOut | None = None
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class DashboardSnapshot(BaseModel):
|
|
"""Public TV dashboard payload — no auth required."""
|
|
session: DailySessionOut | None
|
|
child: ChildOut
|
|
blocks: list[ScheduleBlockOut] = []
|
|
completed_block_ids: list[int] = []
|
|
block_elapsed_seconds: int = 0 # seconds already elapsed for the current block
|
|
is_paused: bool = False # whether the current block's timer is paused
|
|
morning_routine: list[str] = [] # text items shown on TV during greeting state
|
|
break_activities: list[str] = [] # text items shown on TV during break time
|
|
is_break_active: bool = False # whether break mode is currently active
|
|
break_elapsed_seconds: int = 0 # seconds already elapsed in the break timer
|
|
is_break_paused: bool = False # whether the break timer is paused
|
|
block_agendas: dict[str, str] = {} # block_id → agenda text override for today
|