diff --git a/README.md b/README.md index 694ddf34..40601187 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,20 @@ RSSA - Front End - `app.vue`: Main layout - `components` : Contains all reusable UI components. -- `components/flow` : Entry point for business logic and workflows. Pages or routes call these flow components to handle API requests and process application logic -- `components/app` : View-layer components that manage and present data. These are used within `flow/` to render or handle specific parts of the UI, and return results back to the flow +- `components/content` : Entry point for business logic and workflows. Pages or routes call these content components to handle API requests and process application logic +- `components/app` : View-layer components that manage and present data. These are used within `content/` to render or handle specific parts of the UI, and return results back to the content - `components/pub` : Public/shared components used across different parts of the app. - `composables` : Contains reusable logic and utility functions (e.g. composables, hooks).. - `layouts` : Reusable UI layout patterns used across pages. +- `models` : Contains data definitions or interfaces. +- `schemas` : Contains JSON schemas used for validation. +- `services` : Contains reusable API calls and business logic. + ## Directory Structure for `app/pages` - `pages/auth` : Authentication related pages. -- `pages/(features)` : Grouped feature modules that reflect specific business flow or domains. +- `pages/(features)` : Grouped feature modules that reflect specific business content or domains. ## Directory Structure for `server/` @@ -50,16 +54,16 @@ The basic development workflow follows these steps: - Keep components pure, avoid making HTTP requests directly within them. - They receive data via props and emit events upward. -### Business Logic in `components/flow` +### Business Logic in `components/content` - This layer connects the UI with the logic (API calls, validations, navigation). -- It composes components from `components/app/`, `components/pub/`, and other flow. +- It composes components from `components/app/`, `components/pub/`, and other content. - Also responsible for managing state, side effects, and interactions. ### Create Pages in `pages/` - Define permissions and guards for each page. -- Pages load the appropriate flow from `components/flow/`. +- Pages load the appropriate content from `components/content/`. - They do not contain UI or logic directly, just route level layout or guards. ## Code Conventions diff --git a/app/components/app/item-price/entry-form.vue b/app/components/app/item-price/entry-form.vue new file mode 100644 index 00000000..e0c97dc8 --- /dev/null +++ b/app/components/app/item-price/entry-form.vue @@ -0,0 +1,50 @@ + + + diff --git a/app/components/app/item-price/list-cfg.ts b/app/components/app/item-price/list-cfg.ts new file mode 100644 index 00000000..e2c72f9c --- /dev/null +++ b/app/components/app/item-price/list-cfg.ts @@ -0,0 +1,46 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +const _doctorStatus = { + 0: 'Tidak Aktif', + 1: 'Aktif', +} + +export const cols: Col[] = [{}, {}, { width: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/item-price/list.vue b/app/components/app/item-price/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/item-price/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/item-price/picker.vue b/app/components/app/item-price/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item-price/search.vue b/app/components/app/item-price/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item-price/status-badge.vue b/app/components/app/item-price/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/item-price/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/app/item/entry-form.vue b/app/components/app/item/entry-form.vue new file mode 100644 index 00000000..8f6d3abf --- /dev/null +++ b/app/components/app/item/entry-form.vue @@ -0,0 +1,68 @@ + + + diff --git a/app/components/app/item/list-cfg.ts b/app/components/app/item/list-cfg.ts new file mode 100644 index 00000000..e2c72f9c --- /dev/null +++ b/app/components/app/item/list-cfg.ts @@ -0,0 +1,46 @@ +import type { + Col, + KeyLabel, + RecComponent, + RecStrFuncComponent, + RecStrFuncUnknown, + Th, +} from '~/components/pub/custom-ui/data/types' +import { defineAsyncComponent } from 'vue' + +const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue')) + +const _doctorStatus = { + 0: 'Tidak Aktif', + 1: 'Aktif', +} + +export const cols: Col[] = [{}, {}, { width: 50 }] + +export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]] + +export const keys = ['code', 'name', 'action'] + +export const delKeyNames: KeyLabel[] = [ + { key: 'code', label: 'Kode' }, + { key: 'name', label: 'Nama' }, +] + +export const funcParsed: RecStrFuncUnknown = {} + +export const funcComponent: RecStrFuncComponent = { + action(rec, idx) { + const res: RecComponent = { + idx, + rec: rec as object, + component: action, + } + return res + }, +} + +export const funcHtml: RecStrFuncUnknown = { + patient_address(_rec) { + return '-' + }, +} diff --git a/app/components/app/item/list.vue b/app/components/app/item/list.vue new file mode 100644 index 00000000..5b8778d9 --- /dev/null +++ b/app/components/app/item/list.vue @@ -0,0 +1,19 @@ + + + diff --git a/app/components/app/item/picker.vue b/app/components/app/item/picker.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item/search.vue b/app/components/app/item/search.vue new file mode 100644 index 00000000..e69de29b diff --git a/app/components/app/item/status-badge.vue b/app/components/app/item/status-badge.vue new file mode 100644 index 00000000..32cdfbca --- /dev/null +++ b/app/components/app/item/status-badge.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/flow/auth/login.vue b/app/components/content/auth/login.vue similarity index 100% rename from app/components/flow/auth/login.vue rename to app/components/content/auth/login.vue diff --git a/app/components/flow/dashboard/index.vue b/app/components/content/dashboard/index.vue similarity index 100% rename from app/components/flow/dashboard/index.vue rename to app/components/content/dashboard/index.vue diff --git a/app/components/flow/medicine-group/list.vue b/app/components/content/item-price/list.vue similarity index 100% rename from app/components/flow/medicine-group/list.vue rename to app/components/content/item-price/list.vue diff --git a/app/components/content/item/list.vue b/app/components/content/item/list.vue new file mode 100644 index 00000000..41c7311f --- /dev/null +++ b/app/components/content/item/list.vue @@ -0,0 +1,71 @@ + + + diff --git a/app/components/content/medicine-group/list.vue b/app/components/content/medicine-group/list.vue new file mode 100644 index 00000000..93afabff --- /dev/null +++ b/app/components/content/medicine-group/list.vue @@ -0,0 +1,75 @@ + + + diff --git a/app/components/flow/medicine-method/list.vue b/app/components/content/medicine-method/list.vue similarity index 100% rename from app/components/flow/medicine-method/list.vue rename to app/components/content/medicine-method/list.vue diff --git a/app/components/flow/medicine/entry.vue b/app/components/content/medicine/entry.vue similarity index 100% rename from app/components/flow/medicine/entry.vue rename to app/components/content/medicine/entry.vue diff --git a/app/components/flow/medicine/list.vue b/app/components/content/medicine/list.vue similarity index 100% rename from app/components/flow/medicine/list.vue rename to app/components/content/medicine/list.vue diff --git a/app/components/flow/patient/add.vue b/app/components/content/patient/add.vue similarity index 100% rename from app/components/flow/patient/add.vue rename to app/components/content/patient/add.vue diff --git a/app/components/flow/patient/list.vue b/app/components/content/patient/list.vue similarity index 100% rename from app/components/flow/patient/list.vue rename to app/components/content/patient/list.vue diff --git a/app/components/flow/rehab/registration/home.vue b/app/components/content/rehab/registration/home.vue similarity index 100% rename from app/components/flow/rehab/registration/home.vue rename to app/components/content/rehab/registration/home.vue diff --git a/app/components/flow/rehab/registration/sep-prosedur/add.vue b/app/components/content/rehab/registration/sep-prosedur/add.vue similarity index 100% rename from app/components/flow/rehab/registration/sep-prosedur/add.vue rename to app/components/content/rehab/registration/sep-prosedur/add.vue diff --git a/app/components/flow/rehab/registration/sep-prosedur/list.vue b/app/components/content/rehab/registration/sep-prosedur/list.vue similarity index 100% rename from app/components/flow/rehab/registration/sep-prosedur/list.vue rename to app/components/content/rehab/registration/sep-prosedur/list.vue diff --git a/app/components/flow/satusehat/const.ts b/app/components/content/satusehat/const.ts similarity index 100% rename from app/components/flow/satusehat/const.ts rename to app/components/content/satusehat/const.ts diff --git a/app/components/flow/satusehat/list.vue b/app/components/content/satusehat/list.vue similarity index 100% rename from app/components/flow/satusehat/list.vue rename to app/components/content/satusehat/list.vue diff --git a/app/components/flow/satusehat/schema.query.ts b/app/components/content/satusehat/schema.query.ts similarity index 100% rename from app/components/flow/satusehat/schema.query.ts rename to app/components/content/satusehat/schema.query.ts diff --git a/app/components/flow/user/entry.vue b/app/components/content/user/entry.vue similarity index 100% rename from app/components/flow/user/entry.vue rename to app/components/content/user/entry.vue diff --git a/app/components/flow/user/list.vue b/app/components/content/user/list.vue similarity index 100% rename from app/components/flow/user/list.vue rename to app/components/content/user/list.vue diff --git a/app/models/item-price.ts b/app/models/item-price.ts new file mode 100644 index 00000000..fb474109 --- /dev/null +++ b/app/models/item-price.ts @@ -0,0 +1,39 @@ +export interface ItemPrice { + id: string + item_id: number + price: number + insuranceCompany_code: string +} + +export interface CreateDto { + item_id: number + price: number + insuranceCompany_code: string +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + item_id: 1, + price: 1, + insuranceCompany_code: 'test', + } +} diff --git a/app/models/item.ts b/app/models/item.ts new file mode 100644 index 00000000..851ff11d --- /dev/null +++ b/app/models/item.ts @@ -0,0 +1,48 @@ +export interface Item { + id: string + name: string + code: string + itemGroup_code: string + uom_code: string + infra_id: number + stock: number +} + +export interface CreateDto { + name: string + code: string + itemGroup_code: string + uom_code: string + infra_id: number + stock: number +} + +export interface GetListDto { + page: number + size: number + name?: string + code?: string +} + +export interface GetDetailDto { + id?: string +} + +export interface UpdateDto extends CreateDto { + id?: number +} + +export interface DeleteDto { + id?: string +} + +export function genMedicine(): CreateDto { + return { + name: 'test', + code: 'test', + itemGroup_code: 'test', + uom_code: 'test', + infra_id: 1, + stock: 1, + } +} diff --git a/app/pages/(features)/doctor/add.vue b/app/pages/(features)/doctor/add.vue index 987baa28..c0a43c7f 100644 --- a/app/pages/(features)/doctor/add.vue +++ b/app/pages/(features)/doctor/add.vue @@ -35,7 +35,7 @@ const canCreate = hasCreateAccess(roleAccess) diff --git a/app/pages/(features)/doctor/index.vue b/app/pages/(features)/doctor/index.vue index e75a5b89..f0c8ddba 100644 --- a/app/pages/(features)/doctor/index.vue +++ b/app/pages/(features)/doctor/index.vue @@ -33,7 +33,7 @@ const canRead = hasReadAccess(roleAccess)