@opencrvs/toolkit 2.0.0-rc.ca1536b → 2.0.0-rc.cb67c16
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 +207 -61
- package/dist/cli.js +98 -7
- package/dist/commons/api/router.d.ts +420 -4
- package/dist/commons/conditionals/conditionals.d.ts +6 -0
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +42 -36
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/utils.d.ts +3 -0
- package/dist/commons/events/utils.d.ts +11 -0
- package/dist/conditionals/index.js +7 -1
- package/dist/events/index.js +729 -122
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +96 -5
- package/dist/notification/index.js +641 -95
- package/dist/scopes/index.js +3 -1
- package/opencrvs-toolkit-2.0.0-rc.cb67c16.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.ca1536b.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,
|
|
@@ -310,6 +316,7 @@ __export(events_exports, {
|
|
|
310
316
|
getAvailableActionsForEvent: () => getAvailableActionsForEvent,
|
|
311
317
|
getAvailableRolesForUserUpdatePayload: () => getAvailableRolesForUserUpdatePayload,
|
|
312
318
|
getCompleteActionAnnotation: () => getCompleteActionAnnotation,
|
|
319
|
+
getCompleteActionContent: () => getCompleteActionContent,
|
|
313
320
|
getCompleteActionDeclaration: () => getCompleteActionDeclaration,
|
|
314
321
|
getCurrentEventState: () => getCurrentEventState,
|
|
315
322
|
getCustomActionFields: () => getCustomActionFields,
|
|
@@ -318,6 +325,7 @@ __export(events_exports, {
|
|
|
318
325
|
getDeclarationFields: () => getDeclarationFields,
|
|
319
326
|
getDeclarationPages: () => getDeclarationPages,
|
|
320
327
|
getEventConfigById: () => getEventConfigById,
|
|
328
|
+
getEventFlags: () => getEventFlags,
|
|
321
329
|
getFilePathsFromEvent: () => getFilePathsFromEvent,
|
|
322
330
|
getLocationHierarchy: () => getLocationHierarchy,
|
|
323
331
|
getMixedPath: () => getMixedPath,
|
|
@@ -380,6 +388,7 @@ __export(events_exports, {
|
|
|
380
388
|
isPageVisible: () => isPageVisible,
|
|
381
389
|
isParagraphFieldType: () => isParagraphFieldType,
|
|
382
390
|
isPhoneFieldType: () => isPhoneFieldType,
|
|
391
|
+
isPotentialDuplicate: () => isPotentialDuplicate,
|
|
383
392
|
isPrintButtonFieldType: () => isPrintButtonFieldType,
|
|
384
393
|
isQrReaderFieldType: () => isQrReaderFieldType,
|
|
385
394
|
isQueryParamReaderFieldType: () => isQueryParamReaderFieldType,
|
|
@@ -413,6 +422,7 @@ __export(events_exports, {
|
|
|
413
422
|
plainDateToLocalDate: () => plainDateToLocalDate,
|
|
414
423
|
precompileActionSchemas: () => precompileActionSchemas,
|
|
415
424
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
|
425
|
+
resolveEventCustomFlags: () => resolveEventCustomFlags,
|
|
416
426
|
resolvePlaceOfEvent: () => resolvePlaceOfEvent,
|
|
417
427
|
runFieldValidations: () => runFieldValidations,
|
|
418
428
|
runStructuralValidations: () => runStructuralValidations,
|
|
@@ -704,7 +714,9 @@ var decodeScope = (query) => {
|
|
|
704
714
|
};
|
|
705
715
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
706
716
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
707
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
717
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
718
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
719
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
708
720
|
};
|
|
709
721
|
function getAcceptedScopesByType({
|
|
710
722
|
acceptedScopes,
|
|
@@ -1077,7 +1089,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
1077
1089
|
ShowConditional,
|
|
1078
1090
|
// Action can be shown to the user in the list but as disabled
|
|
1079
1091
|
EnableConditional
|
|
1080
|
-
])
|
|
1092
|
+
]).meta({
|
|
1093
|
+
id: "ActionConditional",
|
|
1094
|
+
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."
|
|
1095
|
+
});
|
|
1081
1096
|
var DisplayOnReviewConditional = z7.object({
|
|
1082
1097
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
1083
1098
|
conditional: Conditional
|
|
@@ -1092,8 +1107,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
1092
1107
|
// Field output can be shown / hidden on the review page
|
|
1093
1108
|
DisplayOnReviewConditional
|
|
1094
1109
|
]).meta({
|
|
1095
|
-
|
|
1096
|
-
|
|
1110
|
+
id: "FieldConditional",
|
|
1111
|
+
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."
|
|
1097
1112
|
});
|
|
1098
1113
|
|
|
1099
1114
|
// ../commons/src/events/FieldType.ts
|
|
@@ -1643,8 +1658,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1643
1658
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1644
1659
|
z14.object({
|
|
1645
1660
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1646
|
-
requestId: z14.string()
|
|
1661
|
+
requestId: z14.string(),
|
|
1647
1662
|
// TODO move into 'content' property
|
|
1663
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1648
1664
|
}).shape
|
|
1649
1665
|
);
|
|
1650
1666
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1736,6 +1752,9 @@ var FlagConfig = z15.object({
|
|
|
1736
1752
|
"Indicates if this flag expects an action to be performed to be cleared."
|
|
1737
1753
|
),
|
|
1738
1754
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1755
|
+
}).meta({
|
|
1756
|
+
id: "FlagConfig",
|
|
1757
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1739
1758
|
});
|
|
1740
1759
|
var ActionFlagConfig = z15.object({
|
|
1741
1760
|
id: Flag,
|
|
@@ -1743,6 +1762,9 @@ var ActionFlagConfig = z15.object({
|
|
|
1743
1762
|
conditional: Conditional.optional().describe(
|
|
1744
1763
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1745
1764
|
)
|
|
1765
|
+
}).meta({
|
|
1766
|
+
id: "ActionFlagConfig",
|
|
1767
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1746
1768
|
});
|
|
1747
1769
|
|
|
1748
1770
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -2166,14 +2188,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
2166
2188
|
}
|
|
2167
2189
|
}).describe("Unique identifier for the field");
|
|
2168
2190
|
var FieldReference = import_v43.default.object({
|
|
2169
|
-
$$field: FieldId,
|
|
2191
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
2170
2192
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
2171
2193
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
2172
2194
|
)
|
|
2173
2195
|
}).describe("Reference to a field by its ID");
|
|
2174
2196
|
var ValidationConfig = import_v43.default.object({
|
|
2175
|
-
validator: Conditional
|
|
2176
|
-
|
|
2197
|
+
validator: Conditional.describe(
|
|
2198
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
2199
|
+
),
|
|
2200
|
+
message: TranslationConfig.describe(
|
|
2201
|
+
"Error message displayed when the validator does not hold."
|
|
2202
|
+
)
|
|
2203
|
+
}).meta({
|
|
2204
|
+
id: "ValidationConfig",
|
|
2205
|
+
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."
|
|
2177
2206
|
});
|
|
2178
2207
|
var requiredSchema = import_v43.default.union([
|
|
2179
2208
|
import_v43.default.boolean(),
|
|
@@ -2212,6 +2241,9 @@ var BaseField = import_v43.default.object({
|
|
|
2212
2241
|
}).describe("Common properties shared across all field types.");
|
|
2213
2242
|
var Divider = BaseField.extend({
|
|
2214
2243
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
2244
|
+
}).meta({
|
|
2245
|
+
description: "A horizontal line divider",
|
|
2246
|
+
id: "Divider"
|
|
2215
2247
|
});
|
|
2216
2248
|
var TextField = BaseField.extend({
|
|
2217
2249
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -2222,7 +2254,10 @@ var TextField = BaseField.extend({
|
|
|
2222
2254
|
prefix: TranslationConfig.optional(),
|
|
2223
2255
|
postfix: TranslationConfig.optional()
|
|
2224
2256
|
}).default({ type: "text" }).optional()
|
|
2225
|
-
}).
|
|
2257
|
+
}).meta({
|
|
2258
|
+
description: "A text input field",
|
|
2259
|
+
id: "TextField"
|
|
2260
|
+
});
|
|
2226
2261
|
var NumberField = BaseField.extend({
|
|
2227
2262
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
2228
2263
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -2232,7 +2267,10 @@ var NumberField = BaseField.extend({
|
|
|
2232
2267
|
prefix: TranslationConfig.optional(),
|
|
2233
2268
|
postfix: TranslationConfig.optional()
|
|
2234
2269
|
}).optional()
|
|
2235
|
-
}).
|
|
2270
|
+
}).meta({
|
|
2271
|
+
description: "A number input field",
|
|
2272
|
+
id: "NumberField"
|
|
2273
|
+
});
|
|
2236
2274
|
var TextAreaField = BaseField.extend({
|
|
2237
2275
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
2238
2276
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -2243,7 +2281,10 @@ var TextAreaField = BaseField.extend({
|
|
|
2243
2281
|
prefix: TranslationConfig.optional(),
|
|
2244
2282
|
postfix: TranslationConfig.optional()
|
|
2245
2283
|
}).default({ rows: 4 }).optional()
|
|
2246
|
-
}).
|
|
2284
|
+
}).meta({
|
|
2285
|
+
description: "A multiline text input",
|
|
2286
|
+
id: "TextAreaField"
|
|
2287
|
+
});
|
|
2247
2288
|
var ImageMimeType = import_v43.default.enum([
|
|
2248
2289
|
"image/png",
|
|
2249
2290
|
"image/jpg",
|
|
@@ -2273,13 +2314,19 @@ var SignatureField = BaseField.extend({
|
|
|
2273
2314
|
}).default({
|
|
2274
2315
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2275
2316
|
})
|
|
2276
|
-
}).
|
|
2317
|
+
}).meta({
|
|
2318
|
+
description: "A signature input field",
|
|
2319
|
+
id: "SignatureField"
|
|
2320
|
+
});
|
|
2277
2321
|
var EmailField = BaseField.extend({
|
|
2278
2322
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
2279
2323
|
configuration: import_v43.default.object({
|
|
2280
2324
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
2281
2325
|
}).default({ maxLength: 255 }).optional(),
|
|
2282
2326
|
defaultValue: NonEmptyTextValue.optional()
|
|
2327
|
+
}).meta({
|
|
2328
|
+
description: "An email input field",
|
|
2329
|
+
id: "EmailField"
|
|
2283
2330
|
});
|
|
2284
2331
|
var DateField = BaseField.extend({
|
|
2285
2332
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -2289,7 +2336,10 @@ var DateField = BaseField.extend({
|
|
|
2289
2336
|
"Text to display above the date input"
|
|
2290
2337
|
).optional()
|
|
2291
2338
|
}).optional()
|
|
2292
|
-
}).
|
|
2339
|
+
}).meta({
|
|
2340
|
+
description: "A date input (yyyy-MM-dd)",
|
|
2341
|
+
id: "DateField"
|
|
2342
|
+
});
|
|
2293
2343
|
var AgeField = BaseField.extend({
|
|
2294
2344
|
type: import_v43.default.literal(FieldType.AGE),
|
|
2295
2345
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -2298,7 +2348,10 @@ var AgeField = BaseField.extend({
|
|
|
2298
2348
|
prefix: TranslationConfig.optional(),
|
|
2299
2349
|
postfix: TranslationConfig.optional()
|
|
2300
2350
|
})
|
|
2301
|
-
}).
|
|
2351
|
+
}).meta({
|
|
2352
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
2353
|
+
id: "AgeField"
|
|
2354
|
+
});
|
|
2302
2355
|
var TimeField = BaseField.extend({
|
|
2303
2356
|
type: import_v43.default.literal(FieldType.TIME),
|
|
2304
2357
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -2308,7 +2361,10 @@ var TimeField = BaseField.extend({
|
|
|
2308
2361
|
"Text to display above the time input"
|
|
2309
2362
|
).optional()
|
|
2310
2363
|
}).optional()
|
|
2311
|
-
}).
|
|
2364
|
+
}).meta({
|
|
2365
|
+
description: "A single time input (HH-mm)",
|
|
2366
|
+
id: "TimeField"
|
|
2367
|
+
});
|
|
2312
2368
|
var DateRangeField = BaseField.extend({
|
|
2313
2369
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
2314
2370
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -2317,7 +2373,10 @@ var DateRangeField = BaseField.extend({
|
|
|
2317
2373
|
"Text to display above the date input"
|
|
2318
2374
|
).optional()
|
|
2319
2375
|
}).optional()
|
|
2320
|
-
}).
|
|
2376
|
+
}).meta({
|
|
2377
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
2378
|
+
id: "DateRangeField"
|
|
2379
|
+
});
|
|
2321
2380
|
var HtmlFontVariant = import_v43.default.enum([
|
|
2322
2381
|
"reg12",
|
|
2323
2382
|
"reg14",
|
|
@@ -2361,18 +2420,30 @@ var ImageViewField = BaseField.extend({
|
|
|
2361
2420
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
2362
2421
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2363
2422
|
configuration: ImageConfiguration
|
|
2364
|
-
}).
|
|
2423
|
+
}).meta({
|
|
2424
|
+
description: "A read-only image component for form pages",
|
|
2425
|
+
id: "ImageViewField"
|
|
2426
|
+
});
|
|
2365
2427
|
var Paragraph = BaseField.extend({
|
|
2366
2428
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
2367
2429
|
configuration: ParagraphConfiguration
|
|
2368
|
-
}).
|
|
2430
|
+
}).meta({
|
|
2431
|
+
description: "A read-only HTML <p> paragraph",
|
|
2432
|
+
id: "Paragraph"
|
|
2433
|
+
});
|
|
2369
2434
|
var Heading = BaseField.extend({
|
|
2370
2435
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
2371
2436
|
configuration: HeadingConfiguration
|
|
2372
|
-
}).
|
|
2437
|
+
}).meta({
|
|
2438
|
+
description: "A read-only heading component for form pages",
|
|
2439
|
+
id: "Heading"
|
|
2440
|
+
});
|
|
2373
2441
|
var PageHeader = BaseField.extend({
|
|
2374
2442
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2375
|
-
}).
|
|
2443
|
+
}).meta({
|
|
2444
|
+
description: "A read-only header component for form pages",
|
|
2445
|
+
id: "PageHeader"
|
|
2446
|
+
});
|
|
2376
2447
|
var File = BaseField.extend({
|
|
2377
2448
|
type: import_v43.default.literal(FieldType.FILE),
|
|
2378
2449
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -2391,7 +2462,10 @@ var File = BaseField.extend({
|
|
|
2391
2462
|
}).default({
|
|
2392
2463
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2393
2464
|
})
|
|
2394
|
-
}).
|
|
2465
|
+
}).meta({
|
|
2466
|
+
description: "A file upload field",
|
|
2467
|
+
id: "File"
|
|
2468
|
+
});
|
|
2395
2469
|
var SelectOption = import_v43.default.object({
|
|
2396
2470
|
value: import_v43.default.string().describe("The value of the option"),
|
|
2397
2471
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -2408,7 +2482,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
2408
2482
|
"Placeholder for the number field"
|
|
2409
2483
|
)
|
|
2410
2484
|
}).optional()
|
|
2411
|
-
}).
|
|
2485
|
+
}).meta({
|
|
2486
|
+
description: "A number with unit input field",
|
|
2487
|
+
id: "NumberWithUnitField"
|
|
2488
|
+
});
|
|
2412
2489
|
var RadioGroup = BaseField.extend({
|
|
2413
2490
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
2414
2491
|
defaultValue: TextValue.optional(),
|
|
@@ -2418,7 +2495,10 @@ var RadioGroup = BaseField.extend({
|
|
|
2418
2495
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
2419
2496
|
}).optional()
|
|
2420
2497
|
}).optional()
|
|
2421
|
-
}).
|
|
2498
|
+
}).meta({
|
|
2499
|
+
description: "A grouped radio button field",
|
|
2500
|
+
id: "RadioGroup"
|
|
2501
|
+
});
|
|
2422
2502
|
var BulletList = BaseField.extend({
|
|
2423
2503
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
2424
2504
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -2427,7 +2507,10 @@ var BulletList = BaseField.extend({
|
|
|
2427
2507
|
fontVariant: HtmlFontVariant.optional()
|
|
2428
2508
|
}).optional()
|
|
2429
2509
|
}).default({})
|
|
2430
|
-
}).
|
|
2510
|
+
}).meta({
|
|
2511
|
+
description: "A list of bullet points",
|
|
2512
|
+
id: "BulletList"
|
|
2513
|
+
});
|
|
2431
2514
|
var Select = BaseField.extend({
|
|
2432
2515
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
2433
2516
|
defaultValue: TextValue.optional(),
|
|
@@ -2442,7 +2525,10 @@ var Select = BaseField.extend({
|
|
|
2442
2525
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
2443
2526
|
`
|
|
2444
2527
|
)
|
|
2445
|
-
}).
|
|
2528
|
+
}).meta({
|
|
2529
|
+
description: "A select input field",
|
|
2530
|
+
id: "Select"
|
|
2531
|
+
});
|
|
2446
2532
|
var SelectDateRangeOption = import_v43.default.object({
|
|
2447
2533
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
2448
2534
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -2451,7 +2537,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
2451
2537
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
2452
2538
|
defaultValue: SelectDateRangeValue.optional(),
|
|
2453
2539
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
2454
|
-
}).
|
|
2540
|
+
}).meta({
|
|
2541
|
+
description: "A date range selection field",
|
|
2542
|
+
id: "SelectDateRangeField"
|
|
2543
|
+
});
|
|
2455
2544
|
var NameConfig = import_v43.default.object({
|
|
2456
2545
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2457
2546
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -2482,26 +2571,41 @@ var NameField = BaseField.extend({
|
|
|
2482
2571
|
surname: { required: true }
|
|
2483
2572
|
}
|
|
2484
2573
|
}).optional()
|
|
2485
|
-
}).
|
|
2574
|
+
}).meta({
|
|
2575
|
+
description: "A field for entering a persons name",
|
|
2576
|
+
id: "NameField"
|
|
2577
|
+
});
|
|
2486
2578
|
var PhoneField = BaseField.extend({
|
|
2487
2579
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2488
2580
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
2489
|
-
}).
|
|
2581
|
+
}).meta({
|
|
2582
|
+
description: "A field for entering a phone number",
|
|
2583
|
+
id: "PhoneField"
|
|
2584
|
+
});
|
|
2490
2585
|
var IdField = BaseField.extend({
|
|
2491
2586
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2492
2587
|
type: import_v43.default.literal(FieldType.ID)
|
|
2493
|
-
}).
|
|
2588
|
+
}).meta({
|
|
2589
|
+
description: "A field for entering an ID",
|
|
2590
|
+
id: "IdField"
|
|
2591
|
+
});
|
|
2494
2592
|
var Checkbox = BaseField.extend({
|
|
2495
2593
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
2496
2594
|
defaultValue: CheckboxFieldValue.default(false)
|
|
2497
|
-
}).
|
|
2595
|
+
}).meta({
|
|
2596
|
+
description: "A boolean checkbox field",
|
|
2597
|
+
id: "Checkbox"
|
|
2598
|
+
});
|
|
2498
2599
|
var Country = BaseField.extend({
|
|
2499
2600
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
2500
2601
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2501
2602
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
2502
2603
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2503
2604
|
)
|
|
2504
|
-
}).
|
|
2605
|
+
}).meta({
|
|
2606
|
+
description: "A field for selecting a country",
|
|
2607
|
+
id: "Country"
|
|
2608
|
+
});
|
|
2505
2609
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2506
2610
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2507
2611
|
);
|
|
@@ -2510,16 +2614,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2510
2614
|
"HEALTH_FACILITY",
|
|
2511
2615
|
"CRVS_OFFICE"
|
|
2512
2616
|
]);
|
|
2513
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
2514
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2515
|
-
type: AdministrativeAreas,
|
|
2516
|
-
allowedLocations: AllowedLocations
|
|
2517
|
-
}).describe("Administrative area options");
|
|
2518
2617
|
var AdministrativeAreaField = BaseField.extend({
|
|
2519
2618
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2520
2619
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2521
|
-
configuration:
|
|
2522
|
-
|
|
2620
|
+
configuration: import_v43.default.object({
|
|
2621
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2622
|
+
type: AdministrativeAreas,
|
|
2623
|
+
allowedLocations: AllowedLocations
|
|
2624
|
+
}).describe("Administrative area options")
|
|
2625
|
+
}).meta({
|
|
2626
|
+
description: "Administrative area input field",
|
|
2627
|
+
id: "AdministrativeAreaField"
|
|
2628
|
+
});
|
|
2523
2629
|
var LocationInput = BaseField.extend({
|
|
2524
2630
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2525
2631
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -2527,7 +2633,10 @@ var LocationInput = BaseField.extend({
|
|
|
2527
2633
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2528
2634
|
allowedLocations: AllowedLocations
|
|
2529
2635
|
}).optional()
|
|
2530
|
-
}).
|
|
2636
|
+
}).meta({
|
|
2637
|
+
description: "A field for selecting a location",
|
|
2638
|
+
id: "LocationInput"
|
|
2639
|
+
});
|
|
2531
2640
|
var FileUploadWithOptions = BaseField.extend({
|
|
2532
2641
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2533
2642
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -2541,6 +2650,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2541
2650
|
}).default({
|
|
2542
2651
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2543
2652
|
})
|
|
2653
|
+
}).meta({
|
|
2654
|
+
description: "A field for uploading files with file type options",
|
|
2655
|
+
id: "FileUploadWithOptions"
|
|
2544
2656
|
});
|
|
2545
2657
|
var Facility = BaseField.extend({
|
|
2546
2658
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -2586,7 +2698,10 @@ var Address = BaseField.extend({
|
|
|
2586
2698
|
allowedLocations: AllowedLocations
|
|
2587
2699
|
}).optional(),
|
|
2588
2700
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2589
|
-
}).
|
|
2701
|
+
}).meta({
|
|
2702
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2703
|
+
id: "Address"
|
|
2704
|
+
});
|
|
2590
2705
|
var StaticDataEntry = import_v43.default.object({
|
|
2591
2706
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2592
2707
|
label: TranslationConfig,
|
|
@@ -2601,7 +2716,10 @@ var DataField = BaseField.extend({
|
|
|
2601
2716
|
subtitle: TranslationConfig.optional(),
|
|
2602
2717
|
data: import_v43.default.array(DataEntry)
|
|
2603
2718
|
})
|
|
2604
|
-
}).
|
|
2719
|
+
}).meta({
|
|
2720
|
+
description: "A field for displaying a table of read-only data",
|
|
2721
|
+
id: "DataField"
|
|
2722
|
+
});
|
|
2605
2723
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2606
2724
|
var ButtonType = import_v43.default.enum([
|
|
2607
2725
|
"primary",
|
|
@@ -2628,11 +2746,17 @@ var ButtonField = BaseField.extend({
|
|
|
2628
2746
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2629
2747
|
defaultValue: ButtonFieldValue.optional(),
|
|
2630
2748
|
configuration: ButtonConfiguration
|
|
2631
|
-
}).
|
|
2749
|
+
}).meta({
|
|
2750
|
+
description: "A generic button that can be used to trigger an action",
|
|
2751
|
+
id: "ButtonField"
|
|
2752
|
+
});
|
|
2632
2753
|
var FieldGroup = BaseField.extend({
|
|
2633
2754
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2634
2755
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2635
2756
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2757
|
+
}).meta({
|
|
2758
|
+
description: "A group of fields that are displayed together",
|
|
2759
|
+
id: "FieldGroup"
|
|
2636
2760
|
});
|
|
2637
2761
|
var AlphaPrintButton = BaseField.extend({
|
|
2638
2762
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2642,7 +2766,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2642
2766
|
"Label for the print button"
|
|
2643
2767
|
)
|
|
2644
2768
|
})
|
|
2645
|
-
}).
|
|
2769
|
+
}).meta({
|
|
2770
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2771
|
+
id: "AlphaPrintButton"
|
|
2772
|
+
});
|
|
2646
2773
|
var HttpField = BaseField.extend({
|
|
2647
2774
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2648
2775
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -2658,20 +2785,30 @@ var HttpField = BaseField.extend({
|
|
|
2658
2785
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2659
2786
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2660
2787
|
})
|
|
2661
|
-
}).
|
|
2788
|
+
}).meta({
|
|
2789
|
+
description: "Makes a background HTTP request to an external service and stores the response so other fields can use it. Has no visible UI \u2014 pair with LOADER to show request status.",
|
|
2790
|
+
id: "HttpField"
|
|
2791
|
+
});
|
|
2662
2792
|
var AutocompleteField = BaseField.extend({
|
|
2663
2793
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2664
2794
|
configuration: import_v43.default.object({
|
|
2665
|
-
url: import_v43.default.string().describe(
|
|
2795
|
+
url: import_v43.default.string().describe(
|
|
2796
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2797
|
+
).optional(),
|
|
2666
2798
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2667
2799
|
defaultOptions: import_v43.default.array(
|
|
2668
2800
|
import_v43.default.object({
|
|
2669
2801
|
label: import_v43.default.string(),
|
|
2670
2802
|
value: import_v43.default.string()
|
|
2671
2803
|
})
|
|
2672
|
-
).optional()
|
|
2804
|
+
).optional().describe(
|
|
2805
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2806
|
+
)
|
|
2673
2807
|
})
|
|
2674
|
-
}).
|
|
2808
|
+
}).meta({
|
|
2809
|
+
description: "Generic autocomplete component designed for use with large dictionary-based datasets. The component supports dynamic retrieval of options from configurable data sources and is intended for datasets that may contain tens or hundreds of thousands of records.",
|
|
2810
|
+
id: "AutocompleteField"
|
|
2811
|
+
});
|
|
2675
2812
|
var SearchField = HttpField.extend({
|
|
2676
2813
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2677
2814
|
configuration: SearchQuery.pick({
|
|
@@ -2704,6 +2841,9 @@ var SearchField = HttpField.extend({
|
|
|
2704
2841
|
ok: TranslationConfig.optional()
|
|
2705
2842
|
}).optional()
|
|
2706
2843
|
})
|
|
2844
|
+
}).meta({
|
|
2845
|
+
description: "A search input field",
|
|
2846
|
+
id: "SearchField"
|
|
2707
2847
|
});
|
|
2708
2848
|
var LinkButtonField = BaseField.extend({
|
|
2709
2849
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2712,7 +2852,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
2712
2852
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2713
2853
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2714
2854
|
})
|
|
2715
|
-
}).
|
|
2855
|
+
}).meta({
|
|
2856
|
+
description: "A button that opens a URL link",
|
|
2857
|
+
id: "LinkButtonField"
|
|
2858
|
+
});
|
|
2716
2859
|
var VerificationStatus = BaseField.extend({
|
|
2717
2860
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2718
2861
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -2722,15 +2865,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
2722
2865
|
"Explaining text on the banner in form."
|
|
2723
2866
|
)
|
|
2724
2867
|
})
|
|
2868
|
+
}).meta({
|
|
2869
|
+
description: "Displays a verification state (e.g. ID verified / pending). Often paired with ID_READER \u2014 it can read its value off an ID_READER rather than holding its own.",
|
|
2870
|
+
id: "VerificationStatus"
|
|
2725
2871
|
});
|
|
2726
2872
|
var QueryParamReaderField = BaseField.extend({
|
|
2727
2873
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2728
2874
|
configuration: import_v43.default.object({
|
|
2729
2875
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2730
2876
|
})
|
|
2731
|
-
}).
|
|
2732
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2733
|
-
|
|
2877
|
+
}).meta({
|
|
2878
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2879
|
+
id: "QueryParamReaderField"
|
|
2880
|
+
});
|
|
2734
2881
|
var QrReaderField = BaseField.extend({
|
|
2735
2882
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2736
2883
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -2741,7 +2888,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2741
2888
|
})
|
|
2742
2889
|
}).optional()
|
|
2743
2890
|
}).meta({
|
|
2744
|
-
description: "
|
|
2891
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2745
2892
|
id: "QrReaderField"
|
|
2746
2893
|
});
|
|
2747
2894
|
var IdReaderField = BaseField.extend({
|
|
@@ -2750,12 +2897,18 @@ var IdReaderField = BaseField.extend({
|
|
|
2750
2897
|
methods: import_v43.default.array(
|
|
2751
2898
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2752
2899
|
)
|
|
2900
|
+
}).meta({
|
|
2901
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2902
|
+
id: "IdReaderField"
|
|
2753
2903
|
});
|
|
2754
2904
|
var CustomField = BaseField.extend({
|
|
2755
2905
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2756
2906
|
defaultValue: CustomFieldValue.optional(),
|
|
2757
2907
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2758
2908
|
configuration: import_v43.default.unknown().optional()
|
|
2909
|
+
}).meta({
|
|
2910
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2911
|
+
id: "CustomField"
|
|
2759
2912
|
});
|
|
2760
2913
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2761
2914
|
var LoaderField = BaseField.extend({
|
|
@@ -2765,22 +2918,25 @@ var LoaderField = BaseField.extend({
|
|
|
2765
2918
|
configuration: import_v43.default.object({
|
|
2766
2919
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2767
2920
|
})
|
|
2768
|
-
}).
|
|
2769
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2770
|
-
|
|
2921
|
+
}).meta({
|
|
2922
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2923
|
+
id: "LoaderField"
|
|
2924
|
+
});
|
|
2771
2925
|
var HiddenField = BaseField.extend({
|
|
2772
2926
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2773
2927
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2774
2928
|
defaultValue: TextValue.optional()
|
|
2775
|
-
}).
|
|
2776
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2777
|
-
|
|
2929
|
+
}).meta({
|
|
2930
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2931
|
+
id: "HiddenField"
|
|
2932
|
+
});
|
|
2778
2933
|
var UserRoleField = BaseField.extend({
|
|
2779
2934
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2780
2935
|
defaultValue: TextValue.optional()
|
|
2781
|
-
}).
|
|
2782
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2783
|
-
|
|
2936
|
+
}).meta({
|
|
2937
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2938
|
+
id: "UserRoleField"
|
|
2939
|
+
});
|
|
2784
2940
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2785
2941
|
FieldGroup,
|
|
2786
2942
|
Address,
|
|
@@ -2879,16 +3035,19 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2879
3035
|
type: z21.literal(PageTypes.enum.VERIFICATION),
|
|
2880
3036
|
actions: VerificationActionConfig
|
|
2881
3037
|
});
|
|
2882
|
-
var PageConfig = z21.discriminatedUnion("type", [
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
3038
|
+
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
3039
|
+
id: "PageConfig",
|
|
3040
|
+
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."
|
|
3041
|
+
});
|
|
2886
3042
|
|
|
2887
3043
|
// ../commons/src/events/FormConfig.ts
|
|
2888
3044
|
var DeclarationFormConfig = z22.object({
|
|
2889
3045
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2890
3046
|
pages: z22.array(FormPageConfig)
|
|
2891
|
-
}).
|
|
3047
|
+
}).meta({
|
|
3048
|
+
id: "DeclarationFormConfig",
|
|
3049
|
+
description: "Configuration of the declaration form."
|
|
3050
|
+
});
|
|
2892
3051
|
var ActionFormConfig = z22.object({
|
|
2893
3052
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2894
3053
|
pages: z22.array(PageConfig)
|
|
@@ -2988,6 +3147,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2988
3147
|
id: z23.string(),
|
|
2989
3148
|
label: TranslationConfig,
|
|
2990
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."
|
|
2991
3153
|
});
|
|
2992
3154
|
|
|
2993
3155
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -3105,17 +3267,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3105
3267
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
3106
3268
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
3107
3269
|
*/
|
|
3108
|
-
ReadActionConfig.meta({
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3270
|
+
ReadActionConfig.meta({
|
|
3271
|
+
id: "ReadActionConfig",
|
|
3272
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
3273
|
+
}),
|
|
3274
|
+
DeclareConfig.meta({
|
|
3275
|
+
id: "DeclareActionConfig",
|
|
3276
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
3277
|
+
}),
|
|
3278
|
+
RejectConfig.meta({
|
|
3279
|
+
id: "RejectActionConfig",
|
|
3280
|
+
description: "Configuration for rejecting a record before registration."
|
|
3281
|
+
}),
|
|
3282
|
+
RegisterConfig.meta({
|
|
3283
|
+
id: "RegisterActionConfig",
|
|
3284
|
+
description: "Configuration for registering a record."
|
|
3285
|
+
}),
|
|
3112
3286
|
PrintCertificateActionConfig.meta({
|
|
3113
|
-
id: "PrintCertificateActionConfig"
|
|
3287
|
+
id: "PrintCertificateActionConfig",
|
|
3288
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
3289
|
+
}),
|
|
3290
|
+
RequestCorrectionConfig.meta({
|
|
3291
|
+
id: "RequestCorrectionActionConfig",
|
|
3292
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
3293
|
+
}),
|
|
3294
|
+
EditActionConfig.meta({
|
|
3295
|
+
id: "EditActionConfig",
|
|
3296
|
+
description: "Configuration for editing a record before registration."
|
|
3297
|
+
}),
|
|
3298
|
+
ArchiveConfig.meta({
|
|
3299
|
+
id: "ArchiveActionConfig",
|
|
3300
|
+
description: "Configuration for archiving a record."
|
|
3114
3301
|
}),
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3302
|
+
CustomActionConfig.meta({
|
|
3303
|
+
id: "CustomActionConfig",
|
|
3304
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
3305
|
+
})
|
|
3119
3306
|
]).describe(
|
|
3120
3307
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
3121
3308
|
).meta({ id: "ActionConfig" });
|
|
@@ -3191,7 +3378,10 @@ var Field = BaseField2.extend({
|
|
|
3191
3378
|
}).describe("Custom field defined for the summary view.");
|
|
3192
3379
|
var SummaryConfig = z27.object({
|
|
3193
3380
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3194
|
-
}).
|
|
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
|
+
});
|
|
3195
3385
|
|
|
3196
3386
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3197
3387
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -3315,6 +3505,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
3315
3505
|
var AdvancedSearchConfig = z28.object({
|
|
3316
3506
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3317
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()`)."
|
|
3318
3511
|
});
|
|
3319
3512
|
|
|
3320
3513
|
// ../commons/src/events/utils.ts
|
|
@@ -3333,9 +3526,11 @@ var z30 = __toESM(require("zod/v4"));
|
|
|
3333
3526
|
var z29 = __toESM(require("zod/v4"));
|
|
3334
3527
|
function getDynamicNameValue(field3) {
|
|
3335
3528
|
const nameConfiguration = field3.configuration?.name;
|
|
3529
|
+
const firstnameRequired = nameConfiguration?.firstname?.required ?? field3.required;
|
|
3530
|
+
const surnameRequired = nameConfiguration?.surname?.required ?? field3.required;
|
|
3336
3531
|
return z29.object({
|
|
3337
|
-
firstname:
|
|
3338
|
-
surname:
|
|
3532
|
+
firstname: firstnameRequired ? NonEmptyTextValue : TextValue,
|
|
3533
|
+
surname: surnameRequired ? NonEmptyTextValue : TextValue,
|
|
3339
3534
|
middlename: nameConfiguration?.middlename?.required ? NonEmptyTextValue : TextValue.optional()
|
|
3340
3535
|
});
|
|
3341
3536
|
}
|
|
@@ -4562,6 +4757,22 @@ function getCompleteActionAnnotation(annotation, event2, action) {
|
|
|
4562
4757
|
}
|
|
4563
4758
|
return deepMerge(annotation, action.annotation ?? {});
|
|
4564
4759
|
}
|
|
4760
|
+
function getCompleteActionContent(event2, action) {
|
|
4761
|
+
const currentContent = "content" in action ? action.content : void 0;
|
|
4762
|
+
if (!action.originalActionId) {
|
|
4763
|
+
return currentContent;
|
|
4764
|
+
}
|
|
4765
|
+
const originalAction = event2.actions.find(
|
|
4766
|
+
({ id }) => id === action.originalActionId
|
|
4767
|
+
);
|
|
4768
|
+
if (originalAction && "content" in originalAction && originalAction.content) {
|
|
4769
|
+
return {
|
|
4770
|
+
...originalAction.content,
|
|
4771
|
+
...currentContent ?? {}
|
|
4772
|
+
};
|
|
4773
|
+
}
|
|
4774
|
+
return currentContent;
|
|
4775
|
+
}
|
|
4565
4776
|
function getCompleteActionDeclaration(declaration, event2, action) {
|
|
4566
4777
|
if (action.originalActionId) {
|
|
4567
4778
|
const originalAction = event2.actions.find(
|
|
@@ -4668,6 +4879,9 @@ function not(condition) {
|
|
|
4668
4879
|
function never2() {
|
|
4669
4880
|
return not(alwaysTrue());
|
|
4670
4881
|
}
|
|
4882
|
+
function always() {
|
|
4883
|
+
return defineConditional(alwaysTrue());
|
|
4884
|
+
}
|
|
4671
4885
|
function jsonFieldPath(field3) {
|
|
4672
4886
|
return [field3.$$field, ...field3.$$subfield].join("/");
|
|
4673
4887
|
}
|
|
@@ -5363,7 +5577,7 @@ var _EventConfigBase = z33.object({
|
|
|
5363
5577
|
),
|
|
5364
5578
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
5365
5579
|
actions: z33.array(ActionConfig).describe(
|
|
5366
|
-
"Configuration of
|
|
5580
|
+
"Configuration of core and custom actions associated with the event."
|
|
5367
5581
|
),
|
|
5368
5582
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
5369
5583
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -5375,7 +5589,7 @@ var _EventConfigBase = z33.object({
|
|
|
5375
5589
|
"Configuration of fields available in the advanced search feature."
|
|
5376
5590
|
),
|
|
5377
5591
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
5378
|
-
"Configuration of flags associated with the actions of this event type."
|
|
5592
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
5379
5593
|
),
|
|
5380
5594
|
analytics: z33.boolean().optional().default(true).describe(
|
|
5381
5595
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -5388,8 +5602,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
5388
5602
|
validateActionFlags(event2, ctx);
|
|
5389
5603
|
validateActionOrder(event2, ctx);
|
|
5390
5604
|
}).meta({
|
|
5391
|
-
id: "EventConfig"
|
|
5392
|
-
|
|
5605
|
+
id: "EventConfig",
|
|
5606
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
5607
|
+
});
|
|
5393
5608
|
|
|
5394
5609
|
// ../commons/src/events/EventConfigInput.ts
|
|
5395
5610
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -5612,6 +5827,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
5612
5827
|
var WorkqueueColumn = z34.object({
|
|
5613
5828
|
label: TranslationConfig,
|
|
5614
5829
|
value: WorkqueueColumnValue
|
|
5830
|
+
}).meta({
|
|
5831
|
+
id: "WorkqueueColumn",
|
|
5832
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
5615
5833
|
});
|
|
5616
5834
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
5617
5835
|
return workqueueColumns.map(
|
|
@@ -5814,18 +6032,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5814
6032
|
query: true,
|
|
5815
6033
|
columns: true
|
|
5816
6034
|
});
|
|
5817
|
-
var WorkqueueConfigInput =
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
query: CountryConfigQueryInputType,
|
|
5823
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
5824
|
-
"Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
|
|
5825
|
-
),
|
|
5826
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5827
|
-
icon: AvailableIcons,
|
|
5828
|
-
emptyMessage: TranslationConfig.optional()
|
|
6035
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
6036
|
+
query: CountryConfigQueryInputType
|
|
6037
|
+
}).meta({
|
|
6038
|
+
id: "WorkqueueConfig",
|
|
6039
|
+
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."
|
|
5829
6040
|
});
|
|
5830
6041
|
function defineWorkqueue(workqueueInput) {
|
|
5831
6042
|
const queryInput = workqueueInput.query;
|
|
@@ -5888,7 +6099,9 @@ var BaseActionInput = z38.object({
|
|
|
5888
6099
|
keepAssignment: z38.boolean().optional(),
|
|
5889
6100
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
5890
6101
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
5891
|
-
waitFor: z38.boolean().
|
|
6102
|
+
waitFor: z38.boolean().default(true).describe(
|
|
6103
|
+
"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."
|
|
6104
|
+
),
|
|
5892
6105
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
5893
6106
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
5894
6107
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -6006,7 +6219,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
6006
6219
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
6007
6220
|
z38.object({
|
|
6008
6221
|
requestId: z38.string(),
|
|
6009
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
6222
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
6223
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
6010
6224
|
}).shape
|
|
6011
6225
|
);
|
|
6012
6226
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -6068,7 +6282,7 @@ var Draft = z39.object({
|
|
|
6068
6282
|
}).describe(
|
|
6069
6283
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
6070
6284
|
);
|
|
6071
|
-
var DraftInput = BaseActionInput.extend({
|
|
6285
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
6072
6286
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
6073
6287
|
status: z39.enum([
|
|
6074
6288
|
ActionStatus.Requested,
|
|
@@ -6199,26 +6413,43 @@ var import_date_fns3 = require("date-fns");
|
|
|
6199
6413
|
function isEditInProgress(actions) {
|
|
6200
6414
|
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6201
6415
|
}
|
|
6416
|
+
function findPendingCorrectionAction(writeActions2) {
|
|
6417
|
+
let correctionRequestAction;
|
|
6418
|
+
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
6419
|
+
const action = writeActions2[i];
|
|
6420
|
+
if (action.type === ActionType.APPROVE_CORRECTION || action.type === ActionType.REJECT_CORRECTION) {
|
|
6421
|
+
break;
|
|
6422
|
+
}
|
|
6423
|
+
if (action.type === ActionType.REQUEST_CORRECTION) {
|
|
6424
|
+
correctionRequestAction = action;
|
|
6425
|
+
break;
|
|
6426
|
+
}
|
|
6427
|
+
}
|
|
6428
|
+
return correctionRequestAction;
|
|
6429
|
+
}
|
|
6202
6430
|
function isCorrectionRequested(actions) {
|
|
6431
|
+
return findPendingCorrectionAction(actions) !== void 0;
|
|
6432
|
+
}
|
|
6433
|
+
function isDeclarationIncomplete(actions) {
|
|
6434
|
+
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6435
|
+
}
|
|
6436
|
+
function isRejected(actions) {
|
|
6437
|
+
const resettingActionTypes = [
|
|
6438
|
+
ActionType.NOTIFY,
|
|
6439
|
+
ActionType.DECLARE,
|
|
6440
|
+
ActionType.EDIT,
|
|
6441
|
+
ActionType.REGISTER
|
|
6442
|
+
];
|
|
6203
6443
|
return actions.reduce((prev, { type }) => {
|
|
6204
|
-
if (type === ActionType.
|
|
6444
|
+
if (type === ActionType.REJECT) {
|
|
6205
6445
|
return true;
|
|
6206
6446
|
}
|
|
6207
|
-
if (type
|
|
6208
|
-
return false;
|
|
6209
|
-
}
|
|
6210
|
-
if (type === ActionType.REJECT_CORRECTION) {
|
|
6447
|
+
if (resettingActionTypes.includes(type)) {
|
|
6211
6448
|
return false;
|
|
6212
6449
|
}
|
|
6213
6450
|
return prev;
|
|
6214
6451
|
}, false);
|
|
6215
6452
|
}
|
|
6216
|
-
function isDeclarationIncomplete(actions) {
|
|
6217
|
-
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6218
|
-
}
|
|
6219
|
-
function isRejected(actions) {
|
|
6220
|
-
return actions.at(-1)?.type === ActionType.REJECT;
|
|
6221
|
-
}
|
|
6222
6453
|
function isPotentialDuplicate(actions) {
|
|
6223
6454
|
return actions.reduce((prev, { type }) => {
|
|
6224
6455
|
if (type === ActionType.DUPLICATE_DETECTED) {
|
|
@@ -6281,8 +6512,7 @@ function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
|
6281
6512
|
return (0, import_lodash3.uniq)(flags);
|
|
6282
6513
|
}, []);
|
|
6283
6514
|
}
|
|
6284
|
-
function
|
|
6285
|
-
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6515
|
+
function getActionStatusFlags(sortedActions) {
|
|
6286
6516
|
const actionStatus = sortedActions.reduce(
|
|
6287
6517
|
(actionStatuses, { type, status: status2 }) => ({
|
|
6288
6518
|
...actionStatuses,
|
|
@@ -6290,26 +6520,40 @@ function getEventFlags(event2, config) {
|
|
|
6290
6520
|
}),
|
|
6291
6521
|
{}
|
|
6292
6522
|
);
|
|
6293
|
-
|
|
6523
|
+
return Object.entries(actionStatus).filter(([, status2]) => status2 !== ActionStatus.Accepted).map(([type, status2]) => {
|
|
6294
6524
|
const flag2 = joinValues([type, status2], ":").toLowerCase();
|
|
6295
6525
|
return flag2;
|
|
6296
6526
|
});
|
|
6297
|
-
|
|
6298
|
-
|
|
6527
|
+
}
|
|
6528
|
+
function getInherentFlags(sortedActions) {
|
|
6529
|
+
const acceptedActions = sortedActions.filter(
|
|
6530
|
+
({ status: status2 }) => status2 === ActionStatus.Accepted
|
|
6531
|
+
);
|
|
6532
|
+
const inherentFlags = [];
|
|
6533
|
+
if (isCorrectionRequested(acceptedActions)) {
|
|
6534
|
+
inherentFlags.push(InherentFlags.CORRECTION_REQUESTED);
|
|
6299
6535
|
}
|
|
6300
|
-
if (isDeclarationIncomplete(
|
|
6301
|
-
|
|
6536
|
+
if (isDeclarationIncomplete(acceptedActions)) {
|
|
6537
|
+
inherentFlags.push(InherentFlags.INCOMPLETE);
|
|
6302
6538
|
}
|
|
6303
|
-
if (isRejected(
|
|
6304
|
-
|
|
6539
|
+
if (isRejected(acceptedActions)) {
|
|
6540
|
+
inherentFlags.push(InherentFlags.REJECTED);
|
|
6305
6541
|
}
|
|
6306
|
-
if (isPotentialDuplicate(
|
|
6307
|
-
|
|
6542
|
+
if (isPotentialDuplicate(acceptedActions)) {
|
|
6543
|
+
inherentFlags.push(InherentFlags.POTENTIAL_DUPLICATE);
|
|
6308
6544
|
}
|
|
6309
|
-
if (isEditInProgress(
|
|
6310
|
-
|
|
6545
|
+
if (isEditInProgress(acceptedActions)) {
|
|
6546
|
+
inherentFlags.push(InherentFlags.EDIT_IN_PROGRESS);
|
|
6311
6547
|
}
|
|
6312
|
-
return
|
|
6548
|
+
return inherentFlags;
|
|
6549
|
+
}
|
|
6550
|
+
function getEventFlags(event2, config) {
|
|
6551
|
+
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6552
|
+
return [
|
|
6553
|
+
...getActionStatusFlags(sortedActions),
|
|
6554
|
+
...getInherentFlags(sortedActions),
|
|
6555
|
+
...resolveEventCustomFlags(event2, config)
|
|
6556
|
+
];
|
|
6313
6557
|
}
|
|
6314
6558
|
|
|
6315
6559
|
// ../commons/src/events/state/index.ts
|
|
@@ -10308,3 +10552,366 @@ function getFilePathsFromEvent(event2) {
|
|
|
10308
10552
|
});
|
|
10309
10553
|
return (0, import_lodash7.uniq)(filepaths);
|
|
10310
10554
|
}
|
|
10555
|
+
|
|
10556
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
10557
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
10558
|
+
{
|
|
10559
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10560
|
+
name: "Central",
|
|
10561
|
+
parentId: null,
|
|
10562
|
+
validUntil: null,
|
|
10563
|
+
externalId: "ydyJb1RAy4U1"
|
|
10564
|
+
},
|
|
10565
|
+
{
|
|
10566
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10567
|
+
name: "Sulaka",
|
|
10568
|
+
parentId: null,
|
|
10569
|
+
validUntil: null,
|
|
10570
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
10571
|
+
},
|
|
10572
|
+
{
|
|
10573
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
10574
|
+
name: "Pualula",
|
|
10575
|
+
parentId: null,
|
|
10576
|
+
validUntil: null,
|
|
10577
|
+
externalId: "Aq91DweLmT8k"
|
|
10578
|
+
},
|
|
10579
|
+
{
|
|
10580
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
10581
|
+
name: "Chuminga",
|
|
10582
|
+
parentId: null,
|
|
10583
|
+
validUntil: null,
|
|
10584
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
10585
|
+
},
|
|
10586
|
+
{
|
|
10587
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10588
|
+
name: "Ibombo",
|
|
10589
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10590
|
+
validUntil: null,
|
|
10591
|
+
externalId: "k7DsP4vbN1Qe"
|
|
10592
|
+
},
|
|
10593
|
+
{
|
|
10594
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10595
|
+
name: "Isango",
|
|
10596
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10597
|
+
validUntil: null,
|
|
10598
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
10599
|
+
},
|
|
10600
|
+
{
|
|
10601
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10602
|
+
name: "Isamba",
|
|
10603
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10604
|
+
validUntil: null,
|
|
10605
|
+
externalId: "sT0xVu1KqJ7r"
|
|
10606
|
+
},
|
|
10607
|
+
{
|
|
10608
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10609
|
+
name: "Itambo",
|
|
10610
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10611
|
+
validUntil: null,
|
|
10612
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
10613
|
+
},
|
|
10614
|
+
{
|
|
10615
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
10616
|
+
name: "Ezhi",
|
|
10617
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10618
|
+
validUntil: null,
|
|
10619
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
10620
|
+
},
|
|
10621
|
+
{
|
|
10622
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10623
|
+
name: "Ilanga",
|
|
10624
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10625
|
+
validUntil: null,
|
|
10626
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
10627
|
+
},
|
|
10628
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
10629
|
+
{
|
|
10630
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10631
|
+
name: "Klow",
|
|
10632
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10633
|
+
validUntil: null,
|
|
10634
|
+
externalId: "IkYcYBUcyY2"
|
|
10635
|
+
},
|
|
10636
|
+
{
|
|
10637
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
10638
|
+
name: "Mbondo",
|
|
10639
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10640
|
+
validUntil: null,
|
|
10641
|
+
externalId: "Qhvv5hvo3mY"
|
|
10642
|
+
},
|
|
10643
|
+
{
|
|
10644
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
10645
|
+
name: "Ndara",
|
|
10646
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10647
|
+
validUntil: null,
|
|
10648
|
+
externalId: "crXh068O9TR"
|
|
10649
|
+
},
|
|
10650
|
+
{
|
|
10651
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
10652
|
+
name: "Olani",
|
|
10653
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10654
|
+
validUntil: null,
|
|
10655
|
+
externalId: "r00It8Tvvp7"
|
|
10656
|
+
},
|
|
10657
|
+
{
|
|
10658
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
10659
|
+
name: "Pemba",
|
|
10660
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10661
|
+
validUntil: null,
|
|
10662
|
+
externalId: "ZnUWsbONIaH"
|
|
10663
|
+
},
|
|
10664
|
+
{
|
|
10665
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
10666
|
+
name: "Quanza",
|
|
10667
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10668
|
+
validUntil: null,
|
|
10669
|
+
externalId: "fDZycvQTa7l"
|
|
10670
|
+
},
|
|
10671
|
+
{
|
|
10672
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
10673
|
+
name: "Rivka",
|
|
10674
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10675
|
+
validUntil: null,
|
|
10676
|
+
externalId: "KqswxCGTELa"
|
|
10677
|
+
},
|
|
10678
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
10679
|
+
{
|
|
10680
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
10681
|
+
name: "Mbula",
|
|
10682
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10683
|
+
validUntil: null,
|
|
10684
|
+
externalId: "osEbKjRc9Kg"
|
|
10685
|
+
},
|
|
10686
|
+
{
|
|
10687
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
10688
|
+
name: "Ndoki",
|
|
10689
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10690
|
+
validUntil: null,
|
|
10691
|
+
externalId: "aq4daBUAGr3"
|
|
10692
|
+
},
|
|
10693
|
+
{
|
|
10694
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
10695
|
+
name: "Tsanga",
|
|
10696
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10697
|
+
validUntil: null,
|
|
10698
|
+
externalId: "cqis6Y8trbJ"
|
|
10699
|
+
},
|
|
10700
|
+
{
|
|
10701
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
10702
|
+
name: "Waziri",
|
|
10703
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10704
|
+
validUntil: null,
|
|
10705
|
+
externalId: "LMijHPyyx6d"
|
|
10706
|
+
},
|
|
10707
|
+
{
|
|
10708
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
10709
|
+
name: "Zimbi",
|
|
10710
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10711
|
+
validUntil: null,
|
|
10712
|
+
externalId: "pcQYbPuKGZ7"
|
|
10713
|
+
},
|
|
10714
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
10715
|
+
{
|
|
10716
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
10717
|
+
name: "Felani",
|
|
10718
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10719
|
+
validUntil: null,
|
|
10720
|
+
externalId: "gSqpoCGdMXp"
|
|
10721
|
+
},
|
|
10722
|
+
{
|
|
10723
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
10724
|
+
name: "Goroma",
|
|
10725
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10726
|
+
validUntil: null,
|
|
10727
|
+
externalId: "KvAAIaNqVrp"
|
|
10728
|
+
},
|
|
10729
|
+
{
|
|
10730
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
10731
|
+
name: "Halifu",
|
|
10732
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10733
|
+
validUntil: null,
|
|
10734
|
+
externalId: "qe4UnEVt1hv"
|
|
10735
|
+
},
|
|
10736
|
+
{
|
|
10737
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
10738
|
+
name: "Jabari",
|
|
10739
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10740
|
+
validUntil: null,
|
|
10741
|
+
externalId: "yHH9Nz4rLOt"
|
|
10742
|
+
},
|
|
10743
|
+
{
|
|
10744
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
10745
|
+
name: "Kifani",
|
|
10746
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10747
|
+
validUntil: null,
|
|
10748
|
+
externalId: "eSWmXIGeu1I"
|
|
10749
|
+
},
|
|
10750
|
+
{
|
|
10751
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
10752
|
+
name: "Lumela",
|
|
10753
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10754
|
+
validUntil: null,
|
|
10755
|
+
externalId: "bh0b3aI1uP3"
|
|
10756
|
+
}
|
|
10757
|
+
];
|
|
10758
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
10759
|
+
{
|
|
10760
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
10761
|
+
name: "Central Provincial Office",
|
|
10762
|
+
locationType: "CRVS_OFFICE",
|
|
10763
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10764
|
+
validUntil: null,
|
|
10765
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
10766
|
+
},
|
|
10767
|
+
{
|
|
10768
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
10769
|
+
name: "Central Health Post",
|
|
10770
|
+
locationType: "HEALTH_FACILITY",
|
|
10771
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10772
|
+
validUntil: null
|
|
10773
|
+
},
|
|
10774
|
+
{
|
|
10775
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
10776
|
+
name: "Ibombo District Office",
|
|
10777
|
+
locationType: "CRVS_OFFICE",
|
|
10778
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10779
|
+
validUntil: null,
|
|
10780
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
10781
|
+
},
|
|
10782
|
+
{
|
|
10783
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
10784
|
+
name: "Isamba District Office",
|
|
10785
|
+
locationType: "CRVS_OFFICE",
|
|
10786
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10787
|
+
validUntil: null,
|
|
10788
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
10789
|
+
},
|
|
10790
|
+
{
|
|
10791
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
10792
|
+
name: "Isango District Office",
|
|
10793
|
+
locationType: "CRVS_OFFICE",
|
|
10794
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10795
|
+
validUntil: null,
|
|
10796
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
10797
|
+
},
|
|
10798
|
+
{
|
|
10799
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
10800
|
+
name: "Sulaka Provincial Office",
|
|
10801
|
+
locationType: "CRVS_OFFICE",
|
|
10802
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10803
|
+
validUntil: null,
|
|
10804
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
10805
|
+
},
|
|
10806
|
+
{
|
|
10807
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
10808
|
+
name: "Ilanga District Office",
|
|
10809
|
+
locationType: "CRVS_OFFICE",
|
|
10810
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10811
|
+
validUntil: null,
|
|
10812
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
10813
|
+
},
|
|
10814
|
+
{
|
|
10815
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
10816
|
+
name: "Chamakubi Health Post",
|
|
10817
|
+
locationType: "HEALTH_FACILITY",
|
|
10818
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10819
|
+
validUntil: null,
|
|
10820
|
+
externalId: "M1nFr8LbC2Qy"
|
|
10821
|
+
},
|
|
10822
|
+
{
|
|
10823
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
10824
|
+
name: "Ibombo Rural Health Centre",
|
|
10825
|
+
locationType: "HEALTH_FACILITY",
|
|
10826
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10827
|
+
validUntil: null,
|
|
10828
|
+
externalId: "bT7pV6YrW0Xc"
|
|
10829
|
+
},
|
|
10830
|
+
{
|
|
10831
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
10832
|
+
name: "Chikobo Rural Health Centre",
|
|
10833
|
+
locationType: "HEALTH_FACILITY",
|
|
10834
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10835
|
+
validUntil: null,
|
|
10836
|
+
externalId: "zE4qPn2SgJ5d"
|
|
10837
|
+
},
|
|
10838
|
+
{
|
|
10839
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
10840
|
+
name: "Chilochabalenje Health Post",
|
|
10841
|
+
locationType: "HEALTH_FACILITY",
|
|
10842
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10843
|
+
validUntil: null,
|
|
10844
|
+
externalId: "H8vDs1MqR4Uf"
|
|
10845
|
+
},
|
|
10846
|
+
{
|
|
10847
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
10848
|
+
name: "Chipeso Rural Health Centre",
|
|
10849
|
+
locationType: "HEALTH_FACILITY",
|
|
10850
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10851
|
+
validUntil: null,
|
|
10852
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
10853
|
+
},
|
|
10854
|
+
{
|
|
10855
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
10856
|
+
name: "Chisamba Rural Health Centre",
|
|
10857
|
+
locationType: "HEALTH_FACILITY",
|
|
10858
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10859
|
+
validUntil: null,
|
|
10860
|
+
externalId: "Yr0pCg8LdM2s"
|
|
10861
|
+
},
|
|
10862
|
+
{
|
|
10863
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
10864
|
+
name: "Chitanda Rural Health Centre",
|
|
10865
|
+
locationType: "HEALTH_FACILITY",
|
|
10866
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10867
|
+
validUntil: null,
|
|
10868
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
10869
|
+
},
|
|
10870
|
+
{
|
|
10871
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
10872
|
+
name: "Golden Valley Rural Health Centre",
|
|
10873
|
+
locationType: "HEALTH_FACILITY",
|
|
10874
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10875
|
+
validUntil: null,
|
|
10876
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
10877
|
+
},
|
|
10878
|
+
{
|
|
10879
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
10880
|
+
name: "Ipongo Rural Health Centre",
|
|
10881
|
+
locationType: "HEALTH_FACILITY",
|
|
10882
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10883
|
+
validUntil: null,
|
|
10884
|
+
externalId: "kF2sW9DmH0Bt"
|
|
10885
|
+
},
|
|
10886
|
+
{
|
|
10887
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
10888
|
+
name: "Itumbwe Health Post",
|
|
10889
|
+
locationType: "HEALTH_FACILITY",
|
|
10890
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10891
|
+
validUntil: null,
|
|
10892
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
10893
|
+
},
|
|
10894
|
+
{
|
|
10895
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
10896
|
+
name: "Kabangalala Rural Health Centre",
|
|
10897
|
+
locationType: "HEALTH_FACILITY",
|
|
10898
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10899
|
+
validUntil: null,
|
|
10900
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
10901
|
+
},
|
|
10902
|
+
// Village offices
|
|
10903
|
+
{
|
|
10904
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
10905
|
+
name: "Klow Village Office",
|
|
10906
|
+
locationType: "CRVS_OFFICE",
|
|
10907
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10908
|
+
validUntil: null,
|
|
10909
|
+
externalId: "PmAyxAJkxiJ"
|
|
10910
|
+
}
|
|
10911
|
+
];
|
|
10912
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
10913
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
10914
|
+
);
|
|
10915
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
10916
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
10917
|
+
);
|