@opencrvs/toolkit 2.0.0-rc.23284a8 → 2.0.0-rc.2332d47
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 +202 -70
- package/dist/cli.js +98 -7
- package/dist/commons/api/router.d.ts +361 -34
- 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/EventIndex.d.ts +0 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/state/flags.d.ts +2 -0
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +0 -2
- package/dist/conditionals/index.js +7 -1
- package/dist/events/index.js +654 -128
- 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 +632 -101
- package/dist/scopes/index.js +3 -1
- package/opencrvs-toolkit-2.0.0-rc.2332d47.tgz +0 -0
- package/package.json +6 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.23284a8.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,
|
|
@@ -306,7 +311,6 @@ __export(events_exports, {
|
|
|
306
311
|
getAllUniqueFields: () => getAllUniqueFields,
|
|
307
312
|
getAnnotationFromDrafts: () => getAnnotationFromDrafts,
|
|
308
313
|
getAssignedUserFromActions: () => getAssignedUserFromActions,
|
|
309
|
-
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
|
310
314
|
getAssignmentStatus: () => getAssignmentStatus,
|
|
311
315
|
getAvailableActionsForEvent: () => getAvailableActionsForEvent,
|
|
312
316
|
getAvailableRolesForUserUpdatePayload: () => getAvailableRolesForUserUpdatePayload,
|
|
@@ -705,7 +709,9 @@ var decodeScope = (query) => {
|
|
|
705
709
|
};
|
|
706
710
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
707
711
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
708
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
712
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
713
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
714
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
709
715
|
};
|
|
710
716
|
function getAcceptedScopesByType({
|
|
711
717
|
acceptedScopes,
|
|
@@ -1079,8 +1085,8 @@ var ActionConditional = z7.discriminatedUnion("type", [
|
|
|
1079
1085
|
// Action can be shown to the user in the list but as disabled
|
|
1080
1086
|
EnableConditional
|
|
1081
1087
|
]).meta({
|
|
1082
|
-
|
|
1083
|
-
|
|
1088
|
+
id: "ActionConditional",
|
|
1089
|
+
description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
|
|
1084
1090
|
});
|
|
1085
1091
|
var DisplayOnReviewConditional = z7.object({
|
|
1086
1092
|
type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
|
|
@@ -1096,8 +1102,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
|
|
|
1096
1102
|
// Field output can be shown / hidden on the review page
|
|
1097
1103
|
DisplayOnReviewConditional
|
|
1098
1104
|
]).meta({
|
|
1099
|
-
|
|
1100
|
-
|
|
1105
|
+
id: "FieldConditional",
|
|
1106
|
+
description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
|
|
1101
1107
|
});
|
|
1102
1108
|
|
|
1103
1109
|
// ../commons/src/events/FieldType.ts
|
|
@@ -1741,8 +1747,8 @@ var FlagConfig = z15.object({
|
|
|
1741
1747
|
),
|
|
1742
1748
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1743
1749
|
}).meta({
|
|
1744
|
-
|
|
1745
|
-
|
|
1750
|
+
id: "FlagConfig",
|
|
1751
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1746
1752
|
});
|
|
1747
1753
|
var ActionFlagConfig = z15.object({
|
|
1748
1754
|
id: Flag,
|
|
@@ -1751,8 +1757,8 @@ var ActionFlagConfig = z15.object({
|
|
|
1751
1757
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1752
1758
|
)
|
|
1753
1759
|
}).meta({
|
|
1754
|
-
|
|
1755
|
-
|
|
1760
|
+
id: "ActionFlagConfig",
|
|
1761
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1756
1762
|
});
|
|
1757
1763
|
|
|
1758
1764
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1774,8 +1780,7 @@ var ActionCreationMetadata = z16.object({
|
|
|
1774
1780
|
),
|
|
1775
1781
|
createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
|
1776
1782
|
acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
|
|
1777
|
-
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1778
|
-
createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
|
|
1783
|
+
createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
|
|
1779
1784
|
});
|
|
1780
1785
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
1781
1786
|
registrationNumber: z16.string().describe(
|
|
@@ -1803,9 +1808,6 @@ var EventMetadata = z16.object({
|
|
|
1803
1808
|
createdAtLocation: UUID.nullish().describe(
|
|
1804
1809
|
"Location of the user who created the event."
|
|
1805
1810
|
),
|
|
1806
|
-
createdBySignature: DocumentPath.nullish().describe(
|
|
1807
|
-
"Signature of the user who created the event."
|
|
1808
|
-
),
|
|
1809
1811
|
updatedAtLocation: UUID.nullish().describe(
|
|
1810
1812
|
"Location of the user who last changed the status."
|
|
1811
1813
|
),
|
|
@@ -2180,14 +2182,21 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
|
|
|
2180
2182
|
}
|
|
2181
2183
|
}).describe("Unique identifier for the field");
|
|
2182
2184
|
var FieldReference = import_v43.default.object({
|
|
2183
|
-
$$field: FieldId,
|
|
2185
|
+
$$field: FieldId.describe("Id of the field to reference"),
|
|
2184
2186
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
2185
2187
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
2186
2188
|
)
|
|
2187
2189
|
}).describe("Reference to a field by its ID");
|
|
2188
2190
|
var ValidationConfig = import_v43.default.object({
|
|
2189
|
-
validator: Conditional
|
|
2190
|
-
|
|
2191
|
+
validator: Conditional.describe(
|
|
2192
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
2193
|
+
),
|
|
2194
|
+
message: TranslationConfig.describe(
|
|
2195
|
+
"Error message displayed when the validator does not hold."
|
|
2196
|
+
)
|
|
2197
|
+
}).meta({
|
|
2198
|
+
id: "ValidationConfig",
|
|
2199
|
+
description: "Validation rule applied to a form field. The validator is a conditional expression that must hold for the field value to be considered valid."
|
|
2191
2200
|
});
|
|
2192
2201
|
var requiredSchema = import_v43.default.union([
|
|
2193
2202
|
import_v43.default.boolean(),
|
|
@@ -2226,6 +2235,9 @@ var BaseField = import_v43.default.object({
|
|
|
2226
2235
|
}).describe("Common properties shared across all field types.");
|
|
2227
2236
|
var Divider = BaseField.extend({
|
|
2228
2237
|
type: import_v43.default.literal(FieldType.DIVIDER)
|
|
2238
|
+
}).meta({
|
|
2239
|
+
description: "A horizontal line divider",
|
|
2240
|
+
id: "Divider"
|
|
2229
2241
|
});
|
|
2230
2242
|
var TextField = BaseField.extend({
|
|
2231
2243
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
@@ -2236,7 +2248,10 @@ var TextField = BaseField.extend({
|
|
|
2236
2248
|
prefix: TranslationConfig.optional(),
|
|
2237
2249
|
postfix: TranslationConfig.optional()
|
|
2238
2250
|
}).default({ type: "text" }).optional()
|
|
2239
|
-
}).
|
|
2251
|
+
}).meta({
|
|
2252
|
+
description: "A text input field",
|
|
2253
|
+
id: "TextField"
|
|
2254
|
+
});
|
|
2240
2255
|
var NumberField = BaseField.extend({
|
|
2241
2256
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
2242
2257
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -2246,7 +2261,10 @@ var NumberField = BaseField.extend({
|
|
|
2246
2261
|
prefix: TranslationConfig.optional(),
|
|
2247
2262
|
postfix: TranslationConfig.optional()
|
|
2248
2263
|
}).optional()
|
|
2249
|
-
}).
|
|
2264
|
+
}).meta({
|
|
2265
|
+
description: "A number input field",
|
|
2266
|
+
id: "NumberField"
|
|
2267
|
+
});
|
|
2250
2268
|
var TextAreaField = BaseField.extend({
|
|
2251
2269
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
2252
2270
|
defaultValue: NonEmptyTextValue.optional(),
|
|
@@ -2257,7 +2275,10 @@ var TextAreaField = BaseField.extend({
|
|
|
2257
2275
|
prefix: TranslationConfig.optional(),
|
|
2258
2276
|
postfix: TranslationConfig.optional()
|
|
2259
2277
|
}).default({ rows: 4 }).optional()
|
|
2260
|
-
}).
|
|
2278
|
+
}).meta({
|
|
2279
|
+
description: "A multiline text input",
|
|
2280
|
+
id: "TextAreaField"
|
|
2281
|
+
});
|
|
2261
2282
|
var ImageMimeType = import_v43.default.enum([
|
|
2262
2283
|
"image/png",
|
|
2263
2284
|
"image/jpg",
|
|
@@ -2287,13 +2308,19 @@ var SignatureField = BaseField.extend({
|
|
|
2287
2308
|
}).default({
|
|
2288
2309
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2289
2310
|
})
|
|
2290
|
-
}).
|
|
2311
|
+
}).meta({
|
|
2312
|
+
description: "A signature input field",
|
|
2313
|
+
id: "SignatureField"
|
|
2314
|
+
});
|
|
2291
2315
|
var EmailField = BaseField.extend({
|
|
2292
2316
|
type: import_v43.default.literal(FieldType.EMAIL),
|
|
2293
2317
|
configuration: import_v43.default.object({
|
|
2294
2318
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
2295
2319
|
}).default({ maxLength: 255 }).optional(),
|
|
2296
2320
|
defaultValue: NonEmptyTextValue.optional()
|
|
2321
|
+
}).meta({
|
|
2322
|
+
description: "An email input field",
|
|
2323
|
+
id: "EmailField"
|
|
2297
2324
|
});
|
|
2298
2325
|
var DateField = BaseField.extend({
|
|
2299
2326
|
type: import_v43.default.literal(FieldType.DATE),
|
|
@@ -2303,7 +2330,10 @@ var DateField = BaseField.extend({
|
|
|
2303
2330
|
"Text to display above the date input"
|
|
2304
2331
|
).optional()
|
|
2305
2332
|
}).optional()
|
|
2306
|
-
}).
|
|
2333
|
+
}).meta({
|
|
2334
|
+
description: "A date input (yyyy-MM-dd)",
|
|
2335
|
+
id: "DateField"
|
|
2336
|
+
});
|
|
2307
2337
|
var AgeField = BaseField.extend({
|
|
2308
2338
|
type: import_v43.default.literal(FieldType.AGE),
|
|
2309
2339
|
defaultValue: NumberFieldValue.optional(),
|
|
@@ -2312,7 +2342,10 @@ var AgeField = BaseField.extend({
|
|
|
2312
2342
|
prefix: TranslationConfig.optional(),
|
|
2313
2343
|
postfix: TranslationConfig.optional()
|
|
2314
2344
|
})
|
|
2315
|
-
}).
|
|
2345
|
+
}).meta({
|
|
2346
|
+
description: "An age input field which uses the current date as the asOfDate",
|
|
2347
|
+
id: "AgeField"
|
|
2348
|
+
});
|
|
2316
2349
|
var TimeField = BaseField.extend({
|
|
2317
2350
|
type: import_v43.default.literal(FieldType.TIME),
|
|
2318
2351
|
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
@@ -2322,7 +2355,10 @@ var TimeField = BaseField.extend({
|
|
|
2322
2355
|
"Text to display above the time input"
|
|
2323
2356
|
).optional()
|
|
2324
2357
|
}).optional()
|
|
2325
|
-
}).
|
|
2358
|
+
}).meta({
|
|
2359
|
+
description: "A single time input (HH-mm)",
|
|
2360
|
+
id: "TimeField"
|
|
2361
|
+
});
|
|
2326
2362
|
var DateRangeField = BaseField.extend({
|
|
2327
2363
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
2328
2364
|
defaultValue: DateRangeFieldValue.optional(),
|
|
@@ -2331,7 +2367,10 @@ var DateRangeField = BaseField.extend({
|
|
|
2331
2367
|
"Text to display above the date input"
|
|
2332
2368
|
).optional()
|
|
2333
2369
|
}).optional()
|
|
2334
|
-
}).
|
|
2370
|
+
}).meta({
|
|
2371
|
+
description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
|
|
2372
|
+
id: "DateRangeField"
|
|
2373
|
+
});
|
|
2335
2374
|
var HtmlFontVariant = import_v43.default.enum([
|
|
2336
2375
|
"reg12",
|
|
2337
2376
|
"reg14",
|
|
@@ -2375,18 +2414,30 @@ var ImageViewField = BaseField.extend({
|
|
|
2375
2414
|
type: import_v43.default.literal(FieldType.IMAGE_VIEW),
|
|
2376
2415
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2377
2416
|
configuration: ImageConfiguration
|
|
2378
|
-
}).
|
|
2417
|
+
}).meta({
|
|
2418
|
+
description: "A read-only image component for form pages",
|
|
2419
|
+
id: "ImageViewField"
|
|
2420
|
+
});
|
|
2379
2421
|
var Paragraph = BaseField.extend({
|
|
2380
2422
|
type: import_v43.default.literal(FieldType.PARAGRAPH),
|
|
2381
2423
|
configuration: ParagraphConfiguration
|
|
2382
|
-
}).
|
|
2424
|
+
}).meta({
|
|
2425
|
+
description: "A read-only HTML <p> paragraph",
|
|
2426
|
+
id: "Paragraph"
|
|
2427
|
+
});
|
|
2383
2428
|
var Heading = BaseField.extend({
|
|
2384
2429
|
type: import_v43.default.literal(FieldType.HEADING),
|
|
2385
2430
|
configuration: HeadingConfiguration
|
|
2386
|
-
}).
|
|
2431
|
+
}).meta({
|
|
2432
|
+
description: "A read-only heading component for form pages",
|
|
2433
|
+
id: "Heading"
|
|
2434
|
+
});
|
|
2387
2435
|
var PageHeader = BaseField.extend({
|
|
2388
2436
|
type: import_v43.default.literal(FieldType.PAGE_HEADER)
|
|
2389
|
-
}).
|
|
2437
|
+
}).meta({
|
|
2438
|
+
description: "A read-only header component for form pages",
|
|
2439
|
+
id: "PageHeader"
|
|
2440
|
+
});
|
|
2390
2441
|
var File = BaseField.extend({
|
|
2391
2442
|
type: import_v43.default.literal(FieldType.FILE),
|
|
2392
2443
|
defaultValue: FileFieldValue.optional(),
|
|
@@ -2405,7 +2456,10 @@ var File = BaseField.extend({
|
|
|
2405
2456
|
}).default({
|
|
2406
2457
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2407
2458
|
})
|
|
2408
|
-
}).
|
|
2459
|
+
}).meta({
|
|
2460
|
+
description: "A file upload field",
|
|
2461
|
+
id: "File"
|
|
2462
|
+
});
|
|
2409
2463
|
var SelectOption = import_v43.default.object({
|
|
2410
2464
|
value: import_v43.default.string().describe("The value of the option"),
|
|
2411
2465
|
label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
|
|
@@ -2422,7 +2476,10 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
2422
2476
|
"Placeholder for the number field"
|
|
2423
2477
|
)
|
|
2424
2478
|
}).optional()
|
|
2425
|
-
}).
|
|
2479
|
+
}).meta({
|
|
2480
|
+
description: "A number with unit input field",
|
|
2481
|
+
id: "NumberWithUnitField"
|
|
2482
|
+
});
|
|
2426
2483
|
var RadioGroup = BaseField.extend({
|
|
2427
2484
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
2428
2485
|
defaultValue: TextValue.optional(),
|
|
@@ -2432,7 +2489,10 @@ var RadioGroup = BaseField.extend({
|
|
|
2432
2489
|
size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
|
|
2433
2490
|
}).optional()
|
|
2434
2491
|
}).optional()
|
|
2435
|
-
}).
|
|
2492
|
+
}).meta({
|
|
2493
|
+
description: "A grouped radio button field",
|
|
2494
|
+
id: "RadioGroup"
|
|
2495
|
+
});
|
|
2436
2496
|
var BulletList = BaseField.extend({
|
|
2437
2497
|
type: import_v43.default.literal(FieldType.BULLET_LIST),
|
|
2438
2498
|
items: import_v43.default.array(TranslationConfig).describe("A list of items"),
|
|
@@ -2441,7 +2501,10 @@ var BulletList = BaseField.extend({
|
|
|
2441
2501
|
fontVariant: HtmlFontVariant.optional()
|
|
2442
2502
|
}).optional()
|
|
2443
2503
|
}).default({})
|
|
2444
|
-
}).
|
|
2504
|
+
}).meta({
|
|
2505
|
+
description: "A list of bullet points",
|
|
2506
|
+
id: "BulletList"
|
|
2507
|
+
});
|
|
2445
2508
|
var Select = BaseField.extend({
|
|
2446
2509
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
2447
2510
|
defaultValue: TextValue.optional(),
|
|
@@ -2456,7 +2519,10 @@ var Select = BaseField.extend({
|
|
|
2456
2519
|
{ ..., defaultMessage: "'{input}' is not listed among the health facilities." }
|
|
2457
2520
|
`
|
|
2458
2521
|
)
|
|
2459
|
-
}).
|
|
2522
|
+
}).meta({
|
|
2523
|
+
description: "A select input field",
|
|
2524
|
+
id: "Select"
|
|
2525
|
+
});
|
|
2460
2526
|
var SelectDateRangeOption = import_v43.default.object({
|
|
2461
2527
|
value: SelectDateRangeValue.describe("The value of the option"),
|
|
2462
2528
|
label: TranslationConfig.describe("The label of the option")
|
|
@@ -2465,7 +2531,10 @@ var SelectDateRangeField = BaseField.extend({
|
|
|
2465
2531
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
2466
2532
|
defaultValue: SelectDateRangeValue.optional(),
|
|
2467
2533
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
2468
|
-
}).
|
|
2534
|
+
}).meta({
|
|
2535
|
+
description: "A date range selection field",
|
|
2536
|
+
id: "SelectDateRangeField"
|
|
2537
|
+
});
|
|
2469
2538
|
var NameConfig = import_v43.default.object({
|
|
2470
2539
|
firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
2471
2540
|
middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
|
|
@@ -2496,26 +2565,41 @@ var NameField = BaseField.extend({
|
|
|
2496
2565
|
surname: { required: true }
|
|
2497
2566
|
}
|
|
2498
2567
|
}).optional()
|
|
2499
|
-
}).
|
|
2568
|
+
}).meta({
|
|
2569
|
+
description: "A field for entering a persons name",
|
|
2570
|
+
id: "NameField"
|
|
2571
|
+
});
|
|
2500
2572
|
var PhoneField = BaseField.extend({
|
|
2501
2573
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2502
2574
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
2503
|
-
}).
|
|
2575
|
+
}).meta({
|
|
2576
|
+
description: "A field for entering a phone number",
|
|
2577
|
+
id: "PhoneField"
|
|
2578
|
+
});
|
|
2504
2579
|
var IdField = BaseField.extend({
|
|
2505
2580
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2506
2581
|
type: import_v43.default.literal(FieldType.ID)
|
|
2507
|
-
}).
|
|
2582
|
+
}).meta({
|
|
2583
|
+
description: "A field for entering an ID",
|
|
2584
|
+
id: "IdField"
|
|
2585
|
+
});
|
|
2508
2586
|
var Checkbox = BaseField.extend({
|
|
2509
2587
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
2510
2588
|
defaultValue: CheckboxFieldValue.default(false)
|
|
2511
|
-
}).
|
|
2589
|
+
}).meta({
|
|
2590
|
+
description: "A boolean checkbox field",
|
|
2591
|
+
id: "Checkbox"
|
|
2592
|
+
});
|
|
2512
2593
|
var Country = BaseField.extend({
|
|
2513
2594
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
2514
2595
|
defaultValue: NonEmptyTextValue.optional(),
|
|
2515
2596
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
2516
2597
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2517
2598
|
)
|
|
2518
|
-
}).
|
|
2599
|
+
}).meta({
|
|
2600
|
+
description: "A field for selecting a country",
|
|
2601
|
+
id: "Country"
|
|
2602
|
+
});
|
|
2519
2603
|
var AllowedLocations = JurisdictionReference.optional().describe(
|
|
2520
2604
|
"Limits which location options are selectable depending on user jurisdiction and location."
|
|
2521
2605
|
);
|
|
@@ -2524,16 +2608,18 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2524
2608
|
"HEALTH_FACILITY",
|
|
2525
2609
|
"CRVS_OFFICE"
|
|
2526
2610
|
]);
|
|
2527
|
-
var AdministrativeAreaConfiguration = import_v43.default.object({
|
|
2528
|
-
partOf: FieldReference.optional().describe("Parent location"),
|
|
2529
|
-
type: AdministrativeAreas,
|
|
2530
|
-
allowedLocations: AllowedLocations
|
|
2531
|
-
}).describe("Administrative area options");
|
|
2532
2611
|
var AdministrativeAreaField = BaseField.extend({
|
|
2533
2612
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2534
2613
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2535
|
-
configuration:
|
|
2536
|
-
|
|
2614
|
+
configuration: import_v43.default.object({
|
|
2615
|
+
partOf: FieldReference.optional().describe("Parent location"),
|
|
2616
|
+
type: AdministrativeAreas,
|
|
2617
|
+
allowedLocations: AllowedLocations
|
|
2618
|
+
}).describe("Administrative area options")
|
|
2619
|
+
}).meta({
|
|
2620
|
+
description: "Administrative area input field",
|
|
2621
|
+
id: "AdministrativeAreaField"
|
|
2622
|
+
});
|
|
2537
2623
|
var LocationInput = BaseField.extend({
|
|
2538
2624
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2539
2625
|
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
@@ -2541,7 +2627,10 @@ var LocationInput = BaseField.extend({
|
|
|
2541
2627
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2542
2628
|
allowedLocations: AllowedLocations
|
|
2543
2629
|
}).optional()
|
|
2544
|
-
}).
|
|
2630
|
+
}).meta({
|
|
2631
|
+
description: "A field for selecting a location",
|
|
2632
|
+
id: "LocationInput"
|
|
2633
|
+
});
|
|
2545
2634
|
var FileUploadWithOptions = BaseField.extend({
|
|
2546
2635
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2547
2636
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
@@ -2555,6 +2644,9 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2555
2644
|
}).default({
|
|
2556
2645
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
|
2557
2646
|
})
|
|
2647
|
+
}).meta({
|
|
2648
|
+
description: "A field for uploading files with file type options",
|
|
2649
|
+
id: "FileUploadWithOptions"
|
|
2558
2650
|
});
|
|
2559
2651
|
var Facility = BaseField.extend({
|
|
2560
2652
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
@@ -2600,7 +2692,10 @@ var Address = BaseField.extend({
|
|
|
2600
2692
|
allowedLocations: AllowedLocations
|
|
2601
2693
|
}).optional(),
|
|
2602
2694
|
defaultValue: DefaultAddressFieldValue.optional()
|
|
2603
|
-
}).
|
|
2695
|
+
}).meta({
|
|
2696
|
+
description: "Address input field \u2013 a combination of location and text fields",
|
|
2697
|
+
id: "Address"
|
|
2698
|
+
});
|
|
2604
2699
|
var StaticDataEntry = import_v43.default.object({
|
|
2605
2700
|
id: import_v43.default.string().describe("ID for the data entry."),
|
|
2606
2701
|
label: TranslationConfig,
|
|
@@ -2615,7 +2710,10 @@ var DataField = BaseField.extend({
|
|
|
2615
2710
|
subtitle: TranslationConfig.optional(),
|
|
2616
2711
|
data: import_v43.default.array(DataEntry)
|
|
2617
2712
|
})
|
|
2618
|
-
}).
|
|
2713
|
+
}).meta({
|
|
2714
|
+
description: "A field for displaying a table of read-only data",
|
|
2715
|
+
id: "DataField"
|
|
2716
|
+
});
|
|
2619
2717
|
var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
|
|
2620
2718
|
var ButtonType = import_v43.default.enum([
|
|
2621
2719
|
"primary",
|
|
@@ -2642,11 +2740,17 @@ var ButtonField = BaseField.extend({
|
|
|
2642
2740
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2643
2741
|
defaultValue: ButtonFieldValue.optional(),
|
|
2644
2742
|
configuration: ButtonConfiguration
|
|
2645
|
-
}).
|
|
2743
|
+
}).meta({
|
|
2744
|
+
description: "A generic button that can be used to trigger an action",
|
|
2745
|
+
id: "ButtonField"
|
|
2746
|
+
});
|
|
2646
2747
|
var FieldGroup = BaseField.extend({
|
|
2647
2748
|
type: import_v43.default.literal(FieldType.FIELD_GROUP),
|
|
2648
2749
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
2649
2750
|
fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
|
|
2751
|
+
}).meta({
|
|
2752
|
+
description: "A group of fields that are displayed together",
|
|
2753
|
+
id: "FieldGroup"
|
|
2650
2754
|
});
|
|
2651
2755
|
var AlphaPrintButton = BaseField.extend({
|
|
2652
2756
|
type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
|
|
@@ -2656,7 +2760,10 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2656
2760
|
"Label for the print button"
|
|
2657
2761
|
)
|
|
2658
2762
|
})
|
|
2659
|
-
}).
|
|
2763
|
+
}).meta({
|
|
2764
|
+
description: "An experimental print button field for printing certificates during the declaration process",
|
|
2765
|
+
id: "AlphaPrintButton"
|
|
2766
|
+
});
|
|
2660
2767
|
var HttpField = BaseField.extend({
|
|
2661
2768
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2662
2769
|
defaultValue: HttpFieldValue.optional(),
|
|
@@ -2672,20 +2779,30 @@ var HttpField = BaseField.extend({
|
|
|
2672
2779
|
params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
|
|
2673
2780
|
timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
|
|
2674
2781
|
})
|
|
2675
|
-
}).
|
|
2782
|
+
}).meta({
|
|
2783
|
+
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.",
|
|
2784
|
+
id: "HttpField"
|
|
2785
|
+
});
|
|
2676
2786
|
var AutocompleteField = BaseField.extend({
|
|
2677
2787
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2678
2788
|
configuration: import_v43.default.object({
|
|
2679
|
-
url: import_v43.default.string().describe(
|
|
2789
|
+
url: import_v43.default.string().describe(
|
|
2790
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2791
|
+
).optional(),
|
|
2680
2792
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2681
2793
|
defaultOptions: import_v43.default.array(
|
|
2682
2794
|
import_v43.default.object({
|
|
2683
2795
|
label: import_v43.default.string(),
|
|
2684
2796
|
value: import_v43.default.string()
|
|
2685
2797
|
})
|
|
2686
|
-
).optional()
|
|
2798
|
+
).optional().describe(
|
|
2799
|
+
"Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
|
|
2800
|
+
)
|
|
2687
2801
|
})
|
|
2688
|
-
}).
|
|
2802
|
+
}).meta({
|
|
2803
|
+
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.",
|
|
2804
|
+
id: "AutocompleteField"
|
|
2805
|
+
});
|
|
2689
2806
|
var SearchField = HttpField.extend({
|
|
2690
2807
|
type: import_v43.default.literal(FieldType.SEARCH),
|
|
2691
2808
|
configuration: SearchQuery.pick({
|
|
@@ -2718,6 +2835,9 @@ var SearchField = HttpField.extend({
|
|
|
2718
2835
|
ok: TranslationConfig.optional()
|
|
2719
2836
|
}).optional()
|
|
2720
2837
|
})
|
|
2838
|
+
}).meta({
|
|
2839
|
+
description: "A search input field",
|
|
2840
|
+
id: "SearchField"
|
|
2721
2841
|
});
|
|
2722
2842
|
var LinkButtonField = BaseField.extend({
|
|
2723
2843
|
type: import_v43.default.literal(FieldType.LINK_BUTTON),
|
|
@@ -2726,7 +2846,10 @@ var LinkButtonField = BaseField.extend({
|
|
|
2726
2846
|
text: TranslationConfig.describe("Text to display on the button"),
|
|
2727
2847
|
icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
|
|
2728
2848
|
})
|
|
2729
|
-
}).
|
|
2849
|
+
}).meta({
|
|
2850
|
+
description: "A button that opens a URL link",
|
|
2851
|
+
id: "LinkButtonField"
|
|
2852
|
+
});
|
|
2730
2853
|
var VerificationStatus = BaseField.extend({
|
|
2731
2854
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2732
2855
|
defaultValue: VerificationStatusValue.optional(),
|
|
@@ -2736,15 +2859,19 @@ var VerificationStatus = BaseField.extend({
|
|
|
2736
2859
|
"Explaining text on the banner in form."
|
|
2737
2860
|
)
|
|
2738
2861
|
})
|
|
2862
|
+
}).meta({
|
|
2863
|
+
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.",
|
|
2864
|
+
id: "VerificationStatus"
|
|
2739
2865
|
});
|
|
2740
2866
|
var QueryParamReaderField = BaseField.extend({
|
|
2741
2867
|
type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
|
|
2742
2868
|
configuration: import_v43.default.object({
|
|
2743
2869
|
pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
|
|
2744
2870
|
})
|
|
2745
|
-
}).
|
|
2746
|
-
"A field that maps URL query params into form values and clears them afterward"
|
|
2747
|
-
|
|
2871
|
+
}).meta({
|
|
2872
|
+
description: "A field that maps URL query params into form values and clears them afterward",
|
|
2873
|
+
id: "QueryParamReaderField"
|
|
2874
|
+
});
|
|
2748
2875
|
var QrReaderField = BaseField.extend({
|
|
2749
2876
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2750
2877
|
defaultValue: QrReaderFieldValue.optional(),
|
|
@@ -2755,7 +2882,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2755
2882
|
})
|
|
2756
2883
|
}).optional()
|
|
2757
2884
|
}).meta({
|
|
2758
|
-
description: "
|
|
2885
|
+
description: "QR code reader field, including optional JSON Schema validator.",
|
|
2759
2886
|
id: "QrReaderField"
|
|
2760
2887
|
});
|
|
2761
2888
|
var IdReaderField = BaseField.extend({
|
|
@@ -2764,12 +2891,18 @@ var IdReaderField = BaseField.extend({
|
|
|
2764
2891
|
methods: import_v43.default.array(
|
|
2765
2892
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2766
2893
|
)
|
|
2894
|
+
}).meta({
|
|
2895
|
+
description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
|
|
2896
|
+
id: "IdReaderField"
|
|
2767
2897
|
});
|
|
2768
2898
|
var CustomField = BaseField.extend({
|
|
2769
2899
|
type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
|
|
2770
2900
|
defaultValue: CustomFieldValue.optional(),
|
|
2771
2901
|
src: import_v43.default.string().describe("Module source path for the custom field component"),
|
|
2772
2902
|
configuration: import_v43.default.unknown().optional()
|
|
2903
|
+
}).meta({
|
|
2904
|
+
description: "An expiremental custom field that is defined by a module source path",
|
|
2905
|
+
id: "CustomField"
|
|
2773
2906
|
});
|
|
2774
2907
|
var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
|
|
2775
2908
|
var LoaderField = BaseField.extend({
|
|
@@ -2779,22 +2912,25 @@ var LoaderField = BaseField.extend({
|
|
|
2779
2912
|
configuration: import_v43.default.object({
|
|
2780
2913
|
text: TranslationConfig.describe("Display text above the loading spinner")
|
|
2781
2914
|
})
|
|
2782
|
-
}).
|
|
2783
|
-
"A non-interactive field that indicates an in progress operation in form"
|
|
2784
|
-
|
|
2915
|
+
}).meta({
|
|
2916
|
+
description: "A non-interactive field that indicates an in progress operation in form",
|
|
2917
|
+
id: "LoaderField"
|
|
2918
|
+
});
|
|
2785
2919
|
var HiddenField = BaseField.extend({
|
|
2786
2920
|
type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
|
|
2787
2921
|
required: import_v43.default.boolean().default(false).optional(),
|
|
2788
2922
|
defaultValue: TextValue.optional()
|
|
2789
|
-
}).
|
|
2790
|
-
"A non-interactive, hidden field that only hold a value in the form"
|
|
2791
|
-
|
|
2923
|
+
}).meta({
|
|
2924
|
+
description: "A non-interactive, hidden field that only hold a value in the form",
|
|
2925
|
+
id: "HiddenField"
|
|
2926
|
+
});
|
|
2792
2927
|
var UserRoleField = BaseField.extend({
|
|
2793
2928
|
type: import_v43.default.literal(FieldType.USER_ROLE),
|
|
2794
2929
|
defaultValue: TextValue.optional()
|
|
2795
|
-
}).
|
|
2796
|
-
"A select dropdown that is automatically populated with available user roles"
|
|
2797
|
-
|
|
2930
|
+
}).meta({
|
|
2931
|
+
description: "A select dropdown that is automatically populated with available user roles",
|
|
2932
|
+
id: "UserRoleField"
|
|
2933
|
+
});
|
|
2798
2934
|
var FieldConfig = import_v43.default.discriminatedUnion("type", [
|
|
2799
2935
|
FieldGroup,
|
|
2800
2936
|
Address,
|
|
@@ -2894,15 +3030,18 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2894
3030
|
actions: VerificationActionConfig
|
|
2895
3031
|
});
|
|
2896
3032
|
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2897
|
-
|
|
2898
|
-
|
|
3033
|
+
id: "PageConfig",
|
|
3034
|
+
description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
|
|
2899
3035
|
});
|
|
2900
3036
|
|
|
2901
3037
|
// ../commons/src/events/FormConfig.ts
|
|
2902
3038
|
var DeclarationFormConfig = z22.object({
|
|
2903
3039
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2904
3040
|
pages: z22.array(FormPageConfig)
|
|
2905
|
-
}).
|
|
3041
|
+
}).meta({
|
|
3042
|
+
id: "DeclarationFormConfig",
|
|
3043
|
+
description: "Configuration of the declaration form."
|
|
3044
|
+
});
|
|
2906
3045
|
var ActionFormConfig = z22.object({
|
|
2907
3046
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2908
3047
|
pages: z22.array(PageConfig)
|
|
@@ -3002,6 +3141,9 @@ var DeduplicationConfig = z23.object({
|
|
|
3002
3141
|
id: z23.string(),
|
|
3003
3142
|
label: TranslationConfig,
|
|
3004
3143
|
query: Clause
|
|
3144
|
+
}).meta({
|
|
3145
|
+
id: "DeduplicationConfig",
|
|
3146
|
+
description: "Configuration for duplicate detection on a declare or register action. The query is built from fuzzy / strict / date-range matchers combined with and/or/not."
|
|
3005
3147
|
});
|
|
3006
3148
|
|
|
3007
3149
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -3119,17 +3261,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3119
3261
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
3120
3262
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
3121
3263
|
*/
|
|
3122
|
-
ReadActionConfig.meta({
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3264
|
+
ReadActionConfig.meta({
|
|
3265
|
+
id: "ReadActionConfig",
|
|
3266
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
3267
|
+
}),
|
|
3268
|
+
DeclareConfig.meta({
|
|
3269
|
+
id: "DeclareActionConfig",
|
|
3270
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
3271
|
+
}),
|
|
3272
|
+
RejectConfig.meta({
|
|
3273
|
+
id: "RejectActionConfig",
|
|
3274
|
+
description: "Configuration for rejecting a record before registration."
|
|
3275
|
+
}),
|
|
3276
|
+
RegisterConfig.meta({
|
|
3277
|
+
id: "RegisterActionConfig",
|
|
3278
|
+
description: "Configuration for registering a record."
|
|
3279
|
+
}),
|
|
3126
3280
|
PrintCertificateActionConfig.meta({
|
|
3127
|
-
id: "PrintCertificateActionConfig"
|
|
3281
|
+
id: "PrintCertificateActionConfig",
|
|
3282
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
3283
|
+
}),
|
|
3284
|
+
RequestCorrectionConfig.meta({
|
|
3285
|
+
id: "RequestCorrectionActionConfig",
|
|
3286
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
3287
|
+
}),
|
|
3288
|
+
EditActionConfig.meta({
|
|
3289
|
+
id: "EditActionConfig",
|
|
3290
|
+
description: "Configuration for editing a record before registration."
|
|
3291
|
+
}),
|
|
3292
|
+
ArchiveConfig.meta({
|
|
3293
|
+
id: "ArchiveActionConfig",
|
|
3294
|
+
description: "Configuration for archiving a record."
|
|
3128
3295
|
}),
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3296
|
+
CustomActionConfig.meta({
|
|
3297
|
+
id: "CustomActionConfig",
|
|
3298
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
3299
|
+
})
|
|
3133
3300
|
]).describe(
|
|
3134
3301
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
3135
3302
|
).meta({ id: "ActionConfig" });
|
|
@@ -3205,7 +3372,10 @@ var Field = BaseField2.extend({
|
|
|
3205
3372
|
}).describe("Custom field defined for the summary view.");
|
|
3206
3373
|
var SummaryConfig = z27.object({
|
|
3207
3374
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
3208
|
-
}).
|
|
3375
|
+
}).meta({
|
|
3376
|
+
id: "SummaryConfig",
|
|
3377
|
+
description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
|
|
3378
|
+
});
|
|
3209
3379
|
|
|
3210
3380
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
3211
3381
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -3329,6 +3499,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
3329
3499
|
var AdvancedSearchConfig = z28.object({
|
|
3330
3500
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
3331
3501
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3502
|
+
}).meta({
|
|
3503
|
+
id: "AdvancedSearchConfig",
|
|
3504
|
+
description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
|
|
3332
3505
|
});
|
|
3333
3506
|
|
|
3334
3507
|
// ../commons/src/events/utils.ts
|
|
@@ -4682,6 +4855,9 @@ function not(condition) {
|
|
|
4682
4855
|
function never2() {
|
|
4683
4856
|
return not(alwaysTrue());
|
|
4684
4857
|
}
|
|
4858
|
+
function always() {
|
|
4859
|
+
return defineConditional(alwaysTrue());
|
|
4860
|
+
}
|
|
4685
4861
|
function jsonFieldPath(field3) {
|
|
4686
4862
|
return [field3.$$field, ...field3.$$subfield].join("/");
|
|
4687
4863
|
}
|
|
@@ -5377,7 +5553,7 @@ var _EventConfigBase = z33.object({
|
|
|
5377
5553
|
),
|
|
5378
5554
|
label: TranslationConfig.describe("Human-readable label for the event type."),
|
|
5379
5555
|
actions: z33.array(ActionConfig).describe(
|
|
5380
|
-
"Configuration of
|
|
5556
|
+
"Configuration of core and custom actions associated with the event."
|
|
5381
5557
|
),
|
|
5382
5558
|
actionOrder: z33.array(z33.string()).optional().describe(
|
|
5383
5559
|
"Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
|
|
@@ -5389,7 +5565,7 @@ var _EventConfigBase = z33.object({
|
|
|
5389
5565
|
"Configuration of fields available in the advanced search feature."
|
|
5390
5566
|
),
|
|
5391
5567
|
flags: z33.array(FlagConfig).optional().default([]).describe(
|
|
5392
|
-
"Configuration of flags associated with the actions of this event type."
|
|
5568
|
+
"Configuration of custom flags associated with the actions of this event type."
|
|
5393
5569
|
),
|
|
5394
5570
|
analytics: z33.boolean().optional().default(true).describe(
|
|
5395
5571
|
"Indicates whether the records of this event type are included in analytics"
|
|
@@ -5402,8 +5578,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
5402
5578
|
validateActionFlags(event2, ctx);
|
|
5403
5579
|
validateActionOrder(event2, ctx);
|
|
5404
5580
|
}).meta({
|
|
5405
|
-
id: "EventConfig"
|
|
5406
|
-
|
|
5581
|
+
id: "EventConfig",
|
|
5582
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
5583
|
+
});
|
|
5407
5584
|
|
|
5408
5585
|
// ../commons/src/events/EventConfigInput.ts
|
|
5409
5586
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -5626,6 +5803,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
5626
5803
|
var WorkqueueColumn = z34.object({
|
|
5627
5804
|
label: TranslationConfig,
|
|
5628
5805
|
value: WorkqueueColumnValue
|
|
5806
|
+
}).meta({
|
|
5807
|
+
id: "WorkqueueColumn",
|
|
5808
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
5629
5809
|
});
|
|
5630
5810
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
5631
5811
|
return workqueueColumns.map(
|
|
@@ -5828,18 +6008,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
5828
6008
|
query: true,
|
|
5829
6009
|
columns: true
|
|
5830
6010
|
});
|
|
5831
|
-
var WorkqueueConfigInput =
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
query: CountryConfigQueryInputType,
|
|
5837
|
-
action: z37.object({ type: WorkqueueActionType }).optional().describe(
|
|
5838
|
-
"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."
|
|
5839
|
-
),
|
|
5840
|
-
columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
|
|
5841
|
-
icon: AvailableIcons,
|
|
5842
|
-
emptyMessage: TranslationConfig.optional()
|
|
6011
|
+
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
6012
|
+
query: CountryConfigQueryInputType
|
|
6013
|
+
}).meta({
|
|
6014
|
+
id: "WorkqueueConfig",
|
|
6015
|
+
description: "Configuration for a single workqueue. Defines the filter applied to the event index, the quick-action button, the columns shown on each row, and the message rendered when the queue is empty."
|
|
5843
6016
|
});
|
|
5844
6017
|
function defineWorkqueue(workqueueInput) {
|
|
5845
6018
|
const queryInput = workqueueInput.query;
|
|
@@ -5902,7 +6075,9 @@ var BaseActionInput = z38.object({
|
|
|
5902
6075
|
keepAssignment: z38.boolean().optional(),
|
|
5903
6076
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
5904
6077
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
5905
|
-
waitFor: z38.boolean().
|
|
6078
|
+
waitFor: z38.boolean().default(true).describe(
|
|
6079
|
+
"Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
|
|
6080
|
+
),
|
|
5906
6081
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
5907
6082
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
5908
6083
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -6082,7 +6257,7 @@ var Draft = z39.object({
|
|
|
6082
6257
|
}).describe(
|
|
6083
6258
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
6084
6259
|
);
|
|
6085
|
-
var DraftInput = BaseActionInput.extend({
|
|
6260
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
6086
6261
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
6087
6262
|
status: z39.enum([
|
|
6088
6263
|
ActionStatus.Requested,
|
|
@@ -6156,7 +6331,6 @@ function getDeclarationActionCreationMetadata(actionType, actions) {
|
|
|
6156
6331
|
createdAtLocation: requestAction?.createdAtLocation ?? acceptAction.createdAtLocation,
|
|
6157
6332
|
acceptedAt: acceptAction.createdAt,
|
|
6158
6333
|
createdByRole: requestAction?.createdByRole ?? acceptAction.createdByRole,
|
|
6159
|
-
createdBySignature: requestAction?.createdBySignature ?? acceptAction.createdBySignature,
|
|
6160
6334
|
registrationNumber
|
|
6161
6335
|
};
|
|
6162
6336
|
}
|
|
@@ -6214,19 +6388,22 @@ var import_date_fns3 = require("date-fns");
|
|
|
6214
6388
|
function isEditInProgress(actions) {
|
|
6215
6389
|
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6216
6390
|
}
|
|
6217
|
-
function
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
return false;
|
|
6391
|
+
function findPendingCorrectionAction(writeActions2) {
|
|
6392
|
+
let correctionRequestAction;
|
|
6393
|
+
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
6394
|
+
const action = writeActions2[i];
|
|
6395
|
+
if (action.type === ActionType.APPROVE_CORRECTION || action.type === ActionType.REJECT_CORRECTION) {
|
|
6396
|
+
break;
|
|
6224
6397
|
}
|
|
6225
|
-
if (type === ActionType.
|
|
6226
|
-
|
|
6398
|
+
if (action.type === ActionType.REQUEST_CORRECTION && action.status !== ActionStatus.Rejected) {
|
|
6399
|
+
correctionRequestAction = action;
|
|
6400
|
+
break;
|
|
6227
6401
|
}
|
|
6228
|
-
|
|
6229
|
-
|
|
6402
|
+
}
|
|
6403
|
+
return correctionRequestAction;
|
|
6404
|
+
}
|
|
6405
|
+
function isCorrectionRequested(actions) {
|
|
6406
|
+
return findPendingCorrectionAction(actions) !== void 0;
|
|
6230
6407
|
}
|
|
6231
6408
|
function isDeclarationIncomplete(actions) {
|
|
6232
6409
|
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
@@ -6370,17 +6547,6 @@ function getAssignedUserFromActions(actions) {
|
|
|
6370
6547
|
return user2;
|
|
6371
6548
|
}, null);
|
|
6372
6549
|
}
|
|
6373
|
-
function getAssignedUserSignatureFromActions(actions) {
|
|
6374
|
-
return actions.reduce((signature, action) => {
|
|
6375
|
-
if (action.type === ActionType.ASSIGN) {
|
|
6376
|
-
return action.createdBySignature || null;
|
|
6377
|
-
}
|
|
6378
|
-
if (action.type === ActionType.UNASSIGN) {
|
|
6379
|
-
return null;
|
|
6380
|
-
}
|
|
6381
|
-
return signature;
|
|
6382
|
-
}, null);
|
|
6383
|
-
}
|
|
6384
6550
|
function deepDropNulls(obj) {
|
|
6385
6551
|
if (Array.isArray(obj)) {
|
|
6386
6552
|
return obj.map(deepDropNulls);
|
|
@@ -6476,10 +6642,8 @@ function getCurrentEventState(event2, config) {
|
|
|
6476
6642
|
createdBy: creationAction.createdBy,
|
|
6477
6643
|
createdByUserType: creationAction.createdByUserType,
|
|
6478
6644
|
createdAtLocation: creationAction.createdAtLocation,
|
|
6479
|
-
createdBySignature: creationAction.createdBySignature,
|
|
6480
6645
|
updatedAt: acceptedActionMetadata.createdAt,
|
|
6481
6646
|
assignedTo: getAssignedUserFromActions(acceptedActions),
|
|
6482
|
-
assignedToSignature: getAssignedUserSignatureFromActions(acceptedActions),
|
|
6483
6647
|
updatedBy: requestActionMetadata.createdBy,
|
|
6484
6648
|
updatedAtLocation: requestActionMetadata.createdAtLocation,
|
|
6485
6649
|
declaration,
|
|
@@ -9738,7 +9902,6 @@ var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
|
|
9738
9902
|
createdBy: overrides.createdBy ?? generateUuid(rng),
|
|
9739
9903
|
createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
|
|
9740
9904
|
updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
|
|
9741
|
-
createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
|
|
9742
9905
|
updatedAt: overrides.updatedAt ?? (0, import_date_fns4.addDays)(new Date(createdAt), 1).toISOString(),
|
|
9743
9906
|
assignedTo: overrides.assignedTo ?? null,
|
|
9744
9907
|
updatedBy: overrides.updatedBy ?? generateUuid(rng),
|
|
@@ -10337,3 +10500,366 @@ function getFilePathsFromEvent(event2) {
|
|
|
10337
10500
|
});
|
|
10338
10501
|
return (0, import_lodash7.uniq)(filepaths);
|
|
10339
10502
|
}
|
|
10503
|
+
|
|
10504
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
10505
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
10506
|
+
{
|
|
10507
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10508
|
+
name: "Central",
|
|
10509
|
+
parentId: null,
|
|
10510
|
+
validUntil: null,
|
|
10511
|
+
externalId: "ydyJb1RAy4U1"
|
|
10512
|
+
},
|
|
10513
|
+
{
|
|
10514
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10515
|
+
name: "Sulaka",
|
|
10516
|
+
parentId: null,
|
|
10517
|
+
validUntil: null,
|
|
10518
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
10519
|
+
},
|
|
10520
|
+
{
|
|
10521
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
10522
|
+
name: "Pualula",
|
|
10523
|
+
parentId: null,
|
|
10524
|
+
validUntil: null,
|
|
10525
|
+
externalId: "Aq91DweLmT8k"
|
|
10526
|
+
},
|
|
10527
|
+
{
|
|
10528
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
10529
|
+
name: "Chuminga",
|
|
10530
|
+
parentId: null,
|
|
10531
|
+
validUntil: null,
|
|
10532
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
10533
|
+
},
|
|
10534
|
+
{
|
|
10535
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10536
|
+
name: "Ibombo",
|
|
10537
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10538
|
+
validUntil: null,
|
|
10539
|
+
externalId: "k7DsP4vbN1Qe"
|
|
10540
|
+
},
|
|
10541
|
+
{
|
|
10542
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10543
|
+
name: "Isango",
|
|
10544
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10545
|
+
validUntil: null,
|
|
10546
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
10547
|
+
},
|
|
10548
|
+
{
|
|
10549
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10550
|
+
name: "Isamba",
|
|
10551
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10552
|
+
validUntil: null,
|
|
10553
|
+
externalId: "sT0xVu1KqJ7r"
|
|
10554
|
+
},
|
|
10555
|
+
{
|
|
10556
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10557
|
+
name: "Itambo",
|
|
10558
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10559
|
+
validUntil: null,
|
|
10560
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
10561
|
+
},
|
|
10562
|
+
{
|
|
10563
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
10564
|
+
name: "Ezhi",
|
|
10565
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10566
|
+
validUntil: null,
|
|
10567
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
10568
|
+
},
|
|
10569
|
+
{
|
|
10570
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10571
|
+
name: "Ilanga",
|
|
10572
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10573
|
+
validUntil: null,
|
|
10574
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
10575
|
+
},
|
|
10576
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
10577
|
+
{
|
|
10578
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10579
|
+
name: "Klow",
|
|
10580
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10581
|
+
validUntil: null,
|
|
10582
|
+
externalId: "IkYcYBUcyY2"
|
|
10583
|
+
},
|
|
10584
|
+
{
|
|
10585
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
10586
|
+
name: "Mbondo",
|
|
10587
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10588
|
+
validUntil: null,
|
|
10589
|
+
externalId: "Qhvv5hvo3mY"
|
|
10590
|
+
},
|
|
10591
|
+
{
|
|
10592
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
10593
|
+
name: "Ndara",
|
|
10594
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10595
|
+
validUntil: null,
|
|
10596
|
+
externalId: "crXh068O9TR"
|
|
10597
|
+
},
|
|
10598
|
+
{
|
|
10599
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
10600
|
+
name: "Olani",
|
|
10601
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10602
|
+
validUntil: null,
|
|
10603
|
+
externalId: "r00It8Tvvp7"
|
|
10604
|
+
},
|
|
10605
|
+
{
|
|
10606
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
10607
|
+
name: "Pemba",
|
|
10608
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10609
|
+
validUntil: null,
|
|
10610
|
+
externalId: "ZnUWsbONIaH"
|
|
10611
|
+
},
|
|
10612
|
+
{
|
|
10613
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
10614
|
+
name: "Quanza",
|
|
10615
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10616
|
+
validUntil: null,
|
|
10617
|
+
externalId: "fDZycvQTa7l"
|
|
10618
|
+
},
|
|
10619
|
+
{
|
|
10620
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
10621
|
+
name: "Rivka",
|
|
10622
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10623
|
+
validUntil: null,
|
|
10624
|
+
externalId: "KqswxCGTELa"
|
|
10625
|
+
},
|
|
10626
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
10627
|
+
{
|
|
10628
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
10629
|
+
name: "Mbula",
|
|
10630
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10631
|
+
validUntil: null,
|
|
10632
|
+
externalId: "osEbKjRc9Kg"
|
|
10633
|
+
},
|
|
10634
|
+
{
|
|
10635
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
10636
|
+
name: "Ndoki",
|
|
10637
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10638
|
+
validUntil: null,
|
|
10639
|
+
externalId: "aq4daBUAGr3"
|
|
10640
|
+
},
|
|
10641
|
+
{
|
|
10642
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
10643
|
+
name: "Tsanga",
|
|
10644
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10645
|
+
validUntil: null,
|
|
10646
|
+
externalId: "cqis6Y8trbJ"
|
|
10647
|
+
},
|
|
10648
|
+
{
|
|
10649
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
10650
|
+
name: "Waziri",
|
|
10651
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10652
|
+
validUntil: null,
|
|
10653
|
+
externalId: "LMijHPyyx6d"
|
|
10654
|
+
},
|
|
10655
|
+
{
|
|
10656
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
10657
|
+
name: "Zimbi",
|
|
10658
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10659
|
+
validUntil: null,
|
|
10660
|
+
externalId: "pcQYbPuKGZ7"
|
|
10661
|
+
},
|
|
10662
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
10663
|
+
{
|
|
10664
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
10665
|
+
name: "Felani",
|
|
10666
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10667
|
+
validUntil: null,
|
|
10668
|
+
externalId: "gSqpoCGdMXp"
|
|
10669
|
+
},
|
|
10670
|
+
{
|
|
10671
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
10672
|
+
name: "Goroma",
|
|
10673
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10674
|
+
validUntil: null,
|
|
10675
|
+
externalId: "KvAAIaNqVrp"
|
|
10676
|
+
},
|
|
10677
|
+
{
|
|
10678
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
10679
|
+
name: "Halifu",
|
|
10680
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10681
|
+
validUntil: null,
|
|
10682
|
+
externalId: "qe4UnEVt1hv"
|
|
10683
|
+
},
|
|
10684
|
+
{
|
|
10685
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
10686
|
+
name: "Jabari",
|
|
10687
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10688
|
+
validUntil: null,
|
|
10689
|
+
externalId: "yHH9Nz4rLOt"
|
|
10690
|
+
},
|
|
10691
|
+
{
|
|
10692
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
10693
|
+
name: "Kifani",
|
|
10694
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10695
|
+
validUntil: null,
|
|
10696
|
+
externalId: "eSWmXIGeu1I"
|
|
10697
|
+
},
|
|
10698
|
+
{
|
|
10699
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
10700
|
+
name: "Lumela",
|
|
10701
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
10702
|
+
validUntil: null,
|
|
10703
|
+
externalId: "bh0b3aI1uP3"
|
|
10704
|
+
}
|
|
10705
|
+
];
|
|
10706
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
10707
|
+
{
|
|
10708
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
10709
|
+
name: "Central Provincial Office",
|
|
10710
|
+
locationType: "CRVS_OFFICE",
|
|
10711
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10712
|
+
validUntil: null,
|
|
10713
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
10714
|
+
},
|
|
10715
|
+
{
|
|
10716
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
10717
|
+
name: "Central Health Post",
|
|
10718
|
+
locationType: "HEALTH_FACILITY",
|
|
10719
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
10720
|
+
validUntil: null
|
|
10721
|
+
},
|
|
10722
|
+
{
|
|
10723
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
10724
|
+
name: "Ibombo District Office",
|
|
10725
|
+
locationType: "CRVS_OFFICE",
|
|
10726
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10727
|
+
validUntil: null,
|
|
10728
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
10729
|
+
},
|
|
10730
|
+
{
|
|
10731
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
10732
|
+
name: "Isamba District Office",
|
|
10733
|
+
locationType: "CRVS_OFFICE",
|
|
10734
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
10735
|
+
validUntil: null,
|
|
10736
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
10737
|
+
},
|
|
10738
|
+
{
|
|
10739
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
10740
|
+
name: "Isango District Office",
|
|
10741
|
+
locationType: "CRVS_OFFICE",
|
|
10742
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
10743
|
+
validUntil: null,
|
|
10744
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
10745
|
+
},
|
|
10746
|
+
{
|
|
10747
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
10748
|
+
name: "Sulaka Provincial Office",
|
|
10749
|
+
locationType: "CRVS_OFFICE",
|
|
10750
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
10751
|
+
validUntil: null,
|
|
10752
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
10753
|
+
},
|
|
10754
|
+
{
|
|
10755
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
10756
|
+
name: "Ilanga District Office",
|
|
10757
|
+
locationType: "CRVS_OFFICE",
|
|
10758
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
10759
|
+
validUntil: null,
|
|
10760
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
10761
|
+
},
|
|
10762
|
+
{
|
|
10763
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
10764
|
+
name: "Chamakubi Health Post",
|
|
10765
|
+
locationType: "HEALTH_FACILITY",
|
|
10766
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10767
|
+
validUntil: null,
|
|
10768
|
+
externalId: "M1nFr8LbC2Qy"
|
|
10769
|
+
},
|
|
10770
|
+
{
|
|
10771
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
10772
|
+
name: "Ibombo Rural Health Centre",
|
|
10773
|
+
locationType: "HEALTH_FACILITY",
|
|
10774
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10775
|
+
validUntil: null,
|
|
10776
|
+
externalId: "bT7pV6YrW0Xc"
|
|
10777
|
+
},
|
|
10778
|
+
{
|
|
10779
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
10780
|
+
name: "Chikobo Rural Health Centre",
|
|
10781
|
+
locationType: "HEALTH_FACILITY",
|
|
10782
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10783
|
+
validUntil: null,
|
|
10784
|
+
externalId: "zE4qPn2SgJ5d"
|
|
10785
|
+
},
|
|
10786
|
+
{
|
|
10787
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
10788
|
+
name: "Chilochabalenje Health Post",
|
|
10789
|
+
locationType: "HEALTH_FACILITY",
|
|
10790
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10791
|
+
validUntil: null,
|
|
10792
|
+
externalId: "H8vDs1MqR4Uf"
|
|
10793
|
+
},
|
|
10794
|
+
{
|
|
10795
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
10796
|
+
name: "Chipeso Rural Health Centre",
|
|
10797
|
+
locationType: "HEALTH_FACILITY",
|
|
10798
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10799
|
+
validUntil: null,
|
|
10800
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
10801
|
+
},
|
|
10802
|
+
{
|
|
10803
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
10804
|
+
name: "Chisamba Rural Health Centre",
|
|
10805
|
+
locationType: "HEALTH_FACILITY",
|
|
10806
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10807
|
+
validUntil: null,
|
|
10808
|
+
externalId: "Yr0pCg8LdM2s"
|
|
10809
|
+
},
|
|
10810
|
+
{
|
|
10811
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
10812
|
+
name: "Chitanda Rural Health Centre",
|
|
10813
|
+
locationType: "HEALTH_FACILITY",
|
|
10814
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10815
|
+
validUntil: null,
|
|
10816
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
10817
|
+
},
|
|
10818
|
+
{
|
|
10819
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
10820
|
+
name: "Golden Valley Rural Health Centre",
|
|
10821
|
+
locationType: "HEALTH_FACILITY",
|
|
10822
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10823
|
+
validUntil: null,
|
|
10824
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
10825
|
+
},
|
|
10826
|
+
{
|
|
10827
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
10828
|
+
name: "Ipongo Rural Health Centre",
|
|
10829
|
+
locationType: "HEALTH_FACILITY",
|
|
10830
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10831
|
+
validUntil: null,
|
|
10832
|
+
externalId: "kF2sW9DmH0Bt"
|
|
10833
|
+
},
|
|
10834
|
+
{
|
|
10835
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
10836
|
+
name: "Itumbwe Health Post",
|
|
10837
|
+
locationType: "HEALTH_FACILITY",
|
|
10838
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10839
|
+
validUntil: null,
|
|
10840
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
10841
|
+
},
|
|
10842
|
+
{
|
|
10843
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
10844
|
+
name: "Kabangalala Rural Health Centre",
|
|
10845
|
+
locationType: "HEALTH_FACILITY",
|
|
10846
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
10847
|
+
validUntil: null,
|
|
10848
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
10849
|
+
},
|
|
10850
|
+
// Village offices
|
|
10851
|
+
{
|
|
10852
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
10853
|
+
name: "Klow Village Office",
|
|
10854
|
+
locationType: "CRVS_OFFICE",
|
|
10855
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
10856
|
+
validUntil: null,
|
|
10857
|
+
externalId: "PmAyxAJkxiJ"
|
|
10858
|
+
}
|
|
10859
|
+
];
|
|
10860
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
10861
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
10862
|
+
);
|
|
10863
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
10864
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
10865
|
+
);
|