Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit fb2791a

Browse files
committed
Update schemas.ts
1 parent a91ee0e commit fb2791a

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

apps/client/src/services/sbhsApi/schemas.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,68 @@ export const daySchema = z.record(
300300
dayNumber: z.coerce.number().nullish(),
301301
})
302302
);
303+
304+
const timetableSchema = z.object({
305+
student: z.object({
306+
surname: z.string(),
307+
givenname: z.string(),
308+
sex: z.string(), // "M"/"B" for male
309+
DOB: z.string(), // date of birth. Unix timestamp
310+
roll: z.coerce.number(), // index of roll class
311+
lines: z.record(z.coerce.number()),
312+
extraLines: z.record(z.coerce.number()),
313+
BoSNumber: z.coerce.number(), // Board of Studies number. 0 if not available
314+
studentId: z.string(), // Student ID number
315+
year: z.string(), // student's [primary] year group
316+
years: z.string().array(), // array of years the student is in
317+
}),
318+
days: z.record(
319+
z.object({
320+
dayname: z.string(), // name of the day
321+
routine: z.string(), // routine (see timetable/daytimetable()
322+
rollcall: z.object({
323+
// roll call info for this day
324+
title: z.string(), // name of roll class
325+
teacher: z.string(), // teacher code for roll class
326+
room: z.string(), // room for roll call
327+
}),
328+
periods: z.record(
329+
z.object({
330+
// corresponds to routine
331+
title: z.string(), // short name for class
332+
teacher: z.string(), // teacher code for class
333+
room: z.string(), // room for class
334+
year: z.string(), // year for class (Note [1])
335+
})
336+
),
337+
})
338+
),
339+
subjects: z.record(
340+
z.object({
341+
title: "8 Maths 1", // title of the class
342+
shortTitle: "Ma1", // corresponds to period.title
343+
subject: "Mathematics", // full name of the subject
344+
teacher: "DW", // teacher code for the class teacher
345+
fullTeacher: "Mr R Dow", // full name of the teacher
346+
year: "8", // year for the class (Note [1])
347+
})
348+
),
349+
extraSubjects: {
350+
// collection of extra subjects
351+
"1": {
352+
// these subjects have no timetable classes
353+
title: "Student Advis", // title of the class
354+
shortTitle: "SA7", // corresponds to period.title
355+
teacher: "DW", // teacher code for the class teacher
356+
fullTeacher: "Mr R Dow", // full name of the teacher
357+
},
358+
},
359+
rollcall: {
360+
// roll class details
361+
title: "08M", // title of the class
362+
teacher: "DW", // teacher code for the teacher
363+
fullTeacher: "Mr R Dow", // full name of the teacher
364+
room: " ", // roll class room
365+
},
366+
advisor: "Mr R Dowdell", // year adviser
367+
});

0 commit comments

Comments
 (0)