22 lines
645 B
TypeScript
22 lines
645 B
TypeScript
import { z } from "zod"
|
|
|
|
const relationFieldSchema = z
|
|
.object({ value: z.string(), label: z.string() })
|
|
.nullable()
|
|
|
|
const vendorCreditFormSchema = z.object({
|
|
vendor: relationFieldSchema,
|
|
bill: relationFieldSchema,
|
|
department: relationFieldSchema,
|
|
subject: z.string().min(1, "Subject is required"),
|
|
vendor_credit_date: z.string().optional(),
|
|
status: z.string().optional(),
|
|
discount: z.string().optional(),
|
|
notes: z.string().optional(),
|
|
})
|
|
|
|
type VendorCreditFormValues = z.infer<typeof vendorCreditFormSchema>
|
|
|
|
export { vendorCreditFormSchema, relationFieldSchema }
|
|
export type { VendorCreditFormValues }
|