import { z } from "zod"

export const createCategorySchema = z.object({
  name: z
    .string()
    .min(3, {
      message: "Name is required and must be at least 3 characters long",
    })
    .nonempty("Name is required and must be at least 3 characters long"),
})

export type CreateCategoryFormType = z.infer<typeof createCategorySchema>

export const updateCategorySchema = createCategorySchema.extend({
  id: z.string().nonempty("ID is required"),
})

export type UpdateCategoryFormType = z.infer<typeof updateCategorySchema>
