import { z } from "zod";

import { RoleEnum } from "@/constants/roleEnum";
import { RiskEnum } from "@/constants/riskEnum";

export const adminSchema = z.object({
  id: z.string().optional(),
  email: z
    .string()
    .trim()
    .min(1, "Email is required")
    .pipe(z.email("Please enter a valid email address")),
  firstName: z.string().trim().min(1, "First name is required"),
  lastName: z.string().trim().min(1, "Last name is required"),
  title: z.string().trim().min(1, "Title is required"),
  role: z.enum(RoleEnum),
  riskStatus: z.enum(RiskEnum).default(RiskEnum.LOW_RISK),
  managerId: z.string().optional().nullable(),
});

export type AdminFormValues = z.input<typeof adminSchema>;
