import { z } from "zod"

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

const billFormSchema = z.object({
    vendor: relationFieldSchema,
    job_card: relationFieldSchema,
    payment_term: relationFieldSchema,
    department: relationFieldSchema,
    title: z.string().min(1, "Title is required"),
    bill_date: z.string().optional(),
    bill_due_date: z.string().optional(),
    status: z.string().optional(),
    notes: z.string().optional(),
})

type BillFormValues = z.infer<typeof billFormSchema>

export { billFormSchema, relationFieldSchema }
export type { BillFormValues }
