@opencrvs/toolkit 2.0.0-rc.4844c26 → 2.0.0-rc.4917ce5
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/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +17 -10
- package/dist/commons/api/router.d.ts +14 -3
- package/dist/commons/conditionals/conditionals.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +36 -36
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/state/flags.d.ts +15 -0
- package/dist/conditionals/index.js +4 -0
- package/dist/events/index.js +483 -54
- package/dist/notification/index.js +420 -29
- package/opencrvs-toolkit-2.0.0-rc.4917ce5.tgz +0 -0
- package/package.json +6 -2
- package/opencrvs-toolkit-2.0.0-rc.4844c26.tgz +0 -0
package/dist/events/index.js
CHANGED
|
@@ -213,6 +213,10 @@ __export(events_exports, {
|
|
|
213
213
|
UUID: () => UUID,
|
|
214
214
|
UnassignActionInput: () => UnassignActionInput,
|
|
215
215
|
UserAuditRecordInput: () => UserAuditRecordInput,
|
|
216
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS,
|
|
217
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP,
|
|
218
|
+
V2_DEFAULT_MOCK_LOCATIONS: () => V2_DEFAULT_MOCK_LOCATIONS,
|
|
219
|
+
V2_DEFAULT_MOCK_LOCATIONS_MAP: () => V2_DEFAULT_MOCK_LOCATIONS_MAP,
|
|
216
220
|
ValidationConfig: () => ValidationConfig,
|
|
217
221
|
VerificationActionConfig: () => VerificationActionConfig,
|
|
218
222
|
VerificationPageConfig: () => VerificationPageConfig,
|
|
@@ -234,6 +238,7 @@ __export(events_exports, {
|
|
|
234
238
|
ageToDate: () => ageToDate,
|
|
235
239
|
aggregateActionAnnotations: () => aggregateActionAnnotations,
|
|
236
240
|
aggregateActionDeclarations: () => aggregateActionDeclarations,
|
|
241
|
+
always: () => always,
|
|
237
242
|
alwaysTrue: () => alwaysTrue,
|
|
238
243
|
and: () => and,
|
|
239
244
|
annotationActions: () => annotationActions,
|
|
@@ -1080,8 +1085,8 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
1080
1085
|
// Action can be shown to the user in the list but as disabled
|
|
1081
1086
|
EnableConditional
|
|
1082
1087
|
]).meta({
|
|
1083
|
-
|
|
1084
|
-
|
|
1088
|
+
id: "ActionConditional",
|
|
1089
|
+
description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
|
|
1085
1090
|
});
|
|
1086
1091
|
var DisplayOnReviewConditional = z7.object({
|
|
1087
1092
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
@@ -1097,8 +1102,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
1097
1102
|
// Field output can be shown / hidden on the review page
|
|
1098
1103
|
DisplayOnReviewConditional
|
|
1099
1104
|
]).meta({
|
|
1100
|
-
|
|
1101
|
-
|
|
1105
|
+
id: "FieldConditional",
|
|
1106
|
+
description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
|
|
1102
1107
|
});
|
|
1103
1108
|
|
|
1104
1109
|
// ../commons/src/events/FieldType.ts
|
|
@@ -1742,8 +1747,8 @@ var FlagConfig = z15.object({
|
|
|
1742
1747
|
),
|
|
1743
1748
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1744
1749
|
}).meta({
|
|
1745
|
-
|
|
1746
|
-
|
|
1750
|
+
id: "FlagConfig",
|
|
1751
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1747
1752
|
});
|
|
1748
1753
|
var ActionFlagConfig = z15.object({
|
|
1749
1754
|
id: Flag,
|
|
@@ -1752,8 +1757,8 @@ var ActionFlagConfig = z15.object({
|
|
|
1752
1757
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1753
1758
|
)
|
|
1754
1759
|
}).meta({
|
|
1755
|
-
|
|
1756
|
-
|
|
1760
|
+
id: "ActionFlagConfig",
|
|
1761
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1757
1762
|
});
|
|
1758
1763
|
|
|
1759
1764
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -2183,8 +2188,15 @@ var FieldReference = import_v43.default.object({
|
|
|
2183
2188
|
)
|
|
2184
2189
|
}).describe("Reference to a field by its ID");
|
|
2185
2190
|
var ValidationConfig = import_v43.default.object({
|
|
2186
|
-
validator: Conditional
|
|
2187
|
-
|
|
2191
|
+
validator: Conditional.describe(
|
|
2192
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
2193
|
+
),
|
|
2194
|
+
message: TranslationConfig.describe(
|
|
2195
|
+
"Error message displayed when the validator does not hold."
|
|
2196
|
+
)
|
|
2197
|
+
}).meta({
|
|
2198
|
+
id: "ValidationConfig",
|
|
2199
|
+
description: "Validation rule applied to a form field. The validator is a conditional expression that must hold for the field value to be considered valid."
|
|
2188
2200
|
});
|
|
2189
2201
|
var requiredSchema = import_v43.default.union([
|
|
2190
2202
|
import_v43.default.boolean(),
|
|
@@ -3018,15 +3030,18 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
3018
3030
|
actions: VerificationActionConfig
|
|
3019
3031
|
});
|
|
3020
3032
|
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
3021
|
-
|
|
3022
|
-
|
|
3033
|
+
id: "PageConfig",
|
|
3034
|
+
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
3023
3035
|
});
|
|
3024
3036
|
|
|
3025
3037
|
// ../commons/src/events/FormConfig.ts
|
|
3026
3038
|
var DeclarationFormConfig = z22.object({
|
|
3027
3039
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
3028
3040
|
pages: z22.array(FormPageConfig)
|
|
3029
|
-
}).
|
|
3041
|
+
}).meta({
|
|
3042
|
+
id: "DeclarationFormConfig",
|
|
3043
|
+
description: "Configuration of the declaration form."
|
|
3044
|
+
});
|
|
3030
3045
|
var ActionFormConfig = z22.object({
|
|
3031
3046
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
3032
3047
|
pages: z22.array(PageConfig)
|
|
@@ -3126,6 +3141,9 @@ var DeduplicationConfig = z23.object({
|
|
|
3126
3141
|
id: z23.string(),
|
|
3127
3142
|
label: TranslationConfig,
|
|
3128
3143
|
query: Clause
|
|
3144
|
+
}).meta({
|
|
3145
|
+
id: "DeduplicationConfig",
|
|
3146
|
+
description: "Configuration for duplicate detection on a declare or register action. The query is built from fuzzy / strict / date-range matchers combined with and/or/not."
|
|
3129
3147
|
});
|
|
3130
3148
|
|
|
3131
3149
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -3245,36 +3263,39 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3245
3263
|
*/
|
|
3246
3264
|
ReadActionConfig.meta({
|
|
3247
3265
|
id: "ReadActionConfig",
|
|
3248
|
-
description: "
|
|
3266
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
3249
3267
|
}),
|
|
3250
3268
|
DeclareConfig.meta({
|
|
3251
3269
|
id: "DeclareActionConfig",
|
|
3252
|
-
description: "
|
|
3270
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
3253
3271
|
}),
|
|
3254
3272
|
RejectConfig.meta({
|
|
3255
3273
|
id: "RejectActionConfig",
|
|
3256
|
-
description: "
|
|
3274
|
+
description: "Configuration for rejecting a record before registration."
|
|
3257
3275
|
}),
|
|
3258
3276
|
RegisterConfig.meta({
|
|
3259
3277
|
id: "RegisterActionConfig",
|
|
3260
|
-
description: "
|
|
3278
|
+
description: "Configuration for registering a record."
|
|
3261
3279
|
}),
|
|
3262
3280
|
PrintCertificateActionConfig.meta({
|
|
3263
3281
|
id: "PrintCertificateActionConfig",
|
|
3264
|
-
description: "
|
|
3282
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
3283
|
+
}),
|
|
3284
|
+
RequestCorrectionConfig.meta({
|
|
3285
|
+
id: "RequestCorrectionActionConfig",
|
|
3286
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
3265
3287
|
}),
|
|
3266
|
-
RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
|
|
3267
3288
|
EditActionConfig.meta({
|
|
3268
3289
|
id: "EditActionConfig",
|
|
3269
|
-
description: "
|
|
3290
|
+
description: "Configuration for editing a record before registration."
|
|
3270
3291
|
}),
|
|
3271
3292
|
ArchiveConfig.meta({
|
|
3272
3293
|
id: "ArchiveActionConfig",
|
|
3273
|
-
description: "
|
|
3294
|
+
description: "Configuration for archiving a record."
|
|
3274
3295
|
}),
|
|
3275
3296
|
CustomActionConfig.meta({
|
|
3276
3297
|
id: "CustomActionConfig",
|
|
3277
|
-
description: "
|
|
3298
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
3278
3299
|
})
|
|
3279
3300
|
]).describe(
|
|
3280
3301
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
@@ -3351,7 +3372,10 @@ var Field = BaseField2.extend({
|
|
|
3351
3372
|
}).describe("Custom field defined for the summary view.");
|
|
3352
3373
|
var SummaryConfig = z27.object({
|
|
3353
3374
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3354
|
-
}).
|
|
3375
|
+
}).meta({
|
|
3376
|
+
id: "SummaryConfig",
|
|
3377
|
+
description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
|
|
3378
|
+
});
|
|
3355
3379
|
|
|
3356
3380
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3357
3381
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -3475,6 +3499,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
3475
3499
|
var AdvancedSearchConfig = z28.object({
|
|
3476
3500
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3477
3501
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3502
|
+
}).meta({
|
|
3503
|
+
id: "AdvancedSearchConfig",
|
|
3504
|
+
description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
|
|
3478
3505
|
});
|
|
3479
3506
|
|
|
3480
3507
|
// ../commons/src/events/utils.ts
|
|
@@ -4828,6 +4855,9 @@ function not(condition) {
|
|
|
4828
4855
|
function never2() {
|
|
4829
4856
|
return not(alwaysTrue());
|
|
4830
4857
|
}
|
|
4858
|
+
function always() {
|
|
4859
|
+
return defineConditional(alwaysTrue());
|
|
4860
|
+
}
|
|
4831
4861
|
function jsonFieldPath(field3) {
|
|
4832
4862
|
return [field3.$$field, ...field3.$$subfield].join("/");
|
|
4833
4863
|
}
|
|
@@ -5548,8 +5578,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
5548
5578
|
validateActionFlags(event2, ctx);
|
|
5549
5579
|
validateActionOrder(event2, ctx);
|
|
5550
5580
|
}).meta({
|
|
5551
|
-
id: "EventConfig"
|
|
5552
|
-
|
|
5581
|
+
id: "EventConfig",
|
|
5582
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
5583
|
+
});
|
|
5553
5584
|
|
|
5554
5585
|
// ../commons/src/events/EventConfigInput.ts
|
|
5555
5586
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -5772,6 +5803,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
5772
5803
|
var WorkqueueColumn = z34.object({
|
|
5773
5804
|
label: TranslationConfig,
|
|
5774
5805
|
value: WorkqueueColumnValue
|
|
5806
|
+
}).meta({
|
|
5807
|
+
id: "WorkqueueColumn",
|
|
5808
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
5775
5809
|
});
|
|
5776
5810
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
5777
5811
|
return workqueueColumns.map(
|
|
@@ -5977,8 +6011,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5977
6011
|
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
5978
6012
|
query: CountryConfigQueryInputType
|
|
5979
6013
|
}).meta({
|
|
5980
|
-
|
|
5981
|
-
|
|
6014
|
+
id: "WorkqueueConfig",
|
|
6015
|
+
description: "Configuration for a single workqueue. Defines the filter applied to the event index, the quick-action button, the columns shown on each row, and the message rendered when the queue is empty."
|
|
5982
6016
|
});
|
|
5983
6017
|
function defineWorkqueue(workqueueInput) {
|
|
5984
6018
|
const queryInput = workqueueInput.query;
|
|
@@ -6041,7 +6075,9 @@ var BaseActionInput = z38.object({
|
|
|
6041
6075
|
keepAssignment: z38.boolean().optional(),
|
|
6042
6076
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
6043
6077
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
6044
|
-
waitFor: z38.boolean().
|
|
6078
|
+
waitFor: z38.boolean().default(true).describe(
|
|
6079
|
+
"Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
|
|
6080
|
+
),
|
|
6045
6081
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
6046
6082
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
6047
6083
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -6221,7 +6257,7 @@ var Draft = z39.object({
|
|
|
6221
6257
|
}).describe(
|
|
6222
6258
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
6223
6259
|
);
|
|
6224
|
-
var DraftInput = BaseActionInput.extend({
|
|
6260
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
6225
6261
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
6226
6262
|
status: z39.enum([
|
|
6227
6263
|
ActionStatus.Requested,
|
|
@@ -6352,26 +6388,43 @@ var import_date_fns3 = require("date-fns");
|
|
|
6352
6388
|
function isEditInProgress(actions) {
|
|
6353
6389
|
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6354
6390
|
}
|
|
6391
|
+
function findPendingCorrectionAction(writeActions2) {
|
|
6392
|
+
let correctionRequestAction;
|
|
6393
|
+
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
6394
|
+
const action = writeActions2[i];
|
|
6395
|
+
if (action.type === ActionType.APPROVE_CORRECTION || action.type === ActionType.REJECT_CORRECTION) {
|
|
6396
|
+
break;
|
|
6397
|
+
}
|
|
6398
|
+
if (action.type === ActionType.REQUEST_CORRECTION) {
|
|
6399
|
+
correctionRequestAction = action;
|
|
6400
|
+
break;
|
|
6401
|
+
}
|
|
6402
|
+
}
|
|
6403
|
+
return correctionRequestAction;
|
|
6404
|
+
}
|
|
6355
6405
|
function isCorrectionRequested(actions) {
|
|
6406
|
+
return findPendingCorrectionAction(actions) !== void 0;
|
|
6407
|
+
}
|
|
6408
|
+
function isDeclarationIncomplete(actions) {
|
|
6409
|
+
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6410
|
+
}
|
|
6411
|
+
function isRejected(actions) {
|
|
6412
|
+
const resettingActionTypes = [
|
|
6413
|
+
ActionType.NOTIFY,
|
|
6414
|
+
ActionType.DECLARE,
|
|
6415
|
+
ActionType.EDIT,
|
|
6416
|
+
ActionType.REGISTER
|
|
6417
|
+
];
|
|
6356
6418
|
return actions.reduce((prev, { type }) => {
|
|
6357
|
-
if (type === ActionType.
|
|
6419
|
+
if (type === ActionType.REJECT) {
|
|
6358
6420
|
return true;
|
|
6359
6421
|
}
|
|
6360
|
-
if (type
|
|
6361
|
-
return false;
|
|
6362
|
-
}
|
|
6363
|
-
if (type === ActionType.REJECT_CORRECTION) {
|
|
6422
|
+
if (resettingActionTypes.includes(type)) {
|
|
6364
6423
|
return false;
|
|
6365
6424
|
}
|
|
6366
6425
|
return prev;
|
|
6367
6426
|
}, false);
|
|
6368
6427
|
}
|
|
6369
|
-
function isDeclarationIncomplete(actions) {
|
|
6370
|
-
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6371
|
-
}
|
|
6372
|
-
function isRejected(actions) {
|
|
6373
|
-
return actions.at(-1)?.type === ActionType.REJECT;
|
|
6374
|
-
}
|
|
6375
6428
|
function isPotentialDuplicate(actions) {
|
|
6376
6429
|
return actions.reduce((prev, { type }) => {
|
|
6377
6430
|
if (type === ActionType.DUPLICATE_DETECTED) {
|
|
@@ -6434,8 +6487,7 @@ function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
|
6434
6487
|
return (0, import_lodash3.uniq)(flags);
|
|
6435
6488
|
}, []);
|
|
6436
6489
|
}
|
|
6437
|
-
function
|
|
6438
|
-
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6490
|
+
function getActionStatusFlags(sortedActions) {
|
|
6439
6491
|
const actionStatus = sortedActions.reduce(
|
|
6440
6492
|
(actionStatuses, { type, status: status2 }) => ({
|
|
6441
6493
|
...actionStatuses,
|
|
@@ -6443,26 +6495,40 @@ function getEventFlags(event2, config) {
|
|
|
6443
6495
|
}),
|
|
6444
6496
|
{}
|
|
6445
6497
|
);
|
|
6446
|
-
|
|
6498
|
+
return Object.entries(actionStatus).filter(([, status2]) => status2 !== ActionStatus.Accepted).map(([type, status2]) => {
|
|
6447
6499
|
const flag2 = joinValues([type, status2], ":").toLowerCase();
|
|
6448
6500
|
return flag2;
|
|
6449
6501
|
});
|
|
6450
|
-
|
|
6451
|
-
|
|
6502
|
+
}
|
|
6503
|
+
function getInherentFlags(sortedActions) {
|
|
6504
|
+
const acceptedActions = sortedActions.filter(
|
|
6505
|
+
({ status: status2 }) => status2 === ActionStatus.Accepted
|
|
6506
|
+
);
|
|
6507
|
+
const inherentFlags = [];
|
|
6508
|
+
if (isCorrectionRequested(acceptedActions)) {
|
|
6509
|
+
inherentFlags.push(InherentFlags.CORRECTION_REQUESTED);
|
|
6452
6510
|
}
|
|
6453
|
-
if (isDeclarationIncomplete(
|
|
6454
|
-
|
|
6511
|
+
if (isDeclarationIncomplete(acceptedActions)) {
|
|
6512
|
+
inherentFlags.push(InherentFlags.INCOMPLETE);
|
|
6455
6513
|
}
|
|
6456
|
-
if (isRejected(
|
|
6457
|
-
|
|
6514
|
+
if (isRejected(acceptedActions)) {
|
|
6515
|
+
inherentFlags.push(InherentFlags.REJECTED);
|
|
6458
6516
|
}
|
|
6459
|
-
if (isPotentialDuplicate(
|
|
6460
|
-
|
|
6517
|
+
if (isPotentialDuplicate(acceptedActions)) {
|
|
6518
|
+
inherentFlags.push(InherentFlags.POTENTIAL_DUPLICATE);
|
|
6461
6519
|
}
|
|
6462
|
-
if (isEditInProgress(
|
|
6463
|
-
|
|
6520
|
+
if (isEditInProgress(acceptedActions)) {
|
|
6521
|
+
inherentFlags.push(InherentFlags.EDIT_IN_PROGRESS);
|
|
6464
6522
|
}
|
|
6465
|
-
return
|
|
6523
|
+
return inherentFlags;
|
|
6524
|
+
}
|
|
6525
|
+
function getEventFlags(event2, config) {
|
|
6526
|
+
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6527
|
+
return [
|
|
6528
|
+
...getActionStatusFlags(sortedActions),
|
|
6529
|
+
...getInherentFlags(sortedActions),
|
|
6530
|
+
...resolveEventCustomFlags(event2, config)
|
|
6531
|
+
];
|
|
6466
6532
|
}
|
|
6467
6533
|
|
|
6468
6534
|
// ../commons/src/events/state/index.ts
|
|
@@ -10461,3 +10527,366 @@ function getFilePathsFromEvent(event2) {
|
|
|
10461
10527
|
});
|
|
10462
10528
|
return (0, import_lodash7.uniq)(filepaths);
|
|
10463
10529
|
}
|
|
10530
|
+
|
|
10531
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
10532
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
10533
|
+
{
|
|
10534
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10535
|
+
name: "Central",
|
|
10536
|
+
parentId: null,
|
|
10537
|
+
validUntil: null,
|
|
10538
|
+
externalId: "ydyJb1RAy4U1"
|
|
10539
|
+
},
|
|
10540
|
+
{
|
|
10541
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10542
|
+
name: "Sulaka",
|
|
10543
|
+
parentId: null,
|
|
10544
|
+
validUntil: null,
|
|
10545
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
10546
|
+
},
|
|
10547
|
+
{
|
|
10548
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
10549
|
+
name: "Pualula",
|
|
10550
|
+
parentId: null,
|
|
10551
|
+
validUntil: null,
|
|
10552
|
+
externalId: "Aq91DweLmT8k"
|
|
10553
|
+
},
|
|
10554
|
+
{
|
|
10555
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
10556
|
+
name: "Chuminga",
|
|
10557
|
+
parentId: null,
|
|
10558
|
+
validUntil: null,
|
|
10559
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
10560
|
+
},
|
|
10561
|
+
{
|
|
10562
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10563
|
+
name: "Ibombo",
|
|
10564
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10565
|
+
validUntil: null,
|
|
10566
|
+
externalId: "k7DsP4vbN1Qe"
|
|
10567
|
+
},
|
|
10568
|
+
{
|
|
10569
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10570
|
+
name: "Isango",
|
|
10571
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10572
|
+
validUntil: null,
|
|
10573
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
10574
|
+
},
|
|
10575
|
+
{
|
|
10576
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10577
|
+
name: "Isamba",
|
|
10578
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10579
|
+
validUntil: null,
|
|
10580
|
+
externalId: "sT0xVu1KqJ7r"
|
|
10581
|
+
},
|
|
10582
|
+
{
|
|
10583
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10584
|
+
name: "Itambo",
|
|
10585
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10586
|
+
validUntil: null,
|
|
10587
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
10588
|
+
},
|
|
10589
|
+
{
|
|
10590
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
10591
|
+
name: "Ezhi",
|
|
10592
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10593
|
+
validUntil: null,
|
|
10594
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
10595
|
+
},
|
|
10596
|
+
{
|
|
10597
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10598
|
+
name: "Ilanga",
|
|
10599
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10600
|
+
validUntil: null,
|
|
10601
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
10602
|
+
},
|
|
10603
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
10604
|
+
{
|
|
10605
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10606
|
+
name: "Klow",
|
|
10607
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10608
|
+
validUntil: null,
|
|
10609
|
+
externalId: "IkYcYBUcyY2"
|
|
10610
|
+
},
|
|
10611
|
+
{
|
|
10612
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
10613
|
+
name: "Mbondo",
|
|
10614
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10615
|
+
validUntil: null,
|
|
10616
|
+
externalId: "Qhvv5hvo3mY"
|
|
10617
|
+
},
|
|
10618
|
+
{
|
|
10619
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
10620
|
+
name: "Ndara",
|
|
10621
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10622
|
+
validUntil: null,
|
|
10623
|
+
externalId: "crXh068O9TR"
|
|
10624
|
+
},
|
|
10625
|
+
{
|
|
10626
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
10627
|
+
name: "Olani",
|
|
10628
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10629
|
+
validUntil: null,
|
|
10630
|
+
externalId: "r00It8Tvvp7"
|
|
10631
|
+
},
|
|
10632
|
+
{
|
|
10633
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
10634
|
+
name: "Pemba",
|
|
10635
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10636
|
+
validUntil: null,
|
|
10637
|
+
externalId: "ZnUWsbONIaH"
|
|
10638
|
+
},
|
|
10639
|
+
{
|
|
10640
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
10641
|
+
name: "Quanza",
|
|
10642
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10643
|
+
validUntil: null,
|
|
10644
|
+
externalId: "fDZycvQTa7l"
|
|
10645
|
+
},
|
|
10646
|
+
{
|
|
10647
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
10648
|
+
name: "Rivka",
|
|
10649
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10650
|
+
validUntil: null,
|
|
10651
|
+
externalId: "KqswxCGTELa"
|
|
10652
|
+
},
|
|
10653
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
10654
|
+
{
|
|
10655
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
10656
|
+
name: "Mbula",
|
|
10657
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10658
|
+
validUntil: null,
|
|
10659
|
+
externalId: "osEbKjRc9Kg"
|
|
10660
|
+
},
|
|
10661
|
+
{
|
|
10662
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
10663
|
+
name: "Ndoki",
|
|
10664
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10665
|
+
validUntil: null,
|
|
10666
|
+
externalId: "aq4daBUAGr3"
|
|
10667
|
+
},
|
|
10668
|
+
{
|
|
10669
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
10670
|
+
name: "Tsanga",
|
|
10671
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10672
|
+
validUntil: null,
|
|
10673
|
+
externalId: "cqis6Y8trbJ"
|
|
10674
|
+
},
|
|
10675
|
+
{
|
|
10676
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
10677
|
+
name: "Waziri",
|
|
10678
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10679
|
+
validUntil: null,
|
|
10680
|
+
externalId: "LMijHPyyx6d"
|
|
10681
|
+
},
|
|
10682
|
+
{
|
|
10683
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
10684
|
+
name: "Zimbi",
|
|
10685
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10686
|
+
validUntil: null,
|
|
10687
|
+
externalId: "pcQYbPuKGZ7"
|
|
10688
|
+
},
|
|
10689
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
10690
|
+
{
|
|
10691
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
10692
|
+
name: "Felani",
|
|
10693
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10694
|
+
validUntil: null,
|
|
10695
|
+
externalId: "gSqpoCGdMXp"
|
|
10696
|
+
},
|
|
10697
|
+
{
|
|
10698
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
10699
|
+
name: "Goroma",
|
|
10700
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10701
|
+
validUntil: null,
|
|
10702
|
+
externalId: "KvAAIaNqVrp"
|
|
10703
|
+
},
|
|
10704
|
+
{
|
|
10705
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
10706
|
+
name: "Halifu",
|
|
10707
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10708
|
+
validUntil: null,
|
|
10709
|
+
externalId: "qe4UnEVt1hv"
|
|
10710
|
+
},
|
|
10711
|
+
{
|
|
10712
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
10713
|
+
name: "Jabari",
|
|
10714
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10715
|
+
validUntil: null,
|
|
10716
|
+
externalId: "yHH9Nz4rLOt"
|
|
10717
|
+
},
|
|
10718
|
+
{
|
|
10719
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
10720
|
+
name: "Kifani",
|
|
10721
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10722
|
+
validUntil: null,
|
|
10723
|
+
externalId: "eSWmXIGeu1I"
|
|
10724
|
+
},
|
|
10725
|
+
{
|
|
10726
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
10727
|
+
name: "Lumela",
|
|
10728
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10729
|
+
validUntil: null,
|
|
10730
|
+
externalId: "bh0b3aI1uP3"
|
|
10731
|
+
}
|
|
10732
|
+
];
|
|
10733
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
10734
|
+
{
|
|
10735
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
10736
|
+
name: "Central Provincial Office",
|
|
10737
|
+
locationType: "CRVS_OFFICE",
|
|
10738
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10739
|
+
validUntil: null,
|
|
10740
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
10741
|
+
},
|
|
10742
|
+
{
|
|
10743
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
10744
|
+
name: "Central Health Post",
|
|
10745
|
+
locationType: "HEALTH_FACILITY",
|
|
10746
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10747
|
+
validUntil: null
|
|
10748
|
+
},
|
|
10749
|
+
{
|
|
10750
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
10751
|
+
name: "Ibombo District Office",
|
|
10752
|
+
locationType: "CRVS_OFFICE",
|
|
10753
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10754
|
+
validUntil: null,
|
|
10755
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
10756
|
+
},
|
|
10757
|
+
{
|
|
10758
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
10759
|
+
name: "Isamba District Office",
|
|
10760
|
+
locationType: "CRVS_OFFICE",
|
|
10761
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10762
|
+
validUntil: null,
|
|
10763
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
10764
|
+
},
|
|
10765
|
+
{
|
|
10766
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
10767
|
+
name: "Isango District Office",
|
|
10768
|
+
locationType: "CRVS_OFFICE",
|
|
10769
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10770
|
+
validUntil: null,
|
|
10771
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
10772
|
+
},
|
|
10773
|
+
{
|
|
10774
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
10775
|
+
name: "Sulaka Provincial Office",
|
|
10776
|
+
locationType: "CRVS_OFFICE",
|
|
10777
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10778
|
+
validUntil: null,
|
|
10779
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
10780
|
+
},
|
|
10781
|
+
{
|
|
10782
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
10783
|
+
name: "Ilanga District Office",
|
|
10784
|
+
locationType: "CRVS_OFFICE",
|
|
10785
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10786
|
+
validUntil: null,
|
|
10787
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
10788
|
+
},
|
|
10789
|
+
{
|
|
10790
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
10791
|
+
name: "Chamakubi Health Post",
|
|
10792
|
+
locationType: "HEALTH_FACILITY",
|
|
10793
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10794
|
+
validUntil: null,
|
|
10795
|
+
externalId: "M1nFr8LbC2Qy"
|
|
10796
|
+
},
|
|
10797
|
+
{
|
|
10798
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
10799
|
+
name: "Ibombo Rural Health Centre",
|
|
10800
|
+
locationType: "HEALTH_FACILITY",
|
|
10801
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10802
|
+
validUntil: null,
|
|
10803
|
+
externalId: "bT7pV6YrW0Xc"
|
|
10804
|
+
},
|
|
10805
|
+
{
|
|
10806
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
10807
|
+
name: "Chikobo Rural Health Centre",
|
|
10808
|
+
locationType: "HEALTH_FACILITY",
|
|
10809
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10810
|
+
validUntil: null,
|
|
10811
|
+
externalId: "zE4qPn2SgJ5d"
|
|
10812
|
+
},
|
|
10813
|
+
{
|
|
10814
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
10815
|
+
name: "Chilochabalenje Health Post",
|
|
10816
|
+
locationType: "HEALTH_FACILITY",
|
|
10817
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10818
|
+
validUntil: null,
|
|
10819
|
+
externalId: "H8vDs1MqR4Uf"
|
|
10820
|
+
},
|
|
10821
|
+
{
|
|
10822
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
10823
|
+
name: "Chipeso Rural Health Centre",
|
|
10824
|
+
locationType: "HEALTH_FACILITY",
|
|
10825
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10826
|
+
validUntil: null,
|
|
10827
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
10828
|
+
},
|
|
10829
|
+
{
|
|
10830
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
10831
|
+
name: "Chisamba Rural Health Centre",
|
|
10832
|
+
locationType: "HEALTH_FACILITY",
|
|
10833
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10834
|
+
validUntil: null,
|
|
10835
|
+
externalId: "Yr0pCg8LdM2s"
|
|
10836
|
+
},
|
|
10837
|
+
{
|
|
10838
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
10839
|
+
name: "Chitanda Rural Health Centre",
|
|
10840
|
+
locationType: "HEALTH_FACILITY",
|
|
10841
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10842
|
+
validUntil: null,
|
|
10843
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
10844
|
+
},
|
|
10845
|
+
{
|
|
10846
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
10847
|
+
name: "Golden Valley Rural Health Centre",
|
|
10848
|
+
locationType: "HEALTH_FACILITY",
|
|
10849
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10850
|
+
validUntil: null,
|
|
10851
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
10852
|
+
},
|
|
10853
|
+
{
|
|
10854
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
10855
|
+
name: "Ipongo Rural Health Centre",
|
|
10856
|
+
locationType: "HEALTH_FACILITY",
|
|
10857
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10858
|
+
validUntil: null,
|
|
10859
|
+
externalId: "kF2sW9DmH0Bt"
|
|
10860
|
+
},
|
|
10861
|
+
{
|
|
10862
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
10863
|
+
name: "Itumbwe Health Post",
|
|
10864
|
+
locationType: "HEALTH_FACILITY",
|
|
10865
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10866
|
+
validUntil: null,
|
|
10867
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
10868
|
+
},
|
|
10869
|
+
{
|
|
10870
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
10871
|
+
name: "Kabangalala Rural Health Centre",
|
|
10872
|
+
locationType: "HEALTH_FACILITY",
|
|
10873
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10874
|
+
validUntil: null,
|
|
10875
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
10876
|
+
},
|
|
10877
|
+
// Village offices
|
|
10878
|
+
{
|
|
10879
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
10880
|
+
name: "Klow Village Office",
|
|
10881
|
+
locationType: "CRVS_OFFICE",
|
|
10882
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10883
|
+
validUntil: null,
|
|
10884
|
+
externalId: "PmAyxAJkxiJ"
|
|
10885
|
+
}
|
|
10886
|
+
];
|
|
10887
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
10888
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
10889
|
+
);
|
|
10890
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
10891
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
10892
|
+
);
|