@medipass/utils 11.70.0 → 11.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc.cjs +3 -0
- package/CHANGELOG.md +11 -0
- package/{billable-items-01050ba2.js → billable-items-f8291b1e.js} +0 -0
- package/build-validation-schema.js +14 -1
- package/{businesses-e3a20604.js → businesses-2633ab9b.js} +0 -0
- package/chart.js +2 -0
- package/{forms-f06ca97e.js → forms-e1c51a53.js} +0 -0
- package/get-select-options.js +1 -0
- package/google-addresses.js +17 -7
- package/{health-fund-accounts-3cd8650f.js → health-fund-accounts-88eac93c.js} +0 -0
- package/{health-fund-settings-43327826.js → health-fund-settings-e7a0f2ec.js} +0 -0
- package/{health-funds-300facef.js → health-funds-7fea63a0.js} +0 -0
- package/intercom.js +7 -2
- package/lib/__tests__/get-env.test.d.ts +1 -0
- package/lib/__tests__/get-staff-type-display-name.test.d.ts +1 -0
- package/lib/__tests__/redux-actions.test.d.ts +1 -0
- package/lib/__tests__/redux-reducer.test.d.ts +1 -0
- package/lib/__tests__/validate.test.d.ts +1 -0
- package/lib/build-validation-schema.d.ts +149 -0
- package/lib/chart.d.ts +9 -0
- package/lib/claim-payment-status-formatted.d.ts +6 -0
- package/lib/claim-payment-status-icons.d.ts +4 -0
- package/lib/claim-payment-status-text-classes.d.ts +4 -0
- package/lib/constants.d.ts +325 -0
- package/lib/countries.d.ts +10 -0
- package/lib/datetime.d.ts +2 -0
- package/lib/document-types-formatted.d.ts +9 -0
- package/lib/document-types-icons.d.ts +4 -0
- package/lib/document-types-text-classes.d.ts +4 -0
- package/lib/documents/workflow-state-formatted-text-classes.d.ts +6 -0
- package/lib/documents/workflow-state-formatted.d.ts +6 -0
- package/lib/documents/workflow-state-icons.d.ts +5 -0
- package/lib/form-applications/assign-values-to-sections.d.ts +5 -0
- package/lib/funders.d.ts +20 -0
- package/lib/get-env.d.ts +22 -0
- package/lib/get-select-options.d.ts +9 -0
- package/lib/get-staff-type-display-name.d.ts +2 -0
- package/lib/google-addresses.d.ts +3 -0
- package/lib/i18n/index.d.ts +8 -0
- package/lib/i18n/translations.d.ts +28 -0
- package/lib/index.d.ts +47 -0
- package/lib/intercom.d.ts +16 -0
- package/lib/normalise-abn.d.ts +2 -0
- package/lib/parse-health-fund-card-fields.d.ts +2 -0
- package/lib/payment-options.d.ts +13 -0
- package/lib/products.d.ts +4 -0
- package/lib/redux-actions.d.ts +35 -0
- package/lib/redux-reducer.d.ts +24 -0
- package/lib/sanitise-url.d.ts +4 -0
- package/lib/scroll.d.ts +2 -0
- package/lib/sensitive-keys.d.ts +3 -0
- package/lib/sentry.d.ts +15 -0
- package/lib/service-items.d.ts +37 -0
- package/lib/status-icons.d.ts +4 -0
- package/lib/status-text-classes.d.ts +4 -0
- package/lib/test-framework/fixtures/accounts.d.ts +28 -0
- package/lib/test-framework/fixtures/billable-items.d.ts +17 -0
- package/lib/test-framework/fixtures/businesses.d.ts +43 -0
- package/lib/test-framework/fixtures/documents.d.ts +113 -0
- package/lib/test-framework/fixtures/form-application-templates.d.ts +66 -0
- package/lib/test-framework/fixtures/form-applications.d.ts +30 -0
- package/lib/test-framework/fixtures/forms.d.ts +41 -0
- package/lib/test-framework/fixtures/health-fund-accounts.d.ts +10 -0
- package/lib/test-framework/fixtures/health-fund-settings.d.ts +12 -0
- package/lib/test-framework/fixtures/health-funds.d.ts +90 -0
- package/lib/test-framework/fixtures/index.d.ts +39 -0
- package/lib/test-framework/fixtures/members.d.ts +43 -0
- package/lib/test-framework/fixtures/message-mappings.d.ts +19 -0
- package/lib/test-framework/fixtures/modalities.d.ts +9 -0
- package/lib/test-framework/fixtures/patients.d.ts +36 -0
- package/lib/test-framework/fixtures/payment-methods.d.ts +16 -0
- package/lib/test-framework/fixtures/practices.d.ts +105 -0
- package/lib/test-framework/fixtures/products.d.ts +46 -0
- package/lib/test-framework/fixtures/professional-categories.d.ts +9 -0
- package/lib/test-framework/fixtures/services.d.ts +93 -0
- package/lib/test-framework/fixtures/specialties.d.ts +10 -0
- package/lib/test-framework/fixtures/staff.d.ts +139 -0
- package/lib/test-framework/fixtures/subscriptions.d.ts +142 -0
- package/lib/test-framework/fixtures/transaction-reports.d.ts +156 -0
- package/lib/test-framework/fixtures/transactions.d.ts +1832 -0
- package/lib/test-framework/fixtures/workflow-exceptions.d.ts +25 -0
- package/lib/test-framework/react.d.ts +8 -0
- package/lib/transaction-details-by-funder.d.ts +33 -0
- package/lib/transaction-status-formatted.d.ts +9 -0
- package/lib/transaction-status-helpers.d.ts +20 -0
- package/lib/transaction-status-icons.d.ts +4 -0
- package/lib/transaction-status-text-classes.d.ts +4 -0
- package/lib/transaction-status.d.ts +1 -0
- package/lib/validate-form.d.ts +45 -0
- package/lib/validate.d.ts +15 -0
- package/lib/webpack-config.d.ts +4 -0
- package/lib/workflow-state-formatted-text-classes.d.ts +5 -0
- package/lib/workflow-state-formatted.d.ts +4 -0
- package/{members-cb4f73a9.js → members-8eb8d8d0.js} +0 -0
- package/{modalities-b360d521.js → modalities-2dfbea63.js} +0 -0
- package/package.json +9 -6
- package/{patients-2083dd9c.js → patients-dd3709c1.js} +0 -0
- package/{payment-methods-4fa2d01f.js → payment-methods-d36bc018.js} +0 -0
- package/{practices-3e703f22.js → practices-d6c480f1.js} +0 -0
- package/{products-bd313cb4.js → products-0a392564.js} +0 -0
- package/{professional-categories-e2e5284b.js → professional-categories-157d1767.js} +0 -0
- package/redux-actions.js +13 -3
- package/redux-reducer.js +1 -0
- package/sentry.js +3 -1
- package/service-items.js +5 -34
- package/{services-2e25cdac.js → services-f8480eba.js} +0 -0
- package/{specialties-7640b7e3.js → specialties-25fbb171.js} +0 -0
- package/{staff-990794cd.js → staff-646053b7.js} +0 -0
- package/{subscriptions-45c1321a.js → subscriptions-aef302aa.js} +0 -0
- package/test-framework/fixtures/billable-items.js +1 -1
- package/test-framework/fixtures/businesses.js +1 -1
- package/test-framework/fixtures/forms.js +1 -1
- package/test-framework/fixtures/health-fund-accounts.js +1 -1
- package/test-framework/fixtures/health-fund-settings.js +1 -1
- package/test-framework/fixtures/health-funds.js +1 -1
- package/test-framework/fixtures/index.js +18 -18
- package/test-framework/fixtures/members.js +1 -1
- package/test-framework/fixtures/modalities.js +1 -1
- package/test-framework/fixtures/patients.js +1 -1
- package/test-framework/fixtures/payment-methods.js +1 -1
- package/test-framework/fixtures/practices.js +1 -1
- package/test-framework/fixtures/products.js +1 -1
- package/test-framework/fixtures/professional-categories.js +1 -1
- package/test-framework/fixtures/services.js +1 -1
- package/test-framework/fixtures/specialties.js +1 -1
- package/test-framework/fixtures/staff.js +1 -1
- package/test-framework/fixtures/subscriptions.js +1 -1
- package/test-framework/fixtures/transactions.js +1 -1
- package/transaction-details-by-funder.js +1 -0
- package/transaction-status.js +2 -2
- package/{transactions-6e5fd92d.js → transactions-4a08e450.js} +0 -0
- package/tsconfig.json +32 -0
- package/validate-form.js +3 -3
- package/.eslintrc +0 -3
- package/blah.js +0 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const defaultWorkflowException: {
|
|
2
|
+
_id: string;
|
|
3
|
+
funderId: string;
|
|
4
|
+
healthFundId: string;
|
|
5
|
+
code: string;
|
|
6
|
+
fullName: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
description: string;
|
|
9
|
+
searchWords: string[];
|
|
10
|
+
created: Date;
|
|
11
|
+
modified: Date;
|
|
12
|
+
};
|
|
13
|
+
export declare const anotherWorkflowException: {
|
|
14
|
+
_id: string;
|
|
15
|
+
funderId: string;
|
|
16
|
+
healthFundId: string;
|
|
17
|
+
code: string;
|
|
18
|
+
fullName: string;
|
|
19
|
+
displayName: string;
|
|
20
|
+
description: string;
|
|
21
|
+
searchWords: string[];
|
|
22
|
+
omittableCodes: string[];
|
|
23
|
+
created: Date;
|
|
24
|
+
modified: Date;
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const setupTestEnvironment: () => void;
|
|
2
|
+
export declare const setupComponent: (component: any, initialProps: any, initialState: any) => {
|
|
3
|
+
wrapper: any;
|
|
4
|
+
wrapperInstance: any;
|
|
5
|
+
wrapperJSON: import("enzyme-to-json").Json;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: {};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const INVOICE_SECTION: Readonly<{
|
|
2
|
+
BANK_DETAILS: "BankDetails";
|
|
3
|
+
BILLED_TO: "BilledTo";
|
|
4
|
+
BOTTOM_ACTION: "BottomAction";
|
|
5
|
+
CLAIMANT: "Patient";
|
|
6
|
+
DOCUMENTS: "Documents";
|
|
7
|
+
INSTALMENT_PLAN_SCHEDULE: "InstalmentPlanSchedule";
|
|
8
|
+
INVOICE_OVERVIEW: "InvoiceOverview";
|
|
9
|
+
MESSAGES: "Messages";
|
|
10
|
+
NOTES: "Notes";
|
|
11
|
+
PATIENT: "Patient";
|
|
12
|
+
PAYEE_PROVIDER: "PayeeProvider";
|
|
13
|
+
PAYMENTS: "Payments";
|
|
14
|
+
PRACTICE: "Practice";
|
|
15
|
+
PROVIDER: "Provider";
|
|
16
|
+
REFERRAL: "Referral";
|
|
17
|
+
SERVICE_ITEMS: "ServiceItems";
|
|
18
|
+
SERVICE_TOTALS: "ServiceTotals";
|
|
19
|
+
STATEMENT: "Statement";
|
|
20
|
+
SETTLEMENT_BANK_DETAILS: "SettlementBankDetails";
|
|
21
|
+
TOP_ACTION: "TopAction";
|
|
22
|
+
TRANSACTION_PAYMENT_CARD_FORM: "TransactionPaymentCardForm";
|
|
23
|
+
TRANSACTION_REPORTS_BUTTONS: "TransactionReportsButtons";
|
|
24
|
+
WSQ_TRANSACTION_DETAILS_MESSAGE: "TransactionDetailsMessage";
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns whether the funder with the provided `funderCode` has a transaction details section
|
|
28
|
+
* enabled. `section` must be one of the supported `INVOICE_SECTION` sections.
|
|
29
|
+
*
|
|
30
|
+
* Default to section support if no funder code is provided, to allow patient claims to be
|
|
31
|
+
* supported for all sections.
|
|
32
|
+
*/
|
|
33
|
+
export declare const isFunderSectionSupported: (funderCode?: string, section: string) => boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const getPaymentStatus: ({ paymentStatus, transactionStatus, hasNoGap, paidInPerson }: {
|
|
2
|
+
paymentStatus: any;
|
|
3
|
+
transactionStatus: any;
|
|
4
|
+
hasNoGap: any;
|
|
5
|
+
paidInPerson: any;
|
|
6
|
+
}) => string;
|
|
7
|
+
export declare const getPaymentTextClass: ({ paymentStatus, transactionStatus, hasNoGap, paidInPerson }: {
|
|
8
|
+
paymentStatus: any;
|
|
9
|
+
transactionStatus: any;
|
|
10
|
+
hasNoGap: any;
|
|
11
|
+
paidInPerson: any;
|
|
12
|
+
}) => string;
|
|
13
|
+
export declare const getPaymentIcon: ({ paymentStatus, transactionStatus, hasNoGap, paidInPerson }: {
|
|
14
|
+
paymentStatus: any;
|
|
15
|
+
transactionStatus: any;
|
|
16
|
+
hasNoGap: any;
|
|
17
|
+
paidInPerson: any;
|
|
18
|
+
}) => string;
|
|
19
|
+
declare const _default: {};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getOverrideStatus(transaction: any, defaultStatus: any): any;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const isRequired: (value: any) => string;
|
|
2
|
+
export declare const isNumber: (value: any) => string;
|
|
3
|
+
export declare const isEqualTo: (target: any, message?: string) => (value: any) => string;
|
|
4
|
+
export declare const isSameValueAsField: (targetField: any, message?: string) => (value: any, values: any) => string;
|
|
5
|
+
export declare const isLengthEqualTo: (length: any, message?: string) => (value: any) => string;
|
|
6
|
+
export declare const isLengthGreaterThanOrEqualTo: (length: any) => (value: any) => string;
|
|
7
|
+
export declare const isLengthLessThanOrEqualTo: (length: any) => (value: any) => string;
|
|
8
|
+
export declare const isLengthWithSpacesLessThanOrEqualTo: (length: any) => (value: any) => string;
|
|
9
|
+
export declare const isLengthWithSpacesGreaterThanOrEqualTo: (length: any) => (value: any) => string;
|
|
10
|
+
export declare const isGreaterThanOrEqualTo: (length: any) => (value: any) => string;
|
|
11
|
+
export declare const isGreaterThan: (length: any) => (value: any) => string;
|
|
12
|
+
export declare const isLessThanOrEqualTo: (length: any) => (value: any) => string;
|
|
13
|
+
export declare const hasUppercaseLetter: (value: any) => string;
|
|
14
|
+
export declare const hasNumber: (value: any) => string;
|
|
15
|
+
export declare const isValidBankAccountName: (value: any) => string;
|
|
16
|
+
export declare const hasSpecialChar: (value: any) => string;
|
|
17
|
+
export declare const isValidEmailAsync: (value: any) => Promise<string>;
|
|
18
|
+
export declare const isValidEmail: (value: any) => string;
|
|
19
|
+
export declare const isValidMobile: (value: any) => string;
|
|
20
|
+
export declare const isValidDatePatterns: ({ day, month, year }: {
|
|
21
|
+
day: any;
|
|
22
|
+
month: any;
|
|
23
|
+
year: any;
|
|
24
|
+
}) => (value: any) => any;
|
|
25
|
+
export declare const isValidDate: (value: any) => string;
|
|
26
|
+
export declare const isValidUrlAsync: (value: any) => Promise<string>;
|
|
27
|
+
export declare const isYearInRange: ({ index, isShortYearFormat, lessThanCurrentYear }: {
|
|
28
|
+
index: any;
|
|
29
|
+
isShortYearFormat: any;
|
|
30
|
+
lessThanCurrentYear: any;
|
|
31
|
+
}) => (value?: string) => string;
|
|
32
|
+
export declare const isValidDOB: (value: any) => string;
|
|
33
|
+
export declare const matchesRegex: (pattern: any, message: any) => (value: any) => any;
|
|
34
|
+
export declare const isFutureDate: (value: any) => string;
|
|
35
|
+
export declare const isMoreThanThreeYears: (value: any) => string;
|
|
36
|
+
export declare const hasInvalidCharacters: (value: any) => string;
|
|
37
|
+
export declare const hasStrictInvalidCharacters: (value: any) => string;
|
|
38
|
+
export declare const hasDoubleSpaces: (value: any) => string;
|
|
39
|
+
export declare const hasWhitespaceAtStartOrEnd: (value: any) => string;
|
|
40
|
+
export declare const hasSpaceAfterHyphen: (value: any) => string;
|
|
41
|
+
export declare const hasSpaceBeforeHyphen: (value: any) => string;
|
|
42
|
+
export declare const hasSpaceAfterApostrophe: (value: any) => string;
|
|
43
|
+
export declare const hasSpaceBeforeApostrophe: (value: any) => string;
|
|
44
|
+
declare const combineValidators: (...fns: any[]) => (value: any) => any;
|
|
45
|
+
export default combineValidators;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import 'core-js/es6/promise';
|
|
2
|
+
import 'core-js/es6/set';
|
|
3
|
+
export declare const isNotEmpty: (value: any) => Promise<boolean>;
|
|
4
|
+
export declare const isEmail: (email: any) => Promise<boolean>;
|
|
5
|
+
export declare const isNumber: (number: any) => Promise<boolean>;
|
|
6
|
+
export declare const isStringLength: (length: any, value: any) => Promise<boolean>;
|
|
7
|
+
export declare const isUrl: (value: any) => Promise<boolean>;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
isEmail: (email: any) => Promise<boolean>;
|
|
10
|
+
isNotEmpty: (value: any) => Promise<boolean>;
|
|
11
|
+
isNumber: (number: any) => Promise<boolean>;
|
|
12
|
+
isStringLength: (length: any, value: any) => Promise<boolean>;
|
|
13
|
+
isUrl: (value: any) => Promise<boolean>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medipass/utils",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.71.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"build": "BABEL_RUNTIME=true node ../../scripts/build.js",
|
|
9
9
|
"clean": "node ../../scripts/clean.js",
|
|
10
10
|
"develop": "BABEL_RUNTIME=true node ../../scripts/build.js --watch",
|
|
11
|
-
"lint": "eslint
|
|
12
|
-
"lint:fix": "eslint
|
|
11
|
+
"lint": "eslint \"**/*.{ts,tsx}\"",
|
|
12
|
+
"lint:fix": "eslint \"**/*.{ts,tsx}\" --fix",
|
|
13
13
|
"prepare": "yarn build",
|
|
14
14
|
"postpublish": "yarn clean",
|
|
15
15
|
"test": "yarn lint && jest",
|
|
16
|
-
"test-ci": "yarn lint && jest --silent"
|
|
16
|
+
"test-ci": "yarn lint && jest --silent",
|
|
17
|
+
"check-types": "tsc --noEmit --project tsconfig.json"
|
|
17
18
|
},
|
|
18
19
|
"author": "Jake Moxey",
|
|
19
20
|
"peerDependencies": {
|
|
@@ -44,9 +45,11 @@
|
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@babel/plugin-transform-runtime": "7.8.3",
|
|
48
|
+
"@types/jest": "29.1.2",
|
|
47
49
|
"redux-mock-store": "^1.3.0",
|
|
48
50
|
"redux-thunk": "^2.2.0",
|
|
49
|
-
"rimraf": "^2.6.2"
|
|
51
|
+
"rimraf": "^2.6.2",
|
|
52
|
+
"typescript": "4.8.4"
|
|
50
53
|
},
|
|
51
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "c0b96948bea84482e689ab5353934eca2491d4a9"
|
|
52
55
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/redux-actions.js
CHANGED
|
@@ -91,7 +91,9 @@ var sdkActionCreator = function sdkActionCreator(sdkAction, actions, funcs) {
|
|
|
91
91
|
while (1) {
|
|
92
92
|
switch (_context.prev = _context.next) {
|
|
93
93
|
case 0:
|
|
94
|
+
// @ts-expect-error TS(2339): Property 'request' does not exist on type '{}'.
|
|
94
95
|
if (actions.request) {
|
|
96
|
+
// @ts-expect-error TS(2339): Property 'request' does not exist on type '{}'.
|
|
95
97
|
dispatch(actions.request());
|
|
96
98
|
}
|
|
97
99
|
|
|
@@ -102,11 +104,15 @@ var sdkActionCreator = function sdkActionCreator(sdkAction, actions, funcs) {
|
|
|
102
104
|
case 4:
|
|
103
105
|
data = _context.sent;
|
|
104
106
|
|
|
107
|
+
// @ts-expect-error TS(2339): Property 'success' does not exist on type '{}'.
|
|
105
108
|
if (actions.success) {
|
|
109
|
+
// @ts-expect-error TS(2339): Property 'success' does not exist on type '{}'.
|
|
106
110
|
dispatch(actions.success(data));
|
|
107
|
-
}
|
|
111
|
+
} // @ts-expect-error TS(2339): Property 'success' does not exist on type '{}'.
|
|
112
|
+
|
|
108
113
|
|
|
109
114
|
if (funcs.success) {
|
|
115
|
+
// @ts-expect-error TS(2339): Property 'success' does not exist on type '{}'.
|
|
110
116
|
funcs.success(data);
|
|
111
117
|
}
|
|
112
118
|
|
|
@@ -119,13 +125,17 @@ var sdkActionCreator = function sdkActionCreator(sdkAction, actions, funcs) {
|
|
|
119
125
|
|
|
120
126
|
if (errorData.statusCode === 403 && !errorData.message) {
|
|
121
127
|
errorData.message = 'You are forbidden to view this resource.';
|
|
122
|
-
}
|
|
128
|
+
} // @ts-expect-error TS(2339): Property 'failure' does not exist on type '{}'.
|
|
129
|
+
|
|
123
130
|
|
|
124
131
|
if (actions.failure) {
|
|
132
|
+
// @ts-expect-error TS(2339): Property 'failure' does not exist on type '{}'.
|
|
125
133
|
dispatch(actions.failure(errorData));
|
|
126
|
-
}
|
|
134
|
+
} // @ts-expect-error TS(2339): Property 'failure' does not exist on type '{}'.
|
|
135
|
+
|
|
127
136
|
|
|
128
137
|
if (funcs.failure) {
|
|
138
|
+
// @ts-expect-error TS(2339): Property 'failure' does not exist on type '{}'.
|
|
129
139
|
funcs.failure(errorData);
|
|
130
140
|
}
|
|
131
141
|
|
package/redux-reducer.js
CHANGED
|
@@ -83,6 +83,7 @@ var getRootReducer = function getRootReducer(appReducer, _temp5) {
|
|
|
83
83
|
var newState = _objectSpread({}, state);
|
|
84
84
|
|
|
85
85
|
if (action.type === reduxActions.CLEAR_ALL_STATE) {
|
|
86
|
+
// @ts-expect-error TS(2769): No overload matches this call.
|
|
86
87
|
newState = _objectSpread({}, _pick(state, persistKeys));
|
|
87
88
|
}
|
|
88
89
|
|
package/sentry.js
CHANGED
|
@@ -24,7 +24,8 @@ var STATUS_CODES = {
|
|
|
24
24
|
|
|
25
25
|
var _ignore = function _ignore(error) {
|
|
26
26
|
return process.env.NODE_ENV === 'test' || error.message === ERROR_MESSAGES.NETWORK_ERROR || _get(error, 'data.statusCode') === STATUS_CODES.UNAUTHORIZED || _get(error, 'data.statusCode') >= STATUS_CODES.SERVER_ERROR || _get(error, 'data.errorCode') === ERROR_CODES.INVALID_AUTHENTICATION;
|
|
27
|
-
};
|
|
27
|
+
}; // @ts-expect-error TS(2554): Expected 1 arguments, but got 0.
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
var clearUserContext = function clearUserContext() {
|
|
30
31
|
return Sentry.setUser();
|
|
@@ -49,6 +50,7 @@ var logError = function logError(_error, _temp) {
|
|
|
49
50
|
if (error instanceof Error) {
|
|
50
51
|
var _error2, _error2$config;
|
|
51
52
|
|
|
53
|
+
// @ts-expect-error TS(2339): Property 'config' does not exist on type 'Error'.
|
|
52
54
|
var errorHeaders = (_error2 = error) == null ? void 0 : (_error2$config = _error2.config) == null ? void 0 : _error2$config.headers;
|
|
53
55
|
var maskedErrorHeaders = masked(errorHeaders, ['Authorization']);
|
|
54
56
|
error = _set(error, 'config.headers', maskedErrorHeaders);
|
package/service-items.js
CHANGED
|
@@ -4,11 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
|
-
require('./constants.js');
|
|
8
7
|
var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
|
|
9
8
|
var _get = _interopDefault(require('lodash/get'));
|
|
10
9
|
var _isEmpty = _interopDefault(require('lodash/isEmpty'));
|
|
11
|
-
var funders = require('./funders.js');
|
|
12
10
|
|
|
13
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
12
|
|
|
@@ -27,17 +25,7 @@ var calculateTotalAmount = function calculateTotalAmount(serviceItems, opts) {
|
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
var total = serviceItems.reduce(function (total, item) {
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
if (funders.isIcare(_get(opts, 'funder.code')) && _get(item, 'unit') === 'minutes') {
|
|
33
|
-
includeQuantity = false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var prices = calculateAmounts({
|
|
37
|
-
isTaxable: Boolean(opts.includeGST && item.isTaxable),
|
|
38
|
-
initialGrossAmount: item != null && item.grossAmount ? parseFloat((item == null ? void 0 : item.grossAmount) || 0) : parseFloat((item == null ? void 0 : item.feeAmount) || 0),
|
|
39
|
-
quantity: includeQuantity ? item.quantity : 1
|
|
40
|
-
});
|
|
28
|
+
var prices = calculateAmounts(item != null && item.grossAmount ? parseFloat((item == null ? void 0 : item.grossAmount) || 0) : parseFloat((item == null ? void 0 : item.feeAmount) || 0), Boolean(opts.includeGST && item.isTaxable));
|
|
41
29
|
var itemTotal = undefined;
|
|
42
30
|
|
|
43
31
|
if (opts.isSubTotal) {
|
|
@@ -61,22 +49,9 @@ var calculateTotalDiscountAmount = function calculateTotalDiscountAmount(service
|
|
|
61
49
|
}, 0);
|
|
62
50
|
};
|
|
63
51
|
var calculateTotalGSTAmount = function calculateTotalGSTAmount(serviceItems, opts) {
|
|
64
|
-
if (opts === void 0) {
|
|
65
|
-
opts = {};
|
|
66
|
-
}
|
|
67
52
|
|
|
68
53
|
return serviceItems.reduce(function (total, item) {
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
if (funders.isIcare(_get(opts, 'funder.code')) && _get(item, 'unit') === 'minutes') {
|
|
72
|
-
includeQuantity = false;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
var prices = calculateAmounts({
|
|
76
|
-
isTaxable: item.isTaxable,
|
|
77
|
-
initialGrossAmount: parseFloat((item == null ? void 0 : item.grossAmount) || 0),
|
|
78
|
-
quantity: includeQuantity ? item.quantity : 1
|
|
79
|
-
});
|
|
54
|
+
var prices = calculateAmounts(parseFloat((item == null ? void 0 : item.grossAmount) || 0), item.isTaxable);
|
|
80
55
|
var gstAmount = prices == null ? void 0 : prices.taxAmount;
|
|
81
56
|
return total + gstAmount;
|
|
82
57
|
}, 0);
|
|
@@ -91,8 +66,7 @@ var applyDiscountToServiceItems = function applyDiscountToServiceItems(serviceIt
|
|
|
91
66
|
|
|
92
67
|
if (discountType === 'percentage') {
|
|
93
68
|
percentage = parseFloat(discount) / 100;
|
|
94
|
-
}
|
|
95
|
-
|
|
69
|
+
}
|
|
96
70
|
|
|
97
71
|
return serviceItems.map(function (serviceItem) {
|
|
98
72
|
return _objectSpread({}, serviceItem, {
|
|
@@ -192,11 +166,8 @@ function mapItemsToClaimItems(transaction) {
|
|
|
192
166
|
});
|
|
193
167
|
return newItems;
|
|
194
168
|
}
|
|
195
|
-
var calculateAmounts = function calculateAmounts(
|
|
196
|
-
var
|
|
197
|
-
initialGrossAmount = _ref3.initialGrossAmount;
|
|
198
|
-
var grossAmount = parseFloat(initialGrossAmount || 0);
|
|
199
|
-
var feeAmount = parseFloat(initialGrossAmount || 0);
|
|
169
|
+
var calculateAmounts = function calculateAmounts(grossAmount, isTaxable) {
|
|
170
|
+
var feeAmount = grossAmount;
|
|
200
171
|
var taxAmount = 0;
|
|
201
172
|
|
|
202
173
|
if (!isTaxable) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var transactions = require('../../transactions-
|
|
6
|
-
var subscriptions = require('../../subscriptions-
|
|
7
|
-
var staff = require('../../staff-
|
|
8
|
-
var specialties = require('../../specialties-
|
|
9
|
-
var services = require('../../services-
|
|
10
|
-
var professionalCategories = require('../../professional-categories-
|
|
11
|
-
var products = require('../../products-
|
|
12
|
-
var practices = require('../../practices-
|
|
13
|
-
var paymentMethods = require('../../payment-methods-
|
|
14
|
-
var patients = require('../../patients-
|
|
15
|
-
var modalities = require('../../modalities-
|
|
16
|
-
var members = require('../../members-
|
|
17
|
-
var billableItems = require('../../billable-items-
|
|
18
|
-
var businesses = require('../../businesses-
|
|
19
|
-
var forms = require('../../forms-
|
|
20
|
-
var healthFundAccounts = require('../../health-fund-accounts-
|
|
21
|
-
var healthFundSettings = require('../../health-fund-settings-
|
|
22
|
-
var healthFunds = require('../../health-funds-
|
|
5
|
+
var transactions = require('../../transactions-4a08e450.js');
|
|
6
|
+
var subscriptions = require('../../subscriptions-aef302aa.js');
|
|
7
|
+
var staff = require('../../staff-646053b7.js');
|
|
8
|
+
var specialties = require('../../specialties-25fbb171.js');
|
|
9
|
+
var services = require('../../services-f8480eba.js');
|
|
10
|
+
var professionalCategories = require('../../professional-categories-157d1767.js');
|
|
11
|
+
var products = require('../../products-0a392564.js');
|
|
12
|
+
var practices = require('../../practices-d6c480f1.js');
|
|
13
|
+
var paymentMethods = require('../../payment-methods-d36bc018.js');
|
|
14
|
+
var patients = require('../../patients-dd3709c1.js');
|
|
15
|
+
var modalities = require('../../modalities-2dfbea63.js');
|
|
16
|
+
var members = require('../../members-8eb8d8d0.js');
|
|
17
|
+
var billableItems = require('../../billable-items-f8291b1e.js');
|
|
18
|
+
var businesses = require('../../businesses-2633ab9b.js');
|
|
19
|
+
var forms = require('../../forms-e1c51a53.js');
|
|
20
|
+
var healthFundAccounts = require('../../health-fund-accounts-88eac93c.js');
|
|
21
|
+
var healthFundSettings = require('../../health-fund-settings-e7a0f2ec.js');
|
|
22
|
+
var healthFunds = require('../../health-funds-7fea63a0.js');
|
|
23
23
|
|
|
24
24
|
var index = {
|
|
25
25
|
billableItems: billableItems.billableItems,
|