feat(seed): Greenfield full timetable seed with classes and student enrollment
seed_greenfield_timetable.py creates the complete school data set: - POST /timetable/setup: school_timetables, academic_years, terms, weeks, days - POST /timetable/materialize-periods: 1624 academic_periods (203 days x 8 periods) - 17 classes (Physics/Maths/English/History/Science, Yr7-12) with correct metadata - class_teachers links (primary teacher per class) - teacher timetable init + slot assignments (class_id FK patched onto slots) - class_students enrollment: student1->Yr9 (5 classes), student2->Yr10 (4), student3->Yr11 (2) - POST /timetable/materialize: 1462 taught_lessons all with class_id populated - POST /admin/seed-timetable endpoint wired in platform_admin_router Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
@@ -146,3 +146,15 @@ async def seed_environment(
|
||||
loop = asyncio.get_event_loop()
|
||||
result = await loop.run_in_executor(None, _seed)
|
||||
return {"status": "ok", **result}
|
||||
|
||||
|
||||
@router.post("/seed-timetable")
|
||||
async def seed_greenfield_timetable(
|
||||
_: dict = Depends(require_platform_admin),
|
||||
) -> Dict[str, Any]:
|
||||
"""Seed full timetable + taught lessons for Greenfield Academy. Platform admin only."""
|
||||
import asyncio
|
||||
from run.initialization.seed_greenfield_timetable import seed as _seed
|
||||
loop = asyncio.get_event_loop()
|
||||
result = await loop.run_in_executor(None, _seed)
|
||||
return {"status": "ok", **result}
|
||||
|
||||
Reference in New Issue
Block a user