wip: adjust strict form data

person-relative: schema bind strict typed
person-contact: strict schema type
person-families: strict schema type
person-address-relative: strict schema type
patient: strict schema type
person-address: strict schema type
This commit is contained in:
Khafid Prayoga
2025-12-05 20:36:50 +07:00
parent 8754c7c062
commit 1f6ca8a7f9
10 changed files with 602 additions and 208 deletions
+11 -1
View File
@@ -26,8 +26,18 @@ const PersonFamiliesSchema = z.discriminatedUnion('shareFamilyData', [
}),
])
interface PersonFamiliesFormData {
shareFamilyData: '0' | '1'
families: {
relation: 'mother' | 'father' | 'guardian' | 'emergency_contact'
name: string
education: string
occupation?: string
}[]
}
type PersonFamilyFormData = z.infer<typeof PersonFamilySchema>
type PersonFamiliesFormData = z.infer<typeof PersonFamiliesSchema>
// type PersonFamiliesFormData = z.infer<typeof PersonFamiliesSchema>
export { PersonFamilySchema, PersonFamiliesSchema }
export type { PersonFamilyFormData, PersonFamiliesFormData }