Remove school day hours from schedule templates

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>
This commit is contained in:
2026-03-03 13:45:05 -08:00
parent c05543d855
commit c565c94a23
9 changed files with 3 additions and 93 deletions

View File

@@ -13,7 +13,7 @@ from app.dependencies import get_db
from app.models.child import Child
from app.models.morning_routine import MorningRoutineItem
from app.models.break_activity import BreakActivityItem
from app.models.schedule import ScheduleBlock, ScheduleTemplate
from app.models.schedule import ScheduleBlock
from app.models.subject import Subject # noqa: F401 — needed for selectinload chain
from app.models.session import DailySession, TimerEvent
from app.schemas.session import DashboardSnapshot
@@ -45,8 +45,6 @@ async def get_dashboard(child_id: int, db: AsyncSession = Depends(get_db)):
blocks = []
completed_ids = []
block_elapsed_seconds = 0
day_start_time = None
day_end_time = None
if session and session.template_id:
blocks_result = await db.execute(
@@ -57,14 +55,6 @@ async def get_dashboard(child_id: int, db: AsyncSession = Depends(get_db)):
)
blocks = blocks_result.scalars().all()
template_result = await db.execute(
select(ScheduleTemplate).where(ScheduleTemplate.id == session.template_id)
)
template = template_result.scalar_one_or_none()
if template:
day_start_time = template.day_start_time
day_end_time = template.day_end_time
events_result = await db.execute(
select(TimerEvent).where(
TimerEvent.session_id == session.id,
@@ -101,8 +91,6 @@ async def get_dashboard(child_id: int, db: AsyncSession = Depends(get_db)):
completed_block_ids=completed_ids,
block_elapsed_seconds=block_elapsed_seconds,
is_paused=is_paused,
day_start_time=day_start_time,
day_end_time=day_end_time,
morning_routine=morning_routine,
break_activities=break_activities,
)