import { StaffUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas";
import { z } from "zod";

export type Staff = z.infer<typeof StaffUncheckedCreateInputObjectSchema>;

export const staffCreateSchema = (
  StaffUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
).omit({
  id: true,
  createdAt: true,
  displayOrder: true,
  userId: true,
});

export const staffUpdateSchema = (
  StaffUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
)
  .partial()
  .omit({
    id: true,
    createdAt: true,
    userId: true,
  });

export type StaffFormData = {
  name: string;
  email?: string;
  role: string;
  phone?: string;
  displayOrder?: number;
};

export type StaffCreateInput = z.infer<
  typeof StaffUncheckedCreateInputObjectSchema
>;

export type StaffCreateBody = Omit<
  StaffCreateInput,
  "id" | "createdAt" | "userId" | "displayOrder"
>;

export type StaffUpdateInput = Partial<
  Omit<StaffCreateInput, "id" | "createdAt" | "userId">
>;
