From d829290016800abd3a23fd254e271e7b1095da9a Mon Sep 17 00:00:00 2001 From: Donald Kibet Date: Tue, 28 Nov 2023 11:02:28 +0300 Subject: [PATCH] (feat) Billing App (#62) --- packages/esm-billing-app/README.md | 5 ++ packages/esm-billing-app/package.json | 53 +++++++++++++++++++ packages/esm-billing-app/src/config-schema.ts | 5 ++ .../esm-billing-app/src/dashboard.meta.ts | 1 + .../esm-billing-app/src/declarations.d.tsx | 2 + packages/esm-billing-app/src/index.ts | 12 +++++ packages/esm-billing-app/src/routes.json | 10 ++++ packages/esm-billing-app/translations/en.json | 1 + packages/esm-billing-app/tsconfig.json | 5 ++ packages/esm-billing-app/webpack.config.js | 1 + yarn.lock | 19 +++++++ 11 files changed, 114 insertions(+) create mode 100644 packages/esm-billing-app/README.md create mode 100644 packages/esm-billing-app/package.json create mode 100644 packages/esm-billing-app/src/config-schema.ts create mode 100644 packages/esm-billing-app/src/dashboard.meta.ts create mode 100644 packages/esm-billing-app/src/declarations.d.tsx create mode 100644 packages/esm-billing-app/src/index.ts create mode 100644 packages/esm-billing-app/src/routes.json create mode 100644 packages/esm-billing-app/translations/en.json create mode 100644 packages/esm-billing-app/tsconfig.json create mode 100644 packages/esm-billing-app/webpack.config.js diff --git a/packages/esm-billing-app/README.md b/packages/esm-billing-app/README.md new file mode 100644 index 000000000..6fcc859e4 --- /dev/null +++ b/packages/esm-billing-app/README.md @@ -0,0 +1,5 @@ +![Node.js CI](https://github.com/palladiumkenya/kenyaemr-esm-3.x/workflows/Node.js%20CI/badge.svg) + +# ESM Billing App + + diff --git a/packages/esm-billing-app/package.json b/packages/esm-billing-app/package.json new file mode 100644 index 000000000..24f0b26eb --- /dev/null +++ b/packages/esm-billing-app/package.json @@ -0,0 +1,53 @@ +{ + "name": "@kenyaemr/esm-billing-app", + "version": "5.1.0", + "description": "Billing app for KenyaEMR", + "browser": "dist/kenyaemr-esm-billing-app.js", + "main": "src/index.ts", + "source": true, + "license": "MPL-2.0", + "homepage": "https://github.com/palladiumkenya/kenyaemr-esm-core#readme", + "scripts": { + "start": "openmrs develop", + "serve": "webpack serve --mode=development", + "debug": "npm run serve", + "build": "webpack --mode production", + "analyze": "webpack --mode=production --env.analyze=true", + "lint": "eslint src --ext ts,tsx", + "typescript": "tsc", + "extract-translations": "i18next 'src/**/*.component.tsx'" + }, + "browserslist": [ + "extends browserslist-config-openmrs" + ], + "keywords": [ + "openmrs" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/palladiumkenya/kenyaemr-esm-core#readme" + }, + "bugs": { + "url": "https://github.com/palladiumkenya/kenyaemr-esm-core/issues" + }, + "dependencies": { + "@carbon/react": "^1.12.0", + "lodash-es": "^4.17.15", + "react-to-print": "^2.14.13" + }, + "peerDependencies": { + "@openmrs/esm-framework": "5.x", + "@openmrs/esm-patient-common-lib": "5.x", + "react": "^18.1.0", + "react-i18next": "11.x", + "react-router-dom": "6.x", + "swr": "2.x" + }, + "devDependencies": { + "@openmrs/esm-patient-common-lib": "next", + "webpack": "^5.74.0" + } +} diff --git a/packages/esm-billing-app/src/config-schema.ts b/packages/esm-billing-app/src/config-schema.ts new file mode 100644 index 000000000..a459b3f76 --- /dev/null +++ b/packages/esm-billing-app/src/config-schema.ts @@ -0,0 +1,5 @@ +import { Type } from '@openmrs/esm-framework'; + +export interface BillingConfig {} + +export const configSchema = {}; diff --git a/packages/esm-billing-app/src/dashboard.meta.ts b/packages/esm-billing-app/src/dashboard.meta.ts new file mode 100644 index 000000000..d02159bad --- /dev/null +++ b/packages/esm-billing-app/src/dashboard.meta.ts @@ -0,0 +1 @@ +export const dashboardMeta = {}; diff --git a/packages/esm-billing-app/src/declarations.d.tsx b/packages/esm-billing-app/src/declarations.d.tsx new file mode 100644 index 000000000..875203d56 --- /dev/null +++ b/packages/esm-billing-app/src/declarations.d.tsx @@ -0,0 +1,2 @@ +declare module '*.css'; +declare module '*.scss'; diff --git a/packages/esm-billing-app/src/index.ts b/packages/esm-billing-app/src/index.ts new file mode 100644 index 000000000..fecb22333 --- /dev/null +++ b/packages/esm-billing-app/src/index.ts @@ -0,0 +1,12 @@ +import { getAsyncLifecycle, defineConfigSchema, registerBreadcrumbs, getSyncLifecycle } from '@openmrs/esm-framework'; +import { configSchema } from './config-schema'; +import { dashboardMeta } from './dashboard.meta'; +import { createDashboardLink, registerWorkspace } from '@openmrs/esm-patient-common-lib'; + +const moduleName = '@kenyaemr/esm-billing-app'; +export const importTranslation = require.context('../translations', false, /.json$/, 'lazy'); + +export function startupApp() { + registerBreadcrumbs([]); + defineConfigSchema(moduleName, configSchema); +} diff --git a/packages/esm-billing-app/src/routes.json b/packages/esm-billing-app/src/routes.json new file mode 100644 index 000000000..42160d189 --- /dev/null +++ b/packages/esm-billing-app/src/routes.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json.openmrs.org/routes.schema.json", + "backendDependencies": { + "kenyaemr": "^18.2.0" + }, + "pages": [], + "extensions": [ + + ] +} \ No newline at end of file diff --git a/packages/esm-billing-app/translations/en.json b/packages/esm-billing-app/translations/en.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/packages/esm-billing-app/translations/en.json @@ -0,0 +1 @@ +{} diff --git a/packages/esm-billing-app/tsconfig.json b/packages/esm-billing-app/tsconfig.json new file mode 100644 index 000000000..72a7d91be --- /dev/null +++ b/packages/esm-billing-app/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src/**/*"], + "exclude": ["src/**/*.test.tsx", "src/**/*.outdated.tsx"] +} diff --git a/packages/esm-billing-app/webpack.config.js b/packages/esm-billing-app/webpack.config.js new file mode 100644 index 000000000..2c74029c8 --- /dev/null +++ b/packages/esm-billing-app/webpack.config.js @@ -0,0 +1 @@ +module.exports = require('openmrs/default-webpack-config'); diff --git a/yarn.lock b/yarn.lock index d395fc927..5507a7dd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2944,6 +2944,25 @@ __metadata: languageName: unknown linkType: soft +"@kenyaemr/esm-billing-app@workspace:packages/esm-billing-app": + version: 0.0.0-use.local + resolution: "@kenyaemr/esm-billing-app@workspace:packages/esm-billing-app" + dependencies: + "@carbon/react": "npm:^1.12.0" + "@openmrs/esm-patient-common-lib": "npm:next" + lodash-es: "npm:^4.17.15" + react-to-print: "npm:^2.14.13" + webpack: "npm:^5.74.0" + peerDependencies: + "@openmrs/esm-framework": 5.x + "@openmrs/esm-patient-common-lib": 5.x + react: ^18.1.0 + react-i18next: 11.x + react-router-dom: 6.x + swr: 2.x + languageName: unknown + linkType: soft + "@kenyaemr/esm-care-panel-app@workspace:packages/esm-care-panel-app": version: 0.0.0-use.local resolution: "@kenyaemr/esm-care-panel-app@workspace:packages/esm-care-panel-app"