Naalya Handbook
School features

Timetable

How staff build and release a term timetable, who is told, and what students and teachers see in a week.

Every route needs Feature.TIMETABLE and starts with /api/v1.

ControllerForNeeds
campuses/:campusId/timetablesBuilding and releasingmanage on timetable
timetableReadingNo permission decorator: your own lessons, or a released timetable for staff

Building and releasing

Create the term's timetable (createTimetable). One per term (This term already has a timetable), never for an ended term (This term has ended) or a locked year. You can copy day plans and lessons from another term. Days off and one-week changes are not copied. A missing source is There is no timetable to copy from that term.

Add day plans. Each plan has classes, weekdays and slots. A slot that does not end after it starts is refused with that slot's label plus must end after it starts. Two slots that overlap name both labels. A class already on another plan that weekday is refused with the class name, the other plan's name, and the weekday.

Release (releaseTimetable). Sets releasedAt once; a second release is This timetable is already out. It can't be undone. Deleting a released timetable is This timetable is already out and cannot be removed.

On release:

WhatTo whom
TIMETABLE_CHANGEScreens refresh
Outlook copies of every lessonTeachers' calendars, at sweep priority
TIMETABLE_RELEASED notificationCampus staff plus every teacher with a lesson, opening /staff-hub/campus/$campusId/timetable

Edits after release re-sync Outlook and send TIMETABLE_CHANGED, in-app only, to the teachers on the touched lessons. Before release, edits tell no one. A failed notification is logged and never undoes the release or edit. Every write, including an edit after release, still refuses a locked year and a term that has ended.

The OpenAPI text on create doesn't list every refusal (Term not found, No school in context, and the copy-source string above), and get can return null though it isn't marked nullable.

Days off

A day off is a named date range on the timetable. The last day cannot come before the first (The last day cannot come before the first day), and both dates must fall inside the term (The days must fall within the term). An empty class list covers every lesson on those weekdays. A named list covers those classes. The lesson rows stay. They show again when the day off is deleted. Deleting a missing id is Day off not found.

Lessons on a plan

These routes need manage on timetable. They sit under campuses/:campusId/timetables/:id. Several lessons may share one period.

RouteWhat it does
GET .../lessons (listTimetableLessons)One class. With a stream, that stream and the whole class. Without one, every lesson of the class
GET .../lessons/choices (listTimetableChoices)Subjects offered to the class or stream. The stream's own teachers come first, then the rest of the class. A teacher already busy at an overlapping time that weekday is named with the other class
POST .../lessons (createTimetableLesson)A subject or an activity, and usually a teacher. The period must be a lesson slot on the plan that class follows that weekday
PATCH .../lessons/:lessonId (updateTimetableLesson)Changes the subject, the activity, or the teacher. The class, stream, weekday, and period stay. To move a lesson, delete it and add it again
DELETE .../lessons/:lessonId (deleteTimetableLesson)Removes the lesson. Returns Lesson deleted successfully
PUT .../lessons/:lessonId/days/:date (changeTimetableLessonDay)Skips that week, or gives it its own time and place
DELETE .../lessons/:lessonId/days/:date (restoreTimetableLessonDay)Puts that week back. A week with no change is left as it is

A lesson needs a subject or an activity, not both (A lesson needs a subject or an activity, not both). A period that class does not have is That class has no lesson period then. A missing lesson is Lesson not found.

A one-week change is today or later on the school clock. A past date is Days already gone cannot change. A date that is not YYYY-MM-DD is The date must be YYYY-MM-DD. A date the lesson does not run is The lesson does not run on that day. A day off for that class is No lessons that day. A move whose end is not after its start is The end time must be after the start time. Two people changing different weeks of one lesson at the same moment can lose one change. The row is not locked.

Reading a week

RouteWhoReturns
GET /timetable/my-lessons (listMyLessons)AnyoneYour lessons from start to end, 1 to 31 days
GET /timetable/campuses/:campusId/released (getReleasedTimetable)StaffThe released timetable covering a date, or empty
GET .../released/:id/lessons (listReleasedTimetableLessons)StaffThat released timetable's lessons. An unreleased id is Timetable not found
GET /timetable/lessons/:lessonId/context (getTimetableLessonContext)StaffOne released lesson on one date. An unreleased or missing lesson is Lesson not found

Whose lessons my-lessons returns:

ViewerGets
TeacherLessons they teach, on released timetables
StudentTheir class and stream's lessons; a subject lesson only if it's the only one in that period or they take the subject; activities always
Guardian, guestNothing

A window that is empty, backwards, or longer than 31 days is Choose 1 to 31 days, the last not before the first. Days off and skipped weeks are left out. A moved lesson shows that week's time and place with moved: true. A teacher is matched on their profile id. An empty profile id matches no lessons. A guardian or a guest gets an empty list. The student placement query was not opened. The filter after it was: an activity always, a subject when it is the only lesson in that period or the student takes it.

The week number counts from the term's first day: whole weeks from that day, plus 1. A date outside the term has no week number, and then the context has no plans or files. A lesson with no subject stops there too. A whole-class lesson is read against every stream of the class. This week and, from week 2, the week before, each return up to 20 plans per stream. Schemes are up to 5 per stream. The first scheme's id is schemeOfWorkId. Files are that week's folder on each scheme. A scheme the reader may not see contributes no files. recordOfWork is the first record found for that week, as an id and a status. The class's level and grade level are included. The placement SQL and the lesson-planning list methods were not opened.

In the Hub

Students see /student/timetable ("My timetable"): a week grid starting Monday, weekends shown only when a lesson falls on them. "Today" follows the school clock from the lesson times, not the phone.

Teachers see the campus timetable two ways:

ViewShowsTapping a lesson
For meTheir own weekOpens the lesson panel as theirs, with Plan this week and Add files
A classThat class's released weekOpens the panel. The teacher's own lesson loads plans and files. Someone else's lesson shows its details only

When the week has more than one day plan, the class sheet shows one plan at a time. The plan name sits on the left, and Previous day plan and Next day plan cycle the plans. Until someone chooses, the sheet opens on the plan that includes today. A week with one plan has no switcher.

The lesson panel loads the lesson's context:

  • This week's plans, labelled Draft, Shared, Waiting for approval, Approved or Returned, each linking to the plan.
  • Plan this week opens the scheme when there's no plan yet. Go ahead opens Rover with a draft naming the lesson, class, week and plans.
  • Add files to this week uploads to the lesson-planning folder: up to 100 MB in the Hub, and within the teacher's storage limit on the API. The file is kept only once the upload is confirmed; see Files.
  • A date outside the term, or a failed load, both show "Outside the term".
  • A lesson that is not the signed-in teacher's skips the missing-item suggestion and the plans and files under it. The header still shows. In a class view the lesson counts as theirs when one lesson in the slot has their staff id.

On this page