Add lessons Phase 2: schedule slots with conflict detection
Recurring weekly time slots linking instructors to lesson types. Includes day/time overlap detection, instructor and day-of-week filtering, and 17 new integration tests (40 total lessons tests).
This commit is contained in:
@@ -36,3 +36,18 @@ export type LessonTypeCreateInput = z.infer<typeof LessonTypeCreateSchema>
|
||||
|
||||
export const LessonTypeUpdateSchema = LessonTypeCreateSchema.partial()
|
||||
export type LessonTypeUpdateInput = z.infer<typeof LessonTypeUpdateSchema>
|
||||
|
||||
// --- Schedule Slot schemas ---
|
||||
|
||||
export const ScheduleSlotCreateSchema = z.object({
|
||||
instructorId: z.string().uuid(),
|
||||
lessonTypeId: z.string().uuid(),
|
||||
dayOfWeek: z.coerce.number().int().min(0).max(6),
|
||||
startTime: z.string().regex(/^\d{2}:\d{2}$/, 'Must be HH:MM format'),
|
||||
room: opt(z.string().max(100)),
|
||||
maxStudents: z.coerce.number().int().min(1).default(1),
|
||||
})
|
||||
export type ScheduleSlotCreateInput = z.infer<typeof ScheduleSlotCreateSchema>
|
||||
|
||||
export const ScheduleSlotUpdateSchema = ScheduleSlotCreateSchema.partial()
|
||||
export type ScheduleSlotUpdateInput = z.infer<typeof ScheduleSlotUpdateSchema>
|
||||
|
||||
Reference in New Issue
Block a user