import { z } from "zod";
import type { Messages } from "@/shared/i18n/config";
import {
  ANTAI_EXCEPTION_STATUS_VALUES,
  ANTAI_EXCEPTION_TYPE_VALUES,
  ANTAI_EXCEPTION_RESOLUTION_VALUES,
} from "@/shared/constants/antai";

export const antaiExceptionSchema = (t: Messages) =>
  z.object({
    status: z.enum(ANTAI_EXCEPTION_STATUS_VALUES),
    exception_type: z.enum(ANTAI_EXCEPTION_TYPE_VALUES).optional(),
    resolution: z.enum(ANTAI_EXCEPTION_RESOLUTION_VALUES).optional(),
    detail: z.string().max(2000, t.antai.exception.detailMaxLength).optional(),
  });

export type AntaiExceptionFormValues = z.infer<ReturnType<typeof antaiExceptionSchema>>;
