Files
simrsx-fe/app/schemas/person-contact.schema.ts
Khafid Prayoga 3cac23ce8a fix edit form state
fix: id list for contacts and address list

fix warning

fix duplicate contacts responsible: true

fix edit family

fix nik required
2025-12-10 14:36:32 +07:00

18 lines
603 B
TypeScript

import { z } from 'zod'
const PersonContactBaseSchema = z.object({
id: z.number().optional(),
contactType: z.string({ required_error: 'Mohon pilih tipe kontak' }).min(1, 'Mohon pilih tipe kontak'),
contactNumber: z.string({ required_error: 'Nomor kontak harus diisi' }).min(8, 'Nomor minimal 8 digit'),
})
const PersonContactListSchema = z.object({
contacts: z.array(PersonContactBaseSchema).min(1, 'Minimal 1 kontak'),
})
type PersonContactFormData = z.infer<typeof PersonContactListSchema>
export { PersonContactListSchema, PersonContactBaseSchema }
export type { PersonContactFormData }