The day progress bar no longer uses day start/end times (it uses block durations instead), so the field is no longer needed. Removed from: Admin UI, schedule store, schedule model/schemas/router, session broadcast payload, dashboard snapshot, and startup migrations. DB columns are left in place (harmless, no migration required). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
67 lines
1.6 KiB
Python
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
|
|
break_time_enabled: bool = False
|
|
break_time_minutes: int | None = None
|
|
|
|
|
|
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
|
|
break_time_enabled: bool | None = None
|
|
break_time_minutes: 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
|
|
break_time_enabled: bool
|
|
break_time_minutes: int | None
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class ScheduleTemplateCreate(BaseModel):
|
|
name: str
|
|
child_id: int | None = None
|
|
is_default: bool = False
|
|
blocks: list[ScheduleBlockCreate] = []
|
|
|
|
|
|
class ScheduleTemplateUpdate(BaseModel):
|
|
name: str | None = None
|
|
child_id: int | None = None
|
|
is_default: bool | None = None
|
|
|
|
|
|
class ScheduleTemplateOut(BaseModel):
|
|
id: int
|
|
name: str
|
|
child_id: int | None
|
|
is_default: bool
|
|
blocks: list[ScheduleBlockOut] = []
|
|
|
|
model_config = {"from_attributes": True}
|