@opencrvs/toolkit 2.0.0-rc.de6e7de → 2.0.0-rc.dfba38c
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 +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 +2 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/conditionals/index.js +4 -0
- package/dist/events/index.js +449 -30
- package/dist/notification/index.js +382 -5
- package/opencrvs-toolkit-2.0.0-rc.dfba38c.tgz +0 -0
- package/package.json +2 -2
- package/opencrvs-toolkit-2.0.0-rc.de6e7de.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,
|
|
@@ -318,6 +324,7 @@ __export(events_exports, {
|
|
|
318
324
|
getDeclarationFields: () => getDeclarationFields,
|
|
319
325
|
getDeclarationPages: () => getDeclarationPages,
|
|
320
326
|
getEventConfigById: () => getEventConfigById,
|
|
327
|
+
getEventFlags: () => getEventFlags,
|
|
321
328
|
getFilePathsFromEvent: () => getFilePathsFromEvent,
|
|
322
329
|
getLocationHierarchy: () => getLocationHierarchy,
|
|
323
330
|
getMixedPath: () => getMixedPath,
|
|
@@ -380,6 +387,7 @@ __export(events_exports, {
|
|
|
380
387
|
isPageVisible: () => isPageVisible,
|
|
381
388
|
isParagraphFieldType: () => isParagraphFieldType,
|
|
382
389
|
isPhoneFieldType: () => isPhoneFieldType,
|
|
390
|
+
isPotentialDuplicate: () => isPotentialDuplicate,
|
|
383
391
|
isPrintButtonFieldType: () => isPrintButtonFieldType,
|
|
384
392
|
isQrReaderFieldType: () => isQrReaderFieldType,
|
|
385
393
|
isQueryParamReaderFieldType: () => isQueryParamReaderFieldType,
|
|
@@ -413,6 +421,7 @@ __export(events_exports, {
|
|
|
413
421
|
plainDateToLocalDate: () => plainDateToLocalDate,
|
|
414
422
|
precompileActionSchemas: () => precompileActionSchemas,
|
|
415
423
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
|
424
|
+
resolveEventCustomFlags: () => resolveEventCustomFlags,
|
|
416
425
|
resolvePlaceOfEvent: () => resolvePlaceOfEvent,
|
|
417
426
|
runFieldValidations: () => runFieldValidations,
|
|
418
427
|
runStructuralValidations: () => runStructuralValidations,
|
|
@@ -3136,6 +3145,9 @@ var DeduplicationConfig = z23.object({
|
|
|
3136
3145
|
id: z23.string(),
|
|
3137
3146
|
label: TranslationConfig,
|
|
3138
3147
|
query: Clause
|
|
3148
|
+
}).meta({
|
|
3149
|
+
id: "DeduplicationConfig",
|
|
3150
|
+
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."
|
|
3139
3151
|
});
|
|
3140
3152
|
|
|
3141
3153
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -3364,7 +3376,10 @@ var Field = BaseField2.extend({
|
|
|
3364
3376
|
}).describe("Custom field defined for the summary view.");
|
|
3365
3377
|
var SummaryConfig = z27.object({
|
|
3366
3378
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3367
|
-
}).
|
|
3379
|
+
}).meta({
|
|
3380
|
+
id: "SummaryConfig",
|
|
3381
|
+
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."
|
|
3382
|
+
});
|
|
3368
3383
|
|
|
3369
3384
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3370
3385
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -3488,6 +3503,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
3488
3503
|
var AdvancedSearchConfig = z28.object({
|
|
3489
3504
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3490
3505
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3506
|
+
}).meta({
|
|
3507
|
+
id: "AdvancedSearchConfig",
|
|
3508
|
+
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()`)."
|
|
3491
3509
|
});
|
|
3492
3510
|
|
|
3493
3511
|
// ../commons/src/events/utils.ts
|
|
@@ -4841,6 +4859,9 @@ function not(condition) {
|
|
|
4841
4859
|
function never2() {
|
|
4842
4860
|
return not(alwaysTrue());
|
|
4843
4861
|
}
|
|
4862
|
+
function always() {
|
|
4863
|
+
return defineConditional(alwaysTrue());
|
|
4864
|
+
}
|
|
4844
4865
|
function jsonFieldPath(field3) {
|
|
4845
4866
|
return [field3.$$field, ...field3.$$subfield].join("/");
|
|
4846
4867
|
}
|
|
@@ -5786,6 +5807,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
5786
5807
|
var WorkqueueColumn = z34.object({
|
|
5787
5808
|
label: TranslationConfig,
|
|
5788
5809
|
value: WorkqueueColumnValue
|
|
5810
|
+
}).meta({
|
|
5811
|
+
id: "WorkqueueColumn",
|
|
5812
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
5789
5813
|
});
|
|
5790
5814
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
5791
5815
|
return workqueueColumns.map(
|
|
@@ -5991,8 +6015,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5991
6015
|
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
5992
6016
|
query: CountryConfigQueryInputType
|
|
5993
6017
|
}).meta({
|
|
5994
|
-
|
|
5995
|
-
|
|
6018
|
+
id: "WorkqueueConfig",
|
|
6019
|
+
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."
|
|
5996
6020
|
});
|
|
5997
6021
|
function defineWorkqueue(workqueueInput) {
|
|
5998
6022
|
const queryInput = workqueueInput.query;
|
|
@@ -6055,7 +6079,9 @@ var BaseActionInput = z38.object({
|
|
|
6055
6079
|
keepAssignment: z38.boolean().optional(),
|
|
6056
6080
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
6057
6081
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
6058
|
-
waitFor: z38.boolean().
|
|
6082
|
+
waitFor: z38.boolean().default(true).describe(
|
|
6083
|
+
"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."
|
|
6084
|
+
),
|
|
6059
6085
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
6060
6086
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
6061
6087
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -6235,7 +6261,7 @@ var Draft = z39.object({
|
|
|
6235
6261
|
}).describe(
|
|
6236
6262
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
6237
6263
|
);
|
|
6238
|
-
var DraftInput = BaseActionInput.extend({
|
|
6264
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
6239
6265
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
6240
6266
|
status: z39.enum([
|
|
6241
6267
|
ActionStatus.Requested,
|
|
@@ -6366,26 +6392,43 @@ var import_date_fns3 = require("date-fns");
|
|
|
6366
6392
|
function isEditInProgress(actions) {
|
|
6367
6393
|
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6368
6394
|
}
|
|
6395
|
+
function findPendingCorrectionAction(writeActions2) {
|
|
6396
|
+
let correctionRequestAction;
|
|
6397
|
+
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
6398
|
+
const action = writeActions2[i];
|
|
6399
|
+
if (action.type === ActionType.APPROVE_CORRECTION || action.type === ActionType.REJECT_CORRECTION) {
|
|
6400
|
+
break;
|
|
6401
|
+
}
|
|
6402
|
+
if (action.type === ActionType.REQUEST_CORRECTION) {
|
|
6403
|
+
correctionRequestAction = action;
|
|
6404
|
+
break;
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
return correctionRequestAction;
|
|
6408
|
+
}
|
|
6369
6409
|
function isCorrectionRequested(actions) {
|
|
6410
|
+
return findPendingCorrectionAction(actions) !== void 0;
|
|
6411
|
+
}
|
|
6412
|
+
function isDeclarationIncomplete(actions) {
|
|
6413
|
+
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6414
|
+
}
|
|
6415
|
+
function isRejected(actions) {
|
|
6416
|
+
const resettingActionTypes = [
|
|
6417
|
+
ActionType.NOTIFY,
|
|
6418
|
+
ActionType.DECLARE,
|
|
6419
|
+
ActionType.EDIT,
|
|
6420
|
+
ActionType.REGISTER
|
|
6421
|
+
];
|
|
6370
6422
|
return actions.reduce((prev, { type }) => {
|
|
6371
|
-
if (type === ActionType.
|
|
6423
|
+
if (type === ActionType.REJECT) {
|
|
6372
6424
|
return true;
|
|
6373
6425
|
}
|
|
6374
|
-
if (type
|
|
6375
|
-
return false;
|
|
6376
|
-
}
|
|
6377
|
-
if (type === ActionType.REJECT_CORRECTION) {
|
|
6426
|
+
if (resettingActionTypes.includes(type)) {
|
|
6378
6427
|
return false;
|
|
6379
6428
|
}
|
|
6380
6429
|
return prev;
|
|
6381
6430
|
}, false);
|
|
6382
6431
|
}
|
|
6383
|
-
function isDeclarationIncomplete(actions) {
|
|
6384
|
-
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6385
|
-
}
|
|
6386
|
-
function isRejected(actions) {
|
|
6387
|
-
return actions.at(-1)?.type === ActionType.REJECT;
|
|
6388
|
-
}
|
|
6389
6432
|
function isPotentialDuplicate(actions) {
|
|
6390
6433
|
return actions.reduce((prev, { type }) => {
|
|
6391
6434
|
if (type === ActionType.DUPLICATE_DETECTED) {
|
|
@@ -6448,8 +6491,7 @@ function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
|
6448
6491
|
return (0, import_lodash3.uniq)(flags);
|
|
6449
6492
|
}, []);
|
|
6450
6493
|
}
|
|
6451
|
-
function
|
|
6452
|
-
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6494
|
+
function getActionStatusFlags(sortedActions) {
|
|
6453
6495
|
const actionStatus = sortedActions.reduce(
|
|
6454
6496
|
(actionStatuses, { type, status: status2 }) => ({
|
|
6455
6497
|
...actionStatuses,
|
|
@@ -6457,26 +6499,40 @@ function getEventFlags(event2, config) {
|
|
|
6457
6499
|
}),
|
|
6458
6500
|
{}
|
|
6459
6501
|
);
|
|
6460
|
-
|
|
6502
|
+
return Object.entries(actionStatus).filter(([, status2]) => status2 !== ActionStatus.Accepted).map(([type, status2]) => {
|
|
6461
6503
|
const flag2 = joinValues([type, status2], ":").toLowerCase();
|
|
6462
6504
|
return flag2;
|
|
6463
6505
|
});
|
|
6464
|
-
|
|
6465
|
-
|
|
6506
|
+
}
|
|
6507
|
+
function getInherentFlags(sortedActions) {
|
|
6508
|
+
const acceptedActions = sortedActions.filter(
|
|
6509
|
+
({ status: status2 }) => status2 === ActionStatus.Accepted
|
|
6510
|
+
);
|
|
6511
|
+
const inherentFlags = [];
|
|
6512
|
+
if (isCorrectionRequested(acceptedActions)) {
|
|
6513
|
+
inherentFlags.push(InherentFlags.CORRECTION_REQUESTED);
|
|
6466
6514
|
}
|
|
6467
|
-
if (isDeclarationIncomplete(
|
|
6468
|
-
|
|
6515
|
+
if (isDeclarationIncomplete(acceptedActions)) {
|
|
6516
|
+
inherentFlags.push(InherentFlags.INCOMPLETE);
|
|
6469
6517
|
}
|
|
6470
|
-
if (isRejected(
|
|
6471
|
-
|
|
6518
|
+
if (isRejected(acceptedActions)) {
|
|
6519
|
+
inherentFlags.push(InherentFlags.REJECTED);
|
|
6472
6520
|
}
|
|
6473
|
-
if (isPotentialDuplicate(
|
|
6474
|
-
|
|
6521
|
+
if (isPotentialDuplicate(acceptedActions)) {
|
|
6522
|
+
inherentFlags.push(InherentFlags.POTENTIAL_DUPLICATE);
|
|
6475
6523
|
}
|
|
6476
|
-
if (isEditInProgress(
|
|
6477
|
-
|
|
6524
|
+
if (isEditInProgress(acceptedActions)) {
|
|
6525
|
+
inherentFlags.push(InherentFlags.EDIT_IN_PROGRESS);
|
|
6478
6526
|
}
|
|
6479
|
-
return
|
|
6527
|
+
return inherentFlags;
|
|
6528
|
+
}
|
|
6529
|
+
function getEventFlags(event2, config) {
|
|
6530
|
+
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6531
|
+
return [
|
|
6532
|
+
...getActionStatusFlags(sortedActions),
|
|
6533
|
+
...getInherentFlags(sortedActions),
|
|
6534
|
+
...resolveEventCustomFlags(event2, config)
|
|
6535
|
+
];
|
|
6480
6536
|
}
|
|
6481
6537
|
|
|
6482
6538
|
// ../commons/src/events/state/index.ts
|
|
@@ -10475,3 +10531,366 @@ function getFilePathsFromEvent(event2) {
|
|
|
10475
10531
|
});
|
|
10476
10532
|
return (0, import_lodash7.uniq)(filepaths);
|
|
10477
10533
|
}
|
|
10534
|
+
|
|
10535
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
10536
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
10537
|
+
{
|
|
10538
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10539
|
+
name: "Central",
|
|
10540
|
+
parentId: null,
|
|
10541
|
+
validUntil: null,
|
|
10542
|
+
externalId: "ydyJb1RAy4U1"
|
|
10543
|
+
},
|
|
10544
|
+
{
|
|
10545
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10546
|
+
name: "Sulaka",
|
|
10547
|
+
parentId: null,
|
|
10548
|
+
validUntil: null,
|
|
10549
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
10550
|
+
},
|
|
10551
|
+
{
|
|
10552
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
10553
|
+
name: "Pualula",
|
|
10554
|
+
parentId: null,
|
|
10555
|
+
validUntil: null,
|
|
10556
|
+
externalId: "Aq91DweLmT8k"
|
|
10557
|
+
},
|
|
10558
|
+
{
|
|
10559
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
10560
|
+
name: "Chuminga",
|
|
10561
|
+
parentId: null,
|
|
10562
|
+
validUntil: null,
|
|
10563
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
10564
|
+
},
|
|
10565
|
+
{
|
|
10566
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10567
|
+
name: "Ibombo",
|
|
10568
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10569
|
+
validUntil: null,
|
|
10570
|
+
externalId: "k7DsP4vbN1Qe"
|
|
10571
|
+
},
|
|
10572
|
+
{
|
|
10573
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10574
|
+
name: "Isango",
|
|
10575
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10576
|
+
validUntil: null,
|
|
10577
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
10578
|
+
},
|
|
10579
|
+
{
|
|
10580
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10581
|
+
name: "Isamba",
|
|
10582
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10583
|
+
validUntil: null,
|
|
10584
|
+
externalId: "sT0xVu1KqJ7r"
|
|
10585
|
+
},
|
|
10586
|
+
{
|
|
10587
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10588
|
+
name: "Itambo",
|
|
10589
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10590
|
+
validUntil: null,
|
|
10591
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
10592
|
+
},
|
|
10593
|
+
{
|
|
10594
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
10595
|
+
name: "Ezhi",
|
|
10596
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10597
|
+
validUntil: null,
|
|
10598
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
10599
|
+
},
|
|
10600
|
+
{
|
|
10601
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10602
|
+
name: "Ilanga",
|
|
10603
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10604
|
+
validUntil: null,
|
|
10605
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
10606
|
+
},
|
|
10607
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
10608
|
+
{
|
|
10609
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10610
|
+
name: "Klow",
|
|
10611
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10612
|
+
validUntil: null,
|
|
10613
|
+
externalId: "IkYcYBUcyY2"
|
|
10614
|
+
},
|
|
10615
|
+
{
|
|
10616
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
10617
|
+
name: "Mbondo",
|
|
10618
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10619
|
+
validUntil: null,
|
|
10620
|
+
externalId: "Qhvv5hvo3mY"
|
|
10621
|
+
},
|
|
10622
|
+
{
|
|
10623
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
10624
|
+
name: "Ndara",
|
|
10625
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10626
|
+
validUntil: null,
|
|
10627
|
+
externalId: "crXh068O9TR"
|
|
10628
|
+
},
|
|
10629
|
+
{
|
|
10630
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
10631
|
+
name: "Olani",
|
|
10632
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10633
|
+
validUntil: null,
|
|
10634
|
+
externalId: "r00It8Tvvp7"
|
|
10635
|
+
},
|
|
10636
|
+
{
|
|
10637
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
10638
|
+
name: "Pemba",
|
|
10639
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10640
|
+
validUntil: null,
|
|
10641
|
+
externalId: "ZnUWsbONIaH"
|
|
10642
|
+
},
|
|
10643
|
+
{
|
|
10644
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
10645
|
+
name: "Quanza",
|
|
10646
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10647
|
+
validUntil: null,
|
|
10648
|
+
externalId: "fDZycvQTa7l"
|
|
10649
|
+
},
|
|
10650
|
+
{
|
|
10651
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
10652
|
+
name: "Rivka",
|
|
10653
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10654
|
+
validUntil: null,
|
|
10655
|
+
externalId: "KqswxCGTELa"
|
|
10656
|
+
},
|
|
10657
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
10658
|
+
{
|
|
10659
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
10660
|
+
name: "Mbula",
|
|
10661
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10662
|
+
validUntil: null,
|
|
10663
|
+
externalId: "osEbKjRc9Kg"
|
|
10664
|
+
},
|
|
10665
|
+
{
|
|
10666
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
10667
|
+
name: "Ndoki",
|
|
10668
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10669
|
+
validUntil: null,
|
|
10670
|
+
externalId: "aq4daBUAGr3"
|
|
10671
|
+
},
|
|
10672
|
+
{
|
|
10673
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
10674
|
+
name: "Tsanga",
|
|
10675
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10676
|
+
validUntil: null,
|
|
10677
|
+
externalId: "cqis6Y8trbJ"
|
|
10678
|
+
},
|
|
10679
|
+
{
|
|
10680
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
10681
|
+
name: "Waziri",
|
|
10682
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10683
|
+
validUntil: null,
|
|
10684
|
+
externalId: "LMijHPyyx6d"
|
|
10685
|
+
},
|
|
10686
|
+
{
|
|
10687
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
10688
|
+
name: "Zimbi",
|
|
10689
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10690
|
+
validUntil: null,
|
|
10691
|
+
externalId: "pcQYbPuKGZ7"
|
|
10692
|
+
},
|
|
10693
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
10694
|
+
{
|
|
10695
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
10696
|
+
name: "Felani",
|
|
10697
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10698
|
+
validUntil: null,
|
|
10699
|
+
externalId: "gSqpoCGdMXp"
|
|
10700
|
+
},
|
|
10701
|
+
{
|
|
10702
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
10703
|
+
name: "Goroma",
|
|
10704
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10705
|
+
validUntil: null,
|
|
10706
|
+
externalId: "KvAAIaNqVrp"
|
|
10707
|
+
},
|
|
10708
|
+
{
|
|
10709
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
10710
|
+
name: "Halifu",
|
|
10711
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10712
|
+
validUntil: null,
|
|
10713
|
+
externalId: "qe4UnEVt1hv"
|
|
10714
|
+
},
|
|
10715
|
+
{
|
|
10716
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
10717
|
+
name: "Jabari",
|
|
10718
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10719
|
+
validUntil: null,
|
|
10720
|
+
externalId: "yHH9Nz4rLOt"
|
|
10721
|
+
},
|
|
10722
|
+
{
|
|
10723
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
10724
|
+
name: "Kifani",
|
|
10725
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10726
|
+
validUntil: null,
|
|
10727
|
+
externalId: "eSWmXIGeu1I"
|
|
10728
|
+
},
|
|
10729
|
+
{
|
|
10730
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
10731
|
+
name: "Lumela",
|
|
10732
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10733
|
+
validUntil: null,
|
|
10734
|
+
externalId: "bh0b3aI1uP3"
|
|
10735
|
+
}
|
|
10736
|
+
];
|
|
10737
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
10738
|
+
{
|
|
10739
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
10740
|
+
name: "Central Provincial Office",
|
|
10741
|
+
locationType: "CRVS_OFFICE",
|
|
10742
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10743
|
+
validUntil: null,
|
|
10744
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
10745
|
+
},
|
|
10746
|
+
{
|
|
10747
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
10748
|
+
name: "Central Health Post",
|
|
10749
|
+
locationType: "HEALTH_FACILITY",
|
|
10750
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10751
|
+
validUntil: null
|
|
10752
|
+
},
|
|
10753
|
+
{
|
|
10754
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
10755
|
+
name: "Ibombo District Office",
|
|
10756
|
+
locationType: "CRVS_OFFICE",
|
|
10757
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10758
|
+
validUntil: null,
|
|
10759
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
10760
|
+
},
|
|
10761
|
+
{
|
|
10762
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
10763
|
+
name: "Isamba District Office",
|
|
10764
|
+
locationType: "CRVS_OFFICE",
|
|
10765
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10766
|
+
validUntil: null,
|
|
10767
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
10768
|
+
},
|
|
10769
|
+
{
|
|
10770
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
10771
|
+
name: "Isango District Office",
|
|
10772
|
+
locationType: "CRVS_OFFICE",
|
|
10773
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10774
|
+
validUntil: null,
|
|
10775
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
10776
|
+
},
|
|
10777
|
+
{
|
|
10778
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
10779
|
+
name: "Sulaka Provincial Office",
|
|
10780
|
+
locationType: "CRVS_OFFICE",
|
|
10781
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10782
|
+
validUntil: null,
|
|
10783
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
10784
|
+
},
|
|
10785
|
+
{
|
|
10786
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
10787
|
+
name: "Ilanga District Office",
|
|
10788
|
+
locationType: "CRVS_OFFICE",
|
|
10789
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10790
|
+
validUntil: null,
|
|
10791
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
10792
|
+
},
|
|
10793
|
+
{
|
|
10794
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
10795
|
+
name: "Chamakubi Health Post",
|
|
10796
|
+
locationType: "HEALTH_FACILITY",
|
|
10797
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10798
|
+
validUntil: null,
|
|
10799
|
+
externalId: "M1nFr8LbC2Qy"
|
|
10800
|
+
},
|
|
10801
|
+
{
|
|
10802
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
10803
|
+
name: "Ibombo Rural Health Centre",
|
|
10804
|
+
locationType: "HEALTH_FACILITY",
|
|
10805
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10806
|
+
validUntil: null,
|
|
10807
|
+
externalId: "bT7pV6YrW0Xc"
|
|
10808
|
+
},
|
|
10809
|
+
{
|
|
10810
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
10811
|
+
name: "Chikobo Rural Health Centre",
|
|
10812
|
+
locationType: "HEALTH_FACILITY",
|
|
10813
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10814
|
+
validUntil: null,
|
|
10815
|
+
externalId: "zE4qPn2SgJ5d"
|
|
10816
|
+
},
|
|
10817
|
+
{
|
|
10818
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
10819
|
+
name: "Chilochabalenje Health Post",
|
|
10820
|
+
locationType: "HEALTH_FACILITY",
|
|
10821
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10822
|
+
validUntil: null,
|
|
10823
|
+
externalId: "H8vDs1MqR4Uf"
|
|
10824
|
+
},
|
|
10825
|
+
{
|
|
10826
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
10827
|
+
name: "Chipeso Rural Health Centre",
|
|
10828
|
+
locationType: "HEALTH_FACILITY",
|
|
10829
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10830
|
+
validUntil: null,
|
|
10831
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
10832
|
+
},
|
|
10833
|
+
{
|
|
10834
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
10835
|
+
name: "Chisamba Rural Health Centre",
|
|
10836
|
+
locationType: "HEALTH_FACILITY",
|
|
10837
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10838
|
+
validUntil: null,
|
|
10839
|
+
externalId: "Yr0pCg8LdM2s"
|
|
10840
|
+
},
|
|
10841
|
+
{
|
|
10842
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
10843
|
+
name: "Chitanda Rural Health Centre",
|
|
10844
|
+
locationType: "HEALTH_FACILITY",
|
|
10845
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10846
|
+
validUntil: null,
|
|
10847
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
10848
|
+
},
|
|
10849
|
+
{
|
|
10850
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
10851
|
+
name: "Golden Valley Rural Health Centre",
|
|
10852
|
+
locationType: "HEALTH_FACILITY",
|
|
10853
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10854
|
+
validUntil: null,
|
|
10855
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
10856
|
+
},
|
|
10857
|
+
{
|
|
10858
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
10859
|
+
name: "Ipongo Rural Health Centre",
|
|
10860
|
+
locationType: "HEALTH_FACILITY",
|
|
10861
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10862
|
+
validUntil: null,
|
|
10863
|
+
externalId: "kF2sW9DmH0Bt"
|
|
10864
|
+
},
|
|
10865
|
+
{
|
|
10866
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
10867
|
+
name: "Itumbwe Health Post",
|
|
10868
|
+
locationType: "HEALTH_FACILITY",
|
|
10869
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10870
|
+
validUntil: null,
|
|
10871
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
10872
|
+
},
|
|
10873
|
+
{
|
|
10874
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
10875
|
+
name: "Kabangalala Rural Health Centre",
|
|
10876
|
+
locationType: "HEALTH_FACILITY",
|
|
10877
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10878
|
+
validUntil: null,
|
|
10879
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
10880
|
+
},
|
|
10881
|
+
// Village offices
|
|
10882
|
+
{
|
|
10883
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
10884
|
+
name: "Klow Village Office",
|
|
10885
|
+
locationType: "CRVS_OFFICE",
|
|
10886
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10887
|
+
validUntil: null,
|
|
10888
|
+
externalId: "PmAyxAJkxiJ"
|
|
10889
|
+
}
|
|
10890
|
+
];
|
|
10891
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
10892
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
10893
|
+
);
|
|
10894
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
10895
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
10896
|
+
);
|