@medipass/utils 11.54.2-feat-tyro-terminal-refunds.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 (98) hide show
  1. package/.eslintrc +3 -0
  2. package/CHANGELOG.md +3218 -0
  3. package/babel.config.js +4 -0
  4. package/billable-items-01050ba2.js +27 -0
  5. package/build-validation-schema.js +1282 -0
  6. package/businesses-968c8afa.js +54 -0
  7. package/chart.js +45 -0
  8. package/claim-payment-status-formatted.js +12 -0
  9. package/claim-payment-status-icons.js +10 -0
  10. package/claim-payment-status-text-classes.js +10 -0
  11. package/constants.js +387 -0
  12. package/countries.js +1011 -0
  13. package/datetime.js +36 -0
  14. package/document-types-formatted.js +13 -0
  15. package/document-types-icons.js +10 -0
  16. package/document-types-text-classes.js +10 -0
  17. package/documents/workflow-state-formatted-text-classes.js +12 -0
  18. package/documents/workflow-state-formatted.js +15 -0
  19. package/documents/workflow-state-icons.js +10 -0
  20. package/form-applications/assign-values-to-sections.js +29 -0
  21. package/forms-f06ca97e.js +51 -0
  22. package/funders.js +104 -0
  23. package/get-env.js +196 -0
  24. package/get-select-options.js +65 -0
  25. package/get-staff-type-display-name.js +12 -0
  26. package/google-addresses.js +127 -0
  27. package/health-fund-accounts-3cd8650f.js +20 -0
  28. package/health-fund-settings-43327826.js +22 -0
  29. package/health-funds-300facef.js +194 -0
  30. package/i18n/index.js +59 -0
  31. package/i18n/translations.js +36 -0
  32. package/index.js +57 -0
  33. package/intercom.js +103 -0
  34. package/jest.config.js +6 -0
  35. package/jest.setup.js +0 -0
  36. package/members-cb4f73a9.js +53 -0
  37. package/modalities-b360d521.js +19 -0
  38. package/normalise-abn.js +22 -0
  39. package/package.json +53 -0
  40. package/parse-health-fund-card-fields.js +12 -0
  41. package/patients-2083dd9c.js +46 -0
  42. package/payment-methods-4fa2d01f.js +26 -0
  43. package/payment-options.js +52 -0
  44. package/practices-3faceeff.js +89 -0
  45. package/products-bd313cb4.js +83 -0
  46. package/products.js +31 -0
  47. package/professional-categories-e2e5284b.js +19 -0
  48. package/redux-actions.js +161 -0
  49. package/redux-reducer.js +112 -0
  50. package/sanitise-url.js +17 -0
  51. package/scroll.js +9 -0
  52. package/sensitive-keys.js +9 -0
  53. package/sentry.js +104 -0
  54. package/service-items.js +229 -0
  55. package/services-2e25cdac.js +127 -0
  56. package/specialties-7640b7e3.js +20 -0
  57. package/staff-c3ecf4e6.js +165 -0
  58. package/status-icons.js +10 -0
  59. package/status-text-classes.js +10 -0
  60. package/subscriptions-45c1321a.js +160 -0
  61. package/test-framework/fixtures/accounts.js +34 -0
  62. package/test-framework/fixtures/billable-items.js +9 -0
  63. package/test-framework/fixtures/businesses.js +9 -0
  64. package/test-framework/fixtures/documents.js +121 -0
  65. package/test-framework/fixtures/form-application-templates.js +74 -0
  66. package/test-framework/fixtures/form-applications.js +39 -0
  67. package/test-framework/fixtures/forms.js +9 -0
  68. package/test-framework/fixtures/health-fund-accounts.js +9 -0
  69. package/test-framework/fixtures/health-fund-settings.js +9 -0
  70. package/test-framework/fixtures/health-funds.js +10 -0
  71. package/test-framework/fixtures/index.js +45 -0
  72. package/test-framework/fixtures/members.js +9 -0
  73. package/test-framework/fixtures/message-mappings.js +61 -0
  74. package/test-framework/fixtures/modalities.js +9 -0
  75. package/test-framework/fixtures/patients.js +9 -0
  76. package/test-framework/fixtures/payment-methods.js +9 -0
  77. package/test-framework/fixtures/practices.js +11 -0
  78. package/test-framework/fixtures/products.js +10 -0
  79. package/test-framework/fixtures/professional-categories.js +9 -0
  80. package/test-framework/fixtures/services.js +11 -0
  81. package/test-framework/fixtures/specialties.js +9 -0
  82. package/test-framework/fixtures/staff.js +12 -0
  83. package/test-framework/fixtures/subscriptions.js +13 -0
  84. package/test-framework/fixtures/transaction-reports.js +69 -0
  85. package/test-framework/fixtures/transactions.js +22 -0
  86. package/test-framework/fixtures/workflow-exceptions.js +32 -0
  87. package/test-framework/react.js +38 -0
  88. package/transaction-status-formatted.js +13 -0
  89. package/transaction-status-helpers.js +77 -0
  90. package/transaction-status-icons.js +10 -0
  91. package/transaction-status-text-classes.js +10 -0
  92. package/transaction-status.js +42 -0
  93. package/transactions-6e5fd92d.js +1883 -0
  94. package/validate-form.js +368 -0
  95. package/validate.js +37 -0
  96. package/webpack-config.js +27 -0
  97. package/workflow-state-formatted-text-classes.js +12 -0
  98. package/workflow-state-formatted.js +13 -0
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var transactions = require('../../transactions-6e5fd92d.js');
6
+ var subscriptions = require('../../subscriptions-45c1321a.js');
7
+ var staff = require('../../staff-c3ecf4e6.js');
8
+ var specialties = require('../../specialties-7640b7e3.js');
9
+ var services = require('../../services-2e25cdac.js');
10
+ var professionalCategories = require('../../professional-categories-e2e5284b.js');
11
+ var products = require('../../products-bd313cb4.js');
12
+ var practices = require('../../practices-3faceeff.js');
13
+ var paymentMethods = require('../../payment-methods-4fa2d01f.js');
14
+ var patients = require('../../patients-2083dd9c.js');
15
+ var modalities = require('../../modalities-b360d521.js');
16
+ var members = require('../../members-cb4f73a9.js');
17
+ var billableItems = require('../../billable-items-01050ba2.js');
18
+ var businesses = require('../../businesses-968c8afa.js');
19
+ var forms = require('../../forms-f06ca97e.js');
20
+ var healthFundAccounts = require('../../health-fund-accounts-3cd8650f.js');
21
+ var healthFundSettings = require('../../health-fund-settings-43327826.js');
22
+ var healthFunds = require('../../health-funds-300facef.js');
23
+
24
+ var index = {
25
+ billableItems: billableItems.billableItems,
26
+ businesses: businesses.businesses,
27
+ forms: forms.forms,
28
+ healthFundAccounts: healthFundAccounts.healthFundAccounts,
29
+ healthFundSettings: healthFundSettings.healthFundSettings,
30
+ healthFunds: healthFunds.healthFunds,
31
+ members: members.members,
32
+ modalities: modalities.modalities,
33
+ patients: patients.patients,
34
+ paymentMethods: paymentMethods.paymentMethods,
35
+ practices: practices.practices$1,
36
+ products: products.products,
37
+ professionalCategories: professionalCategories.professionalCategories,
38
+ services: services.services,
39
+ specialties: specialties.specialties,
40
+ staff: staff.staff,
41
+ subscriptions: subscriptions.subscriptions,
42
+ transactions: transactions.transactions
43
+ };
44
+
45
+ exports.default = index;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var members = require('../../members-cb4f73a9.js');
6
+
7
+
8
+
9
+ exports.defaultMember = members.defaultMember;
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var cancellationMessageMappings = {
6
+ meta: {
7
+ count: 7,
8
+ pageCount: 1,
9
+ totalCount: 7,
10
+ next: null,
11
+ previous: null,
12
+ self: 'https://dev-api-au.medipass.io/v2.3/businesses/5934a17a8c9421002788b359/messagemappings?funderId=5b6923a1983d92182de76583&type=cancellation&limit=99&page=1',
13
+ first: 'https://dev-api-au.medipass.io/v2.3/businesses/5934a17a8c9421002788b359/messagemappings?funderId=5b6923a1983d92182de76583&type=cancellation&limit=99&page=1',
14
+ last: 'https://dev-api-au.medipass.io/v2.3/businesses/5934a17a8c9421002788b359/messagemappings?funderId=5b6923a1983d92182de76583&type=cancellation&limit=99&page=1'
15
+ },
16
+ items: [{
17
+ _id: '5c53c62b616ec9339b72a523',
18
+ refId: '001',
19
+ created: '2019-02-01T04:07:43.224Z',
20
+ modified: '2019-02-06T17:46:04.242Z',
21
+ refMessage: 'Incorrect Patient Selection'
22
+ }, {
23
+ _id: '5c53c62b616ec9339b72a529',
24
+ refId: '002',
25
+ created: '2019-02-01T04:07:43.224Z',
26
+ modified: '2019-02-06T17:46:04.242Z',
27
+ refMessage: 'Incorrect Provider Details'
28
+ }, {
29
+ _id: '5c53c62b616ec9339b72a52f',
30
+ refId: '003',
31
+ created: '2019-02-01T04:07:43.224Z',
32
+ modified: '2019-02-06T17:46:04.242Z',
33
+ refMessage: 'Incorrect Date of Service'
34
+ }, {
35
+ _id: '5c53c62b616ec9339b72a536',
36
+ refId: '004',
37
+ created: '2019-02-01T04:07:43.224Z',
38
+ modified: '2019-02-06T17:46:04.242Z',
39
+ refMessage: 'Incorrect Item Number Claimed'
40
+ }, {
41
+ _id: '5c53c62b616ec9339b72a53c',
42
+ refId: '005',
43
+ created: '2019-02-01T04:07:43.224Z',
44
+ modified: '2019-02-06T17:46:04.242Z',
45
+ refMessage: 'Omitted Text on Original Claim'
46
+ }, {
47
+ _id: '5c53c62b616ec9339b72a542',
48
+ refId: '006',
49
+ created: '2019-02-01T04:07:43.224Z',
50
+ modified: '2019-02-06T17:46:04.242Z',
51
+ refMessage: 'Incorrect Payment Type (ie Paid / Unpaid)'
52
+ }, {
53
+ _id: '5c53c62b616ec9339b72a548',
54
+ refId: '007',
55
+ created: '2019-02-01T04:07:43.224Z',
56
+ modified: '2019-02-06T17:46:04.242Z',
57
+ refMessage: 'Other'
58
+ }]
59
+ };
60
+
61
+ exports.cancellationMessageMappings = cancellationMessageMappings;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var modalities = require('../../modalities-b360d521.js');
6
+
7
+
8
+
9
+ exports.defaultModality = modalities.defaultModality;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var patients = require('../../patients-2083dd9c.js');
6
+
7
+
8
+
9
+ exports.defaultPatient = patients.defaultPatient;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var paymentMethods = require('../../payment-methods-4fa2d01f.js');
6
+
7
+
8
+
9
+ exports.defaultPaymentMethod = paymentMethods.defaultPaymentMethod;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var practices = require('../../practices-3faceeff.js');
6
+
7
+
8
+
9
+ exports.defaultPractice = practices.defaultPractice;
10
+ exports.defaultPractice2 = practices.defaultPractice2;
11
+ exports.practices = practices.practices;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var products = require('../../products-bd313cb4.js');
6
+
7
+
8
+
9
+ exports.productBasic = products.productBasic;
10
+ exports.productPro = products.productPro;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var professionalCategories = require('../../professional-categories-e2e5284b.js');
6
+
7
+
8
+
9
+ exports.defaultProfessionalCategory = professionalCategories.defaultProfessionalCategory;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var services = require('../../services-2e25cdac.js');
6
+
7
+
8
+
9
+ exports.defaultService = services.defaultService;
10
+ exports.defaultServiceItems = services.defaultServiceItems;
11
+ exports.serviceWithMultipleClaimItems = services.serviceWithMultipleClaimItems;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var specialties = require('../../specialties-7640b7e3.js');
6
+
7
+
8
+
9
+ exports.defaultSpecialty = specialties.defaultSpecialty;
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var staff = require('../../staff-c3ecf4e6.js');
6
+
7
+
8
+
9
+ exports.defaultPractitioner = staff.defaultPractitioner;
10
+ exports.defaultPractitioner2 = staff.defaultPractitioner2;
11
+ exports.practitionerWithActivePendingProviderSet = staff.practitionerWithActivePendingProviderSet;
12
+ exports.practitionerWithPendingProviderSet = staff.practitionerWithPendingProviderSet;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var subscriptions = require('../../subscriptions-45c1321a.js');
6
+
7
+
8
+
9
+ exports.subscriptionBasic = subscriptions.subscriptionBasic;
10
+ exports.subscriptionPro = subscriptions.subscriptionPro;
11
+ exports.subscriptionProEnded = subscriptions.subscriptionProEnded;
12
+ exports.subscriptionProUpcoming = subscriptions.subscriptionProUpcoming;
13
+ exports.subscriptionProWithoutPaymentMethod = subscriptions.subscriptionProWithoutPaymentMethod;
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var processingReportDefault = {
6
+ reportResult: 0,
7
+ sessionId: 788881339,
8
+ claimId: 'E8227@',
9
+ serviceId: 'A001',
10
+ amountChargedString: '$37.60',
11
+ amountBenefitPaidString: '$43.50',
12
+ providerNumber: '2429581T',
13
+ healthFundAccount: {
14
+ membershipNumber: '6950507481',
15
+ cardRank: '1'
16
+ },
17
+ patient: {
18
+ firstName: 'CLAUDIA',
19
+ lastName: 'CONNOR'
20
+ },
21
+ cardFlag: 'Y',
22
+ claimItems: [{
23
+ serviceDateString: '2018-09-07',
24
+ itemCode: '00023',
25
+ amountChargedString: '$10.00',
26
+ amountBenefitString: '$37.60',
27
+ gatewayCode: null,
28
+ serviceId: 'A001',
29
+ voucherId: '01',
30
+ numberOfPatientsSeen: 1
31
+ }, {
32
+ serviceDateString: '2018-09-07',
33
+ itemCode: '73810',
34
+ amountChargedString: '$1.00',
35
+ amountBenefitString: '$5.90',
36
+ gatewayCode: null,
37
+ serviceId: 'A002',
38
+ voucherId: '02',
39
+ numberOfPatientsSeen: 3
40
+ }]
41
+ };
42
+ var paymentReportDefault = {
43
+ reportResult: 0,
44
+ sessionId: 492869302,
45
+ paymentRunDateString: '2019-02-06',
46
+ paymentRunNumber: '0008',
47
+ amountBenefitPaidString: '$37.60',
48
+ bankAccount: {
49
+ bsb: '062290',
50
+ accountNumber: '122112212',
51
+ accountName: 'DR HAN'
52
+ },
53
+ payments: [{
54
+ claimId: 'D3446@',
55
+ claimDateString: '2019-02-05',
56
+ amountChargedString: '$71.00',
57
+ amountBenefitPaidString: '$37.60',
58
+ amountDepositedString: '$10.00'
59
+ }, {
60
+ claimId: 'E8227@',
61
+ claimDateString: '2019-02-05',
62
+ amountChargedString: '$43.50',
63
+ amountBenefitPaidString: '$43.50',
64
+ amountDepositedString: '$12.50'
65
+ }]
66
+ };
67
+
68
+ exports.paymentReportDefault = paymentReportDefault;
69
+ exports.processingReportDefault = processingReportDefault;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var transactions = require('../../transactions-6e5fd92d.js');
6
+
7
+
8
+
9
+ exports.defaultTransaction = transactions.defaultTransaction;
10
+ exports.ghsTransactionCompleted = transactions.ghsTransactionCompleted;
11
+ exports.transactionForMemberRequestQuote = transactions.transactionForMemberRequestQuote;
12
+ exports.transactionForMemberRequestQuoteComplete = transactions.transactionForMemberRequestQuoteComplete;
13
+ exports.transactionQuoteDefault = transactions.transactionQuoteDefault;
14
+ exports.transactionWithApprovedInPersonPayment = transactions.transactionWithApprovedInPersonPayment;
15
+ exports.transactionWithApprovedPayment = transactions.transactionWithApprovedPayment;
16
+ exports.transactionWithClaim = transactions.transactionWithClaim;
17
+ exports.transactionWithMedicareClaim = transactions.transactionWithMedicareClaim;
18
+ exports.transactionWithMultipleRefundedPayments = transactions.transactionWithMultipleRefundedPayments;
19
+ exports.transactionWithOtherItems = transactions.transactionWithOtherItems;
20
+ exports.transactionWithPendingMedicareClaim = transactions.transactionWithPendingMedicareClaim;
21
+ exports.transactionWithPendingMedicareClaimAndClaimant = transactions.transactionWithPendingMedicareClaimAndClaimant;
22
+ exports.transactionWithRefundedPayment = transactions.transactionWithRefundedPayment;
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var defaultWorkflowException = {
6
+ _id: 'workflowExceptionDefaultId',
7
+ funderId: 'funderDefaultId',
8
+ healthFundId: 'healthFundDefaultId',
9
+ code: '01',
10
+ fullName: 'Scanning error',
11
+ displayName: 'Scanning error',
12
+ description: 'Unable to scan invoice.',
13
+ searchWords: ['scanning error', '01'],
14
+ created: new Date('2018-01-01T00:00:00Z'),
15
+ modified: new Date('2018-02-02T00:00:00Z')
16
+ };
17
+ var anotherWorkflowException = {
18
+ _id: 'workflowDuplicateExceptionId',
19
+ funderId: 'funderDefaultId',
20
+ healthFundId: 'healthFundDefaultId',
21
+ code: '24',
22
+ fullName: 'Duplicate',
23
+ displayName: 'Duplicate',
24
+ description: 'Duplicate invoice detected.',
25
+ searchWords: ['duplicate', '24'],
26
+ omittableCodes: ['48'],
27
+ created: new Date('2018-01-01T00:00:00Z'),
28
+ modified: new Date('2018-02-02T00:00:00Z')
29
+ };
30
+
31
+ exports.anotherWorkflowException = anotherWorkflowException;
32
+ exports.defaultWorkflowException = defaultWorkflowException;
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var React = _interopDefault(require('react'));
8
+ var enzyme = require('enzyme');
9
+ var Adapter = _interopDefault(require('enzyme-adapter-react-16'));
10
+ var toJSON = _interopDefault(require('enzyme-to-json'));
11
+ var _isEmpty = _interopDefault(require('lodash/isEmpty'));
12
+
13
+ var setupTestEnvironment = function setupTestEnvironment() {
14
+ enzyme.configure({
15
+ adapter: new Adapter()
16
+ });
17
+ }; // Setup component using Enzyme
18
+
19
+ var setupComponent = function setupComponent(component, initialProps, initialState) {
20
+ var wrapper = enzyme.shallow(React.createElement(component, initialProps));
21
+
22
+ if (!_isEmpty(initialState)) {
23
+ wrapper.setState(initialState);
24
+ }
25
+
26
+ var wrapperJSON = toJSON(wrapper);
27
+ var wrapperInstance = wrapper.instance();
28
+ return {
29
+ wrapper: wrapper,
30
+ wrapperInstance: wrapperInstance,
31
+ wrapperJSON: wrapperJSON
32
+ };
33
+ };
34
+ var react = {};
35
+
36
+ exports.default = react;
37
+ exports.setupComponent = setupComponent;
38
+ exports.setupTestEnvironment = setupTestEnvironment;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var constants = require('./constants.js');
6
+
7
+ var _CONSUMER, _PROVIDER;
8
+ var transactionStatusFormatted = {
9
+ CONSUMER: (_CONSUMER = {}, _CONSUMER[constants.TRANSACTION_STATUSES.COMPLETED] = 'Paid', _CONSUMER[constants.TRANSACTION_STATUSES.CANCELLED] = 'Cancelled', _CONSUMER[constants.TRANSACTION_STATUSES.PENDING] = 'Requested', _CONSUMER[constants.TRANSACTION_STATUSES.ERRORED] = 'Error', _CONSUMER[constants.TRANSACTION_STATUSES.REFUNDED] = 'Refunded', _CONSUMER[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'Paid', _CONSUMER),
10
+ PROVIDER: (_PROVIDER = {}, _PROVIDER[constants.TRANSACTION_STATUSES.PARTIALLY_REFUNDED] = 'Partial refund', _PROVIDER[constants.TRANSACTION_STATUSES.UNDER_REVIEW] = 'Under review', _PROVIDER[constants.TRANSACTION_STATUSES.ERRORED] = 'Errored', _PROVIDER)
11
+ };
12
+
13
+ exports.default = transactionStatusFormatted;
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var constants = require('./constants.js');
8
+ var _capitalize = _interopDefault(require('lodash/capitalize'));
9
+ var claimPaymentStatusIcons = require('./claim-payment-status-icons.js');
10
+ var claimPaymentStatusTextClasses = require('./claim-payment-status-text-classes.js');
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
+
18
+ if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
19
+ return 'Voided';
20
+ }
21
+
22
+ if (hasNoGap) {
23
+ return 'Not needed';
24
+ }
25
+
26
+ if (paidInPerson) {
27
+ return 'Paid in person';
28
+ }
29
+
30
+ return paymentStatus ? _capitalize(paymentStatus) : 'Pending';
31
+ };
32
+ var getPaymentTextClass = function getPaymentTextClass(_ref2) {
33
+ var paymentStatus = _ref2.paymentStatus,
34
+ transactionStatus = _ref2.transactionStatus,
35
+ hasNoGap = _ref2.hasNoGap,
36
+ paidInPerson = _ref2.paidInPerson;
37
+
38
+ if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
39
+ return 'danger';
40
+ }
41
+
42
+ if (hasNoGap) {
43
+ return 'success';
44
+ }
45
+
46
+ if (paidInPerson) {
47
+ return 'gray';
48
+ }
49
+
50
+ return claimPaymentStatusTextClasses.default[paymentStatus] || 'warning';
51
+ };
52
+ var getPaymentIcon = function getPaymentIcon(_ref3) {
53
+ var paymentStatus = _ref3.paymentStatus,
54
+ transactionStatus = _ref3.transactionStatus,
55
+ hasNoGap = _ref3.hasNoGap,
56
+ paidInPerson = _ref3.paidInPerson;
57
+
58
+ if (transactionStatus === constants.TRANSACTION_STATUSES.CANCELLED) {
59
+ return 'fa-times-circle';
60
+ }
61
+
62
+ if (hasNoGap) {
63
+ return 'fa-check-circle';
64
+ }
65
+
66
+ if (paidInPerson) {
67
+ return '';
68
+ }
69
+
70
+ return claimPaymentStatusIcons.default[paymentStatus] || 'fa-clock';
71
+ };
72
+ var transactionStatusHelpers = {};
73
+
74
+ exports.default = transactionStatusHelpers;
75
+ exports.getPaymentIcon = getPaymentIcon;
76
+ exports.getPaymentStatus = getPaymentStatus;
77
+ exports.getPaymentTextClass = getPaymentTextClass;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var constants = require('./constants.js');
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);
9
+
10
+ exports.default = transactionStatusIcons;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var constants = require('./constants.js');
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);
9
+
10
+ exports.default = transactionStatusTextClasses;
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var _get = _interopDefault(require('lodash/get'));
8
+ var constants = require('@medipass/utils/constants');
9
+ var funders = require('@medipass/utils/funders');
10
+
11
+ function getOverrideStatus(transaction, defaultStatus) {
12
+ var status = defaultStatus;
13
+
14
+ 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
+
20
+ if (isClaimRejected && isTransactionCompleted && !hasMedicareErrored) {
21
+ status = constants.TRANSACTION_STATUSES.UNDER_REVIEW;
22
+ }
23
+
24
+ var isClaimPending = _get(transaction, 'claims[0].status') === constants.TRANSACTION_STATUSES.PENDING && transaction.status !== constants.TRANSACTION_STATUSES.CANCELLED;
25
+
26
+ if (isClaimPending) {
27
+ status = constants.TRANSACTION_STATUSES.PENDING;
28
+ }
29
+ }
30
+
31
+ 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) {
35
+ status = constants.TRANSACTION_STATUSES.SUBMITTED;
36
+ }
37
+ }
38
+
39
+ return status;
40
+ }
41
+
42
+ exports.getOverrideStatus = getOverrideStatus;