diff --git a/app/components/app/consultation/entry.vue b/app/components/app/consultation/entry.vue
new file mode 100644
index 00000000..5b3fdf82
--- /dev/null
+++ b/app/components/app/consultation/entry.vue
@@ -0,0 +1,122 @@
+
+
+
+
+
diff --git a/app/components/app/consultation/list.ts b/app/components/app/consultation/list.ts
new file mode 100644
index 00000000..7e171797
--- /dev/null
+++ b/app/components/app/consultation/list.ts
@@ -0,0 +1,40 @@
+import type {
+ Col,
+ KeyLabel,
+ RecComponent,
+ RecStrFuncComponent,
+ RecStrFuncUnknown,
+ Th,
+} from '~/components/pub/custom-ui/data/types'
+import { defineAsyncComponent } from 'vue'
+
+type SmallDetailDto = any
+
+const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-ud.vue'))
+
+export const cols: Col[] = [{ width: 100 }, {}, {}, {}, { width: 50 }]
+
+export const header: Th[][] = [[{ label: 'Tanggal' }, { label: 'Dokter' }, { label: 'Tujuan' }, { label: 'Pertanyaan' }, { label: 'Jawaban' }, { label: '' }]]
+
+export const keys = ['date', 'dstDoctor.name', 'dstUnit.name', 'case', 'solution', 'action']
+
+export const delKeyNames: KeyLabel[] = [
+ { key: 'data', label: 'Tanggal' },
+ { key: 'dstDoctor.name', label: 'Dokter' },
+]
+
+export const funcComponent: RecStrFuncComponent = {
+ action(rec, idx) {
+ const res: RecComponent = {
+ idx,
+ rec: rec as object,
+ component: action,
+ props: {
+ size: 'sm',
+ },
+ }
+ return res
+ },
+}
+
+export const funcHtml: RecStrFuncUnknown = {}
diff --git a/app/components/app/consultation/list.vue b/app/components/app/consultation/list.vue
new file mode 100644
index 00000000..c563b303
--- /dev/null
+++ b/app/components/app/consultation/list.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/app/components/content/consultation/list.vue b/app/components/content/consultation/list.vue
new file mode 100644
index 00000000..fd2e4786
--- /dev/null
+++ b/app/components/content/consultation/list.vue
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+
+ handleActionRemove(recId, getMyList, toast)"
+ @cancel=""
+ >
+
+
+
ID: {{ record?.id }}
+
Nama: {{ record.name }}
+
Kode: {{ record.code }}
+
+
+
+
diff --git a/app/handlers/consultation.handler.ts b/app/handlers/consultation.handler.ts
new file mode 100644
index 00000000..a8187b01
--- /dev/null
+++ b/app/handlers/consultation.handler.ts
@@ -0,0 +1,17 @@
+import { genCrudHandler } from '~/handlers/_handler'
+import { create, update, remove } from '~/services/consultation.service'
+
+export const {
+ recId,
+ recAction,
+ recItem,
+ isReadonly,
+ isProcessing,
+ isFormEntryDialogOpen,
+ isRecordConfirmationOpen,
+ onResetState,
+ handleActionSave,
+ handleActionEdit,
+ handleActionRemove,
+ handleCancelForm,
+} = genCrudHandler({ create, update, remove })
diff --git a/app/models/consultation.ts b/app/models/consultation.ts
new file mode 100644
index 00000000..b9fbd2fd
--- /dev/null
+++ b/app/models/consultation.ts
@@ -0,0 +1,45 @@
+export interface Consultation {
+ id: number
+ encounter_id: number
+ unit_id: number
+ doctor_id?: number
+ problem: string
+ solution?: string
+ repliedAt?: string
+}
+
+export interface CreateDto {
+ encounter_id: number
+ problem: string
+ unit_id: number
+}
+
+export interface UpdateDto {
+ id: number
+ problem: string
+ unit_id: number
+}
+
+export interface DeleteDto {
+ id: number
+}
+
+export function genCreateDto(): CreateDto {
+ return {
+ encounter_id: 0,
+ problem: '',
+ unit_id: 0,
+ }
+}
+
+export function genConsultation(): Consultation {
+ return {
+ id: 0,
+ encounter_id: 0,
+ unit_id: 0,
+ doctor_id: 0,
+ problem: '',
+ solution: '',
+ repliedAt: '',
+ }
+}
diff --git a/app/pages/_dev/consultation/list.vue b/app/pages/_dev/consultation/list.vue
new file mode 100644
index 00000000..35929b6c
--- /dev/null
+++ b/app/pages/_dev/consultation/list.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
diff --git a/app/schemas/consultation.schema.ts b/app/schemas/consultation.schema.ts
new file mode 100644
index 00000000..0dbf054b
--- /dev/null
+++ b/app/schemas/consultation.schema.ts
@@ -0,0 +1,12 @@
+import { z } from 'zod'
+import type { Consultation } from '~/models/consultation'
+
+const ConsultationSchema = z.object({
+ unit_id: z.number({ required_error: 'Unit harus diisi' }),
+ problem: z.string({ required_error: 'Uraian harus diisi' }).min(20, 'Kode minimum 20 karakter'),
+})
+
+type ConsultationFormData = z.infer & (Consultation)
+
+export { ConsultationSchema }
+export type { ConsultationFormData }
diff --git a/app/services/consultation.service.ts b/app/services/consultation.service.ts
new file mode 100644
index 00000000..9bbe2208
--- /dev/null
+++ b/app/services/consultation.service.ts
@@ -0,0 +1,23 @@
+import * as base from './_crud-base'
+
+const path = '/api/v1/consultation'
+
+export function create(data: any) {
+ return base.create(path, data)
+}
+
+export function getList(params: any = null) {
+ return base.getList(path, params)
+}
+
+export function getDetail(id: number | string) {
+ return base.getDetail(path, id)
+}
+
+export function update(id: number | string, data: any) {
+ return base.update(path, id, data)
+}
+
+export function remove(id: number | string) {
+ return base.remove(path, id)
+}
diff --git a/app/services/unit.service.ts b/app/services/unit.service.ts
index 82d565db..5f171e9e 100644
--- a/app/services/unit.service.ts
+++ b/app/services/unit.service.ts
@@ -1,5 +1,43 @@
import { xfetch } from '~/composables/useXfetch'
+import * as base from './_crud-base'
+import type { Unit } from '~/models/unit'
+const path = '/api/v1/unit'
+
+export function create(data: any) {
+ return base.create(path, data)
+}
+
+export function getList(params: any = null) {
+ return base.getList(path, params)
+}
+
+export function getDetail(id: number | string) {
+ return base.getDetail(path, id)
+}
+
+export function update(id: number | string, data: any) {
+ return base.update(path, id, data)
+}
+
+export function remove(id: number | string) {
+ return base.remove(path, id)
+}
+
+export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> {
+ let data: { value: string; label: string }[] = [];
+ const result = await getList(params)
+ if (result.success) {
+ const resultData = result.body?.data || []
+ data = resultData.map((item: Unit) => ({
+ value: item.id,
+ label: item.name,
+ }))
+ }
+ return data;
+}
+
+//////////////////////// WILL BE LEGACY
const mainUrl = '/api/v1/unit'
export async function getUnits(params: any = null) {