import { z } from "zod";

export const AvailableTimeSchema = z.object({
  date: z.string().min(1),
  startHour: z.number().int().min(0).max(23),
  endHour: z.number().int().min(1).max(24),
}).refine((v) => v.endHour > v.startHour, { message: "endHour must be after startHour" });

export const CreatePlanSchema = z.object({
  roomId: z.string().min(1, "roomId 不能为空"),
  availableTime: AvailableTimeSchema,
});

export const UpdatePlanSchema = z.object({
  planId: z.string().min(1, "planId 不能为空"),
  action: z.string().optional(),
  days: z.array(z.unknown()).optional(),
});

export const CreateRoomSchema = z.object({
  restaurants: z.array(z.unknown()).min(1),
  scene: z.string().optional(),
});
