import { z } from "zod";

export const createUserSchema = z.object({
  name: z.string().trim().min(2, "Nama wajib diisi"),
  email: z.string().trim().email("Email tidak valid"),
  username: z.string().trim().min(3, "Username minimal 3 karakter"),
  phone: z.string().trim().optional().nullable(),
  password: z.string().min(8, "Password minimal 8 karakter"),
  role_code: z.string().trim().min(1, "Role wajib dipilih"),
  status: z.enum(["ACTIVE", "INACTIVE"]).default("ACTIVE")
});

export const updateUserSchema = z.object({
  name: z.string().trim().min(2, "Nama wajib diisi"),
  email: z.string().trim().email("Email tidak valid"),
  username: z.string().trim().min(3, "Username minimal 3 karakter"),
  phone: z.string().trim().optional().nullable(),
  role_code: z.string().trim().min(1, "Role wajib dipilih"),
  status: z.enum(["ACTIVE", "INACTIVE"]).default("ACTIVE")
});
