@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.
Files changed (94) hide show
  1. package/abn.js +40 -45
  2. package/{billable-items-f8291b1e.js → billable-items-5e559447.js} +1 -1
  3. package/build-validation-schema.js +81 -123
  4. package/{businesses-2633ab9b.js → businesses-94ec0280.js} +1 -1
  5. package/chart.js +7 -14
  6. package/claim-payment-status-formatted.js +5 -2
  7. package/claim-payment-status-icons.js +13 -2
  8. package/claim-payment-status-text-classes.js +14 -2
  9. package/constants.js +82 -69
  10. package/countries.js +6 -8
  11. package/datetime.js +6 -13
  12. package/document-types-formatted.js +8 -3
  13. package/document-types-icons.js +4 -2
  14. package/document-types-text-classes.js +5 -2
  15. package/documents/workflow-state-formatted-text-classes.js +13 -4
  16. package/documents/workflow-state-formatted.js +13 -4
  17. package/documents/workflow-state-icons.js +11 -2
  18. package/form-applications/assign-values-to-sections.js +10 -16
  19. package/{forms-e1c51a53.js → forms-646810f2.js} +1 -1
  20. package/funders.js +21 -56
  21. package/get-env.js +38 -75
  22. package/get-select-options.js +21 -40
  23. package/get-staff-type-display-name.js +2 -4
  24. package/google-addresses.js +46 -91
  25. package/{health-fund-accounts-88eac93c.js → health-fund-accounts-8eda8621.js} +1 -1
  26. package/{health-fund-settings-e7a0f2ec.js → health-fund-settings-6d803913.js} +1 -1
  27. package/{health-funds-7fea63a0.js → health-funds-5e838942.js} +2 -2
  28. package/i18n/index.js +15 -18
  29. package/i18n/translations.js +1 -1
  30. package/index.js +1 -3
  31. package/intercom.js +24 -69
  32. package/{members-8eb8d8d0.js → members-e1797829.js} +1 -1
  33. package/{modalities-2dfbea63.js → modalities-d9979fa4.js} +1 -1
  34. package/package.json +4 -4
  35. package/parse-health-fund-card-fields.js +4 -6
  36. package/{patients-dd3709c1.js → patients-aba388c0.js} +1 -1
  37. package/{payment-methods-d36bc018.js → payment-methods-4010f9e5.js} +1 -1
  38. package/payment-options.js +11 -33
  39. package/{practices-d6c480f1.js → practices-17c06e6c.js} +3 -3
  40. package/{products-0a392564.js → products-7054c705.js} +2 -2
  41. package/products.js +5 -12
  42. package/{professional-categories-157d1767.js → professional-categories-0927144e.js} +1 -1
  43. package/redux-actions.js +69 -108
  44. package/redux-reducer.js +53 -69
  45. package/sanitise-url.js +1 -1
  46. package/scroll.js +1 -3
  47. package/sensitive-keys.js +2 -2
  48. package/sentry.js +35 -59
  49. package/service-items.js +70 -111
  50. package/{services-f8480eba.js → services-a81b505c.js} +3 -3
  51. package/{specialties-25fbb171.js → specialties-c29f2f67.js} +1 -1
  52. package/{staff-646053b7.js → staff-fedb5a08.js} +4 -4
  53. package/status-icons.js +12 -2
  54. package/status-text-classes.js +12 -2
  55. package/{subscriptions-aef302aa.js → subscriptions-25d86dab.js} +5 -5
  56. package/test-framework/fixtures/accounts.js +1 -1
  57. package/test-framework/fixtures/billable-items.js +1 -1
  58. package/test-framework/fixtures/businesses.js +1 -1
  59. package/test-framework/fixtures/documents.js +3 -3
  60. package/test-framework/fixtures/form-application-templates.js +1 -1
  61. package/test-framework/fixtures/form-applications.js +1 -1
  62. package/test-framework/fixtures/forms.js +1 -1
  63. package/test-framework/fixtures/health-fund-accounts.js +1 -1
  64. package/test-framework/fixtures/health-fund-settings.js +1 -1
  65. package/test-framework/fixtures/health-funds.js +1 -1
  66. package/test-framework/fixtures/index.js +18 -18
  67. package/test-framework/fixtures/members.js +1 -1
  68. package/test-framework/fixtures/message-mappings.js +1 -1
  69. package/test-framework/fixtures/modalities.js +1 -1
  70. package/test-framework/fixtures/patients.js +1 -1
  71. package/test-framework/fixtures/payment-methods.js +1 -1
  72. package/test-framework/fixtures/practices.js +1 -1
  73. package/test-framework/fixtures/products.js +1 -1
  74. package/test-framework/fixtures/professional-categories.js +1 -1
  75. package/test-framework/fixtures/services.js +1 -1
  76. package/test-framework/fixtures/specialties.js +1 -1
  77. package/test-framework/fixtures/staff.js +1 -1
  78. package/test-framework/fixtures/subscriptions.js +1 -1
  79. package/test-framework/fixtures/transaction-reports.js +6 -6
  80. package/test-framework/fixtures/transactions.js +1 -1
  81. package/test-framework/fixtures/workflow-exceptions.js +2 -2
  82. package/test-framework/react.js +10 -12
  83. package/transaction-details-by-funder.js +20 -21
  84. package/transaction-status-formatted.js +13 -3
  85. package/transaction-status-helpers.js +21 -27
  86. package/transaction-status-icons.js +9 -2
  87. package/transaction-status-text-classes.js +16 -2
  88. package/transaction-status.js +7 -15
  89. package/{transactions-4a08e450.js → transactions-de63fd15.js} +14 -14
  90. package/validate-form.js +79 -269
  91. package/validate.js +16 -28
  92. package/webpack-config.js +6 -13
  93. package/workflow-state-formatted-text-classes.js +12 -4
  94. 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
- var getPaymentStatus = function getPaymentStatus(_ref) {
13
- var paymentStatus = _ref.paymentStatus,
14
- transactionStatus = _ref.transactionStatus,
15
- hasNoGap = _ref.hasNoGap,
16
- paidInPerson = _ref.paidInPerson;
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
- var getPaymentTextClass = function getPaymentTextClass(_ref2) {
33
- var paymentStatus = _ref2.paymentStatus,
34
- transactionStatus = _ref2.transactionStatus,
35
- hasNoGap = _ref2.hasNoGap,
36
- paidInPerson = _ref2.paidInPerson;
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
- var getPaymentIcon = function getPaymentIcon(_ref3) {
53
- var paymentStatus = _ref3.paymentStatus,
54
- transactionStatus = _ref3.transactionStatus,
55
- hasNoGap = _ref3.hasNoGap,
56
- paidInPerson = _ref3.paidInPerson;
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 _TRANSACTION_STATUSES;
8
- var transactionStatusIcons = (_TRANSACTION_STATUSES = {}, _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.COMPLETED] = 'fas fa-check', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.CANCELLED] = 'fas fa-times', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PENDING] = 'fas fa-clock', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.UNDER_REVIEW] = 'fas fa-clock', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'fas fa-check', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.REFUNDED] = 'fas fa-undo', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.ERRORED] = 'fa fa-exclamation-triangle', _TRANSACTION_STATUSES);
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 _TRANSACTION_STATUSES;
8
- var transactionStatusTextClasses = (_TRANSACTION_STATUSES = {}, _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.NEW] = 'primary', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PENDING] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.REQUESTED] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.COMPLETED] = 'success', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.CANCELLED] = 'danger', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.REFUNDED] = '', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'success', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.UNDER_REVIEW] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.ERRORED] = 'danger', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.SUBMITTED] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.OUTSTANDING] = 'warning', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.DECLINED] = 'danger', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.APPROVED] = 'success', _TRANSACTION_STATUSES[constants.TRANSACTION_STATUSES.ARCHIVED] = '', _TRANSACTION_STATUSES);
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;
@@ -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
- var status = defaultStatus;
13
-
12
+ let status = defaultStatus;
14
13
  if (funders.isMedicare(_get(transaction, 'claims[0].funder.code'))) {
15
- var isClaimRejected = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.REJECTED;
16
- var isTransactionCompleted = transaction.status === constants.TRANSACTION_STATUSES.COMPLETED;
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
- var _isClaimPending = _get(transaction, 'status') === constants.TRANSACTION_STATUSES.PENDING;
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
- var defaultTransaction = {
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
- var transactionWithClaim = {
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
- var transactionWithApprovedPayment = {
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
- var transactionWithApprovedInPersonPayment = {
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
- var transactionWithRefundedPayment = {
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
- var transactionWithMultipleRefundedPayments = {
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
- var transactionWithOtherItems = {
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
- var ghsTransactionCompleted = {
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
- var transactionQuoteDefault = {
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
- var transactionForMemberRequestQuote = {
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
- var transactionForMemberRequestQuoteComplete = {
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
- var transactionWithPendingMedicareClaim = {
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
- var transactionWithPendingMedicareClaimAndClaimant = {
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
- var transactionWithMedicareClaim = {
1695
+ const transactionWithMedicareClaim = {
1696
1696
  amountClaimsExpectedBenefit: 5000,
1697
1697
  amountClaimsExpectedBenefitString: '$50.00',
1698
1698
  amountGap: 11095,