import { z } from "zod";

export const operationsQuerySchema = z.object({
  from: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
  to: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional()
});

export const operationsProgressBodySchema = z.object({
  scopeKey: z.string().trim().min(1).max(255),
  type: z.enum(["preparation", "delivery", "pickup", "verification"]),
  date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
  time: z
    .string()
    .regex(/^([01]\d|2[0-3]):[0-5]\d$/)
    .nullable(),
  checkedEquipmentKinds: z.array(z.enum(["laptop", "tablet", "printer", "router", "flipchart"])).max(5),
  confirmedEquipmentItemIds: z.array(z.string().uuid()).max(500),
  markFinished: z.boolean()
});
