Files
homeschool/backend/app/schemas/schedule.py
derekc c9441a9c9a Add subject options and redesign TV dashboard layout
Subject options:
- New subject_options table (auto-created on startup)
- SubjectOut now includes options list; all eager-loading chains updated
- Admin: Options panel per subject with add, inline edit, and delete
- WS broadcast and dashboard API include options in block subject data

TV dashboard:
- Three equal columns: Timer | Activities | Schedule
- Activities column shows current subject's options in large readable text
- Activities area has subject-colored border and tinted background
- Subject name and label displayed correctly using embedded subject data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 11:18:55 -08:00

67 lines
1.6 KiB
Python

from datetime import time
from pydantic import BaseModel
from app.schemas.subject import SubjectOut
class ScheduleBlockCreate(BaseModel):
subject_id: int | None = None
time_start: time
time_end: time
duration_minutes: int | None = None
label: str | None = None
notes: str | None = None
order_index: int = 0
class ScheduleBlockUpdate(BaseModel):
subject_id: int | None = None
time_start: time | None = None
time_end: time | None = None
duration_minutes: int | None = None
label: str | None = None
notes: str | None = None
order_index: int | None = None
class ScheduleBlockOut(BaseModel):
id: int
subject_id: int | None
subject: SubjectOut | None = None
time_start: time
time_end: time
duration_minutes: int | None
label: str | None
notes: str | None
order_index: int
model_config = {"from_attributes": True}
class ScheduleTemplateCreate(BaseModel):
name: str
child_id: int | None = None
is_default: bool = False
day_start_time: time | None = None
day_end_time: time | None = None
blocks: list[ScheduleBlockCreate] = []
class ScheduleTemplateUpdate(BaseModel):
name: str | None = None
child_id: int | None = None
is_default: bool | None = None
day_start_time: time | None = None
day_end_time: time | None = None
class ScheduleTemplateOut(BaseModel):
id: int
name: str
child_id: int | None
is_default: bool
day_start_time: time | None
day_end_time: time | None
blocks: list[ScheduleBlockOut] = []
model_config = {"from_attributes": True}