Files
classroomio/packages/utils/src/validation/course/section.ts
T

38 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-03-09 11:18:22 +01:00
import * as z from 'zod';
// Course Section Schemas
export const ZCourseSectionCreate = z.object({
title: z.string().min(1),
courseId: z.string().min(1),
order: z.number().int().min(0).optional()
});
export type TCourseSectionCreate = z.infer<typeof ZCourseSectionCreate>;
export const ZCourseSectionUpdate = z.object({
title: z.string().min(1).optional(),
order: z.number().int().min(0).optional()
});
export type TCourseSectionUpdate = z.infer<typeof ZCourseSectionUpdate>;
export const ZCourseSectionPromoteUngrouped = z.object({
title: z.string().min(1)
});
export type TCourseSectionPromoteUngrouped = z.infer<typeof ZCourseSectionPromoteUngrouped>;
export const ZCourseSectionGetParam = z.object({
sectionId: z.string().min(1)
});
export type TCourseSectionGetParam = z.infer<typeof ZCourseSectionGetParam>;
export const ZCourseSectionReorder = z.object({
sections: z
.array(
z.object({
id: z.string().min(1),
order: z.number().int().min(0)
})
)
.min(1)
});
export type TCourseSectionReorder = z.infer<typeof ZCourseSectionReorder>;