refactor(patient): rename PatientEntity to Patient and update related components

Update interface name from PatientEntity to Patient for better clarity and consistency. Modify all related components and models to use the new interface name. Also includes minor improvements to address handling in patient forms.
This commit is contained in:
Khafid Prayoga
2025-10-10 15:35:12 +07:00
parent ea04f33ad1
commit 7f6e0cc1fd
6 changed files with 81 additions and 43 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { withBase } from '~/models/_base'
import type { HeaderPrep } from '~/components/pub/my-ui/data/types'
import type { PatientEntity } from '~/models/patient'
import type { Patient } from '~/models/patient'
import type { Person } from '~/models/person'
// Components
@@ -18,7 +18,7 @@ const props = defineProps<{
// #region State & Computed
const patient = ref(
withBase<PatientEntity>({
withBase<Patient>({
person: {} as Person,
personAddresses: [],
personContacts: [],
@@ -74,7 +74,7 @@ function handleAction(type: string) {
class="mb-4 border-b-2 border-b-slate-300 pb-2 xl:mb-5"
/>
<AppPatientPreview
:person="patient.person"
:patient="patient"
@click="handleAction"
/>
</template>
+2 -2
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { PatientEntity, genPatientProps } from '~/models/patient'
import type { Patient, genPatientProps } from '~/models/patient'
import type { ExposedForm } from '~/types/form'
import type { PatientBase } from '~/models/patient'
import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
@@ -16,7 +16,7 @@ import { postPatient } from '~/services/patient.service'
const props = defineProps<{
callbackUrl?: string
}>()
const payload = ref<PatientEntity>()
const payload = ref<Patient>()
// form related state
const personAddressForm = ref<ExposedForm<any> | null>(null)