import { z } from "zod"

export const relationFieldSchema = z
    .object({ value: z.string(), label: z.string() })
    .nullable()

export const expenseItemFormSchema = z.object({
    item_type: z.string().min(1, "Item type is required"),
    item_name: z.string().min(1, "Item name is required"),
    category: relationFieldSchema,
    purchase_price: z.coerce.number().min(0).optional(),
    purchase_chart_of_account: z.string().optional(),
    purchase_information: z.boolean().default(true),
    is_active: z.boolean().default(true),
})

export type ExpenseItemFormValues = z.infer<typeof expenseItemFormSchema>
