@opencrvs/toolkit 2.0.0-rc.65195ed → 2.0.0-rc.654a81d
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/dist/commons/api/router.d.ts +29 -18
- 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 +2 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/conditionals/index.js +4 -0
- package/dist/events/index.js +455 -33
- package/dist/notification/index.js +382 -5
- package/opencrvs-toolkit-2.0.0-rc.654a81d.tgz +0 -0
- package/package.json +2 -2
- package/opencrvs-toolkit-2.0.0-rc.65195ed.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,
|
|
@@ -277,6 +282,7 @@ __export(events_exports, {
|
|
|
277
282
|
findActiveDraftForEvent: () => findActiveDraftForEvent,
|
|
278
283
|
findAllFields: () => findAllFields,
|
|
279
284
|
findLastAssignmentAction: () => findLastAssignmentAction,
|
|
285
|
+
findPendingCorrectionAction: () => findPendingCorrectionAction,
|
|
280
286
|
findRecordActionPages: () => findRecordActionPages,
|
|
281
287
|
flag: () => flag,
|
|
282
288
|
flattenFieldReference: () => flattenFieldReference,
|
|
@@ -319,6 +325,7 @@ __export(events_exports, {
|
|
|
319
325
|
getDeclarationFields: () => getDeclarationFields,
|
|
320
326
|
getDeclarationPages: () => getDeclarationPages,
|
|
321
327
|
getEventConfigById: () => getEventConfigById,
|
|
328
|
+
getEventFlags: () => getEventFlags,
|
|
322
329
|
getFilePathsFromEvent: () => getFilePathsFromEvent,
|
|
323
330
|
getLocationHierarchy: () => getLocationHierarchy,
|
|
324
331
|
getMixedPath: () => getMixedPath,
|
|
@@ -381,6 +388,7 @@ __export(events_exports, {
|
|
|
381
388
|
isPageVisible: () => isPageVisible,
|
|
382
389
|
isParagraphFieldType: () => isParagraphFieldType,
|
|
383
390
|
isPhoneFieldType: () => isPhoneFieldType,
|
|
391
|
+
isPotentialDuplicate: () => isPotentialDuplicate,
|
|
384
392
|
isPrintButtonFieldType: () => isPrintButtonFieldType,
|
|
385
393
|
isQrReaderFieldType: () => isQrReaderFieldType,
|
|
386
394
|
isQueryParamReaderFieldType: () => isQueryParamReaderFieldType,
|
|
@@ -414,6 +422,7 @@ __export(events_exports, {
|
|
|
414
422
|
plainDateToLocalDate: () => plainDateToLocalDate,
|
|
415
423
|
precompileActionSchemas: () => precompileActionSchemas,
|
|
416
424
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
|
425
|
+
resolveEventCustomFlags: () => resolveEventCustomFlags,
|
|
417
426
|
resolvePlaceOfEvent: () => resolvePlaceOfEvent,
|
|
418
427
|
runFieldValidations: () => runFieldValidations,
|
|
419
428
|
runStructuralValidations: () => runStructuralValidations,
|
|
@@ -3138,6 +3147,9 @@ var DeduplicationConfig = z23.object({
|
|
|
3138
3147
|
id: z23.string(),
|
|
3139
3148
|
label: TranslationConfig,
|
|
3140
3149
|
query: Clause
|
|
3150
|
+
}).meta({
|
|
3151
|
+
id: "DeduplicationConfig",
|
|
3152
|
+
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."
|
|
3141
3153
|
});
|
|
3142
3154
|
|
|
3143
3155
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -3366,7 +3378,10 @@ var Field = BaseField2.extend({
|
|
|
3366
3378
|
}).describe("Custom field defined for the summary view.");
|
|
3367
3379
|
var SummaryConfig = z27.object({
|
|
3368
3380
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3369
|
-
}).
|
|
3381
|
+
}).meta({
|
|
3382
|
+
id: "SummaryConfig",
|
|
3383
|
+
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."
|
|
3384
|
+
});
|
|
3370
3385
|
|
|
3371
3386
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3372
3387
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -3490,6 +3505,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
3490
3505
|
var AdvancedSearchConfig = z28.object({
|
|
3491
3506
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3492
3507
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3508
|
+
}).meta({
|
|
3509
|
+
id: "AdvancedSearchConfig",
|
|
3510
|
+
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()`)."
|
|
3493
3511
|
});
|
|
3494
3512
|
|
|
3495
3513
|
// ../commons/src/events/utils.ts
|
|
@@ -4739,14 +4757,17 @@ function getCompleteActionAnnotation(annotation, event2, action) {
|
|
|
4739
4757
|
}
|
|
4740
4758
|
function getCompleteActionContent(event2, action) {
|
|
4741
4759
|
const currentContent = "content" in action ? action.content : void 0;
|
|
4742
|
-
if (!action.originalActionId
|
|
4760
|
+
if (!action.originalActionId) {
|
|
4743
4761
|
return currentContent;
|
|
4744
4762
|
}
|
|
4745
4763
|
const originalAction = event2.actions.find(
|
|
4746
4764
|
({ id }) => id === action.originalActionId
|
|
4747
4765
|
);
|
|
4748
|
-
if (originalAction
|
|
4749
|
-
return
|
|
4766
|
+
if (originalAction && "content" in originalAction && originalAction.content) {
|
|
4767
|
+
return {
|
|
4768
|
+
...originalAction.content,
|
|
4769
|
+
...currentContent ?? {}
|
|
4770
|
+
};
|
|
4750
4771
|
}
|
|
4751
4772
|
return currentContent;
|
|
4752
4773
|
}
|
|
@@ -4856,6 +4877,9 @@ function not(condition) {
|
|
|
4856
4877
|
function never2() {
|
|
4857
4878
|
return not(alwaysTrue());
|
|
4858
4879
|
}
|
|
4880
|
+
function always() {
|
|
4881
|
+
return defineConditional(alwaysTrue());
|
|
4882
|
+
}
|
|
4859
4883
|
function jsonFieldPath(field3) {
|
|
4860
4884
|
return [field3.$$field, ...field3.$$subfield].join("/");
|
|
4861
4885
|
}
|
|
@@ -5801,6 +5825,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
5801
5825
|
var WorkqueueColumn = z34.object({
|
|
5802
5826
|
label: TranslationConfig,
|
|
5803
5827
|
value: WorkqueueColumnValue
|
|
5828
|
+
}).meta({
|
|
5829
|
+
id: "WorkqueueColumn",
|
|
5830
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
5804
5831
|
});
|
|
5805
5832
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
5806
5833
|
return workqueueColumns.map(
|
|
@@ -6006,8 +6033,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
6006
6033
|
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
6007
6034
|
query: CountryConfigQueryInputType
|
|
6008
6035
|
}).meta({
|
|
6009
|
-
|
|
6010
|
-
|
|
6036
|
+
id: "WorkqueueConfig",
|
|
6037
|
+
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."
|
|
6011
6038
|
});
|
|
6012
6039
|
function defineWorkqueue(workqueueInput) {
|
|
6013
6040
|
const queryInput = workqueueInput.query;
|
|
@@ -6070,7 +6097,9 @@ var BaseActionInput = z38.object({
|
|
|
6070
6097
|
keepAssignment: z38.boolean().optional(),
|
|
6071
6098
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
6072
6099
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
6073
|
-
waitFor: z38.boolean().
|
|
6100
|
+
waitFor: z38.boolean().default(true).describe(
|
|
6101
|
+
"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."
|
|
6102
|
+
),
|
|
6074
6103
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
6075
6104
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
6076
6105
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -6251,7 +6280,7 @@ var Draft = z39.object({
|
|
|
6251
6280
|
}).describe(
|
|
6252
6281
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
6253
6282
|
);
|
|
6254
|
-
var DraftInput = BaseActionInput.extend({
|
|
6283
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
6255
6284
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
6256
6285
|
status: z39.enum([
|
|
6257
6286
|
ActionStatus.Requested,
|
|
@@ -6382,26 +6411,43 @@ var import_date_fns3 = require("date-fns");
|
|
|
6382
6411
|
function isEditInProgress(actions) {
|
|
6383
6412
|
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6384
6413
|
}
|
|
6414
|
+
function findPendingCorrectionAction(writeActions2) {
|
|
6415
|
+
let correctionRequestAction;
|
|
6416
|
+
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
6417
|
+
const action = writeActions2[i];
|
|
6418
|
+
if (action.type === ActionType.APPROVE_CORRECTION || action.type === ActionType.REJECT_CORRECTION) {
|
|
6419
|
+
break;
|
|
6420
|
+
}
|
|
6421
|
+
if (action.type === ActionType.REQUEST_CORRECTION) {
|
|
6422
|
+
correctionRequestAction = action;
|
|
6423
|
+
break;
|
|
6424
|
+
}
|
|
6425
|
+
}
|
|
6426
|
+
return correctionRequestAction;
|
|
6427
|
+
}
|
|
6385
6428
|
function isCorrectionRequested(actions) {
|
|
6429
|
+
return findPendingCorrectionAction(actions) !== void 0;
|
|
6430
|
+
}
|
|
6431
|
+
function isDeclarationIncomplete(actions) {
|
|
6432
|
+
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6433
|
+
}
|
|
6434
|
+
function isRejected(actions) {
|
|
6435
|
+
const resettingActionTypes = [
|
|
6436
|
+
ActionType.NOTIFY,
|
|
6437
|
+
ActionType.DECLARE,
|
|
6438
|
+
ActionType.EDIT,
|
|
6439
|
+
ActionType.REGISTER
|
|
6440
|
+
];
|
|
6386
6441
|
return actions.reduce((prev, { type }) => {
|
|
6387
|
-
if (type === ActionType.
|
|
6442
|
+
if (type === ActionType.REJECT) {
|
|
6388
6443
|
return true;
|
|
6389
6444
|
}
|
|
6390
|
-
if (type
|
|
6391
|
-
return false;
|
|
6392
|
-
}
|
|
6393
|
-
if (type === ActionType.REJECT_CORRECTION) {
|
|
6445
|
+
if (resettingActionTypes.includes(type)) {
|
|
6394
6446
|
return false;
|
|
6395
6447
|
}
|
|
6396
6448
|
return prev;
|
|
6397
6449
|
}, false);
|
|
6398
6450
|
}
|
|
6399
|
-
function isDeclarationIncomplete(actions) {
|
|
6400
|
-
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6401
|
-
}
|
|
6402
|
-
function isRejected(actions) {
|
|
6403
|
-
return actions.at(-1)?.type === ActionType.REJECT;
|
|
6404
|
-
}
|
|
6405
6451
|
function isPotentialDuplicate(actions) {
|
|
6406
6452
|
return actions.reduce((prev, { type }) => {
|
|
6407
6453
|
if (type === ActionType.DUPLICATE_DETECTED) {
|
|
@@ -6464,8 +6510,7 @@ function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
|
6464
6510
|
return (0, import_lodash3.uniq)(flags);
|
|
6465
6511
|
}, []);
|
|
6466
6512
|
}
|
|
6467
|
-
function
|
|
6468
|
-
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6513
|
+
function getActionStatusFlags(sortedActions) {
|
|
6469
6514
|
const actionStatus = sortedActions.reduce(
|
|
6470
6515
|
(actionStatuses, { type, status: status2 }) => ({
|
|
6471
6516
|
...actionStatuses,
|
|
@@ -6473,26 +6518,40 @@ function getEventFlags(event2, config) {
|
|
|
6473
6518
|
}),
|
|
6474
6519
|
{}
|
|
6475
6520
|
);
|
|
6476
|
-
|
|
6521
|
+
return Object.entries(actionStatus).filter(([, status2]) => status2 !== ActionStatus.Accepted).map(([type, status2]) => {
|
|
6477
6522
|
const flag2 = joinValues([type, status2], ":").toLowerCase();
|
|
6478
6523
|
return flag2;
|
|
6479
6524
|
});
|
|
6480
|
-
|
|
6481
|
-
|
|
6525
|
+
}
|
|
6526
|
+
function getInherentFlags(sortedActions) {
|
|
6527
|
+
const acceptedActions = sortedActions.filter(
|
|
6528
|
+
({ status: status2 }) => status2 === ActionStatus.Accepted
|
|
6529
|
+
);
|
|
6530
|
+
const inherentFlags = [];
|
|
6531
|
+
if (isCorrectionRequested(acceptedActions)) {
|
|
6532
|
+
inherentFlags.push(InherentFlags.CORRECTION_REQUESTED);
|
|
6482
6533
|
}
|
|
6483
|
-
if (isDeclarationIncomplete(
|
|
6484
|
-
|
|
6534
|
+
if (isDeclarationIncomplete(acceptedActions)) {
|
|
6535
|
+
inherentFlags.push(InherentFlags.INCOMPLETE);
|
|
6485
6536
|
}
|
|
6486
|
-
if (isRejected(
|
|
6487
|
-
|
|
6537
|
+
if (isRejected(acceptedActions)) {
|
|
6538
|
+
inherentFlags.push(InherentFlags.REJECTED);
|
|
6488
6539
|
}
|
|
6489
|
-
if (isPotentialDuplicate(
|
|
6490
|
-
|
|
6540
|
+
if (isPotentialDuplicate(acceptedActions)) {
|
|
6541
|
+
inherentFlags.push(InherentFlags.POTENTIAL_DUPLICATE);
|
|
6491
6542
|
}
|
|
6492
|
-
if (isEditInProgress(
|
|
6493
|
-
|
|
6543
|
+
if (isEditInProgress(acceptedActions)) {
|
|
6544
|
+
inherentFlags.push(InherentFlags.EDIT_IN_PROGRESS);
|
|
6494
6545
|
}
|
|
6495
|
-
return
|
|
6546
|
+
return inherentFlags;
|
|
6547
|
+
}
|
|
6548
|
+
function getEventFlags(event2, config) {
|
|
6549
|
+
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6550
|
+
return [
|
|
6551
|
+
...getActionStatusFlags(sortedActions),
|
|
6552
|
+
...getInherentFlags(sortedActions),
|
|
6553
|
+
...resolveEventCustomFlags(event2, config)
|
|
6554
|
+
];
|
|
6496
6555
|
}
|
|
6497
6556
|
|
|
6498
6557
|
// ../commons/src/events/state/index.ts
|
|
@@ -10491,3 +10550,366 @@ function getFilePathsFromEvent(event2) {
|
|
|
10491
10550
|
});
|
|
10492
10551
|
return (0, import_lodash7.uniq)(filepaths);
|
|
10493
10552
|
}
|
|
10553
|
+
|
|
10554
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
10555
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
10556
|
+
{
|
|
10557
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10558
|
+
name: "Central",
|
|
10559
|
+
parentId: null,
|
|
10560
|
+
validUntil: null,
|
|
10561
|
+
externalId: "ydyJb1RAy4U1"
|
|
10562
|
+
},
|
|
10563
|
+
{
|
|
10564
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10565
|
+
name: "Sulaka",
|
|
10566
|
+
parentId: null,
|
|
10567
|
+
validUntil: null,
|
|
10568
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
10569
|
+
},
|
|
10570
|
+
{
|
|
10571
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
10572
|
+
name: "Pualula",
|
|
10573
|
+
parentId: null,
|
|
10574
|
+
validUntil: null,
|
|
10575
|
+
externalId: "Aq91DweLmT8k"
|
|
10576
|
+
},
|
|
10577
|
+
{
|
|
10578
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
10579
|
+
name: "Chuminga",
|
|
10580
|
+
parentId: null,
|
|
10581
|
+
validUntil: null,
|
|
10582
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
10583
|
+
},
|
|
10584
|
+
{
|
|
10585
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10586
|
+
name: "Ibombo",
|
|
10587
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10588
|
+
validUntil: null,
|
|
10589
|
+
externalId: "k7DsP4vbN1Qe"
|
|
10590
|
+
},
|
|
10591
|
+
{
|
|
10592
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10593
|
+
name: "Isango",
|
|
10594
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10595
|
+
validUntil: null,
|
|
10596
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
10597
|
+
},
|
|
10598
|
+
{
|
|
10599
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10600
|
+
name: "Isamba",
|
|
10601
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10602
|
+
validUntil: null,
|
|
10603
|
+
externalId: "sT0xVu1KqJ7r"
|
|
10604
|
+
},
|
|
10605
|
+
{
|
|
10606
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10607
|
+
name: "Itambo",
|
|
10608
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10609
|
+
validUntil: null,
|
|
10610
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
10611
|
+
},
|
|
10612
|
+
{
|
|
10613
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
10614
|
+
name: "Ezhi",
|
|
10615
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10616
|
+
validUntil: null,
|
|
10617
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
10618
|
+
},
|
|
10619
|
+
{
|
|
10620
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10621
|
+
name: "Ilanga",
|
|
10622
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10623
|
+
validUntil: null,
|
|
10624
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
10625
|
+
},
|
|
10626
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
10627
|
+
{
|
|
10628
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10629
|
+
name: "Klow",
|
|
10630
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10631
|
+
validUntil: null,
|
|
10632
|
+
externalId: "IkYcYBUcyY2"
|
|
10633
|
+
},
|
|
10634
|
+
{
|
|
10635
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
10636
|
+
name: "Mbondo",
|
|
10637
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10638
|
+
validUntil: null,
|
|
10639
|
+
externalId: "Qhvv5hvo3mY"
|
|
10640
|
+
},
|
|
10641
|
+
{
|
|
10642
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
10643
|
+
name: "Ndara",
|
|
10644
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10645
|
+
validUntil: null,
|
|
10646
|
+
externalId: "crXh068O9TR"
|
|
10647
|
+
},
|
|
10648
|
+
{
|
|
10649
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
10650
|
+
name: "Olani",
|
|
10651
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10652
|
+
validUntil: null,
|
|
10653
|
+
externalId: "r00It8Tvvp7"
|
|
10654
|
+
},
|
|
10655
|
+
{
|
|
10656
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
10657
|
+
name: "Pemba",
|
|
10658
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10659
|
+
validUntil: null,
|
|
10660
|
+
externalId: "ZnUWsbONIaH"
|
|
10661
|
+
},
|
|
10662
|
+
{
|
|
10663
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
10664
|
+
name: "Quanza",
|
|
10665
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10666
|
+
validUntil: null,
|
|
10667
|
+
externalId: "fDZycvQTa7l"
|
|
10668
|
+
},
|
|
10669
|
+
{
|
|
10670
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
10671
|
+
name: "Rivka",
|
|
10672
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10673
|
+
validUntil: null,
|
|
10674
|
+
externalId: "KqswxCGTELa"
|
|
10675
|
+
},
|
|
10676
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
10677
|
+
{
|
|
10678
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
10679
|
+
name: "Mbula",
|
|
10680
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10681
|
+
validUntil: null,
|
|
10682
|
+
externalId: "osEbKjRc9Kg"
|
|
10683
|
+
},
|
|
10684
|
+
{
|
|
10685
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
10686
|
+
name: "Ndoki",
|
|
10687
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10688
|
+
validUntil: null,
|
|
10689
|
+
externalId: "aq4daBUAGr3"
|
|
10690
|
+
},
|
|
10691
|
+
{
|
|
10692
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
10693
|
+
name: "Tsanga",
|
|
10694
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10695
|
+
validUntil: null,
|
|
10696
|
+
externalId: "cqis6Y8trbJ"
|
|
10697
|
+
},
|
|
10698
|
+
{
|
|
10699
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
10700
|
+
name: "Waziri",
|
|
10701
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10702
|
+
validUntil: null,
|
|
10703
|
+
externalId: "LMijHPyyx6d"
|
|
10704
|
+
},
|
|
10705
|
+
{
|
|
10706
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
10707
|
+
name: "Zimbi",
|
|
10708
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10709
|
+
validUntil: null,
|
|
10710
|
+
externalId: "pcQYbPuKGZ7"
|
|
10711
|
+
},
|
|
10712
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
10713
|
+
{
|
|
10714
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
10715
|
+
name: "Felani",
|
|
10716
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10717
|
+
validUntil: null,
|
|
10718
|
+
externalId: "gSqpoCGdMXp"
|
|
10719
|
+
},
|
|
10720
|
+
{
|
|
10721
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
10722
|
+
name: "Goroma",
|
|
10723
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10724
|
+
validUntil: null,
|
|
10725
|
+
externalId: "KvAAIaNqVrp"
|
|
10726
|
+
},
|
|
10727
|
+
{
|
|
10728
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
10729
|
+
name: "Halifu",
|
|
10730
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10731
|
+
validUntil: null,
|
|
10732
|
+
externalId: "qe4UnEVt1hv"
|
|
10733
|
+
},
|
|
10734
|
+
{
|
|
10735
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
10736
|
+
name: "Jabari",
|
|
10737
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10738
|
+
validUntil: null,
|
|
10739
|
+
externalId: "yHH9Nz4rLOt"
|
|
10740
|
+
},
|
|
10741
|
+
{
|
|
10742
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
10743
|
+
name: "Kifani",
|
|
10744
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10745
|
+
validUntil: null,
|
|
10746
|
+
externalId: "eSWmXIGeu1I"
|
|
10747
|
+
},
|
|
10748
|
+
{
|
|
10749
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
10750
|
+
name: "Lumela",
|
|
10751
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10752
|
+
validUntil: null,
|
|
10753
|
+
externalId: "bh0b3aI1uP3"
|
|
10754
|
+
}
|
|
10755
|
+
];
|
|
10756
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
10757
|
+
{
|
|
10758
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
10759
|
+
name: "Central Provincial Office",
|
|
10760
|
+
locationType: "CRVS_OFFICE",
|
|
10761
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10762
|
+
validUntil: null,
|
|
10763
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
10764
|
+
},
|
|
10765
|
+
{
|
|
10766
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
10767
|
+
name: "Central Health Post",
|
|
10768
|
+
locationType: "HEALTH_FACILITY",
|
|
10769
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10770
|
+
validUntil: null
|
|
10771
|
+
},
|
|
10772
|
+
{
|
|
10773
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
10774
|
+
name: "Ibombo District Office",
|
|
10775
|
+
locationType: "CRVS_OFFICE",
|
|
10776
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10777
|
+
validUntil: null,
|
|
10778
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
10779
|
+
},
|
|
10780
|
+
{
|
|
10781
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
10782
|
+
name: "Isamba District Office",
|
|
10783
|
+
locationType: "CRVS_OFFICE",
|
|
10784
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10785
|
+
validUntil: null,
|
|
10786
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
10787
|
+
},
|
|
10788
|
+
{
|
|
10789
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
10790
|
+
name: "Isango District Office",
|
|
10791
|
+
locationType: "CRVS_OFFICE",
|
|
10792
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10793
|
+
validUntil: null,
|
|
10794
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
10795
|
+
},
|
|
10796
|
+
{
|
|
10797
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
10798
|
+
name: "Sulaka Provincial Office",
|
|
10799
|
+
locationType: "CRVS_OFFICE",
|
|
10800
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10801
|
+
validUntil: null,
|
|
10802
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
10803
|
+
},
|
|
10804
|
+
{
|
|
10805
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
10806
|
+
name: "Ilanga District Office",
|
|
10807
|
+
locationType: "CRVS_OFFICE",
|
|
10808
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10809
|
+
validUntil: null,
|
|
10810
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
10811
|
+
},
|
|
10812
|
+
{
|
|
10813
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
10814
|
+
name: "Chamakubi Health Post",
|
|
10815
|
+
locationType: "HEALTH_FACILITY",
|
|
10816
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10817
|
+
validUntil: null,
|
|
10818
|
+
externalId: "M1nFr8LbC2Qy"
|
|
10819
|
+
},
|
|
10820
|
+
{
|
|
10821
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
10822
|
+
name: "Ibombo Rural Health Centre",
|
|
10823
|
+
locationType: "HEALTH_FACILITY",
|
|
10824
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10825
|
+
validUntil: null,
|
|
10826
|
+
externalId: "bT7pV6YrW0Xc"
|
|
10827
|
+
},
|
|
10828
|
+
{
|
|
10829
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
10830
|
+
name: "Chikobo Rural Health Centre",
|
|
10831
|
+
locationType: "HEALTH_FACILITY",
|
|
10832
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10833
|
+
validUntil: null,
|
|
10834
|
+
externalId: "zE4qPn2SgJ5d"
|
|
10835
|
+
},
|
|
10836
|
+
{
|
|
10837
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
10838
|
+
name: "Chilochabalenje Health Post",
|
|
10839
|
+
locationType: "HEALTH_FACILITY",
|
|
10840
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10841
|
+
validUntil: null,
|
|
10842
|
+
externalId: "H8vDs1MqR4Uf"
|
|
10843
|
+
},
|
|
10844
|
+
{
|
|
10845
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
10846
|
+
name: "Chipeso Rural Health Centre",
|
|
10847
|
+
locationType: "HEALTH_FACILITY",
|
|
10848
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10849
|
+
validUntil: null,
|
|
10850
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
10851
|
+
},
|
|
10852
|
+
{
|
|
10853
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
10854
|
+
name: "Chisamba Rural Health Centre",
|
|
10855
|
+
locationType: "HEALTH_FACILITY",
|
|
10856
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10857
|
+
validUntil: null,
|
|
10858
|
+
externalId: "Yr0pCg8LdM2s"
|
|
10859
|
+
},
|
|
10860
|
+
{
|
|
10861
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
10862
|
+
name: "Chitanda Rural Health Centre",
|
|
10863
|
+
locationType: "HEALTH_FACILITY",
|
|
10864
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10865
|
+
validUntil: null,
|
|
10866
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
10867
|
+
},
|
|
10868
|
+
{
|
|
10869
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
10870
|
+
name: "Golden Valley Rural Health Centre",
|
|
10871
|
+
locationType: "HEALTH_FACILITY",
|
|
10872
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10873
|
+
validUntil: null,
|
|
10874
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
10875
|
+
},
|
|
10876
|
+
{
|
|
10877
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
10878
|
+
name: "Ipongo Rural Health Centre",
|
|
10879
|
+
locationType: "HEALTH_FACILITY",
|
|
10880
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10881
|
+
validUntil: null,
|
|
10882
|
+
externalId: "kF2sW9DmH0Bt"
|
|
10883
|
+
},
|
|
10884
|
+
{
|
|
10885
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
10886
|
+
name: "Itumbwe Health Post",
|
|
10887
|
+
locationType: "HEALTH_FACILITY",
|
|
10888
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10889
|
+
validUntil: null,
|
|
10890
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
10891
|
+
},
|
|
10892
|
+
{
|
|
10893
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
10894
|
+
name: "Kabangalala Rural Health Centre",
|
|
10895
|
+
locationType: "HEALTH_FACILITY",
|
|
10896
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10897
|
+
validUntil: null,
|
|
10898
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
10899
|
+
},
|
|
10900
|
+
// Village offices
|
|
10901
|
+
{
|
|
10902
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
10903
|
+
name: "Klow Village Office",
|
|
10904
|
+
locationType: "CRVS_OFFICE",
|
|
10905
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10906
|
+
validUntil: null,
|
|
10907
|
+
externalId: "PmAyxAJkxiJ"
|
|
10908
|
+
}
|
|
10909
|
+
];
|
|
10910
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
10911
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
10912
|
+
);
|
|
10913
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
10914
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
10915
|
+
);
|