@medipass/utils 11.73.2 → 11.73.3-chore-update-react-18.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/abn.js +40 -45
- package/{billable-items-f8291b1e.js → billable-items-5e559447.js} +1 -1
- package/build-validation-schema.js +81 -123
- package/{businesses-2633ab9b.js → businesses-94ec0280.js} +1 -1
- package/chart.js +7 -14
- package/claim-payment-status-formatted.js +5 -2
- package/claim-payment-status-icons.js +13 -2
- package/claim-payment-status-text-classes.js +14 -2
- package/constants.js +82 -69
- package/countries.js +6 -8
- package/datetime.js +6 -13
- package/document-types-formatted.js +8 -3
- package/document-types-icons.js +4 -2
- package/document-types-text-classes.js +5 -2
- package/documents/workflow-state-formatted-text-classes.js +13 -4
- package/documents/workflow-state-formatted.js +13 -4
- package/documents/workflow-state-icons.js +11 -2
- package/form-applications/assign-values-to-sections.js +10 -16
- package/{forms-e1c51a53.js → forms-646810f2.js} +1 -1
- package/funders.js +21 -56
- package/get-env.js +38 -75
- package/get-select-options.js +21 -40
- package/get-staff-type-display-name.js +2 -4
- package/google-addresses.js +46 -91
- package/{health-fund-accounts-88eac93c.js → health-fund-accounts-8eda8621.js} +1 -1
- package/{health-fund-settings-e7a0f2ec.js → health-fund-settings-6d803913.js} +1 -1
- package/{health-funds-7fea63a0.js → health-funds-5e838942.js} +2 -2
- package/i18n/index.js +15 -18
- package/i18n/translations.js +1 -1
- package/index.js +1 -3
- package/intercom.js +24 -69
- package/{members-8eb8d8d0.js → members-e1797829.js} +1 -1
- package/{modalities-2dfbea63.js → modalities-d9979fa4.js} +1 -1
- package/package.json +4 -4
- package/parse-health-fund-card-fields.js +4 -6
- package/{patients-dd3709c1.js → patients-aba388c0.js} +1 -1
- package/{payment-methods-d36bc018.js → payment-methods-4010f9e5.js} +1 -1
- package/payment-options.js +11 -33
- package/{practices-d6c480f1.js → practices-17c06e6c.js} +3 -3
- package/{products-0a392564.js → products-7054c705.js} +2 -2
- package/products.js +5 -12
- package/{professional-categories-157d1767.js → professional-categories-0927144e.js} +1 -1
- package/redux-actions.js +69 -108
- package/redux-reducer.js +53 -69
- package/sanitise-url.js +1 -1
- package/scroll.js +1 -3
- package/sensitive-keys.js +2 -2
- package/sentry.js +35 -59
- package/service-items.js +70 -111
- package/{services-f8480eba.js → services-a81b505c.js} +3 -3
- package/{specialties-25fbb171.js → specialties-c29f2f67.js} +1 -1
- package/{staff-646053b7.js → staff-fedb5a08.js} +4 -4
- package/status-icons.js +12 -2
- package/status-text-classes.js +12 -2
- package/{subscriptions-aef302aa.js → subscriptions-25d86dab.js} +5 -5
- package/test-framework/fixtures/accounts.js +1 -1
- package/test-framework/fixtures/billable-items.js +1 -1
- package/test-framework/fixtures/businesses.js +1 -1
- package/test-framework/fixtures/documents.js +3 -3
- package/test-framework/fixtures/form-application-templates.js +1 -1
- package/test-framework/fixtures/form-applications.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/message-mappings.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/transaction-reports.js +6 -6
- package/test-framework/fixtures/transactions.js +1 -1
- package/test-framework/fixtures/workflow-exceptions.js +2 -2
- package/test-framework/react.js +10 -12
- package/transaction-details-by-funder.js +20 -21
- package/transaction-status-formatted.js +13 -3
- package/transaction-status-helpers.js +21 -27
- package/transaction-status-icons.js +9 -2
- package/transaction-status-text-classes.js +16 -2
- package/transaction-status.js +7 -15
- package/{transactions-4a08e450.js → transactions-de63fd15.js} +14 -14
- package/validate-form.js +79 -269
- package/validate.js +16 -28
- package/webpack-config.js +6 -13
- package/workflow-state-formatted-text-classes.js +12 -4
- package/workflow-state-formatted.js +11 -2
|
@@ -9,64 +9,58 @@ var _capitalize = _interopDefault(require('lodash/capitalize'));
|
|
|
9
9
|
var claimPaymentStatusIcons = require('./claim-payment-status-icons.js');
|
|
10
10
|
var claimPaymentStatusTextClasses = require('./claim-payment-status-text-classes.js');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const getPaymentStatus = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
paymentStatus,
|
|
15
|
+
transactionStatus,
|
|
16
|
+
hasNoGap,
|
|
17
|
+
paidInPerson
|
|
18
|
+
} = _ref;
|
|
18
19
|
if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
|
|
19
20
|
return 'Voided';
|
|
20
21
|
}
|
|
21
|
-
|
|
22
22
|
if (hasNoGap) {
|
|
23
23
|
return 'Not needed';
|
|
24
24
|
}
|
|
25
|
-
|
|
26
25
|
if (paidInPerson) {
|
|
27
26
|
return 'Paid in person';
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
return paymentStatus ? _capitalize(paymentStatus) : 'Pending';
|
|
31
29
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
const getPaymentTextClass = _ref2 => {
|
|
31
|
+
let {
|
|
32
|
+
paymentStatus,
|
|
33
|
+
transactionStatus,
|
|
34
|
+
hasNoGap,
|
|
35
|
+
paidInPerson
|
|
36
|
+
} = _ref2;
|
|
38
37
|
if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
|
|
39
38
|
return 'danger';
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
if (hasNoGap) {
|
|
43
41
|
return 'success';
|
|
44
42
|
}
|
|
45
|
-
|
|
46
43
|
if (paidInPerson) {
|
|
47
44
|
return 'gray';
|
|
48
45
|
}
|
|
49
|
-
|
|
50
46
|
return claimPaymentStatusTextClasses.default[paymentStatus] || 'warning';
|
|
51
47
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
const getPaymentIcon = _ref3 => {
|
|
49
|
+
let {
|
|
50
|
+
paymentStatus,
|
|
51
|
+
transactionStatus,
|
|
52
|
+
hasNoGap,
|
|
53
|
+
paidInPerson
|
|
54
|
+
} = _ref3;
|
|
58
55
|
if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
|
|
59
56
|
return 'fa-times-circle';
|
|
60
57
|
}
|
|
61
|
-
|
|
62
58
|
if (hasNoGap) {
|
|
63
59
|
return 'fa-check-circle';
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
if (paidInPerson) {
|
|
67
62
|
return '';
|
|
68
63
|
}
|
|
69
|
-
|
|
70
64
|
return claimPaymentStatusIcons.default[paymentStatus] || 'fa-clock';
|
|
71
65
|
};
|
|
72
66
|
var transactionStatusHelpers = {};
|
|
@@ -4,7 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var constants = require('./constants.js');
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var transactionStatusIcons = {
|
|
8
|
+
[constants.TRANSACTION_STATUSES.COMPLETED]: 'fas fa-check',
|
|
9
|
+
[constants.TRANSACTION_STATUSES.CANCELLED]: 'fas fa-times',
|
|
10
|
+
[constants.TRANSACTION_STATUSES.PENDING]: 'fas fa-clock',
|
|
11
|
+
[constants.TRANSACTION_STATUSES.UNDER_REVIEW]: 'fas fa-clock',
|
|
12
|
+
[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED]: 'fas fa-check',
|
|
13
|
+
[constants.TRANSACTION_STATUSES.REFUNDED]: 'fas fa-undo',
|
|
14
|
+
[constants.TRANSACTION_STATUSES.ERRORED]: 'fa fa-exclamation-triangle'
|
|
15
|
+
};
|
|
9
16
|
|
|
10
17
|
exports.default = transactionStatusIcons;
|
|
@@ -4,7 +4,21 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var constants = require('./constants.js');
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var transactionStatusTextClasses = {
|
|
8
|
+
[constants.TRANSACTION_STATUSES.NEW]: 'primary',
|
|
9
|
+
[constants.TRANSACTION_STATUSES.PENDING]: 'warning',
|
|
10
|
+
[constants.TRANSACTION_STATUSES.REQUESTED]: 'warning',
|
|
11
|
+
[constants.TRANSACTION_STATUSES.COMPLETED]: 'success',
|
|
12
|
+
[constants.TRANSACTION_STATUSES.CANCELLED]: 'danger',
|
|
13
|
+
[constants.TRANSACTION_STATUSES.REFUNDED]: '',
|
|
14
|
+
[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED]: 'success',
|
|
15
|
+
[constants.TRANSACTION_STATUSES.UNDER_REVIEW]: 'warning',
|
|
16
|
+
[constants.TRANSACTION_STATUSES.ERRORED]: 'danger',
|
|
17
|
+
[constants.TRANSACTION_STATUSES.SUBMITTED]: 'warning',
|
|
18
|
+
[constants.TRANSACTION_STATUSES.OUTSTANDING]: 'warning',
|
|
19
|
+
[constants.TRANSACTION_STATUSES.DECLINED]: 'danger',
|
|
20
|
+
[constants.TRANSACTION_STATUSES.APPROVED]: 'success',
|
|
21
|
+
[constants.TRANSACTION_STATUSES.ARCHIVED]: ''
|
|
22
|
+
};
|
|
9
23
|
|
|
10
24
|
exports.default = transactionStatusTextClasses;
|
package/transaction-status.js
CHANGED
|
@@ -9,33 +9,25 @@ var _get = _interopDefault(require('lodash/get'));
|
|
|
9
9
|
var funders = require('./funders.js');
|
|
10
10
|
|
|
11
11
|
function getOverrideStatus(transaction, defaultStatus) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
let status = defaultStatus;
|
|
14
13
|
if (funders.isMedicare(_get(transaction, 'claims[0].funder.code'))) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var hasMedicareErrored = _get(transaction, 'medicare.hasFatalError');
|
|
19
|
-
|
|
14
|
+
const isClaimRejected = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.REJECTED;
|
|
15
|
+
const isTransactionCompleted = transaction.status === constants.TRANSACTION_STATUSES.COMPLETED;
|
|
16
|
+
const hasMedicareErrored = _get(transaction, 'medicare.hasFatalError');
|
|
20
17
|
if (isClaimRejected && isTransactionCompleted && !hasMedicareErrored) {
|
|
21
18
|
status = constants.TRANSACTION_STATUSES.UNDER_REVIEW;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
var isClaimPending = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.PENDING && transaction.status !== constants.TRANSACTION_STATUSES.CANCELLED;
|
|
25
|
-
|
|
20
|
+
const isClaimPending = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.PENDING && transaction.status !== constants.TRANSACTION_STATUSES.CANCELLED;
|
|
26
21
|
if (isClaimPending) {
|
|
27
22
|
status = constants.TRANSACTION_STATUSES.PENDING;
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
|
-
|
|
31
25
|
if (funders.isIcare(_get(transaction, 'claims[0].funder.code')) && _get(transaction, '_schemaVersion') === '2') {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (_isClaimPending) {
|
|
26
|
+
const isClaimPending = _get(transaction, 'status') === constants.TRANSACTION_STATUSES.PENDING;
|
|
27
|
+
if (isClaimPending) {
|
|
35
28
|
status = constants.TRANSACTION_STATUSES.SUBMITTED;
|
|
36
29
|
}
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
return status;
|
|
40
32
|
}
|
|
41
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const defaultTransaction = {
|
|
4
4
|
_id: 'transactionDefaultId',
|
|
5
5
|
abn: 'mockABN',
|
|
6
6
|
organisationId: 'organisationDefaultId',
|
|
@@ -135,7 +135,7 @@ var defaultTransaction = {
|
|
|
135
135
|
modified: new Date('2015-01-02T00:00:00Z').toISOString(),
|
|
136
136
|
workflowStateDate: new Date('2015-01-02T00:00:00Z').toISOString()
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
const transactionWithClaim = {
|
|
139
139
|
_id: 'transactionDefaultWithClaimId',
|
|
140
140
|
organisationId: 'organisationDefaultId',
|
|
141
141
|
businessId: 'businessDefaultId',
|
|
@@ -261,7 +261,7 @@ var transactionWithClaim = {
|
|
|
261
261
|
created: new Date('2015-01-01T00:00:00').toISOString(),
|
|
262
262
|
modified: new Date('2015-01-02T00:00:00Z').toISOString()
|
|
263
263
|
};
|
|
264
|
-
|
|
264
|
+
const transactionWithApprovedPayment = {
|
|
265
265
|
_id: 'transactionWithApprovedPaymentId',
|
|
266
266
|
abn: 'mockABN',
|
|
267
267
|
organisationId: 'organisationDefaultId',
|
|
@@ -411,7 +411,7 @@ var transactionWithApprovedPayment = {
|
|
|
411
411
|
modified: new Date('2015-01-02T00:00:00Z').toISOString(),
|
|
412
412
|
approvedByUsername: 'jake@medipass.io'
|
|
413
413
|
};
|
|
414
|
-
|
|
414
|
+
const transactionWithApprovedInPersonPayment = {
|
|
415
415
|
_id: 'transactionWithApprovedPaymentId',
|
|
416
416
|
abn: 'mockABN',
|
|
417
417
|
organisationId: 'organisationDefaultId',
|
|
@@ -551,7 +551,7 @@ var transactionWithApprovedInPersonPayment = {
|
|
|
551
551
|
modified: new Date('2015-01-02T00:00:00Z').toISOString(),
|
|
552
552
|
approvedByUsername: 'jake@medipass.io'
|
|
553
553
|
};
|
|
554
|
-
|
|
554
|
+
const transactionWithRefundedPayment = {
|
|
555
555
|
_id: 'transactionWithRefundedPaymentId',
|
|
556
556
|
abn: 'mockABN',
|
|
557
557
|
organisationId: 'organisationDefaultId',
|
|
@@ -708,7 +708,7 @@ var transactionWithRefundedPayment = {
|
|
|
708
708
|
modified: new Date('2015-01-02T00:00:00Z').toISOString(),
|
|
709
709
|
approvedByUsername: 'jake@medipass.io'
|
|
710
710
|
};
|
|
711
|
-
|
|
711
|
+
const transactionWithMultipleRefundedPayments = {
|
|
712
712
|
_id: 'transactionWithMultipleRefundedPaymentsId',
|
|
713
713
|
abn: 'mockABN',
|
|
714
714
|
organisationId: 'organisationDefaultId',
|
|
@@ -899,7 +899,7 @@ var transactionWithMultipleRefundedPayments = {
|
|
|
899
899
|
modified: new Date('2015-01-02T00:00:00Z').toISOString(),
|
|
900
900
|
approvedByUsername: 'jake@medipass.io'
|
|
901
901
|
};
|
|
902
|
-
|
|
902
|
+
const transactionWithOtherItems = {
|
|
903
903
|
_id: 'transactionWithOtherItemsId',
|
|
904
904
|
abn: 'mockABN',
|
|
905
905
|
organisationId: 'organisationDefaultId',
|
|
@@ -1042,7 +1042,7 @@ var transactionWithOtherItems = {
|
|
|
1042
1042
|
created: new Date('2015-01-01T00:00:00').toISOString(),
|
|
1043
1043
|
modified: new Date('2015-01-02T00:00:00Z').toISOString()
|
|
1044
1044
|
};
|
|
1045
|
-
|
|
1045
|
+
const ghsTransactionCompleted = {
|
|
1046
1046
|
_id: 'transactionCompletedId',
|
|
1047
1047
|
abn: 'mockABN',
|
|
1048
1048
|
organisationId: 'organisationDefaultId',
|
|
@@ -1166,7 +1166,7 @@ var ghsTransactionCompleted = {
|
|
|
1166
1166
|
created: new Date('2015-01-01T00:00:00').toISOString(),
|
|
1167
1167
|
modified: new Date('2015-01-02T00:00:00Z').toISOString()
|
|
1168
1168
|
};
|
|
1169
|
-
|
|
1169
|
+
const transactionQuoteDefault = {
|
|
1170
1170
|
_id: 'transactionQuoteDefaultId',
|
|
1171
1171
|
abn: 'mockABN',
|
|
1172
1172
|
organisationId: 'organisationDefaultId',
|
|
@@ -1273,7 +1273,7 @@ var transactionQuoteDefault = {
|
|
|
1273
1273
|
created: new Date('2015-01-01T00:00:00').toISOString(),
|
|
1274
1274
|
modified: new Date('2015-01-02T00:00:00Z').toISOString()
|
|
1275
1275
|
};
|
|
1276
|
-
|
|
1276
|
+
const transactionForMemberRequestQuote = {
|
|
1277
1277
|
_id: 'transactionForMemberRequestQuote',
|
|
1278
1278
|
abn: 'mockABN',
|
|
1279
1279
|
organisationId: 'organisationDefaultId',
|
|
@@ -1311,7 +1311,7 @@ var transactionForMemberRequestQuote = {
|
|
|
1311
1311
|
created: new Date('2017-08-01T00:00:00').toISOString(),
|
|
1312
1312
|
modified: new Date('2017-08-02T00:00:00').toISOString()
|
|
1313
1313
|
};
|
|
1314
|
-
|
|
1314
|
+
const transactionForMemberRequestQuoteComplete = {
|
|
1315
1315
|
_id: 'transactionForMemberRequestQuoteComplete',
|
|
1316
1316
|
abn: 'mockABN',
|
|
1317
1317
|
organisationId: 'organisationDefaultId',
|
|
@@ -1348,7 +1348,7 @@ var transactionForMemberRequestQuoteComplete = {
|
|
|
1348
1348
|
created: new Date('2017-08-01T00:00:00').toISOString(),
|
|
1349
1349
|
modified: new Date('2017-08-02T00:00:00').toISOString()
|
|
1350
1350
|
};
|
|
1351
|
-
|
|
1351
|
+
const transactionWithPendingMedicareClaim = {
|
|
1352
1352
|
_id: 'transactionMedicareWithPendingClaimId',
|
|
1353
1353
|
organisationId: 'organisationDefaultId',
|
|
1354
1354
|
businessId: 'businessDefaultId',
|
|
@@ -1507,7 +1507,7 @@ var transactionWithPendingMedicareClaim = {
|
|
|
1507
1507
|
created: new Date('2015-01-01T00:00:00Z'),
|
|
1508
1508
|
modified: new Date('2015-01-02T00:00:00Z')
|
|
1509
1509
|
};
|
|
1510
|
-
|
|
1510
|
+
const transactionWithPendingMedicareClaimAndClaimant = {
|
|
1511
1511
|
_id: 'transactionMedicareWithPendingClaimId',
|
|
1512
1512
|
organisationId: 'organisationDefaultId',
|
|
1513
1513
|
businessId: 'businessDefaultId',
|
|
@@ -1692,7 +1692,7 @@ var transactionWithPendingMedicareClaimAndClaimant = {
|
|
|
1692
1692
|
created: new Date('2015-01-01T00:00:00Z'),
|
|
1693
1693
|
modified: new Date('2015-01-02T00:00:00Z')
|
|
1694
1694
|
};
|
|
1695
|
-
|
|
1695
|
+
const transactionWithMedicareClaim = {
|
|
1696
1696
|
amountClaimsExpectedBenefit: 5000,
|
|
1697
1697
|
amountClaimsExpectedBenefitString: '$50.00',
|
|
1698
1698
|
amountGap: 11095,
|