refactor(patient): restructure patient data handling to use nested properties

Move address, contact and relative data into nested properties of Person model
Update preview component to access data through person object
Remove separate props for addresses, contacts and relatives
This commit is contained in:
Khafid Prayoga
2025-10-10 10:30:00 +07:00
parent bd4a269fad
commit a5d5e8acd1
3 changed files with 40 additions and 17 deletions
+8 -2
View File
@@ -1,8 +1,9 @@
import { type Base, genBase } from './_base'
import type { PersonAddress } from './person-address'
import type { PersonContact } from './person-contact'
import type { PersonRelative } from './person-relative'
export interface Person extends Base {
// todo: awaiting approve from stake holder: buat field sapaan
// todo: adjust field ketika person Balita
name: string
// alias?: string
frontTitle?: string
@@ -26,6 +27,11 @@ export interface Person extends Base {
passportFileUrl?: string
drivingLicenseFileUrl?: string
familyIdentityFileUrl?: string
// preload data for detail patient
addresses?: PersonAddress[] | null
contacts?: PersonContact[] | null
relatives?: PersonRelative[] | null
}
export function genPerson(): Person {