WayrApp Backend & Ecosystem Documentation - v1.0.0
    Preparing search index...

    Variable OrderSchemaConst

    OrderSchema: ZodNumber = ...

    Order validation schema for hierarchical content organization

    Validation schema for order/position values used in hierarchical content structures such as course modules, lessons, and exercises. This schema ensures that order values are positive integers, maintaining proper content sequencing and preventing organizational errors in the learning platform.

    Order values are critical for maintaining logical content flow and user navigation, requiring validation to ensure positive integers that support proper sorting and sequencing operations. The schema prevents zero or negative values that could disrupt content organization and user experience.

    // Content ordering validation
    const LessonOrderSchema = z.object({
    lessonId: z.string().uuid(),
    newOrder: OrderSchema
    });
    // Batch reordering validation
    const ReorderSchema = z.object({
    items: z.array(z.object({
    id: z.string().uuid(),
    order: OrderSchema
    }))
    });