@medipass/utils 11.79.2-chore-settlement-form-validations.0 → 11.79.2-chore-environment-variables.1
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 +22 -27
- package/build-validation-schema.js +15 -46
- package/chart.js +7 -8
- package/constants.js +20 -22
- package/datetime.js +5 -6
- package/env.d.ts +9 -0
- package/env.js +40 -0
- package/form-applications/assign-values-to-sections.js +3 -4
- package/funders.js +2 -3
- package/get-env.js +24 -56
- package/get-select-options.js +3 -4
- package/get-staff-type-display-name.js +2 -2
- package/google-addresses.js +20 -29
- package/i18n/index.js +2 -6
- package/index.js +1 -0
- package/intercom.js +23 -24
- package/package.json +2 -2
- package/parse-health-fund-card-fields.js +2 -1
- package/payment-options.js +21 -20
- package/products.js +0 -1
- package/redux-actions.js +25 -37
- package/redux-reducer.js +43 -51
- package/sanitise-url.js +1 -1
- package/scroll.js +4 -2
- package/sentry.js +16 -26
- package/service-items.js +11 -34
- package/test-framework/fixtures/transaction-reports.js +2 -2
- package/test-framework/react.js +2 -4
- package/transaction-details-by-funder.js +3 -3
- package/transaction-status-helpers.js +18 -27
- package/transaction-status.js +1 -8
- package/validate-form.d.ts +0 -3
- package/validate-form.js +83 -125
- package/validate.js +9 -10
- package/webpack-config.js +6 -7
package/abn.js
CHANGED
|
@@ -5,82 +5,77 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var ABN_LENGTH = 11;
|
|
6
6
|
var ACN_LENGTH = 9;
|
|
7
7
|
var normaliseAbn = function normaliseAbn(abn) {
|
|
8
|
-
var trimmedABN = abn == null ? void 0 : abn.replace(/\s/g, '');
|
|
8
|
+
var trimmedABN = abn == null ? void 0 : abn.replace(/\s/g, '');
|
|
9
9
|
|
|
10
|
+
// The input is an ABN, in which case the format should be 99 999 999 999
|
|
10
11
|
if (trimmedABN.length === ABN_LENGTH) {
|
|
11
12
|
return trimmedABN.substring(0, 2) + ' ' + trimmedABN.substring(2, 5) + ' ' + trimmedABN.substring(5, 8) + ' ' + trimmedABN.substring(8);
|
|
12
|
-
}
|
|
13
|
-
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
+
//The input is an ACN, in which case the format should be 999 999 999
|
|
15
16
|
if (trimmedABN.length === ACN_LENGTH) {
|
|
16
17
|
return trimmedABN.substring(0, 3) + ' ' + trimmedABN.substring(3, 6) + ' ' + trimmedABN.substring(6);
|
|
17
18
|
}
|
|
18
|
-
|
|
19
19
|
return abn;
|
|
20
20
|
};
|
|
21
21
|
var isValidAbn = function isValidAbn(abn) {
|
|
22
|
-
var VALID_ABN_LENGTH = 11;
|
|
22
|
+
var VALID_ABN_LENGTH = 11;
|
|
23
23
|
|
|
24
|
+
// strip whitespace from value
|
|
24
25
|
abn = String(abn).replace(/\s+/g, '');
|
|
25
|
-
|
|
26
26
|
if (abn.length === VALID_ABN_LENGTH) {
|
|
27
27
|
var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
|
|
28
28
|
var abnArray = [];
|
|
29
|
-
|
|
30
29
|
for (var i = 0; i < abn.length; i++) {
|
|
31
30
|
abnArray[i] = abn.charAt(i);
|
|
32
|
-
}
|
|
31
|
+
}
|
|
32
|
+
// subtract 1 from the left-most digit
|
|
33
33
|
// @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
abnArray[0] -= 1; // multiply each of the digits by its weighting factor
|
|
37
|
-
|
|
34
|
+
abnArray[0] -= 1;
|
|
35
|
+
// multiply each of the digits by its weighting factor
|
|
38
36
|
for (var _i = 0; _i < abnArray.length; _i++) {
|
|
39
37
|
// @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
|
|
40
38
|
abnArray[_i] *= weights[_i];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
}
|
|
40
|
+
// sum all the digits
|
|
44
41
|
var abnSum = 0;
|
|
45
|
-
|
|
46
42
|
for (var _i2 = 0; _i2 < abnArray.length; _i2++) {
|
|
47
43
|
// @ts-expect-error TS(2322): Type 'string' is not assignable to type 'number'.
|
|
48
44
|
abnSum += abnArray[_i2];
|
|
49
45
|
}
|
|
50
|
-
|
|
51
46
|
return abnSum % 89 === 0;
|
|
52
47
|
} else {
|
|
53
48
|
return false;
|
|
54
49
|
}
|
|
55
50
|
};
|
|
56
51
|
var isValidAcn = function isValidAcn(acn) {
|
|
57
|
-
var VALID_ACN_LENGTH = 9;
|
|
52
|
+
var VALID_ACN_LENGTH = 9;
|
|
58
53
|
|
|
54
|
+
// strip whitespace from value
|
|
59
55
|
acn = String(acn).replace(/\s+/g, '');
|
|
60
|
-
|
|
61
56
|
if (acn.length === VALID_ACN_LENGTH) {
|
|
62
57
|
var weights = [8, 7, 6, 5, 4, 3, 2, 1];
|
|
63
58
|
var acnArray = [];
|
|
64
|
-
|
|
65
59
|
for (var i = 0; i < acn.length; i++) {
|
|
66
60
|
acnArray[i] = parseInt(acn.charAt(i));
|
|
67
61
|
}
|
|
62
|
+
var acnSum = 0;
|
|
68
63
|
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
// sum the digits 1-8
|
|
71
65
|
for (var _i3 = 0; _i3 < weights.length; _i3++) {
|
|
72
66
|
acnSum = acnSum + acnArray[_i3] * weights[_i3];
|
|
73
|
-
}
|
|
74
|
-
|
|
67
|
+
}
|
|
75
68
|
|
|
76
|
-
|
|
69
|
+
// divide by 10 and take remainder
|
|
70
|
+
var remainder = acnSum % 10;
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
// complement the remainder to 10
|
|
73
|
+
var complement = 10 - remainder;
|
|
79
74
|
|
|
75
|
+
// if the complement equals 10, set it to 0
|
|
80
76
|
if (complement === 10) {
|
|
81
77
|
complement = 0;
|
|
82
78
|
}
|
|
83
|
-
|
|
84
79
|
return acnArray[8] === complement;
|
|
85
80
|
} else {
|
|
86
81
|
return false;
|
|
@@ -892,7 +892,6 @@ var lib$1 = createCommonjsModule(function (module) {
|
|
|
892
892
|
});
|
|
893
893
|
|
|
894
894
|
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; }
|
|
895
|
-
|
|
896
895
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
897
896
|
var FIELD_VALIDATORS = {
|
|
898
897
|
firstName: {
|
|
@@ -922,9 +921,7 @@ var FIELD_VALIDATORS = {
|
|
|
922
921
|
if (!value) {
|
|
923
922
|
return;
|
|
924
923
|
}
|
|
925
|
-
|
|
926
924
|
var day = _get(value.split('/'), '[0]', '').split(' ').join('');
|
|
927
|
-
|
|
928
925
|
return day ? /^0[1-9]|[12][0-9]|3[01]$/.test(day) : true;
|
|
929
926
|
}
|
|
930
927
|
}, {
|
|
@@ -935,9 +932,7 @@ var FIELD_VALIDATORS = {
|
|
|
935
932
|
if (!value) {
|
|
936
933
|
return;
|
|
937
934
|
}
|
|
938
|
-
|
|
939
935
|
var month = _get(value.split('/'), '[1]', '');
|
|
940
|
-
|
|
941
936
|
return month ? /^(0[1-9]|1[012])$/.test(month) : true;
|
|
942
937
|
}
|
|
943
938
|
}, {
|
|
@@ -948,9 +943,7 @@ var FIELD_VALIDATORS = {
|
|
|
948
943
|
if (!value) {
|
|
949
944
|
return;
|
|
950
945
|
}
|
|
951
|
-
|
|
952
946
|
var year = _get(value.split('/'), '[2]', '');
|
|
953
|
-
|
|
954
947
|
return year ? /^[0-9]{4}$/.test(year) : true;
|
|
955
948
|
}
|
|
956
949
|
}, {
|
|
@@ -961,9 +954,7 @@ var FIELD_VALIDATORS = {
|
|
|
961
954
|
if (!value) {
|
|
962
955
|
return;
|
|
963
956
|
}
|
|
964
|
-
|
|
965
957
|
var year = _get(value.split('/'), '[2]', '');
|
|
966
|
-
|
|
967
958
|
return year ? parseInt(year, 10) >= 1900 : true;
|
|
968
959
|
}
|
|
969
960
|
}, {
|
|
@@ -974,9 +965,7 @@ var FIELD_VALIDATORS = {
|
|
|
974
965
|
if (!value) {
|
|
975
966
|
return;
|
|
976
967
|
}
|
|
977
|
-
|
|
978
968
|
var year = _get(value.split('/'), '[2]', '');
|
|
979
|
-
|
|
980
969
|
return year ? parseInt(year, 10) <= new Date().getFullYear() : true;
|
|
981
970
|
}
|
|
982
971
|
}]
|
|
@@ -1093,16 +1082,16 @@ var FIELD_VALIDATORS = {
|
|
|
1093
1082
|
}
|
|
1094
1083
|
}]
|
|
1095
1084
|
}
|
|
1096
|
-
};
|
|
1085
|
+
};
|
|
1097
1086
|
|
|
1087
|
+
// @ts-expect-error TS(7006): Parameter 'field' implicitly has an 'any' type.
|
|
1098
1088
|
var getFieldSchema = function getFieldSchema(field) {
|
|
1099
|
-
var key = field.key || field.name;
|
|
1100
|
-
|
|
1101
|
-
var defaultFieldExists = Boolean(FIELD_VALIDATORS[key]);
|
|
1102
|
-
|
|
1089
|
+
var key = field.key || field.name;
|
|
1090
|
+
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1091
|
+
var defaultFieldExists = Boolean(FIELD_VALIDATORS[key]);
|
|
1092
|
+
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1103
1093
|
var fieldAttributes = defaultFieldExists ? FIELD_VALIDATORS[key] : field;
|
|
1104
1094
|
var schema = yup;
|
|
1105
|
-
|
|
1106
1095
|
switch (fieldAttributes.type) {
|
|
1107
1096
|
case 'string':
|
|
1108
1097
|
{
|
|
@@ -1110,49 +1099,42 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1110
1099
|
schema = schema.string();
|
|
1111
1100
|
break;
|
|
1112
1101
|
}
|
|
1113
|
-
|
|
1114
1102
|
case 'object':
|
|
1115
1103
|
{
|
|
1116
1104
|
// @ts-expect-error TS(2740): Type 'OptionalObjectSchema<ObjectShape, Record<str... Remove this comment to see the full error message
|
|
1117
1105
|
schema = schema.object();
|
|
1118
1106
|
break;
|
|
1119
1107
|
}
|
|
1120
|
-
|
|
1121
1108
|
case 'array':
|
|
1122
1109
|
{
|
|
1123
1110
|
// @ts-expect-error TS(2740): Type 'OptionalArraySchema<AnySchema<any, any, any>... Remove this comment to see the full error message
|
|
1124
1111
|
schema = schema.array();
|
|
1125
1112
|
break;
|
|
1126
1113
|
}
|
|
1127
|
-
|
|
1128
1114
|
case 'boolean':
|
|
1129
1115
|
{
|
|
1130
1116
|
// @ts-expect-error TS(2740): Type 'BooleanSchema<boolean, Record<string, any>, ... Remove this comment to see the full error message
|
|
1131
1117
|
schema = schema.boolean();
|
|
1132
1118
|
break;
|
|
1133
1119
|
}
|
|
1134
|
-
|
|
1135
1120
|
case 'date':
|
|
1136
1121
|
{
|
|
1137
1122
|
// @ts-expect-error TS(2740): Type 'DateSchema<Date, Record<string, any>, Date>'... Remove this comment to see the full error message
|
|
1138
1123
|
schema = schema.date();
|
|
1139
1124
|
break;
|
|
1140
1125
|
}
|
|
1141
|
-
|
|
1142
1126
|
case 'number':
|
|
1143
1127
|
{
|
|
1144
1128
|
// @ts-expect-error TS(2740): Type 'NumberSchema<number, Record<string, any>, nu... Remove this comment to see the full error message
|
|
1145
1129
|
schema = schema.number();
|
|
1146
1130
|
break;
|
|
1147
1131
|
}
|
|
1148
|
-
|
|
1149
1132
|
default:
|
|
1150
1133
|
{
|
|
1151
1134
|
// @ts-expect-error TS(2322): Type 'StringSchema<string, Record<string, any>, st... Remove this comment to see the full error message
|
|
1152
1135
|
schema = schema.string();
|
|
1153
1136
|
}
|
|
1154
1137
|
}
|
|
1155
|
-
|
|
1156
1138
|
if (fieldAttributes.validators) {
|
|
1157
1139
|
// @ts-expect-error TS(7006): Parameter 'validator' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
1158
1140
|
fieldAttributes.validators.forEach(function (validator) {
|
|
@@ -1161,41 +1143,36 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1161
1143
|
{
|
|
1162
1144
|
if (defaultFieldExists && !field.required) {
|
|
1163
1145
|
return;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1146
|
+
}
|
|
1166
1147
|
|
|
1148
|
+
// @ts-expect-error TS(2339): Property 'required' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
1167
1149
|
schema = schema.required(validator.message);
|
|
1168
1150
|
break;
|
|
1169
1151
|
}
|
|
1170
|
-
|
|
1171
1152
|
case 'test':
|
|
1172
1153
|
{
|
|
1173
1154
|
// @ts-expect-error TS(2339): Property 'test' does not exist on type 'typeof imp... Remove this comment to see the full error message
|
|
1174
1155
|
schema = schema.test(field.name, validator.message, validator.fn);
|
|
1175
1156
|
break;
|
|
1176
1157
|
}
|
|
1177
|
-
|
|
1178
1158
|
case 'email':
|
|
1179
1159
|
{
|
|
1180
1160
|
// @ts-expect-error TS(2339): Property 'email' does not exist on type 'typeof im... Remove this comment to see the full error message
|
|
1181
1161
|
schema = schema.email(validator.message);
|
|
1182
1162
|
break;
|
|
1183
1163
|
}
|
|
1184
|
-
|
|
1185
1164
|
case 'min':
|
|
1186
1165
|
{
|
|
1187
1166
|
// @ts-expect-error TS(2339): Property 'min' does not exist on type 'typeof impo... Remove this comment to see the full error message
|
|
1188
1167
|
schema = schema.min(validator.length, validator.message);
|
|
1189
1168
|
break;
|
|
1190
1169
|
}
|
|
1191
|
-
|
|
1192
1170
|
case 'matches':
|
|
1193
1171
|
{
|
|
1194
1172
|
// @ts-expect-error TS(2339): Property 'matches' does not exist on type 'typeof ... Remove this comment to see the full error message
|
|
1195
1173
|
schema = schema.matches(validator.pattern, validator.message);
|
|
1196
1174
|
break;
|
|
1197
1175
|
}
|
|
1198
|
-
|
|
1199
1176
|
case 'oneOf':
|
|
1200
1177
|
{
|
|
1201
1178
|
// @ts-expect-error TS(2339): Property 'oneOf' does not exist on type 'typeof im... Remove this comment to see the full error message
|
|
@@ -1205,37 +1182,33 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1205
1182
|
}
|
|
1206
1183
|
});
|
|
1207
1184
|
}
|
|
1208
|
-
|
|
1209
1185
|
return schema;
|
|
1210
1186
|
};
|
|
1211
|
-
|
|
1212
1187
|
var buildValidationSchema = function buildValidationSchema(fields, overrideSchema) {
|
|
1213
1188
|
if (overrideSchema === void 0) {
|
|
1214
1189
|
overrideSchema = {};
|
|
1215
1190
|
}
|
|
1216
|
-
|
|
1217
1191
|
var schema = {};
|
|
1218
1192
|
fields.forEach(function (field) {
|
|
1219
1193
|
if (!field) {
|
|
1220
1194
|
return;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1195
|
+
}
|
|
1223
1196
|
|
|
1197
|
+
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1224
1198
|
schema[field.name] = getFieldSchema(field);
|
|
1225
1199
|
});
|
|
1226
1200
|
return yup.object().shape(_objectSpread({}, schema, {}, overrideSchema));
|
|
1227
1201
|
};
|
|
1228
1202
|
/* ===== CUSTOM OVERRIDE SCHEMAS ===== */
|
|
1229
|
-
// @ts-expect-error TS(7006): Parameter 'schema' implicitly has an 'any' type.
|
|
1230
1203
|
|
|
1204
|
+
// @ts-expect-error TS(7006): Parameter 'schema' implicitly has an 'any' type.
|
|
1231
1205
|
var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
1232
1206
|
var cardFields = _ref.cardFields,
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1207
|
+
fieldKey = _ref.fieldKey,
|
|
1208
|
+
dayKey = _ref.dayKey,
|
|
1209
|
+
monthKey = _ref.monthKey,
|
|
1210
|
+
yearKey = _ref.yearKey;
|
|
1237
1211
|
var newSchema = schema;
|
|
1238
|
-
|
|
1239
1212
|
if (cardFields[dayKey]) {
|
|
1240
1213
|
// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
|
|
1241
1214
|
newSchema = newSchema.test(fieldKey, _get(cardFields, dayKey + ".validation.message"), function (value) {
|
|
@@ -1244,7 +1217,6 @@ var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
|
1244
1217
|
return new RegExp(_get(cardFields, dayKey + ".validation.regex")).test(day);
|
|
1245
1218
|
});
|
|
1246
1219
|
}
|
|
1247
|
-
|
|
1248
1220
|
if (cardFields[monthKey]) {
|
|
1249
1221
|
// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
|
|
1250
1222
|
newSchema = newSchema.test(fieldKey, _get(cardFields, monthKey + ".validation.message"), function (value) {
|
|
@@ -1253,7 +1225,6 @@ var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
|
1253
1225
|
return new RegExp(_get(cardFields, monthKey + ".validation.regex")).test(month);
|
|
1254
1226
|
});
|
|
1255
1227
|
}
|
|
1256
|
-
|
|
1257
1228
|
if (cardFields[yearKey]) {
|
|
1258
1229
|
// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
|
|
1259
1230
|
newSchema = newSchema.test(fieldKey, _get(cardFields, yearKey + ".validation.message"), function (value) {
|
|
@@ -1262,10 +1233,8 @@ var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
|
1262
1233
|
return new RegExp(_get(cardFields, yearKey + ".validation.regex")).test(year);
|
|
1263
1234
|
});
|
|
1264
1235
|
}
|
|
1265
|
-
|
|
1266
1236
|
return newSchema;
|
|
1267
1237
|
};
|
|
1268
|
-
|
|
1269
1238
|
var paymentMethodValidationSchema = [{
|
|
1270
1239
|
name: 'cardNumber'
|
|
1271
1240
|
}, {
|
package/chart.js
CHANGED
|
@@ -8,35 +8,34 @@ var _capitalize = _interopDefault(require('lodash/capitalize'));
|
|
|
8
8
|
var _get = _interopDefault(require('lodash/get'));
|
|
9
9
|
var moment = _interopDefault(require('moment'));
|
|
10
10
|
|
|
11
|
+
// @ts-expect-error TS(7006): Parameter 'dataset' implicitly has an 'any' type.
|
|
11
12
|
var buildChartLabelsFromDataset = function buildChartLabelsFromDataset(dataset, labelKey, opts) {
|
|
12
13
|
if (opts === void 0) {
|
|
13
14
|
opts = {};
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
return (
|
|
17
|
+
// @ts-expect-error TS(7006): Parameter 'data' implicitly has an 'any' type.
|
|
17
18
|
dataset.map(function (data) {
|
|
18
19
|
// @ts-expect-error TS(2339): Property 'format' does not exist on type '{}'.
|
|
19
20
|
if (opts.format) {
|
|
20
21
|
// @ts-expect-error TS(2339): Property 'format' does not exist on type '{}'.
|
|
21
22
|
return moment(data[labelKey]).format(opts.format);
|
|
22
23
|
}
|
|
23
|
-
|
|
24
24
|
return data[labelKey];
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
|
-
};
|
|
28
|
-
|
|
27
|
+
};
|
|
28
|
+
// @ts-expect-error TS(7006): Parameter 'dataset' implicitly has an 'any' type.
|
|
29
29
|
var buildDataPointsFromDataset = function buildDataPointsFromDataset(dataset, dataKey) {
|
|
30
30
|
return dataset.map(function (data) {
|
|
31
31
|
return _get(data, dataKey);
|
|
32
32
|
});
|
|
33
|
-
};
|
|
34
|
-
|
|
33
|
+
};
|
|
34
|
+
// @ts-expect-error TS(7006): Parameter 'period' implicitly has an 'any' type.
|
|
35
35
|
var humanizePeriod = function humanizePeriod(period) {
|
|
36
36
|
if (period && period.includes('--')) {
|
|
37
37
|
return '';
|
|
38
38
|
}
|
|
39
|
-
|
|
40
39
|
return _capitalize(period);
|
|
41
40
|
};
|
|
42
41
|
var chart = {
|
package/constants.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _FUNDERS_FORMATTED;
|
|
6
|
-
|
|
7
6
|
/* ====== START: ERRORS ======= */
|
|
8
7
|
var ERROR_MESSAGES = {
|
|
9
8
|
INTERNET_ERROR: 'We are unable to establish an internet connection. We will take you back once you are connected to the internet.',
|
|
@@ -37,10 +36,10 @@ var STANDALONE_ERRORS = {
|
|
|
37
36
|
message: 'Provider number does not match the given funder.'
|
|
38
37
|
}
|
|
39
38
|
};
|
|
39
|
+
|
|
40
40
|
/* ====== END: ERRORS ======= */
|
|
41
41
|
|
|
42
42
|
/* ====== START: DOCUMENTS ======= */
|
|
43
|
-
|
|
44
43
|
var DOCUMENT_STATUSES = {
|
|
45
44
|
AVAILABLE: 'available',
|
|
46
45
|
PENDING: 'pending',
|
|
@@ -64,28 +63,28 @@ var DOCUMENT_WORKFLOW_STATES_HUMANIZED = {
|
|
|
64
63
|
UNDER_REVIEW: 'Under review',
|
|
65
64
|
APPROVED: 'Approved'
|
|
66
65
|
};
|
|
66
|
+
|
|
67
67
|
/* ====== END: DOCUMENTS ======= */
|
|
68
68
|
|
|
69
69
|
/* ====== START: FORMS ======= */
|
|
70
|
-
|
|
71
70
|
var FORM_STATUSES = {
|
|
72
71
|
PUBLISHED: 'published',
|
|
73
72
|
DRAFT: 'draft'
|
|
74
73
|
};
|
|
74
|
+
|
|
75
75
|
/* ====== END: FORMS ======= */
|
|
76
76
|
|
|
77
77
|
/* ====== START: FORM APPLICATIONS ======= */
|
|
78
|
-
|
|
79
78
|
var FORM_APPLICATION_STATUSES = {
|
|
80
79
|
PENDING: 'pending',
|
|
81
80
|
APPROVED: 'approved',
|
|
82
81
|
DECLINED: 'declined',
|
|
83
82
|
CANCELLED: 'cancelled'
|
|
84
83
|
};
|
|
84
|
+
|
|
85
85
|
/* ====== END: FORM APPLICATIONS ======= */
|
|
86
86
|
|
|
87
87
|
/* ====== START: FUNDERS ======= */
|
|
88
|
-
|
|
89
88
|
var FUNDERS = {
|
|
90
89
|
// Note: maps to funder.code
|
|
91
90
|
COMCARE: 'comcare',
|
|
@@ -104,10 +103,10 @@ var FUNDERS = {
|
|
|
104
103
|
WSV: 'wsv'
|
|
105
104
|
};
|
|
106
105
|
var FUNDERS_FORMATTED = (_FUNDERS_FORMATTED = {}, _FUNDERS_FORMATTED[FUNDERS.COMCARE] = 'Comcare', _FUNDERS_FORMATTED[FUNDERS.ECLIPSE] = 'Eclipse', _FUNDERS_FORMATTED[FUNDERS.HBF] = 'HBF', _FUNDERS_FORMATTED[FUNDERS.HEALTHPOINT] = 'HEALTHPOINT', _FUNDERS_FORMATTED[FUNDERS.HICAPS] = 'HICAPS', _FUNDERS_FORMATTED[FUNDERS.ICARE] = 'icare', _FUNDERS_FORMATTED[FUNDERS.MEDICARE] = 'Medicare', _FUNDERS_FORMATTED[FUNDERS.NDIS] = 'NDIS', _FUNDERS_FORMATTED[FUNDERS.NIB] = 'NIB', _FUNDERS_FORMATTED[FUNDERS.OHC] = 'Overseas health cover', _FUNDERS_FORMATTED[FUNDERS.PATIENT] = 'Patient funded', _FUNDERS_FORMATTED[FUNDERS.WCQ] = 'Workcover Queensland', _FUNDERS_FORMATTED[FUNDERS.WSV] = 'WorkSafe Victoria', _FUNDERS_FORMATTED);
|
|
106
|
+
|
|
107
107
|
/* ====== END: FUNDERS ======= */
|
|
108
108
|
|
|
109
109
|
/* ====== START: FUTURES ======= */
|
|
110
|
-
|
|
111
110
|
var FUTURE_STATUSES = {
|
|
112
111
|
ACTIVE: 'active',
|
|
113
112
|
PENDING: 'pending',
|
|
@@ -126,24 +125,24 @@ var FUTURE_LABELS = {
|
|
|
126
125
|
subscription: 'Subscription',
|
|
127
126
|
'instalment-plan': 'Instalment plan'
|
|
128
127
|
};
|
|
128
|
+
|
|
129
129
|
/* ====== END: FUTURES ======= */
|
|
130
130
|
|
|
131
131
|
/* ====== START: GATEWAY ======= */
|
|
132
|
-
|
|
133
132
|
var GATEWAY_CODES = {
|
|
134
133
|
HICAPS_ERROR: '12',
|
|
135
134
|
HICAPS_DOWN: '91',
|
|
136
135
|
MEDICARE_DOWN: '3004'
|
|
137
136
|
};
|
|
137
|
+
|
|
138
138
|
/* ====== END: GATEWAY ======= */
|
|
139
139
|
|
|
140
140
|
/* ====== START: MISC ======= */
|
|
141
|
-
|
|
142
141
|
var AUS_STATES = ['Victoria', 'Tasmania', 'Western Australia', 'South Australia', 'Queensland', 'New South Wales', 'Australian Capital Territory', 'Northern Territory'];
|
|
142
|
+
|
|
143
143
|
/* ====== END: MISC ======= */
|
|
144
144
|
|
|
145
145
|
/* ====== START: PAYMENTS ======= */
|
|
146
|
-
|
|
147
146
|
var PAYMENT_FACILITIES = {
|
|
148
147
|
HICAPS_GO: 'hicaps-go',
|
|
149
148
|
MEDIPASS_PAYMENTS: 'medipass-payments'
|
|
@@ -153,10 +152,10 @@ var PAYMENT_PROVIDERS = {
|
|
|
153
152
|
APPLE_PAY: 'apple-pay',
|
|
154
153
|
PAYMENT_CARD: 'payment-card'
|
|
155
154
|
};
|
|
155
|
+
|
|
156
156
|
/* ====== START: PAYMENTS ======= */
|
|
157
157
|
|
|
158
158
|
/* ====== START: PRODUCT ======= */
|
|
159
|
-
|
|
160
159
|
var PRODUCTS = {
|
|
161
160
|
BASIC: 'basic',
|
|
162
161
|
PRO: 'pro'
|
|
@@ -178,10 +177,10 @@ var PRODUCT_FEATURES = {
|
|
|
178
177
|
PMS_INTEGRATION: 'pms:integration',
|
|
179
178
|
REPORTING: 'reporting'
|
|
180
179
|
};
|
|
180
|
+
|
|
181
181
|
/* ====== END: PRODUCT ======= */
|
|
182
182
|
|
|
183
183
|
/* ====== START: STATUSES ======= */
|
|
184
|
-
|
|
185
184
|
var STATUSES = {
|
|
186
185
|
ACTIVE: 'ACTIVE',
|
|
187
186
|
DISABLED: 'DISABLED',
|
|
@@ -194,10 +193,10 @@ var STATUSES = {
|
|
|
194
193
|
PENDING: 'PENDING',
|
|
195
194
|
EXPIRED: 'EXPIRED'
|
|
196
195
|
};
|
|
196
|
+
|
|
197
197
|
/* ====== END: STATUSES ======= */
|
|
198
198
|
|
|
199
199
|
/* ====== START: BUSINESS STATUSES ======= */
|
|
200
|
-
|
|
201
200
|
var BUSINESS_STATUSES = {
|
|
202
201
|
ACTIVE: 'ACTIVE',
|
|
203
202
|
SUSPENDED: 'SUSPENDED'
|
|
@@ -205,7 +204,6 @@ var BUSINESS_STATUSES = {
|
|
|
205
204
|
/* ====== END: BUSINESS STATUSES ======= */
|
|
206
205
|
|
|
207
206
|
/* ====== START: PAYMENT STATUSES ======= */
|
|
208
|
-
|
|
209
207
|
var PAYMENT_STATUSES = {
|
|
210
208
|
ACCEPTED: 'accepted',
|
|
211
209
|
APPROVED: 'approved',
|
|
@@ -213,10 +211,10 @@ var PAYMENT_STATUSES = {
|
|
|
213
211
|
PENDING: 'pending',
|
|
214
212
|
SETTLING: 'settling'
|
|
215
213
|
};
|
|
214
|
+
|
|
216
215
|
/* ====== END: PAYMENT STATUSES ======= */
|
|
217
216
|
|
|
218
217
|
/* ====== START: TRANSACTIONS ======= */
|
|
219
|
-
|
|
220
218
|
var PAYMENT_TYPES = {
|
|
221
219
|
SALE: 'sale',
|
|
222
220
|
REFUND: 'refund',
|
|
@@ -294,42 +292,42 @@ var ICARE_WORKFLOW_STATES_HUMANIZED = {
|
|
|
294
292
|
COMPLETED: 'Completed',
|
|
295
293
|
REJECTED: 'Rejected'
|
|
296
294
|
};
|
|
295
|
+
|
|
297
296
|
/* ====== END: TRANSACTIONS ======= */
|
|
298
297
|
|
|
299
298
|
/* ====== START: MEDICARE ======= */
|
|
300
|
-
|
|
301
299
|
var MEDICARE_FORMS = {
|
|
302
300
|
ONLINE_CLAIMING_PROVIDER_AGREEMENT: 'Online Claiming Provider Agreement'
|
|
303
301
|
};
|
|
302
|
+
|
|
304
303
|
/* ====== END: MEDICARE ======= */
|
|
305
304
|
|
|
306
305
|
/* ====== START: HICAPS FORMS ======= */
|
|
307
|
-
|
|
308
306
|
var HICAPS_FORMS = {
|
|
309
307
|
CLAIMING_PROVIDER_APPLICATION: 'HICAPS Claiming Application'
|
|
310
308
|
};
|
|
309
|
+
|
|
311
310
|
/* ====== END: HICAPS FORMS ======= */
|
|
312
311
|
|
|
313
312
|
/* ====== START: PMS ======= */
|
|
314
|
-
|
|
315
313
|
var PMS = ['Best Practice (Allied)', 'Best Practice (Premier)', 'Clinic to Cloud', 'Cliniko', 'Coreplus', 'Coviu', 'Dental4Windows', 'Doctors on Demand', 'Exact', 'Front Desk', 'Genie', 'Gensolve', 'Gentu', 'Halaxy / HealthKit', 'Iconpractice', 'Kalysys', 'Lysn', 'Medical Director', 'Medilink', 'Medirecords', 'MedTech', 'My Appointments', 'Myhealth1st', 'Nookal', 'Oasis', 'Owner.health', 'Optomate', 'Powerdiary', 'PPMP', 'PracSuite', 'Shexie', 'Splose', 'Sunix', 'TM2', 'VisitBase', 'ZedMed', 'Zurili', 'Other'];
|
|
314
|
+
|
|
316
315
|
/* ====== END: PMS ======= */
|
|
317
316
|
|
|
318
317
|
/* ====== START: REGIONS ======= */
|
|
319
|
-
|
|
320
318
|
var REGIONS = {
|
|
321
319
|
au: 'au',
|
|
322
320
|
uk: 'uk'
|
|
323
321
|
};
|
|
322
|
+
|
|
324
323
|
/* ====== END: REGIONS ======= */
|
|
325
324
|
|
|
326
325
|
/* ====== START: VERIFY MEMBER HEALTH FUNDS ======= */
|
|
327
|
-
|
|
328
326
|
var VERIFY_MEMBER_HEALTH_FUNDS_CODES = ['BUP'];
|
|
327
|
+
|
|
329
328
|
/* ====== END: VERIFY MEMBER HEALTH FUNDS ======= */
|
|
330
329
|
|
|
331
330
|
/* ====== START: INVOICE_ORIGINATING_FLOW ======= */
|
|
332
|
-
|
|
333
331
|
var INVOICE_ORIGINATING_FLOW = {
|
|
334
332
|
ALLIED_PHI: 'allied-phi',
|
|
335
333
|
COMCARE: 'comcare',
|
|
@@ -348,18 +346,18 @@ var INVOICE_ORIGINATING_FLOW = {
|
|
|
348
346
|
WORK_COVER_QUEENSLAND: 'wcq',
|
|
349
347
|
WORKSAFE_VICTORIA: 'wsv'
|
|
350
348
|
};
|
|
349
|
+
|
|
351
350
|
/* ====== END: INVOICE_ORIGINATING_FLOW ======= */
|
|
352
351
|
|
|
353
352
|
/* ====== START: STAFF ======= */
|
|
354
|
-
|
|
355
353
|
var STAFF_TYPES = {
|
|
356
354
|
LOCATION: 'location',
|
|
357
355
|
PERSON: 'person'
|
|
358
356
|
};
|
|
357
|
+
|
|
359
358
|
/* ====== END: STAFF ======= */
|
|
360
359
|
|
|
361
360
|
/* ====== START: ECLIPSE ======= */
|
|
362
|
-
|
|
363
361
|
var ECLIPSE_SUB_TYPE = {
|
|
364
362
|
ONLINE_ELIGIBILITY_CHECK: 'onlineEligibilityCheck',
|
|
365
363
|
IN_PATIENT: 'inPatient',
|
package/datetime.js
CHANGED
|
@@ -8,28 +8,27 @@ var startOfMinute = _interopDefault(require('date-fns/startOfMinute'));
|
|
|
8
8
|
var setMinutes = _interopDefault(require('date-fns/setMinutes'));
|
|
9
9
|
var getMinutes = _interopDefault(require('date-fns/getMinutes'));
|
|
10
10
|
|
|
11
|
+
// @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
11
12
|
var roundToNearestMinutes = function roundToNearestMinutes(date, interval) {
|
|
12
13
|
var roundedMinutes = Math.floor(getMinutes(date) / interval) * interval;
|
|
13
14
|
return setMinutes(startOfMinute(date), roundedMinutes);
|
|
14
|
-
};
|
|
15
|
+
};
|
|
15
16
|
|
|
17
|
+
// @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
16
18
|
var isValidDate = function isValidDate(date) {
|
|
17
19
|
return /\d{4}-\d{2}-\d{2}/.test(date);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
+
};
|
|
20
21
|
|
|
22
|
+
// @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
21
23
|
var parseDate = function parseDate(date) {
|
|
22
24
|
if (!date) {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
25
|
-
|
|
26
27
|
var serviceDateArray = date.split('/');
|
|
27
28
|
var serviceDateString = serviceDateArray[2] + "-" + serviceDateArray[1] + "-" + serviceDateArray[0];
|
|
28
|
-
|
|
29
29
|
if (!isValidDate(serviceDateString)) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
return serviceDateString;
|
|
34
33
|
};
|
|
35
34
|
|
package/env.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const REACT_APP_ENV: string | undefined;
|
|
2
|
+
export declare const REACT_APP_ERROR_MESSAGE__INTERNET_ERROR: string | undefined;
|
|
3
|
+
export declare const REACT_APP_ERROR_MESSAGE__NETWORK_ERROR: string | undefined;
|
|
4
|
+
export declare const REACT_APP_ERROR_MESSAGE__SERVER_ERROR: string | undefined;
|
|
5
|
+
export declare const REACT_APP_ERROR_MESSAGE__PAYMENT_GATEWAY_ERROR: string | undefined;
|
|
6
|
+
export declare const REACT_APP_ERROR_MESSAGE__PAYMENT_ERROR: string | undefined;
|
|
7
|
+
export declare const REACT_APP_ERROR_MESSAGE__PAYMENT_GATEWAY_FIELDS: string | undefined;
|
|
8
|
+
export declare const REACT_APP_REGION: string | undefined;
|
|
9
|
+
export declare const REACT_APP_LOCAL_PORT: string | undefined;
|