import { z } from "zod";
import { isoDateString } from "./common";

export const CreateLeaveRequestSchema = z.object({
  leave_type: z.enum(["vacation", "sick", "unpaid"]).default("vacation"),
  date_from: isoDateString,
  date_to: isoDateString,
  notes: z.string().max(2000).nullish(),
});

export const ReviewLeaveRequestSchema = z.object({
  status: z
    .enum(["pending", "approved", "rejected", "cancelled"])
    .default("pending"),
  reviewer_note: z.string().max(2000).nullish(),
});

export type CreateLeaveRequestInput = z.infer<typeof CreateLeaveRequestSchema>;
export type ReviewLeaveRequestInput = z.infer<typeof ReviewLeaveRequestSchema>;
