garage-erp/apps/dashboard/modules/payment-mades/payment-made.schema.ts
2026-04-06 02:32:47 +03:00

27 lines
855 B
TypeScript

import { z } from "zod"
const relationFieldSchema = z
.object({ value: z.string(), label: z.string() })
.nullable()
const paymentMadeFormSchema = z.object({
// ── Relations ──
vendor: relationFieldSchema,
employee: relationFieldSchema,
payment_mode: relationFieldSchema,
// ── Payment info ──
payment_for: z.string().min(1, "Payment for is required"),
payment_made: z.string().min(1, "Amount is required"),
payment_number: z.string().optional(),
payment_reference: z.string().optional(),
payment_date: z.string().min(1, "Payment date is required"),
paid_through: z.string().optional(),
notes: z.string().optional(),
})
type PaymentMadeFormValues = z.infer<typeof paymentMadeFormSchema>
export { paymentMadeFormSchema, relationFieldSchema }
export type { PaymentMadeFormValues }