From b1cb24cae31d6e1b4c602718ceba01730319607c Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Tue, 19 Aug 2025 11:01:28 +0700 Subject: [PATCH] feat(satusehat): add integration pages and components Add new SatuSehat integration feature including: - Page components for list, add, edit, and detail views - Service status component and type definitions - Summary card component updates for string metrics - RBAC permissions configuration for SatuSehat routes --- app/components/flow/satusehat/list.vue | 107 ++++++++++++++++++ .../pub/base/service-status.type.ts | 7 ++ app/components/pub/base/service-status.vue | 68 +++++++++++ app/components/pub/base/summary-card.type.ts | 2 +- app/components/pub/base/summary-card.vue | 8 +- app/lib/page-permission.ts | 8 ++ .../(features)/satusehat/[id]/detail.vue | 9 ++ app/pages/(features)/satusehat/[id]/edit.vue | 9 ++ app/pages/(features)/satusehat/add.vue | 40 +++++++ app/pages/(features)/satusehat/index.vue | 39 +++++++ 10 files changed, 291 insertions(+), 6 deletions(-) create mode 100644 app/components/flow/satusehat/list.vue create mode 100644 app/components/pub/base/service-status.type.ts create mode 100644 app/components/pub/base/service-status.vue create mode 100644 app/pages/(features)/satusehat/[id]/detail.vue create mode 100644 app/pages/(features)/satusehat/[id]/edit.vue create mode 100644 app/pages/(features)/satusehat/add.vue create mode 100644 app/pages/(features)/satusehat/index.vue diff --git a/app/components/flow/satusehat/list.vue b/app/components/flow/satusehat/list.vue new file mode 100644 index 00000000..c1634333 --- /dev/null +++ b/app/components/flow/satusehat/list.vue @@ -0,0 +1,107 @@ + + + diff --git a/app/components/pub/base/service-status.type.ts b/app/components/pub/base/service-status.type.ts new file mode 100644 index 00000000..f3d15cd0 --- /dev/null +++ b/app/components/pub/base/service-status.type.ts @@ -0,0 +1,7 @@ +export interface ServiceStatus { + serviceName: string + serviceDesc: string + sessionActive: boolean + status: 'connected' | 'connecting' | 'error' | 'disconnected' + isSkeleton?: boolean +} diff --git a/app/components/pub/base/service-status.vue b/app/components/pub/base/service-status.vue new file mode 100644 index 00000000..853e0469 --- /dev/null +++ b/app/components/pub/base/service-status.vue @@ -0,0 +1,68 @@ + + + diff --git a/app/components/pub/base/summary-card.type.ts b/app/components/pub/base/summary-card.type.ts index 64304eaf..be04a9ce 100644 --- a/app/components/pub/base/summary-card.type.ts +++ b/app/components/pub/base/summary-card.type.ts @@ -1,7 +1,7 @@ export interface Summary { title: string icon: Component - metric: number + metric: number | string trend: number timeframe: 'yearly' | 'monthly' | 'weekly' | 'daily' } diff --git a/app/components/pub/base/summary-card.vue b/app/components/pub/base/summary-card.vue index d3413111..d6454627 100644 --- a/app/components/pub/base/summary-card.vue +++ b/app/components/pub/base/summary-card.vue @@ -41,7 +41,7 @@ const isTrending = computed(() => (props.stat?.trend ?? 0) > 0) - + @@ -54,10 +54,8 @@ const isTrending = computed(() => (props.stat?.trend ?? 0) > 0) {{ props.stat.metric.toLocaleString('id-ID') }}

- + {{ props.stat.trend.toFixed(1) }}% diff --git a/app/lib/page-permission.ts b/app/lib/page-permission.ts index 797dd077..3106506a 100644 --- a/app/lib/page-permission.ts +++ b/app/lib/page-permission.ts @@ -9,4 +9,12 @@ export const PAGE_PERMISSIONS = { billing: ['R'], management: ['R'], }, + '/satusehat': { + doctor: ['R'], + nurse: ['R'], + admisi: ['C', 'R', 'U', 'D'], + pharmacy: ['R'], + billing: ['R'], + management: ['R'], + }, } as const satisfies Record diff --git a/app/pages/(features)/satusehat/[id]/detail.vue b/app/pages/(features)/satusehat/[id]/detail.vue new file mode 100644 index 00000000..c1014755 --- /dev/null +++ b/app/pages/(features)/satusehat/[id]/detail.vue @@ -0,0 +1,9 @@ + + + diff --git a/app/pages/(features)/satusehat/[id]/edit.vue b/app/pages/(features)/satusehat/[id]/edit.vue new file mode 100644 index 00000000..351fe46e --- /dev/null +++ b/app/pages/(features)/satusehat/[id]/edit.vue @@ -0,0 +1,9 @@ + + + diff --git a/app/pages/(features)/satusehat/add.vue b/app/pages/(features)/satusehat/add.vue new file mode 100644 index 00000000..d1fee557 --- /dev/null +++ b/app/pages/(features)/satusehat/add.vue @@ -0,0 +1,40 @@ + + + diff --git a/app/pages/(features)/satusehat/index.vue b/app/pages/(features)/satusehat/index.vue new file mode 100644 index 00000000..2c7bb9f5 --- /dev/null +++ b/app/pages/(features)/satusehat/index.vue @@ -0,0 +1,39 @@ + + +