Files
simrsx-fe/app/schemas/person-address.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

37 lines
966 B
TypeScript

import { z } from 'zod'
const PersonAddressSchema = z.object({
id: z.number().optional(),
locationType_code: z.string({
required_error: 'Mohon pilih jenis alamat',
}),
address: z.string({
required_error: 'Mohon lengkapi alamat',
}),
province_code: z.string({
required_error: 'Mohon pilih provinsi',
}),
regency_code: z.string({
required_error: 'Mohon pilih kabupaten/kota',
}),
district_code: z.string({
required_error: 'Mohon pilih kecamatan',
}),
village_code: z.string({
required_error: 'Mohon pilih kelurahan',
}),
postalRegion_code: z.string({
required_error: 'Mohon lengkapi kode pos',
}),
// .min(5, 'Kode pos harus berupa angka 5 digit')
// .regex(/^\d+$/, 'Kode pos harus berupa angka 5 digit'),
rt: z.string().optional(),
rw: z.string().optional(),
})
type PersonAddressFormData = z.infer<typeof PersonAddressSchema>
export { PersonAddressSchema }
export type { PersonAddressFormData }