@opencrvs/toolkit 1.8.0-rc.f8be155 → 1.8.0-rc.f8e0ee5
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/dist/commons/api/router.d.ts +2029 -5136
- package/dist/commons/conditionals/conditionals.d.ts +0 -4
- package/dist/commons/conditionals/validate.d.ts +0 -6
- package/dist/commons/events/ActionConfig.d.ts +20914 -44038
- package/dist/commons/events/ActionDocument.d.ts +484 -1888
- package/dist/commons/events/ActionInput.d.ts +304 -1504
- package/dist/commons/events/ActionType.d.ts +0 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +3 -75
- package/dist/commons/events/CompositeFieldValue.d.ts +0 -28
- package/dist/commons/events/Constants.d.ts +0 -1
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -1
- package/dist/commons/events/Draft.d.ts +34 -130
- package/dist/commons/events/EventConfig.d.ts +16720 -30190
- package/dist/commons/events/EventDocument.d.ts +346 -1210
- package/dist/commons/events/EventIndex.d.ts +32 -270
- package/dist/commons/events/EventMetadata.d.ts +60 -27
- package/dist/commons/events/FieldConfig.d.ts +893 -1682
- package/dist/commons/events/FieldType.d.ts +1 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +50 -89
- package/dist/commons/events/FieldValue.d.ts +5 -41
- package/dist/commons/events/FormConfig.d.ts +2510 -7640
- package/dist/commons/events/PageConfig.d.ts +1638 -2896
- package/dist/commons/events/SummaryConfig.d.ts +5 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +19 -297
- package/dist/commons/events/defineConfig.d.ts +1440 -3841
- package/dist/commons/events/field.d.ts +0 -4
- package/dist/commons/events/scopes.d.ts +1 -1
- package/dist/commons/events/test.utils.d.ts +39 -126
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +18 -9664
- package/dist/conditionals/index.js +1 -18
- package/dist/events/index.js +1103 -1370
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
@@ -56,7 +56,6 @@ __export(events_exports, {
|
|
56
56
|
ArchiveActionInput: () => ArchiveActionInput,
|
57
57
|
AssignActionInput: () => AssignActionInput,
|
58
58
|
AsyncRejectActionDocument: () => AsyncRejectActionDocument,
|
59
|
-
BIRTH_EVENT: () => BIRTH_EVENT,
|
60
59
|
BaseActionInput: () => BaseActionInput,
|
61
60
|
BearerTokenByUserType: () => BearerTokenByUserType,
|
62
61
|
CONFIG_GET_ALLOWED_SCOPES: () => CONFIG_GET_ALLOWED_SCOPES,
|
@@ -102,6 +101,8 @@ __export(events_exports, {
|
|
102
101
|
EventSearchIndex: () => EventSearchIndex,
|
103
102
|
EventState: () => EventState,
|
104
103
|
EventStatus: () => EventStatus,
|
104
|
+
EventStatusEnum: () => EventStatusEnum,
|
105
|
+
EventStatuses: () => EventStatuses,
|
105
106
|
Exact: () => Exact,
|
106
107
|
ExactStatus: () => ExactStatus,
|
107
108
|
FieldConditional: () => FieldConditional,
|
@@ -126,8 +127,6 @@ __export(events_exports, {
|
|
126
127
|
LegalStatuses: () => LegalStatuses,
|
127
128
|
MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
|
128
129
|
MimeType: () => MimeType,
|
129
|
-
NameFieldUpdateValue: () => NameFieldUpdateValue,
|
130
|
-
NameFieldValue: () => NameFieldValue,
|
131
130
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
132
131
|
Not: () => Not,
|
133
132
|
NotifyActionInput: () => NotifyActionInput,
|
@@ -167,7 +166,6 @@ __export(events_exports, {
|
|
167
166
|
VerificationActionConfig: () => VerificationActionConfig,
|
168
167
|
VerificationPageConfig: () => VerificationPageConfig,
|
169
168
|
Within: () => Within,
|
170
|
-
WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
|
171
169
|
WorkqueueColumn: () => WorkqueueColumn,
|
172
170
|
WorkqueueColumnKeys: () => WorkqueueColumnKeys,
|
173
171
|
WorkqueueColumnKeysArray: () => WorkqueueColumnKeysArray,
|
@@ -186,8 +184,9 @@ __export(events_exports, {
|
|
186
184
|
createEmptyDraft: () => createEmptyDraft,
|
187
185
|
createEventConditionals: () => createEventConditionals,
|
188
186
|
createFieldConditionals: () => createFieldConditionals,
|
189
|
-
|
187
|
+
createPseudoRandomNumberGenerator: () => createPseudoRandomNumberGenerator,
|
190
188
|
createValidationSchema: () => createValidationSchema,
|
189
|
+
dateOfEventColumn: () => dateOfEventColumn,
|
191
190
|
deepDropNulls: () => deepDropNulls,
|
192
191
|
deepMerge: () => deepMerge,
|
193
192
|
defaultWorkqueueColumns: () => defaultWorkqueueColumns,
|
@@ -207,6 +206,7 @@ __export(events_exports, {
|
|
207
206
|
eventMetadataLabelMap: () => eventMetadataLabelMap,
|
208
207
|
eventPayloadGenerator: () => eventPayloadGenerator,
|
209
208
|
eventQueryDataGenerator: () => eventQueryDataGenerator,
|
209
|
+
eventStatuses: () => eventStatuses,
|
210
210
|
field: () => field,
|
211
211
|
fieldTypes: () => fieldTypes,
|
212
212
|
filterUnallowedActions: () => filterUnallowedActions,
|
@@ -219,7 +219,6 @@ __export(events_exports, {
|
|
219
219
|
generateActionDocument: () => generateActionDocument,
|
220
220
|
generateEventDocument: () => generateEventDocument,
|
221
221
|
generateEventDraftDocument: () => generateEventDraftDocument,
|
222
|
-
generateRandomName: () => generateRandomName,
|
223
222
|
generateRandomSignature: () => generateRandomSignature,
|
224
223
|
generateTransactionId: () => generateTransactionId,
|
225
224
|
generateTranslationConfig: () => generateTranslationConfig,
|
@@ -230,22 +229,17 @@ __export(events_exports, {
|
|
230
229
|
getActionReview: () => getActionReview,
|
231
230
|
getActionReviewFields: () => getActionReviewFields,
|
232
231
|
getActionVerificationPageIds: () => getActionVerificationPageIds,
|
233
|
-
getAllUniqueFields: () => getAllUniqueFields,
|
234
232
|
getAnnotationFromDrafts: () => getAnnotationFromDrafts,
|
235
233
|
getAssignedUserFromActions: () => getAssignedUserFromActions,
|
236
234
|
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
237
235
|
getCurrentEventState: () => getCurrentEventState,
|
238
236
|
getCurrentEventStateWithDrafts: () => getCurrentEventStateWithDrafts,
|
239
237
|
getDeclaration: () => getDeclaration,
|
240
|
-
getDeclarationFieldById: () => getDeclarationFieldById,
|
241
238
|
getDeclarationFields: () => getDeclarationFields,
|
242
239
|
getDeclarationPages: () => getDeclarationPages,
|
243
|
-
getEventConfigById: () => getEventConfigById,
|
244
240
|
getMixedPath: () => getMixedPath,
|
245
|
-
getRandomDate: () => getRandomDate,
|
246
241
|
getRandomDatetime: () => getRandomDatetime,
|
247
242
|
getStatusFromActions: () => getStatusFromActions,
|
248
|
-
getValidatorsForField: () => getValidatorsForField,
|
249
243
|
getVisibleVerificationPageIds: () => getVisibleVerificationPageIds,
|
250
244
|
hasAnyOfScopes: () => hasAnyOfScopes,
|
251
245
|
isAddressFieldType: () => isAddressFieldType,
|
@@ -268,17 +262,13 @@ __export(events_exports, {
|
|
268
262
|
isFieldVisible: () => isFieldVisible,
|
269
263
|
isFileFieldType: () => isFileFieldType,
|
270
264
|
isFileFieldWithOptionType: () => isFileFieldWithOptionType,
|
271
|
-
isIdFieldType: () => isIdFieldType,
|
272
265
|
isLocationFieldType: () => isLocationFieldType,
|
273
|
-
isMetaAction: () => isMetaAction,
|
274
|
-
isNameFieldType: () => isNameFieldType,
|
275
266
|
isNonInteractiveFieldType: () => isNonInteractiveFieldType,
|
276
267
|
isNumberFieldType: () => isNumberFieldType,
|
277
268
|
isOfficeFieldType: () => isOfficeFieldType,
|
278
269
|
isPageHeaderFieldType: () => isPageHeaderFieldType,
|
279
270
|
isPageVisible: () => isPageVisible,
|
280
271
|
isParagraphFieldType: () => isParagraphFieldType,
|
281
|
-
isPhoneFieldType: () => isPhoneFieldType,
|
282
272
|
isRadioGroupFieldType: () => isRadioGroupFieldType,
|
283
273
|
isSelectFieldType: () => isSelectFieldType,
|
284
274
|
isSignatureFieldType: () => isSignatureFieldType,
|
@@ -288,7 +278,6 @@ __export(events_exports, {
|
|
288
278
|
isUndeclaredDraft: () => isUndeclaredDraft,
|
289
279
|
isVerificationPage: () => isVerificationPage,
|
290
280
|
isWriteAction: () => isWriteAction,
|
291
|
-
mandatoryColumns: () => mandatoryColumns,
|
292
281
|
mapFieldTypeToEmptyValue: () => mapFieldTypeToEmptyValue,
|
293
282
|
mapFieldTypeToMockValue: () => mapFieldTypeToMockValue,
|
294
283
|
mapFieldTypeToZod: () => mapFieldTypeToZod,
|
@@ -302,14 +291,12 @@ __export(events_exports, {
|
|
302
291
|
user: () => user,
|
303
292
|
validate: () => validate,
|
304
293
|
validateFieldInput: () => validateFieldInput,
|
305
|
-
workqueueActions: () => workqueueActions,
|
306
294
|
writeActions: () => writeActions
|
307
295
|
});
|
308
296
|
module.exports = __toCommonJS(events_exports);
|
309
297
|
|
310
298
|
// ../commons/src/events/Constants.ts
|
311
299
|
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
312
|
-
var BIRTH_EVENT = "v2-birth";
|
313
300
|
|
314
301
|
// ../commons/src/events/ActionConfig.ts
|
315
302
|
var import_zod9 = require("zod");
|
@@ -363,12 +350,6 @@ var FieldConditional = import_zod.z.discriminatedUnion("type", [
|
|
363
350
|
ref: "FieldConditional"
|
364
351
|
});
|
365
352
|
|
366
|
-
// ../commons/src/events/PageConfig.ts
|
367
|
-
var import_zod6 = require("zod");
|
368
|
-
|
369
|
-
// ../commons/src/events/FieldConfig.ts
|
370
|
-
var import_zod5 = require("zod");
|
371
|
-
|
372
353
|
// ../commons/src/events/TranslationConfig.ts
|
373
354
|
var import_zod2 = require("zod");
|
374
355
|
var import_zod_openapi2 = require("zod-openapi");
|
@@ -386,11 +367,88 @@ var TranslationConfig = import_zod2.z.object({
|
|
386
367
|
ref: "TranslationConfig"
|
387
368
|
});
|
388
369
|
|
370
|
+
// ../commons/src/events/ActionType.ts
|
371
|
+
var import_zod3 = require("zod");
|
372
|
+
var ActionType = {
|
373
|
+
// Pre-declaration actions
|
374
|
+
DELETE: "DELETE",
|
375
|
+
CREATE: "CREATE",
|
376
|
+
NOTIFY: "NOTIFY",
|
377
|
+
// Declaration actions
|
378
|
+
DECLARE: "DECLARE",
|
379
|
+
VALIDATE: "VALIDATE",
|
380
|
+
REGISTER: "REGISTER",
|
381
|
+
// Declaration system actions. Non-configurable.
|
382
|
+
DETECT_DUPLICATE: "DETECT_DUPLICATE",
|
383
|
+
REJECT: "REJECT",
|
384
|
+
// REJECT_DECLARATION
|
385
|
+
MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE",
|
386
|
+
// MARK_AS_DUPLICATE
|
387
|
+
ARCHIVE: "ARCHIVE",
|
388
|
+
// Record actions
|
389
|
+
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
390
|
+
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
391
|
+
REJECT_CORRECTION: "REJECT_CORRECTION",
|
392
|
+
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
393
|
+
// General actions
|
394
|
+
READ: "READ",
|
395
|
+
ASSIGN: "ASSIGN",
|
396
|
+
UNASSIGN: "UNASSIGN"
|
397
|
+
};
|
398
|
+
var ConfirmableActions = [
|
399
|
+
ActionType.NOTIFY,
|
400
|
+
ActionType.DECLARE,
|
401
|
+
ActionType.VALIDATE,
|
402
|
+
ActionType.REGISTER,
|
403
|
+
ActionType.REJECT,
|
404
|
+
ActionType.ARCHIVE,
|
405
|
+
ActionType.PRINT_CERTIFICATE
|
406
|
+
];
|
407
|
+
var ActionTypes = import_zod3.z.enum([
|
408
|
+
"DELETE",
|
409
|
+
"CREATE",
|
410
|
+
"NOTIFY",
|
411
|
+
"DECLARE",
|
412
|
+
"VALIDATE",
|
413
|
+
"REGISTER",
|
414
|
+
"DETECT_DUPLICATE",
|
415
|
+
"REJECT",
|
416
|
+
"MARKED_AS_DUPLICATE",
|
417
|
+
"ARCHIVE",
|
418
|
+
"PRINT_CERTIFICATE",
|
419
|
+
"REQUEST_CORRECTION",
|
420
|
+
"REJECT_CORRECTION",
|
421
|
+
"APPROVE_CORRECTION",
|
422
|
+
"READ",
|
423
|
+
"ASSIGN",
|
424
|
+
"UNASSIGN"
|
425
|
+
]);
|
426
|
+
var declarationActionValues = [
|
427
|
+
ActionTypes.enum.DECLARE,
|
428
|
+
ActionTypes.enum.VALIDATE,
|
429
|
+
ActionTypes.enum.REGISTER
|
430
|
+
];
|
431
|
+
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
432
|
+
var declarationUpdateActionValues = [
|
433
|
+
...declarationActionValues,
|
434
|
+
ActionTypes.enum.REQUEST_CORRECTION
|
435
|
+
];
|
436
|
+
var DeclarationUpdateActions = ActionTypes.extract(
|
437
|
+
declarationUpdateActionValues
|
438
|
+
);
|
439
|
+
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
440
|
+
var writeActions = ActionTypes.exclude([
|
441
|
+
ActionType.CREATE,
|
442
|
+
ActionType.READ,
|
443
|
+
ActionType.ASSIGN,
|
444
|
+
ActionType.UNASSIGN
|
445
|
+
]);
|
446
|
+
|
447
|
+
// ../commons/src/events/FieldConfig.ts
|
448
|
+
var import_zod6 = require("zod");
|
449
|
+
|
389
450
|
// ../commons/src/events/FieldType.ts
|
390
451
|
var FieldType = {
|
391
|
-
NAME: "NAME",
|
392
|
-
PHONE: "PHONE",
|
393
|
-
ID: "ID",
|
394
452
|
ADDRESS: "ADDRESS",
|
395
453
|
TEXT: "TEXT",
|
396
454
|
NUMBER: "NUMBER",
|
@@ -424,10 +482,10 @@ var compositeFieldTypes = [
|
|
424
482
|
];
|
425
483
|
|
426
484
|
// ../commons/src/events/FieldValue.ts
|
427
|
-
var
|
485
|
+
var import_zod5 = require("zod");
|
428
486
|
|
429
487
|
// ../commons/src/events/CompositeFieldValue.ts
|
430
|
-
var
|
488
|
+
var import_zod4 = require("zod");
|
431
489
|
var GeographicalArea = {
|
432
490
|
URBAN: "URBAN",
|
433
491
|
RURAL: "RURAL"
|
@@ -436,98 +494,88 @@ var AddressType = {
|
|
436
494
|
DOMESTIC: "DOMESTIC",
|
437
495
|
INTERNATIONAL: "INTERNATIONAL"
|
438
496
|
};
|
439
|
-
var FileFieldValue =
|
440
|
-
filename:
|
441
|
-
originalFilename:
|
442
|
-
type:
|
497
|
+
var FileFieldValue = import_zod4.z.object({
|
498
|
+
filename: import_zod4.z.string(),
|
499
|
+
originalFilename: import_zod4.z.string(),
|
500
|
+
type: import_zod4.z.string()
|
443
501
|
});
|
444
|
-
var AdminStructure =
|
445
|
-
country:
|
446
|
-
addressType:
|
447
|
-
province:
|
448
|
-
district:
|
502
|
+
var AdminStructure = import_zod4.z.object({
|
503
|
+
country: import_zod4.z.string(),
|
504
|
+
addressType: import_zod4.z.literal(AddressType.DOMESTIC),
|
505
|
+
province: import_zod4.z.string(),
|
506
|
+
district: import_zod4.z.string()
|
449
507
|
});
|
450
508
|
var UrbanAddressValue = AdminStructure.extend({
|
451
|
-
urbanOrRural:
|
452
|
-
town:
|
453
|
-
residentialArea:
|
454
|
-
street:
|
455
|
-
number:
|
456
|
-
zipCode:
|
509
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.URBAN),
|
510
|
+
town: import_zod4.z.string().optional(),
|
511
|
+
residentialArea: import_zod4.z.string().optional(),
|
512
|
+
street: import_zod4.z.string().optional(),
|
513
|
+
number: import_zod4.z.string().optional(),
|
514
|
+
zipCode: import_zod4.z.string().optional()
|
457
515
|
});
|
458
516
|
var RuralAddressValue = AdminStructure.extend({
|
459
|
-
urbanOrRural:
|
460
|
-
village:
|
517
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.RURAL),
|
518
|
+
village: import_zod4.z.string().optional()
|
461
519
|
});
|
462
520
|
var UrbanAddressUpdateValue = AdminStructure.extend({
|
463
|
-
urbanOrRural:
|
464
|
-
town:
|
465
|
-
residentialArea:
|
466
|
-
street:
|
467
|
-
number:
|
468
|
-
zipCode:
|
469
|
-
});
|
470
|
-
var NameFieldValue = import_zod3.z.object({
|
471
|
-
firstname: import_zod3.z.string(),
|
472
|
-
surname: import_zod3.z.string(),
|
473
|
-
middlename: import_zod3.z.string().optional()
|
521
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.URBAN),
|
522
|
+
town: import_zod4.z.string().nullish(),
|
523
|
+
residentialArea: import_zod4.z.string().nullish(),
|
524
|
+
street: import_zod4.z.string().nullish(),
|
525
|
+
number: import_zod4.z.string().nullish(),
|
526
|
+
zipCode: import_zod4.z.string().nullish()
|
474
527
|
});
|
475
|
-
var NameFieldUpdateValue = import_zod3.z.object({
|
476
|
-
firstname: import_zod3.z.string(),
|
477
|
-
surname: import_zod3.z.string(),
|
478
|
-
middlename: import_zod3.z.string().nullish()
|
479
|
-
}).or(import_zod3.z.null()).or(import_zod3.z.undefined());
|
480
528
|
var RuralAddressUpdateValue = AdminStructure.extend({
|
481
|
-
urbanOrRural:
|
482
|
-
village:
|
529
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.RURAL),
|
530
|
+
village: import_zod4.z.string().nullish()
|
483
531
|
});
|
484
|
-
var GenericAddressValue =
|
485
|
-
country:
|
486
|
-
addressType:
|
487
|
-
state:
|
488
|
-
district2:
|
489
|
-
cityOrTown:
|
490
|
-
addressLine1:
|
491
|
-
addressLine2:
|
492
|
-
addressLine3:
|
493
|
-
postcodeOrZip:
|
532
|
+
var GenericAddressValue = import_zod4.z.object({
|
533
|
+
country: import_zod4.z.string(),
|
534
|
+
addressType: import_zod4.z.literal(AddressType.INTERNATIONAL),
|
535
|
+
state: import_zod4.z.string(),
|
536
|
+
district2: import_zod4.z.string(),
|
537
|
+
cityOrTown: import_zod4.z.string().optional(),
|
538
|
+
addressLine1: import_zod4.z.string().optional(),
|
539
|
+
addressLine2: import_zod4.z.string().optional(),
|
540
|
+
addressLine3: import_zod4.z.string().optional(),
|
541
|
+
postcodeOrZip: import_zod4.z.string().optional()
|
494
542
|
});
|
495
|
-
var AddressFieldValue =
|
496
|
-
var GenericAddressUpdateValue =
|
497
|
-
country:
|
498
|
-
addressType:
|
499
|
-
state:
|
500
|
-
district2:
|
501
|
-
cityOrTown:
|
502
|
-
addressLine1:
|
503
|
-
addressLine2:
|
504
|
-
addressLine3:
|
505
|
-
postcodeOrZip:
|
543
|
+
var AddressFieldValue = import_zod4.z.discriminatedUnion("urbanOrRural", [UrbanAddressValue, RuralAddressValue]).or(GenericAddressValue);
|
544
|
+
var GenericAddressUpdateValue = import_zod4.z.object({
|
545
|
+
country: import_zod4.z.string(),
|
546
|
+
addressType: import_zod4.z.literal(AddressType.INTERNATIONAL),
|
547
|
+
state: import_zod4.z.string(),
|
548
|
+
district2: import_zod4.z.string(),
|
549
|
+
cityOrTown: import_zod4.z.string().nullish(),
|
550
|
+
addressLine1: import_zod4.z.string().nullish(),
|
551
|
+
addressLine2: import_zod4.z.string().nullish(),
|
552
|
+
addressLine3: import_zod4.z.string().nullish(),
|
553
|
+
postcodeOrZip: import_zod4.z.string().nullish()
|
506
554
|
});
|
507
|
-
var AddressFieldUpdateValue =
|
555
|
+
var AddressFieldUpdateValue = import_zod4.z.discriminatedUnion("urbanOrRural", [
|
508
556
|
UrbanAddressUpdateValue,
|
509
557
|
RuralAddressUpdateValue
|
510
558
|
]).or(GenericAddressUpdateValue);
|
511
|
-
var FileFieldValueWithOption =
|
512
|
-
filename:
|
513
|
-
originalFilename:
|
514
|
-
type:
|
515
|
-
option:
|
559
|
+
var FileFieldValueWithOption = import_zod4.z.object({
|
560
|
+
filename: import_zod4.z.string(),
|
561
|
+
originalFilename: import_zod4.z.string(),
|
562
|
+
type: import_zod4.z.string(),
|
563
|
+
option: import_zod4.z.string()
|
516
564
|
});
|
517
|
-
var FileFieldWithOptionValue =
|
565
|
+
var FileFieldWithOptionValue = import_zod4.z.array(FileFieldValueWithOption);
|
518
566
|
|
519
567
|
// ../commons/src/events/FieldValue.ts
|
520
|
-
var TextValue =
|
568
|
+
var TextValue = import_zod5.z.string();
|
521
569
|
var NonEmptyTextValue = TextValue.min(1);
|
522
|
-
var DateValue =
|
523
|
-
var DatetimeValue =
|
524
|
-
var DateRangeFieldValue = DateValue.or(
|
525
|
-
var EmailValue =
|
526
|
-
var CheckboxFieldValue =
|
527
|
-
var NumberFieldValue =
|
528
|
-
var DataFieldValue =
|
529
|
-
var SignatureFieldValue =
|
530
|
-
var FieldValue =
|
570
|
+
var DateValue = import_zod5.z.string().date().describe("Date in the format YYYY-MM-DD");
|
571
|
+
var DatetimeValue = import_zod5.z.string().datetime();
|
572
|
+
var DateRangeFieldValue = DateValue.or(import_zod5.z.tuple([DateValue, DateValue]));
|
573
|
+
var EmailValue = import_zod5.z.string().email();
|
574
|
+
var CheckboxFieldValue = import_zod5.z.boolean();
|
575
|
+
var NumberFieldValue = import_zod5.z.number();
|
576
|
+
var DataFieldValue = import_zod5.z.undefined();
|
577
|
+
var SignatureFieldValue = import_zod5.z.string();
|
578
|
+
var FieldValue = import_zod5.z.union([
|
531
579
|
TextValue,
|
532
580
|
DateValue,
|
533
581
|
DateRangeFieldValue,
|
@@ -538,11 +586,9 @@ var FieldValue = import_zod4.z.union([
|
|
538
586
|
UrbanAddressValue,
|
539
587
|
RuralAddressValue,
|
540
588
|
DataFieldValue,
|
541
|
-
GenericAddressValue
|
542
|
-
NameFieldValue,
|
543
|
-
NameFieldUpdateValue
|
589
|
+
GenericAddressValue
|
544
590
|
]);
|
545
|
-
var FieldUpdateValue =
|
591
|
+
var FieldUpdateValue = import_zod5.z.union([
|
546
592
|
TextValue,
|
547
593
|
DateValue,
|
548
594
|
DateRangeFieldValue,
|
@@ -553,69 +599,68 @@ var FieldUpdateValue = import_zod4.z.union([
|
|
553
599
|
UrbanAddressUpdateValue,
|
554
600
|
RuralAddressUpdateValue,
|
555
601
|
DataFieldValue,
|
556
|
-
GenericAddressUpdateValue
|
557
|
-
NameFieldUpdateValue
|
602
|
+
GenericAddressUpdateValue
|
558
603
|
]);
|
559
604
|
|
560
605
|
// ../commons/src/events/FieldConfig.ts
|
561
606
|
var import_zod_openapi3 = require("zod-openapi");
|
562
|
-
(0, import_zod_openapi3.extendZodWithOpenApi)(
|
563
|
-
var FieldId =
|
564
|
-
var FieldReference =
|
607
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod6.z);
|
608
|
+
var FieldId = import_zod6.z.string().describe("Unique identifier for the field");
|
609
|
+
var FieldReference = import_zod6.z.object({
|
565
610
|
$$field: FieldId
|
566
611
|
}).describe("Reference to a field by its ID");
|
567
612
|
var ParentReference = FieldReference.optional();
|
568
|
-
var BaseField =
|
613
|
+
var BaseField = import_zod6.z.object({
|
569
614
|
id: FieldId,
|
570
615
|
parent: ParentReference,
|
571
|
-
conditionals:
|
572
|
-
required:
|
616
|
+
conditionals: import_zod6.z.array(FieldConditional).default([]).optional(),
|
617
|
+
required: import_zod6.z.boolean().default(false).optional(),
|
573
618
|
placeholder: TranslationConfig.optional(),
|
574
|
-
validation:
|
575
|
-
|
619
|
+
validation: import_zod6.z.array(
|
620
|
+
import_zod6.z.object({
|
576
621
|
validator: Conditional,
|
577
622
|
message: TranslationConfig
|
578
623
|
})
|
579
624
|
).default([]).optional(),
|
580
625
|
label: TranslationConfig,
|
581
626
|
helperText: TranslationConfig.optional(),
|
582
|
-
hideLabel:
|
627
|
+
hideLabel: import_zod6.z.boolean().default(false).optional()
|
583
628
|
});
|
584
629
|
var Divider = BaseField.extend({
|
585
|
-
type:
|
630
|
+
type: import_zod6.z.literal(FieldType.DIVIDER)
|
586
631
|
});
|
587
632
|
var TextField = BaseField.extend({
|
588
|
-
type:
|
633
|
+
type: import_zod6.z.literal(FieldType.TEXT),
|
589
634
|
defaultValue: NonEmptyTextValue.optional(),
|
590
|
-
configuration:
|
591
|
-
maxLength:
|
592
|
-
type:
|
635
|
+
configuration: import_zod6.z.object({
|
636
|
+
maxLength: import_zod6.z.number().optional().describe("Maximum length of the text"),
|
637
|
+
type: import_zod6.z.enum(["text", "password"]).optional(),
|
593
638
|
prefix: TranslationConfig.optional(),
|
594
639
|
postfix: TranslationConfig.optional()
|
595
640
|
}).default({ type: "text" }).optional()
|
596
641
|
}).describe("Text input");
|
597
642
|
var NumberField = BaseField.extend({
|
598
|
-
type:
|
643
|
+
type: import_zod6.z.literal(FieldType.NUMBER),
|
599
644
|
defaultValue: NumberFieldValue.optional(),
|
600
|
-
configuration:
|
601
|
-
min:
|
602
|
-
max:
|
645
|
+
configuration: import_zod6.z.object({
|
646
|
+
min: import_zod6.z.number().optional().describe("Minimum value"),
|
647
|
+
max: import_zod6.z.number().optional().describe("Maximum value"),
|
603
648
|
prefix: TranslationConfig.optional(),
|
604
649
|
postfix: TranslationConfig.optional()
|
605
650
|
}).optional()
|
606
651
|
}).describe("Number input");
|
607
652
|
var TextAreaField = BaseField.extend({
|
608
|
-
type:
|
653
|
+
type: import_zod6.z.literal(FieldType.TEXTAREA),
|
609
654
|
defaultValue: NonEmptyTextValue.optional(),
|
610
|
-
configuration:
|
611
|
-
maxLength:
|
612
|
-
rows:
|
613
|
-
cols:
|
655
|
+
configuration: import_zod6.z.object({
|
656
|
+
maxLength: import_zod6.z.number().optional().describe("Maximum length of the text"),
|
657
|
+
rows: import_zod6.z.number().optional().describe("Number of visible text lines"),
|
658
|
+
cols: import_zod6.z.number().optional().describe("Number of visible columns"),
|
614
659
|
prefix: TranslationConfig.optional(),
|
615
660
|
postfix: TranslationConfig.optional()
|
616
661
|
}).default({ rows: 4 }).optional()
|
617
662
|
}).describe("Multiline text input");
|
618
|
-
var ImageMimeType =
|
663
|
+
var ImageMimeType = import_zod6.z.enum([
|
619
664
|
"image/png",
|
620
665
|
"image/jpg",
|
621
666
|
"image/jpeg",
|
@@ -624,38 +669,38 @@ var ImageMimeType = import_zod5.z.enum([
|
|
624
669
|
var MimeType = ImageMimeType;
|
625
670
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
626
671
|
var SignatureField = BaseField.extend({
|
627
|
-
type:
|
672
|
+
type: import_zod6.z.literal(FieldType.SIGNATURE),
|
628
673
|
signaturePromptLabel: TranslationConfig.describe(
|
629
674
|
"Title of the signature modal"
|
630
675
|
),
|
631
676
|
defaultValue: SignatureFieldValue.optional(),
|
632
|
-
configuration:
|
633
|
-
maxFileSize:
|
677
|
+
configuration: import_zod6.z.object({
|
678
|
+
maxFileSize: import_zod6.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
634
679
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
635
680
|
}).default({
|
636
681
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
637
682
|
})
|
638
683
|
}).describe("Signature input field");
|
639
684
|
var EmailField = BaseField.extend({
|
640
|
-
type:
|
641
|
-
configuration:
|
642
|
-
maxLength:
|
685
|
+
type: import_zod6.z.literal(FieldType.EMAIL),
|
686
|
+
configuration: import_zod6.z.object({
|
687
|
+
maxLength: import_zod6.z.number().optional().describe("Maximum length of the text")
|
643
688
|
}).default({ maxLength: 10 }).optional(),
|
644
689
|
defaultValue: NonEmptyTextValue.optional()
|
645
690
|
});
|
646
691
|
var DateField = BaseField.extend({
|
647
|
-
type:
|
692
|
+
type: import_zod6.z.literal(FieldType.DATE),
|
648
693
|
defaultValue: DateValue.optional(),
|
649
|
-
configuration:
|
694
|
+
configuration: import_zod6.z.object({
|
650
695
|
notice: TranslationConfig.describe(
|
651
696
|
"Text to display above the date input"
|
652
697
|
).optional()
|
653
698
|
}).optional()
|
654
699
|
}).describe("A single date input (dd-mm-YYYY)");
|
655
700
|
var DateRangeField = BaseField.extend({
|
656
|
-
type:
|
701
|
+
type: import_zod6.z.literal(FieldType.DATE_RANGE),
|
657
702
|
defaultValue: DateRangeFieldValue.optional(),
|
658
|
-
configuration:
|
703
|
+
configuration: import_zod6.z.object({
|
659
704
|
notice: TranslationConfig.describe(
|
660
705
|
"Text to display above the date input"
|
661
706
|
).optional()
|
@@ -663,7 +708,7 @@ var DateRangeField = BaseField.extend({
|
|
663
708
|
}).describe(
|
664
709
|
"A date range input ({ rangeStart: dd-mm-YYYY, rangeEnd: dd-mm-YYYY })"
|
665
710
|
);
|
666
|
-
var HtmlFontVariant =
|
711
|
+
var HtmlFontVariant = import_zod6.z.enum([
|
667
712
|
"reg12",
|
668
713
|
"reg14",
|
669
714
|
"reg16",
|
@@ -673,27 +718,31 @@ var HtmlFontVariant = import_zod5.z.enum([
|
|
673
718
|
"h2",
|
674
719
|
"h1"
|
675
720
|
]);
|
721
|
+
var ParagraphConfiguration = import_zod6.z.object({
|
722
|
+
styles: import_zod6.z.object({
|
723
|
+
fontVariant: HtmlFontVariant.optional().describe(
|
724
|
+
"Font variant to use for the paragraph text"
|
725
|
+
),
|
726
|
+
hint: import_zod6.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
727
|
+
}).optional()
|
728
|
+
}).default({});
|
676
729
|
var Paragraph = BaseField.extend({
|
677
|
-
type:
|
730
|
+
type: import_zod6.z.literal(FieldType.PARAGRAPH),
|
678
731
|
defaultValue: NonEmptyTextValue.optional(),
|
679
|
-
configuration:
|
680
|
-
styles: import_zod5.z.object({
|
681
|
-
fontVariant: HtmlFontVariant.optional()
|
682
|
-
}).optional()
|
683
|
-
}).default({})
|
732
|
+
configuration: ParagraphConfiguration
|
684
733
|
}).describe("A read-only HTML <p> paragraph");
|
685
734
|
var PageHeader = BaseField.extend({
|
686
|
-
type:
|
735
|
+
type: import_zod6.z.literal(FieldType.PAGE_HEADER),
|
687
736
|
defaultValue: NonEmptyTextValue.optional()
|
688
737
|
}).describe("A read-only header component for form pages");
|
689
738
|
var File = BaseField.extend({
|
690
|
-
type:
|
739
|
+
type: import_zod6.z.literal(FieldType.FILE),
|
691
740
|
defaultValue: FileFieldValue.optional(),
|
692
|
-
configuration:
|
693
|
-
maxFileSize:
|
741
|
+
configuration: import_zod6.z.object({
|
742
|
+
maxFileSize: import_zod6.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
694
743
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
695
|
-
style:
|
696
|
-
width:
|
744
|
+
style: import_zod6.z.object({
|
745
|
+
width: import_zod6.z.enum(["full", "auto"]).optional().describe(
|
697
746
|
"Whether the file upload button should take the full width of the container or not"
|
698
747
|
)
|
699
748
|
}).optional(),
|
@@ -702,123 +751,103 @@ var File = BaseField.extend({
|
|
702
751
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
703
752
|
})
|
704
753
|
}).describe("File upload");
|
705
|
-
var SelectOption =
|
706
|
-
value:
|
754
|
+
var SelectOption = import_zod6.z.object({
|
755
|
+
value: import_zod6.z.string().describe("The value of the option"),
|
707
756
|
label: TranslationConfig.describe("The label of the option")
|
708
757
|
});
|
709
758
|
var RadioGroup = BaseField.extend({
|
710
|
-
type:
|
759
|
+
type: import_zod6.z.literal(FieldType.RADIO_GROUP),
|
711
760
|
defaultValue: TextValue.optional(),
|
712
|
-
options:
|
713
|
-
configuration:
|
714
|
-
styles:
|
715
|
-
size:
|
761
|
+
options: import_zod6.z.array(SelectOption).describe("A list of options"),
|
762
|
+
configuration: import_zod6.z.object({
|
763
|
+
styles: import_zod6.z.object({
|
764
|
+
size: import_zod6.z.enum(["NORMAL", "LARGE"]).optional()
|
716
765
|
}).optional()
|
717
766
|
}).optional()
|
718
767
|
}).describe("Grouped radio options");
|
719
768
|
var BulletList = BaseField.extend({
|
720
|
-
type:
|
769
|
+
type: import_zod6.z.literal(FieldType.BULLET_LIST),
|
721
770
|
defaultValue: TextValue.optional(),
|
722
|
-
items:
|
723
|
-
configuration:
|
724
|
-
styles:
|
771
|
+
items: import_zod6.z.array(TranslationConfig).describe("A list of items"),
|
772
|
+
configuration: import_zod6.z.object({
|
773
|
+
styles: import_zod6.z.object({
|
725
774
|
fontVariant: HtmlFontVariant.optional()
|
726
775
|
}).optional()
|
727
776
|
}).default({})
|
728
777
|
}).describe("A list of bullet points");
|
729
778
|
var Select = BaseField.extend({
|
730
|
-
type:
|
779
|
+
type: import_zod6.z.literal(FieldType.SELECT),
|
731
780
|
defaultValue: TextValue.optional(),
|
732
|
-
options:
|
781
|
+
options: import_zod6.z.array(SelectOption).describe("A list of options")
|
733
782
|
}).describe("Select input");
|
734
|
-
var NameField = BaseField.extend({
|
735
|
-
type: import_zod5.z.literal(FieldType.NAME),
|
736
|
-
defaultValue: import_zod5.z.object({
|
737
|
-
firstname: NonEmptyTextValue,
|
738
|
-
surname: NonEmptyTextValue
|
739
|
-
}).optional(),
|
740
|
-
configuration: import_zod5.z.object({
|
741
|
-
maxLength: import_zod5.z.number().optional().describe("Maximum length of the text"),
|
742
|
-
prefix: TranslationConfig.optional(),
|
743
|
-
postfix: TranslationConfig.optional()
|
744
|
-
}).optional()
|
745
|
-
}).describe("Name input field");
|
746
|
-
var PhoneField = BaseField.extend({
|
747
|
-
defaultValue: NonEmptyTextValue.optional(),
|
748
|
-
type: import_zod5.z.literal(FieldType.PHONE)
|
749
|
-
}).describe("Phone input field");
|
750
|
-
var IdField = BaseField.extend({
|
751
|
-
defaultValue: NonEmptyTextValue.optional(),
|
752
|
-
type: import_zod5.z.literal(FieldType.ID)
|
753
|
-
}).describe("ID input field");
|
754
783
|
var Checkbox = BaseField.extend({
|
755
|
-
type:
|
784
|
+
type: import_zod6.z.literal(FieldType.CHECKBOX),
|
756
785
|
defaultValue: CheckboxFieldValue.optional()
|
757
786
|
}).describe("Boolean checkbox field");
|
758
787
|
var Country = BaseField.extend({
|
759
|
-
type:
|
788
|
+
type: import_zod6.z.literal(FieldType.COUNTRY),
|
760
789
|
defaultValue: NonEmptyTextValue.optional()
|
761
790
|
}).describe("Country select field");
|
762
|
-
var AdministrativeAreas =
|
791
|
+
var AdministrativeAreas = import_zod6.z.enum([
|
763
792
|
"ADMIN_STRUCTURE",
|
764
793
|
"HEALTH_FACILITY",
|
765
794
|
"CRVS_OFFICE"
|
766
795
|
]);
|
767
|
-
var AdministrativeAreaConfiguration =
|
768
|
-
partOf:
|
769
|
-
$declaration:
|
796
|
+
var AdministrativeAreaConfiguration = import_zod6.z.object({
|
797
|
+
partOf: import_zod6.z.object({
|
798
|
+
$declaration: import_zod6.z.string()
|
770
799
|
}).optional().describe("Parent location"),
|
771
800
|
type: AdministrativeAreas
|
772
801
|
}).describe("Administrative area options");
|
773
802
|
var AdministrativeArea = BaseField.extend({
|
774
|
-
type:
|
803
|
+
type: import_zod6.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
775
804
|
defaultValue: NonEmptyTextValue.optional(),
|
776
805
|
configuration: AdministrativeAreaConfiguration
|
777
806
|
}).describe("Administrative area input field e.g. facility, office");
|
778
807
|
var Location = BaseField.extend({
|
779
|
-
type:
|
808
|
+
type: import_zod6.z.literal(FieldType.LOCATION),
|
780
809
|
defaultValue: NonEmptyTextValue.optional()
|
781
810
|
}).describe("Input field for a location");
|
782
811
|
var FileUploadWithOptions = BaseField.extend({
|
783
|
-
type:
|
784
|
-
options:
|
812
|
+
type: import_zod6.z.literal(FieldType.FILE_WITH_OPTIONS),
|
813
|
+
options: import_zod6.z.array(SelectOption).describe("A list of options"),
|
785
814
|
defaultValue: FileFieldWithOptionValue.optional(),
|
786
|
-
configuration:
|
787
|
-
maxFileSize:
|
815
|
+
configuration: import_zod6.z.object({
|
816
|
+
maxFileSize: import_zod6.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
788
817
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
789
818
|
}).default({
|
790
819
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
791
820
|
})
|
792
821
|
});
|
793
822
|
var Facility = BaseField.extend({
|
794
|
-
type:
|
823
|
+
type: import_zod6.z.literal(FieldType.FACILITY),
|
795
824
|
defaultValue: NonEmptyTextValue.optional()
|
796
825
|
}).describe("Input field for a facility");
|
797
826
|
var Office = BaseField.extend({
|
798
|
-
type:
|
827
|
+
type: import_zod6.z.literal(FieldType.OFFICE),
|
799
828
|
defaultValue: NonEmptyTextValue.optional()
|
800
829
|
}).describe("Input field for an office");
|
801
830
|
var Address = BaseField.extend({
|
802
|
-
type:
|
831
|
+
type: import_zod6.z.literal(FieldType.ADDRESS),
|
803
832
|
defaultValue: AddressFieldValue.optional()
|
804
833
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
805
|
-
var DataEntry =
|
806
|
-
|
834
|
+
var DataEntry = import_zod6.z.union([
|
835
|
+
import_zod6.z.object({
|
807
836
|
label: TranslationConfig,
|
808
|
-
value: TranslationConfig.or(
|
837
|
+
value: TranslationConfig.or(import_zod6.z.string())
|
809
838
|
}),
|
810
|
-
|
811
|
-
fieldId:
|
839
|
+
import_zod6.z.object({
|
840
|
+
fieldId: import_zod6.z.string()
|
812
841
|
})
|
813
842
|
]);
|
814
843
|
var DataField = BaseField.extend({
|
815
|
-
type:
|
816
|
-
configuration:
|
844
|
+
type: import_zod6.z.literal(FieldType.DATA),
|
845
|
+
configuration: import_zod6.z.object({
|
817
846
|
subtitle: TranslationConfig.optional(),
|
818
|
-
data:
|
847
|
+
data: import_zod6.z.array(DataEntry)
|
819
848
|
})
|
820
849
|
}).describe("Data field for displaying read-only data");
|
821
|
-
var FieldConfig =
|
850
|
+
var FieldConfig = import_zod6.z.discriminatedUnion("type", [
|
822
851
|
Address,
|
823
852
|
TextField,
|
824
853
|
NumberField,
|
@@ -830,9 +859,6 @@ var FieldConfig = import_zod5.z.discriminatedUnion("type", [
|
|
830
859
|
BulletList,
|
831
860
|
PageHeader,
|
832
861
|
Select,
|
833
|
-
NameField,
|
834
|
-
PhoneField,
|
835
|
-
IdField,
|
836
862
|
Checkbox,
|
837
863
|
File,
|
838
864
|
Country,
|
@@ -850,14 +876,18 @@ var FieldConfig = import_zod5.z.discriminatedUnion("type", [
|
|
850
876
|
ref: "FieldConfig"
|
851
877
|
});
|
852
878
|
|
879
|
+
// ../commons/src/events/FormConfig.ts
|
880
|
+
var import_zod8 = require("zod");
|
881
|
+
|
853
882
|
// ../commons/src/events/PageConfig.ts
|
883
|
+
var import_zod7 = require("zod");
|
854
884
|
var import_zod_openapi4 = require("zod-openapi");
|
855
|
-
(0, import_zod_openapi4.extendZodWithOpenApi)(
|
856
|
-
var PageTypes =
|
857
|
-
var PageConfigBase =
|
858
|
-
id:
|
885
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod7.z);
|
886
|
+
var PageTypes = import_zod7.z.enum(["FORM", "VERIFICATION"]);
|
887
|
+
var PageConfigBase = import_zod7.z.object({
|
888
|
+
id: import_zod7.z.string().describe("Unique identifier for the page"),
|
859
889
|
title: TranslationConfig.describe("Header title of the page"),
|
860
|
-
fields:
|
890
|
+
fields: import_zod7.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
861
891
|
conditional: Conditional.optional().describe(
|
862
892
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
863
893
|
)
|
@@ -866,13 +896,13 @@ var PageConfigBase = import_zod6.z.object({
|
|
866
896
|
ref: "FormPageConfig"
|
867
897
|
});
|
868
898
|
var FormPageConfig = PageConfigBase.extend({
|
869
|
-
type:
|
899
|
+
type: import_zod7.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
870
900
|
});
|
871
|
-
var VerificationActionConfig =
|
872
|
-
verify:
|
873
|
-
cancel:
|
901
|
+
var VerificationActionConfig = import_zod7.z.object({
|
902
|
+
verify: import_zod7.z.object({ label: TranslationConfig }),
|
903
|
+
cancel: import_zod7.z.object({
|
874
904
|
label: TranslationConfig,
|
875
|
-
confirmation:
|
905
|
+
confirmation: import_zod7.z.object({
|
876
906
|
title: TranslationConfig,
|
877
907
|
body: TranslationConfig
|
878
908
|
})
|
@@ -882,112 +912,15 @@ var VerificationActionConfig = import_zod6.z.object({
|
|
882
912
|
ref: "VerificationActionConfig"
|
883
913
|
});
|
884
914
|
var VerificationPageConfig = FormPageConfig.extend({
|
885
|
-
type:
|
915
|
+
type: import_zod7.z.literal(PageTypes.enum.VERIFICATION),
|
886
916
|
actions: VerificationActionConfig
|
887
917
|
});
|
888
|
-
var PageConfig =
|
918
|
+
var PageConfig = import_zod7.z.discriminatedUnion("type", [
|
889
919
|
FormPageConfig,
|
890
920
|
VerificationPageConfig
|
891
921
|
]);
|
892
922
|
|
893
|
-
// ../commons/src/events/ActionType.ts
|
894
|
-
var import_zod7 = require("zod");
|
895
|
-
var ActionType = {
|
896
|
-
// Pre-declaration actions
|
897
|
-
DELETE: "DELETE",
|
898
|
-
CREATE: "CREATE",
|
899
|
-
NOTIFY: "NOTIFY",
|
900
|
-
// Declaration actions
|
901
|
-
DECLARE: "DECLARE",
|
902
|
-
VALIDATE: "VALIDATE",
|
903
|
-
REGISTER: "REGISTER",
|
904
|
-
// Declaration system actions. Non-configurable.
|
905
|
-
DETECT_DUPLICATE: "DETECT_DUPLICATE",
|
906
|
-
REJECT: "REJECT",
|
907
|
-
// REJECT_DECLARATION
|
908
|
-
MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE",
|
909
|
-
// MARK_AS_DUPLICATE
|
910
|
-
ARCHIVE: "ARCHIVE",
|
911
|
-
// Record actions
|
912
|
-
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
913
|
-
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
914
|
-
REJECT_CORRECTION: "REJECT_CORRECTION",
|
915
|
-
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
916
|
-
// General actions
|
917
|
-
READ: "READ",
|
918
|
-
ASSIGN: "ASSIGN",
|
919
|
-
UNASSIGN: "UNASSIGN"
|
920
|
-
};
|
921
|
-
var ConfirmableActions = [
|
922
|
-
ActionType.NOTIFY,
|
923
|
-
ActionType.DECLARE,
|
924
|
-
ActionType.VALIDATE,
|
925
|
-
ActionType.REGISTER,
|
926
|
-
ActionType.REJECT,
|
927
|
-
ActionType.ARCHIVE,
|
928
|
-
ActionType.PRINT_CERTIFICATE
|
929
|
-
];
|
930
|
-
var ActionTypes = import_zod7.z.enum([
|
931
|
-
"DELETE",
|
932
|
-
"CREATE",
|
933
|
-
"NOTIFY",
|
934
|
-
"DECLARE",
|
935
|
-
"VALIDATE",
|
936
|
-
"REGISTER",
|
937
|
-
"DETECT_DUPLICATE",
|
938
|
-
"REJECT",
|
939
|
-
"MARKED_AS_DUPLICATE",
|
940
|
-
"ARCHIVE",
|
941
|
-
"PRINT_CERTIFICATE",
|
942
|
-
"REQUEST_CORRECTION",
|
943
|
-
"REJECT_CORRECTION",
|
944
|
-
"APPROVE_CORRECTION",
|
945
|
-
"READ",
|
946
|
-
"ASSIGN",
|
947
|
-
"UNASSIGN"
|
948
|
-
]);
|
949
|
-
var declarationActionValues = [
|
950
|
-
ActionTypes.enum.DECLARE,
|
951
|
-
ActionTypes.enum.VALIDATE,
|
952
|
-
ActionTypes.enum.REGISTER
|
953
|
-
];
|
954
|
-
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
955
|
-
var declarationUpdateActionValues = [
|
956
|
-
...declarationActionValues,
|
957
|
-
ActionTypes.enum.REQUEST_CORRECTION
|
958
|
-
];
|
959
|
-
var DeclarationUpdateActions = ActionTypes.extract(
|
960
|
-
declarationUpdateActionValues
|
961
|
-
);
|
962
|
-
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
963
|
-
var writeActions = ActionTypes.exclude([
|
964
|
-
ActionType.CREATE,
|
965
|
-
ActionType.READ,
|
966
|
-
ActionType.ASSIGN,
|
967
|
-
ActionType.UNASSIGN
|
968
|
-
]);
|
969
|
-
var workqueueActions = ActionTypes.exclude([
|
970
|
-
ActionType.CREATE,
|
971
|
-
ActionType.NOTIFY,
|
972
|
-
ActionType.DETECT_DUPLICATE,
|
973
|
-
ActionType.REJECT,
|
974
|
-
ActionType.MARKED_AS_DUPLICATE,
|
975
|
-
ActionType.ARCHIVE,
|
976
|
-
ActionType.REQUEST_CORRECTION,
|
977
|
-
ActionType.REJECT_CORRECTION,
|
978
|
-
ActionType.APPROVE_CORRECTION
|
979
|
-
]);
|
980
|
-
var META_ACTIONS = [
|
981
|
-
ActionType.ASSIGN,
|
982
|
-
ActionType.UNASSIGN,
|
983
|
-
ActionType.READ
|
984
|
-
];
|
985
|
-
function isMetaAction(actionType) {
|
986
|
-
return META_ACTIONS.includes(actionType);
|
987
|
-
}
|
988
|
-
|
989
923
|
// ../commons/src/events/FormConfig.ts
|
990
|
-
var import_zod8 = require("zod");
|
991
924
|
var DeclarationFormConfig = import_zod8.z.object({
|
992
925
|
label: TranslationConfig.describe("Human readable description of the form"),
|
993
926
|
pages: import_zod8.z.array(FormPageConfig)
|
@@ -1069,8 +1002,7 @@ var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
1069
1002
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
1070
1003
|
import_zod9.z.object({
|
1071
1004
|
type: import_zod9.z.literal(ActionType.REQUEST_CORRECTION),
|
1072
|
-
|
1073
|
-
additionalDetailsForm: import_zod9.z.array(PageConfig)
|
1005
|
+
correctionForm: ActionFormConfig
|
1074
1006
|
})
|
1075
1007
|
);
|
1076
1008
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
@@ -1238,7 +1170,8 @@ var Field = BaseField2.extend({
|
|
1238
1170
|
value: TranslationConfig.describe(
|
1239
1171
|
"Summary field value. Can utilise values defined in configuration and EventMetadata"
|
1240
1172
|
),
|
1241
|
-
label: TranslationConfig
|
1173
|
+
label: TranslationConfig,
|
1174
|
+
emptyValueMessage: TranslationConfig.optional()
|
1242
1175
|
}).describe("Custom configured field");
|
1243
1176
|
var SummaryConfig = import_zod13.z.object({
|
1244
1177
|
fields: import_zod13.z.array(import_zod13.z.union([Field, ReferenceField])).describe("Fields rendered in summary view.")
|
@@ -1254,35 +1187,35 @@ var BaseField3 = import_zod14.z.object({
|
|
1254
1187
|
options: import_zod14.z.array(SelectOption).optional(),
|
1255
1188
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
1256
1189
|
`
|
1257
|
-
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
1190
|
+
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
1258
1191
|
when rendering search parameter labels \u2014 for example, in the search results page to indicate which fields were used in the search.
|
1259
1192
|
|
1260
|
-
For example, a field config like { id: "child.
|
1193
|
+
For example, a field config like { id: "child.firstname", label: { defaultMessage: "First Name(s)" } } would render as "First Name(s)" by default.
|
1261
1194
|
|
1262
1195
|
A field config like { id: "mother.firstname", label: { defaultMessage: "First Name(s)" } } would also render as "First Name(s)" by default.
|
1263
1196
|
|
1264
|
-
So, if both child.
|
1197
|
+
So, if both child.firstname and mother.firstname are used in a search, the resulting search criteria labels would be "First Name(s)", "First Name(s)",
|
1265
1198
|
which is ambiguous.
|
1266
1199
|
|
1267
|
-
Now, if we treat the field ID prefix as a label (e.g., "applicant.firstname" \u2192 "Applicant"), and the field label is already
|
1268
|
-
descriptive \u2014 like { id: "applicant.firstname", label: { defaultMessage: "Applicant's First Name" } } \u2014 then the resulting
|
1200
|
+
Now, if we treat the field ID prefix as a label (e.g., "applicant.firstname" \u2192 "Applicant"), and the field label is already
|
1201
|
+
descriptive \u2014 like { id: "applicant.firstname", label: { defaultMessage: "Applicant's First Name" } } \u2014 then the resulting
|
1269
1202
|
label would be "Applicant Applicant's First Name", which is redundant and awkward.
|
1270
1203
|
|
1271
|
-
By setting searchCriteriaLabelPrefix to a translation config object, we can explicitly define the desired prefix
|
1204
|
+
By setting searchCriteriaLabelPrefix to a translation config object, we can explicitly define the desired prefix
|
1272
1205
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
1273
1206
|
`
|
1274
1207
|
),
|
1275
1208
|
conditionals: import_zod14.z.array(FieldConditional).default([]).optional().describe(
|
1276
1209
|
`
|
1277
1210
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
1278
|
-
|
1279
|
-
For example, Informant fields in the declaration form may have conditional logic
|
1280
|
-
that hides them based on other field values. Since the advanced search form reuses
|
1211
|
+
|
1212
|
+
For example, Informant fields in the declaration form may have conditional logic
|
1213
|
+
that hides them based on other field values. Since the advanced search form reuses
|
1281
1214
|
the declaration form config, those same conditionals would apply by default.
|
1282
|
-
|
1215
|
+
|
1283
1216
|
However, in advanced search we often want to make all Informant fields searchable,
|
1284
|
-
regardless of their original visibility logic. To do this, we explicitly set their
|
1285
|
-
'conditionals' to an empty array ('[]') in the search config. This ensures they
|
1217
|
+
regardless of their original visibility logic. To do this, we explicitly set their
|
1218
|
+
'conditionals' to an empty array ('[]') in the search config. This ensures they
|
1286
1219
|
are always rendered in the advanced search form.
|
1287
1220
|
`
|
1288
1221
|
)
|
@@ -1323,16 +1256,9 @@ var import_lodash = require("lodash");
|
|
1323
1256
|
var import_zod16 = require("zod");
|
1324
1257
|
var import_zod_openapi7 = require("zod-openapi");
|
1325
1258
|
|
1326
|
-
// ../commons/src/uuid.ts
|
1327
|
-
var import_uuid = require("uuid");
|
1328
|
-
var import_zod15 = require("zod");
|
1329
|
-
var UUID = import_zod15.z.string().uuid().brand("UUID");
|
1330
|
-
function getUUID() {
|
1331
|
-
return (0, import_uuid.v4)();
|
1332
|
-
}
|
1333
|
-
|
1334
1259
|
// ../commons/src/events/CreatedAtLocation.ts
|
1335
|
-
var
|
1260
|
+
var import_zod15 = require("zod");
|
1261
|
+
var CreatedAtLocation = import_zod15.z.string().nullish();
|
1336
1262
|
|
1337
1263
|
// ../commons/src/events/ActionDocument.ts
|
1338
1264
|
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod16.z);
|
@@ -1344,7 +1270,7 @@ var ActionStatus = {
|
|
1344
1270
|
Rejected: "Rejected"
|
1345
1271
|
};
|
1346
1272
|
var ActionBase = import_zod16.z.object({
|
1347
|
-
id:
|
1273
|
+
id: import_zod16.z.string(),
|
1348
1274
|
transactionId: import_zod16.z.string(),
|
1349
1275
|
createdAt: import_zod16.z.string().datetime(),
|
1350
1276
|
createdBy: import_zod16.z.string(),
|
@@ -1352,14 +1278,14 @@ var ActionBase = import_zod16.z.object({
|
|
1352
1278
|
createdBySignature: import_zod16.z.string().nullish().describe("Reference to signature of the user who created the action"),
|
1353
1279
|
createdAtLocation: CreatedAtLocation,
|
1354
1280
|
declaration: ActionUpdate,
|
1355
|
-
annotation: ActionUpdate.optional()
|
1281
|
+
annotation: ActionUpdate.optional(),
|
1356
1282
|
status: import_zod16.z.enum([
|
1357
1283
|
ActionStatus.Requested,
|
1358
1284
|
ActionStatus.Accepted,
|
1359
1285
|
ActionStatus.Rejected
|
1360
1286
|
]),
|
1361
1287
|
// If the action is an asynchronous confirmation for another action, we will save the original action id here.
|
1362
|
-
originalActionId:
|
1288
|
+
originalActionId: import_zod16.z.string().optional()
|
1363
1289
|
});
|
1364
1290
|
var AssignedAction = ActionBase.merge(
|
1365
1291
|
import_zod16.z.object({
|
@@ -1520,8 +1446,6 @@ function mapFieldTypeToZod(type, required) {
|
|
1520
1446
|
case FieldType.ADMINISTRATIVE_AREA:
|
1521
1447
|
case FieldType.FACILITY:
|
1522
1448
|
case FieldType.OFFICE:
|
1523
|
-
case FieldType.PHONE:
|
1524
|
-
case FieldType.ID:
|
1525
1449
|
schema = required ? NonEmptyTextValue : TextValue;
|
1526
1450
|
break;
|
1527
1451
|
case FieldType.NUMBER:
|
@@ -1543,9 +1467,6 @@ function mapFieldTypeToZod(type, required) {
|
|
1543
1467
|
case FieldType.DATA:
|
1544
1468
|
schema = DataFieldValue;
|
1545
1469
|
break;
|
1546
|
-
case FieldType.NAME:
|
1547
|
-
schema = required ? NameFieldValue : NameFieldUpdateValue;
|
1548
|
-
break;
|
1549
1470
|
}
|
1550
1471
|
return required ? schema : schema.nullish();
|
1551
1472
|
}
|
@@ -1556,6 +1477,58 @@ function createValidationSchema(config) {
|
|
1556
1477
|
}
|
1557
1478
|
return import_zod17.z.object(shape);
|
1558
1479
|
}
|
1480
|
+
function mapFieldTypeToMockValue(field2, i) {
|
1481
|
+
switch (field2.type) {
|
1482
|
+
case FieldType.DIVIDER:
|
1483
|
+
case FieldType.TEXT:
|
1484
|
+
case FieldType.TEXTAREA:
|
1485
|
+
case FieldType.BULLET_LIST:
|
1486
|
+
case FieldType.PAGE_HEADER:
|
1487
|
+
case FieldType.LOCATION:
|
1488
|
+
case FieldType.SELECT:
|
1489
|
+
case FieldType.COUNTRY:
|
1490
|
+
case FieldType.RADIO_GROUP:
|
1491
|
+
case FieldType.PARAGRAPH:
|
1492
|
+
case FieldType.ADMINISTRATIVE_AREA:
|
1493
|
+
case FieldType.FACILITY:
|
1494
|
+
case FieldType.OFFICE:
|
1495
|
+
return `${field2.id}-${field2.type}-${i}`;
|
1496
|
+
case FieldType.NUMBER:
|
1497
|
+
return 19;
|
1498
|
+
case FieldType.EMAIL:
|
1499
|
+
return "test@opencrvs.org";
|
1500
|
+
case FieldType.ADDRESS:
|
1501
|
+
return {
|
1502
|
+
country: "FAR",
|
1503
|
+
addressType: AddressType.DOMESTIC,
|
1504
|
+
province: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
1505
|
+
district: "5ef450bc-712d-48ad-93f3-8da0fa453baa",
|
1506
|
+
urbanOrRural: "URBAN",
|
1507
|
+
town: "Example Town",
|
1508
|
+
residentialArea: "Example Residential Area",
|
1509
|
+
street: "Example Street",
|
1510
|
+
number: "55",
|
1511
|
+
zipCode: "123456"
|
1512
|
+
};
|
1513
|
+
case FieldType.DATE:
|
1514
|
+
return "2021-01-01";
|
1515
|
+
case FieldType.DATE_RANGE:
|
1516
|
+
return ["2021-01-01", "2021-01-02"];
|
1517
|
+
case FieldType.CHECKBOX:
|
1518
|
+
return true;
|
1519
|
+
case FieldType.SIGNATURE:
|
1520
|
+
case FieldType.FILE:
|
1521
|
+
return {
|
1522
|
+
filename: "4f095fc4-4312-4de2-aa38-86dcc0f71044.png",
|
1523
|
+
originalFilename: "abcd.png",
|
1524
|
+
type: "image/png"
|
1525
|
+
};
|
1526
|
+
case FieldType.FILE_WITH_OPTIONS:
|
1527
|
+
return null;
|
1528
|
+
case FieldType.DATA:
|
1529
|
+
return {};
|
1530
|
+
}
|
1531
|
+
}
|
1559
1532
|
function mapFieldTypeToEmptyValue(field2) {
|
1560
1533
|
switch (field2.type) {
|
1561
1534
|
case FieldType.DIVIDER:
|
@@ -1577,9 +1550,6 @@ function mapFieldTypeToEmptyValue(field2) {
|
|
1577
1550
|
case FieldType.CHECKBOX:
|
1578
1551
|
case FieldType.DATE_RANGE:
|
1579
1552
|
case FieldType.DATA:
|
1580
|
-
case FieldType.NAME:
|
1581
|
-
case FieldType.PHONE:
|
1582
|
-
case FieldType.ID:
|
1583
1553
|
return null;
|
1584
1554
|
case FieldType.ADDRESS:
|
1585
1555
|
return {
|
@@ -1624,15 +1594,6 @@ var isTextFieldType = (field2) => {
|
|
1624
1594
|
var isNumberFieldType = (field2) => {
|
1625
1595
|
return field2.config.type === FieldType.NUMBER;
|
1626
1596
|
};
|
1627
|
-
var isNameFieldType = (field2) => {
|
1628
|
-
return field2.config.type === FieldType.NAME;
|
1629
|
-
};
|
1630
|
-
var isPhoneFieldType = (field2) => {
|
1631
|
-
return field2.config.type === FieldType.PHONE;
|
1632
|
-
};
|
1633
|
-
var isIdFieldType = (field2) => {
|
1634
|
-
return field2.config.type === FieldType.ID;
|
1635
|
-
};
|
1636
1597
|
var isTextAreaFieldType = (field2) => {
|
1637
1598
|
return field2.config.type === FieldType.TEXTAREA;
|
1638
1599
|
};
|
@@ -1767,11 +1728,6 @@ var errorMessages = {
|
|
1767
1728
|
defaultMessage: "Invalid input",
|
1768
1729
|
description: "Error message when generic field is invalid",
|
1769
1730
|
id: "v2.error.invalid"
|
1770
|
-
},
|
1771
|
-
unexpectedField: {
|
1772
|
-
defaultMessage: "Unexpected field",
|
1773
|
-
description: "Error message when field is not expected",
|
1774
|
-
id: "v2.error.unexpectedField"
|
1775
1731
|
}
|
1776
1732
|
};
|
1777
1733
|
function createIntlError(message) {
|
@@ -1867,44 +1823,11 @@ function runFieldValidations({
|
|
1867
1823
|
errors: [...fieldValidationResult, ...customValidationResults]
|
1868
1824
|
};
|
1869
1825
|
}
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
return {
|
1876
|
-
message,
|
1877
|
-
validator: {
|
1878
|
-
...jsonSchema,
|
1879
|
-
properties: {
|
1880
|
-
$form: {
|
1881
|
-
type: "object",
|
1882
|
-
properties: $form.properties?.[fieldId]?.properties || {},
|
1883
|
-
required: $form.properties?.[fieldId]?.required || []
|
1884
|
-
}
|
1885
|
-
}
|
1886
|
-
}
|
1887
|
-
};
|
1888
|
-
}
|
1889
|
-
if (!$form.properties?.[fieldId]) {
|
1890
|
-
return null;
|
1891
|
-
}
|
1892
|
-
return {
|
1893
|
-
message,
|
1894
|
-
validator: {
|
1895
|
-
...jsonSchema,
|
1896
|
-
properties: {
|
1897
|
-
$form: {
|
1898
|
-
type: "object",
|
1899
|
-
properties: {
|
1900
|
-
[fieldId]: $form.properties?.[fieldId]
|
1901
|
-
},
|
1902
|
-
required: $form.required?.includes(fieldId) ? [fieldId] : []
|
1903
|
-
}
|
1904
|
-
}
|
1905
|
-
}
|
1906
|
-
};
|
1907
|
-
}).filter((x) => x !== null);
|
1826
|
+
|
1827
|
+
// ../commons/src/uuid.ts
|
1828
|
+
var import_uuid = require("uuid");
|
1829
|
+
function getUUID() {
|
1830
|
+
return (0, import_uuid.v4)();
|
1908
1831
|
}
|
1909
1832
|
|
1910
1833
|
// ../commons/src/utils.ts
|
@@ -1930,10 +1853,7 @@ function getDeclaration(configuration) {
|
|
1930
1853
|
}
|
1931
1854
|
var getActionAnnotationFields = (actionConfig) => {
|
1932
1855
|
if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
|
1933
|
-
return
|
1934
|
-
...actionConfig.onboardingForm.flatMap(({ fields }) => fields),
|
1935
|
-
...actionConfig.additionalDetailsForm.flatMap(({ fields }) => fields)
|
1936
|
-
];
|
1856
|
+
return actionConfig.correctionForm.pages.flatMap(({ fields }) => fields);
|
1937
1857
|
}
|
1938
1858
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
1939
1859
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
@@ -1946,17 +1866,10 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
1946
1866
|
function getAllAnnotationFields(config) {
|
1947
1867
|
return (0, import_lodash.flattenDeep)(config.actions.map(getActionAnnotationFields));
|
1948
1868
|
}
|
1949
|
-
function getAllUniqueFields(eventConfig) {
|
1950
|
-
return (0, import_lodash.uniqBy)(getDeclarationFields(eventConfig), (field2) => field2.id);
|
1951
|
-
}
|
1952
|
-
function getDeclarationFieldById(config, fieldId) {
|
1953
|
-
const field2 = getAllUniqueFields(config).find((f) => f.id === fieldId);
|
1954
|
-
return getOrThrow(field2, `Field with id ${fieldId} not found in event config`);
|
1955
|
-
}
|
1956
1869
|
var findRecordActionPages = (config, actionType) => {
|
1957
1870
|
const action = config.actions.find((a) => a.type === actionType);
|
1958
1871
|
if (action?.type === ActionType.REQUEST_CORRECTION) {
|
1959
|
-
return
|
1872
|
+
return action.correctionForm.pages;
|
1960
1873
|
}
|
1961
1874
|
if (action?.type === ActionType.PRINT_CERTIFICATE) {
|
1962
1875
|
return action.printForm.pages;
|
@@ -2014,7 +1927,7 @@ function createEmptyDraft(eventId, draftId, actionType) {
|
|
2014
1927
|
annotation: {},
|
2015
1928
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
2016
1929
|
createdBy: "@todo",
|
2017
|
-
createdAtLocation: "
|
1930
|
+
createdAtLocation: "@todo",
|
2018
1931
|
status: ActionStatus.Accepted,
|
2019
1932
|
transactionId: "@todo",
|
2020
1933
|
createdByRole: "@todo"
|
@@ -2029,13 +1942,10 @@ function getVisibleVerificationPageIds(pages, annotation) {
|
|
2029
1942
|
}
|
2030
1943
|
function getActionVerificationPageIds(actionConfig, annotation) {
|
2031
1944
|
if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
|
2032
|
-
return
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
annotation
|
2037
|
-
)
|
2038
|
-
];
|
1945
|
+
return getVisibleVerificationPageIds(
|
1946
|
+
actionConfig.correctionForm.pages,
|
1947
|
+
annotation
|
1948
|
+
);
|
2039
1949
|
}
|
2040
1950
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
2041
1951
|
return getVisibleVerificationPageIds(
|
@@ -2058,9 +1968,8 @@ function omitHiddenAnnotationFields(actionConfig, declaration, annotation) {
|
|
2058
1968
|
);
|
2059
1969
|
}
|
2060
1970
|
function deepMerge(currentDocument, actionDocument) {
|
2061
|
-
const currentDocumentClone = (0, import_lodash.cloneDeep)(currentDocument);
|
2062
1971
|
return (0, import_lodash.mergeWith)(
|
2063
|
-
|
1972
|
+
currentDocument,
|
2064
1973
|
actionDocument,
|
2065
1974
|
(previousValue, incomingValue) => {
|
2066
1975
|
if (incomingValue === void 0) {
|
@@ -2108,12 +2017,6 @@ function getMixedPath(obj, path, defaultValue) {
|
|
2108
2017
|
const result = resolve(obj, parts);
|
2109
2018
|
return (0, import_lodash.isNil)(result) ? defaultValue : result;
|
2110
2019
|
}
|
2111
|
-
function getEventConfigById(eventConfigs, id) {
|
2112
|
-
const eventConfig = eventConfigs.find(
|
2113
|
-
(eventConfiguration) => eventConfiguration.id === id
|
2114
|
-
);
|
2115
|
-
return getOrThrow(eventConfig, `Event config for ${id} not found`);
|
2116
|
-
}
|
2117
2020
|
|
2118
2021
|
// ../commons/src/events/EventConfig.ts
|
2119
2022
|
var import_zod_openapi8 = require("zod-openapi");
|
@@ -2400,7 +2303,7 @@ function createFieldConditionals(fieldId) {
|
|
2400
2303
|
properties: {
|
2401
2304
|
[fieldId]: {
|
2402
2305
|
type: ["string", "boolean"],
|
2403
|
-
const: { $data:
|
2306
|
+
const: { $data: `1/${comparedFieldId}` }
|
2404
2307
|
},
|
2405
2308
|
[comparedFieldId]: { type: ["string", "boolean"] }
|
2406
2309
|
},
|
@@ -2510,23 +2413,6 @@ function createFieldConditionals(fieldId) {
|
|
2510
2413
|
}
|
2511
2414
|
},
|
2512
2415
|
required: [fieldId]
|
2513
|
-
}),
|
2514
|
-
getId: () => ({ fieldId }),
|
2515
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2516
|
-
object: (options) => defineFormConditional({
|
2517
|
-
type: "object",
|
2518
|
-
properties: {
|
2519
|
-
[fieldId]: {
|
2520
|
-
type: "object",
|
2521
|
-
properties: Object.fromEntries(
|
2522
|
-
Object.entries(options).map(([key, value]) => {
|
2523
|
-
return [key, value.properties.$form.properties[key]];
|
2524
|
-
})
|
2525
|
-
),
|
2526
|
-
required: Object.keys(options)
|
2527
|
-
}
|
2528
|
-
},
|
2529
|
-
required: [fieldId]
|
2530
2416
|
})
|
2531
2417
|
};
|
2532
2418
|
}
|
@@ -2606,18 +2492,30 @@ var import_zod21 = require("zod");
|
|
2606
2492
|
|
2607
2493
|
// ../commons/src/events/EventMetadata.ts
|
2608
2494
|
var import_zod20 = require("zod");
|
2609
|
-
var EventStatus =
|
2610
|
-
"CREATED",
|
2611
|
-
"NOTIFIED",
|
2612
|
-
"DECLARED",
|
2613
|
-
"VALIDATED",
|
2614
|
-
"REGISTERED",
|
2615
|
-
"CERTIFIED",
|
2616
|
-
"REJECTED",
|
2617
|
-
"ARCHIVED"
|
2618
|
-
|
2495
|
+
var EventStatus = {
|
2496
|
+
CREATED: "CREATED",
|
2497
|
+
NOTIFIED: "NOTIFIED",
|
2498
|
+
DECLARED: "DECLARED",
|
2499
|
+
VALIDATED: "VALIDATED",
|
2500
|
+
REGISTERED: "REGISTERED",
|
2501
|
+
CERTIFIED: "CERTIFIED",
|
2502
|
+
REJECTED: "REJECTED",
|
2503
|
+
ARCHIVED: "ARCHIVED"
|
2504
|
+
};
|
2505
|
+
var eventStatusValues = [
|
2506
|
+
EventStatus.CREATED,
|
2507
|
+
EventStatus.NOTIFIED,
|
2508
|
+
EventStatus.DECLARED,
|
2509
|
+
EventStatus.VALIDATED,
|
2510
|
+
EventStatus.REGISTERED,
|
2511
|
+
EventStatus.CERTIFIED,
|
2512
|
+
EventStatus.REJECTED,
|
2513
|
+
EventStatus.ARCHIVED
|
2514
|
+
];
|
2515
|
+
var EventStatusEnum = import_zod20.z.enum(eventStatusValues);
|
2619
2516
|
var CustomFlags = {
|
2620
|
-
CERTIFICATE_PRINTED: "certificate-printed"
|
2517
|
+
CERTIFICATE_PRINTED: "certificate-printed",
|
2518
|
+
CORRECTION_REQUESTED: "correction-requested"
|
2621
2519
|
};
|
2622
2520
|
var Flag = import_zod20.z.string().regex(
|
2623
2521
|
new RegExp(
|
@@ -2627,6 +2525,8 @@ var Flag = import_zod20.z.string().regex(
|
|
2627
2525
|
),
|
2628
2526
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
2629
2527
|
).or(import_zod20.z.nativeEnum(CustomFlags));
|
2528
|
+
var eventStatuses = Object.values(EventStatus);
|
2529
|
+
var EventStatuses = import_zod20.z.nativeEnum(EventStatus);
|
2630
2530
|
var ZodDate = import_zod20.z.string().date();
|
2631
2531
|
var ActionCreationMetadata = import_zod20.z.object({
|
2632
2532
|
createdAt: import_zod20.z.string().datetime().describe("The timestamp when the action request was created."),
|
@@ -2644,13 +2544,13 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
2644
2544
|
)
|
2645
2545
|
});
|
2646
2546
|
var LegalStatuses = import_zod20.z.object({
|
2647
|
-
[EventStatus.
|
2648
|
-
[EventStatus.
|
2547
|
+
[EventStatus.DECLARED]: ActionCreationMetadata.nullish(),
|
2548
|
+
[EventStatus.REGISTERED]: RegistrationCreationMetadata.nullish()
|
2649
2549
|
});
|
2650
2550
|
var EventMetadata = import_zod20.z.object({
|
2651
|
-
id:
|
2551
|
+
id: import_zod20.z.string(),
|
2652
2552
|
type: import_zod20.z.string().describe("The type of event, such as birth, death, or marriage."),
|
2653
|
-
status:
|
2553
|
+
status: EventStatuses,
|
2654
2554
|
legalStatuses: LegalStatuses.describe(
|
2655
2555
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
2656
2556
|
),
|
@@ -2662,9 +2562,7 @@ var EventMetadata = import_zod20.z.object({
|
|
2662
2562
|
"Location of the user who created the event."
|
2663
2563
|
),
|
2664
2564
|
createdBySignature: import_zod20.z.string().nullish().describe("Signature of the user who created the event."),
|
2665
|
-
updatedAtLocation:
|
2666
|
-
"Location of the user who last updated the declaration."
|
2667
|
-
),
|
2565
|
+
updatedAtLocation: import_zod20.z.string().nullish().describe("Location of the user who last updated the declaration."),
|
2668
2566
|
updatedAt: import_zod20.z.string().datetime().describe("Timestamp of the most recent declaration update."),
|
2669
2567
|
assignedTo: import_zod20.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
2670
2568
|
updatedBy: import_zod20.z.string().nullish().describe("ID of the user who last updated the declaration."),
|
@@ -2817,13 +2715,13 @@ var AnyOf = import_zod22.z.object({
|
|
2817
2715
|
});
|
2818
2716
|
var ExactStatus = import_zod22.z.object({
|
2819
2717
|
type: import_zod22.z.literal("exact"),
|
2820
|
-
term:
|
2718
|
+
term: EventStatusEnum
|
2821
2719
|
}).openapi({
|
2822
2720
|
ref: "ExactStatus"
|
2823
2721
|
});
|
2824
2722
|
var AnyOfStatus = import_zod22.z.object({
|
2825
2723
|
type: import_zod22.z.literal("anyOf"),
|
2826
|
-
terms: import_zod22.z.array(
|
2724
|
+
terms: import_zod22.z.array(EventStatusEnum)
|
2827
2725
|
}).openapi({
|
2828
2726
|
ref: "AnyOfStatus"
|
2829
2727
|
});
|
@@ -2860,7 +2758,6 @@ var QueryExpression = import_zod22.z.object({
|
|
2860
2758
|
"legalStatus.REGISTERED.createdAtLocation": import_zod22.z.optional(
|
2861
2759
|
import_zod22.z.union([Within, Exact])
|
2862
2760
|
),
|
2863
|
-
"legalStatus.REGISTERED.registrationNumber": import_zod22.z.optional(Exact),
|
2864
2761
|
createdAtLocation: import_zod22.z.optional(import_zod22.z.union([Within, Exact])),
|
2865
2762
|
updatedAtLocation: import_zod22.z.optional(import_zod22.z.union([Within, Exact])),
|
2866
2763
|
assignedTo: import_zod22.z.optional(Exact),
|
@@ -2884,13 +2781,22 @@ var QueryType = import_zod22.z.object({
|
|
2884
2781
|
}
|
2885
2782
|
return val;
|
2886
2783
|
},
|
2887
|
-
import_zod22.z.array(QueryExpression).
|
2784
|
+
import_zod22.z.array(QueryExpression).openapi({
|
2888
2785
|
default: [
|
2889
2786
|
{
|
2890
2787
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
2891
2788
|
status: {
|
2892
2789
|
type: "anyOf",
|
2893
|
-
terms:
|
2790
|
+
terms: [
|
2791
|
+
"CREATED",
|
2792
|
+
"NOTIFIED",
|
2793
|
+
"DECLARED",
|
2794
|
+
"VALIDATED",
|
2795
|
+
"REGISTERED",
|
2796
|
+
"CERTIFIED",
|
2797
|
+
"REJECTED",
|
2798
|
+
"ARCHIVED"
|
2799
|
+
]
|
2894
2800
|
},
|
2895
2801
|
updatedAt: {
|
2896
2802
|
type: "range",
|
@@ -3054,7 +2960,7 @@ var AvailableIcons = import_zod24.z.enum([
|
|
3054
2960
|
]);
|
3055
2961
|
|
3056
2962
|
// ../commons/src/events/WorkqueueConfig.ts
|
3057
|
-
var
|
2963
|
+
var dateOfEventColumn = defineWorkqueuesColumns([
|
3058
2964
|
{
|
3059
2965
|
label: {
|
3060
2966
|
id: "workqueues.dateOfEvent",
|
@@ -3072,10 +2978,6 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
3072
2978
|
value: event.field("updatedAt")
|
3073
2979
|
}
|
3074
2980
|
]);
|
3075
|
-
var WorkqueueActionsWithDefault = import_zod25.z.enum([
|
3076
|
-
...workqueueActions.options,
|
3077
|
-
"DEFAULT"
|
3078
|
-
]);
|
3079
2981
|
var WorkqueueConfig = import_zod25.z.object({
|
3080
2982
|
slug: import_zod25.z.string().describe("Determines the url of the workqueue."),
|
3081
2983
|
name: TranslationConfig.describe(
|
@@ -3084,11 +2986,11 @@ var WorkqueueConfig = import_zod25.z.object({
|
|
3084
2986
|
query: CountryConfigQueryType,
|
3085
2987
|
actions: import_zod25.z.array(
|
3086
2988
|
import_zod25.z.object({
|
3087
|
-
type:
|
2989
|
+
type: import_zod25.z.string(),
|
3088
2990
|
conditionals: import_zod25.z.array(Conditional).optional()
|
3089
2991
|
})
|
3090
2992
|
),
|
3091
|
-
columns: import_zod25.z.array(WorkqueueColumn).default(
|
2993
|
+
columns: import_zod25.z.array(WorkqueueColumn).default(dateOfEventColumn),
|
3092
2994
|
icon: AvailableIcons
|
3093
2995
|
}).describe("Configuration for workqueue.");
|
3094
2996
|
var WorkqueueConfigInput = import_zod25.z.object({
|
@@ -3099,11 +3001,11 @@ var WorkqueueConfigInput = import_zod25.z.object({
|
|
3099
3001
|
query: CountryConfigQueryInputType,
|
3100
3002
|
actions: import_zod25.z.array(
|
3101
3003
|
import_zod25.z.object({
|
3102
|
-
type:
|
3004
|
+
type: import_zod25.z.string(),
|
3103
3005
|
conditionals: import_zod25.z.array(Conditional).optional()
|
3104
3006
|
})
|
3105
3007
|
),
|
3106
|
-
columns: import_zod25.z.array(WorkqueueColumn).default(
|
3008
|
+
columns: import_zod25.z.array(WorkqueueColumn).default(dateOfEventColumn),
|
3107
3009
|
icon: AvailableIcons
|
3108
3010
|
});
|
3109
3011
|
function defineWorkqueue(workqueueInput) {
|
@@ -3145,13 +3047,14 @@ var import_zod27 = require("zod");
|
|
3145
3047
|
// ../commons/src/events/ActionInput.ts
|
3146
3048
|
var import_zod26 = require("zod");
|
3147
3049
|
var import_zod_openapi10 = require("zod-openapi");
|
3050
|
+
var import_uuid3 = require("uuid");
|
3148
3051
|
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
3149
3052
|
var BaseActionInput = import_zod26.z.object({
|
3150
|
-
eventId:
|
3053
|
+
eventId: import_zod26.z.string(),
|
3151
3054
|
transactionId: import_zod26.z.string(),
|
3152
3055
|
declaration: ActionUpdate.default({}),
|
3153
3056
|
annotation: ActionUpdate.optional(),
|
3154
|
-
originalActionId:
|
3057
|
+
originalActionId: import_zod26.z.string().optional(),
|
3155
3058
|
keepAssignment: import_zod26.z.boolean().optional()
|
3156
3059
|
});
|
3157
3060
|
var CreateActionInput = BaseActionInput.merge(
|
@@ -3179,7 +3082,7 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
3179
3082
|
).openapi({
|
3180
3083
|
default: {
|
3181
3084
|
eventId: "<event-id-here>",
|
3182
|
-
transactionId:
|
3085
|
+
transactionId: (0, import_uuid3.v4)(),
|
3183
3086
|
declaration: {},
|
3184
3087
|
annotation: {},
|
3185
3088
|
type: ActionType.NOTIFY
|
@@ -3246,7 +3149,7 @@ var ReadActionInput = BaseActionInput.merge(
|
|
3246
3149
|
type: import_zod26.z.literal(ActionType.READ).default(ActionType.READ)
|
3247
3150
|
})
|
3248
3151
|
);
|
3249
|
-
var DeleteActionInput = import_zod26.z.object({ eventId:
|
3152
|
+
var DeleteActionInput = import_zod26.z.object({ eventId: import_zod26.z.string() });
|
3250
3153
|
var ActionInput = import_zod26.z.discriminatedUnion("type", [
|
3251
3154
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
3252
3155
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
@@ -3277,8 +3180,8 @@ var ActionInput = import_zod26.z.discriminatedUnion("type", [
|
|
3277
3180
|
|
3278
3181
|
// ../commons/src/events/Draft.ts
|
3279
3182
|
var Draft = import_zod27.z.object({
|
3280
|
-
id:
|
3281
|
-
eventId:
|
3183
|
+
id: import_zod27.z.string(),
|
3184
|
+
eventId: import_zod27.z.string(),
|
3282
3185
|
transactionId: import_zod27.z.string(),
|
3283
3186
|
createdAt: import_zod27.z.string().datetime(),
|
3284
3187
|
action: ActionBase.extend({
|
@@ -3296,18 +3199,18 @@ var DraftInput = BaseActionInput.extend({
|
|
3296
3199
|
|
3297
3200
|
// ../commons/src/events/EventInput.ts
|
3298
3201
|
var import_zod28 = require("zod");
|
3299
|
-
var
|
3202
|
+
var import_uuid4 = require("uuid");
|
3300
3203
|
var EventInput = import_zod28.z.object({
|
3301
3204
|
transactionId: import_zod28.z.string(),
|
3302
3205
|
type: import_zod28.z.string()
|
3303
|
-
}).openapi({ default: { transactionId: (0,
|
3206
|
+
}).openapi({ default: { transactionId: (0, import_uuid4.v4)(), type: "v2.birth" } });
|
3304
3207
|
|
3305
3208
|
// ../commons/src/events/EventDocument.ts
|
3306
3209
|
var import_zod29 = require("zod");
|
3307
3210
|
var import_zod_openapi11 = require("zod-openapi");
|
3308
3211
|
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod29.z);
|
3309
3212
|
var EventDocument = import_zod29.z.object({
|
3310
|
-
id:
|
3213
|
+
id: import_zod29.z.string(),
|
3311
3214
|
type: import_zod29.z.string(),
|
3312
3215
|
createdAt: import_zod29.z.string().datetime(),
|
3313
3216
|
updatedAt: import_zod29.z.string().datetime(),
|
@@ -3378,43 +3281,85 @@ function getDeclarationActionUpdateMetadata(actions) {
|
|
3378
3281
|
}
|
3379
3282
|
function getLegalStatuses(actions) {
|
3380
3283
|
return {
|
3381
|
-
[EventStatus.
|
3284
|
+
[EventStatus.DECLARED]: getDeclarationActionCreationMetadata(
|
3382
3285
|
ActionType.DECLARE,
|
3383
3286
|
actions
|
3384
3287
|
),
|
3385
|
-
[EventStatus.
|
3288
|
+
[EventStatus.REGISTERED]: getDeclarationActionCreationMetadata(
|
3386
3289
|
ActionType.REGISTER,
|
3387
3290
|
actions
|
3388
3291
|
)
|
3389
3292
|
};
|
3390
3293
|
}
|
3391
3294
|
|
3295
|
+
// ../commons/src/events/state/flags.ts
|
3296
|
+
var customFlagChecks = {
|
3297
|
+
[CustomFlags.CERTIFICATE_PRINTED]: (sortedActions) => {
|
3298
|
+
return sortedActions.reduce((prev, { type }) => {
|
3299
|
+
if (type === ActionType.PRINT_CERTIFICATE) {
|
3300
|
+
return true;
|
3301
|
+
}
|
3302
|
+
if (type === ActionType.APPROVE_CORRECTION) {
|
3303
|
+
return false;
|
3304
|
+
}
|
3305
|
+
return prev;
|
3306
|
+
}, false);
|
3307
|
+
},
|
3308
|
+
[CustomFlags.CORRECTION_REQUESTED]: (sortedActions) => {
|
3309
|
+
return sortedActions.some(
|
3310
|
+
({ type }) => type === ActionType.REQUEST_CORRECTION
|
3311
|
+
);
|
3312
|
+
}
|
3313
|
+
};
|
3314
|
+
function getFlagsFromActions(actions) {
|
3315
|
+
const sortedActions = actions.sort(
|
3316
|
+
(a, b) => a.createdAt.localeCompare(b.createdAt)
|
3317
|
+
);
|
3318
|
+
const actionStatus = sortedActions.reduce(
|
3319
|
+
(actionStatuses, { type, status }) => ({
|
3320
|
+
...actionStatuses,
|
3321
|
+
[type]: status
|
3322
|
+
}),
|
3323
|
+
{}
|
3324
|
+
);
|
3325
|
+
const flags = Object.entries(actionStatus).filter(([, status]) => status !== ActionStatus.Accepted).map(([type, status]) => {
|
3326
|
+
const flag = `${type.toLowerCase()}:${status.toLowerCase()}`;
|
3327
|
+
return flag;
|
3328
|
+
});
|
3329
|
+
Object.entries(customFlagChecks).forEach(([flag, check]) => {
|
3330
|
+
if (check(sortedActions)) {
|
3331
|
+
flags.push(flag);
|
3332
|
+
}
|
3333
|
+
});
|
3334
|
+
return flags;
|
3335
|
+
}
|
3336
|
+
|
3392
3337
|
// ../commons/src/events/state/index.ts
|
3393
3338
|
function getStatusFromActions(actions) {
|
3394
3339
|
const hasRejectedAction = actions.some(
|
3395
3340
|
(a) => a.status === ActionStatus.Rejected
|
3396
3341
|
);
|
3397
3342
|
if (hasRejectedAction) {
|
3398
|
-
return EventStatus.
|
3343
|
+
return EventStatus.REJECTED;
|
3399
3344
|
}
|
3400
3345
|
return actions.reduce((status, action) => {
|
3401
3346
|
switch (action.type) {
|
3402
3347
|
case ActionType.CREATE:
|
3403
|
-
return EventStatus.
|
3348
|
+
return EventStatus.CREATED;
|
3404
3349
|
case ActionType.DECLARE:
|
3405
|
-
return EventStatus.
|
3350
|
+
return EventStatus.DECLARED;
|
3406
3351
|
case ActionType.VALIDATE:
|
3407
|
-
return EventStatus.
|
3352
|
+
return EventStatus.VALIDATED;
|
3408
3353
|
case ActionType.REGISTER:
|
3409
|
-
return EventStatus.
|
3354
|
+
return EventStatus.REGISTERED;
|
3410
3355
|
case ActionType.REJECT:
|
3411
|
-
return EventStatus.
|
3356
|
+
return EventStatus.REJECTED;
|
3412
3357
|
case ActionType.ARCHIVE:
|
3413
|
-
return EventStatus.
|
3358
|
+
return EventStatus.ARCHIVED;
|
3414
3359
|
case ActionType.NOTIFY:
|
3415
|
-
return EventStatus.
|
3360
|
+
return EventStatus.NOTIFIED;
|
3416
3361
|
case ActionType.PRINT_CERTIFICATE:
|
3417
|
-
return EventStatus.
|
3362
|
+
return EventStatus.CERTIFIED;
|
3418
3363
|
case ActionType.ASSIGN:
|
3419
3364
|
case ActionType.UNASSIGN:
|
3420
3365
|
case ActionType.REQUEST_CORRECTION:
|
@@ -3425,39 +3370,7 @@ function getStatusFromActions(actions) {
|
|
3425
3370
|
default:
|
3426
3371
|
return status;
|
3427
3372
|
}
|
3428
|
-
}, EventStatus.
|
3429
|
-
}
|
3430
|
-
function getFlagsFromActions(actions) {
|
3431
|
-
const sortedactions = actions.sort(
|
3432
|
-
(a, b) => a.createdAt.localeCompare(b.createdAt)
|
3433
|
-
);
|
3434
|
-
const actionStatus = sortedactions.reduce(
|
3435
|
-
(actionStatuses, { type, status }) => ({
|
3436
|
-
...actionStatuses,
|
3437
|
-
[type]: status
|
3438
|
-
}),
|
3439
|
-
{}
|
3440
|
-
);
|
3441
|
-
const flags = Object.entries(actionStatus).filter(([, status]) => status !== ActionStatus.Accepted).map(([type, status]) => {
|
3442
|
-
const flag = `${type.toLowerCase()}:${status.toLowerCase()}`;
|
3443
|
-
return flag;
|
3444
|
-
});
|
3445
|
-
const isCertificatePrinted = sortedactions.reduce(
|
3446
|
-
(prev, { type }) => {
|
3447
|
-
if (type === ActionType.PRINT_CERTIFICATE) {
|
3448
|
-
return true;
|
3449
|
-
}
|
3450
|
-
if (type === ActionType.APPROVE_CORRECTION) {
|
3451
|
-
return false;
|
3452
|
-
}
|
3453
|
-
return prev;
|
3454
|
-
},
|
3455
|
-
false
|
3456
|
-
);
|
3457
|
-
if (isCertificatePrinted) {
|
3458
|
-
flags.push(CustomFlags.CERTIFICATE_PRINTED);
|
3459
|
-
}
|
3460
|
-
return flags;
|
3373
|
+
}, EventStatus.CREATED);
|
3461
3374
|
}
|
3462
3375
|
function getAssignedUserFromActions(actions) {
|
3463
3376
|
return actions.reduce((user2, action) => {
|
@@ -3517,7 +3430,7 @@ function deepDropNulls(obj) {
|
|
3517
3430
|
return obj;
|
3518
3431
|
}
|
3519
3432
|
function isUndeclaredDraft(status) {
|
3520
|
-
return status === EventStatus.
|
3433
|
+
return status === EventStatus.CREATED;
|
3521
3434
|
}
|
3522
3435
|
function getAcceptedActions(event2) {
|
3523
3436
|
return event2.actions.filter(
|
@@ -4343,7 +4256,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
4343
4256
|
var TENNIS_CLUB_DECLARATION_REVIEW = {
|
4344
4257
|
title: {
|
4345
4258
|
id: "v2.event.tennis-club-membership.action.declare.form.review.title",
|
4346
|
-
defaultMessage: "{applicant.
|
4259
|
+
defaultMessage: "{applicant.firstname, select, __EMPTY__ {Member declaration} other {{applicant.surname, select, __EMPTY__ {Member declaration} other {Member declaration for {applicant.firstname} {applicant.surname}}}}}",
|
4347
4260
|
description: "Title of the review page"
|
4348
4261
|
},
|
4349
4262
|
fields: [
|
@@ -4388,17 +4301,27 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
4388
4301
|
},
|
4389
4302
|
fields: [
|
4390
4303
|
{
|
4391
|
-
id: "applicant.
|
4392
|
-
type: FieldType.
|
4304
|
+
id: "applicant.firstname",
|
4305
|
+
type: FieldType.TEXT,
|
4393
4306
|
required: true,
|
4394
|
-
hideLabel: true,
|
4395
4307
|
conditionals: [],
|
4396
4308
|
label: {
|
4397
|
-
defaultMessage: "Applicant's name",
|
4309
|
+
defaultMessage: "Applicant's first name",
|
4398
4310
|
description: "This is the label for the field",
|
4399
4311
|
id: "v2.event.tennis-club-membership.action.declare.form.section.who.field.firstname.label"
|
4400
4312
|
}
|
4401
4313
|
},
|
4314
|
+
{
|
4315
|
+
id: "applicant.surname",
|
4316
|
+
type: FieldType.TEXT,
|
4317
|
+
required: true,
|
4318
|
+
conditionals: [],
|
4319
|
+
label: {
|
4320
|
+
defaultMessage: "Applicant's surname",
|
4321
|
+
description: "This is the label for the field",
|
4322
|
+
id: "v2.event.tennis-club-membership.action.declare.form.section.who.field.surname.label"
|
4323
|
+
}
|
4324
|
+
},
|
4402
4325
|
{
|
4403
4326
|
id: "applicant.email",
|
4404
4327
|
type: "EMAIL",
|
@@ -4532,9 +4455,8 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
4532
4455
|
}
|
4533
4456
|
},
|
4534
4457
|
{
|
4535
|
-
id: "recommender.
|
4536
|
-
type: FieldType.
|
4537
|
-
hideLabel: true,
|
4458
|
+
id: "recommender.firstname",
|
4459
|
+
type: FieldType.TEXT,
|
4538
4460
|
required: true,
|
4539
4461
|
conditionals: [
|
4540
4462
|
{
|
@@ -4543,11 +4465,27 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
4543
4465
|
}
|
4544
4466
|
],
|
4545
4467
|
label: {
|
4546
|
-
defaultMessage: "Recommender's name",
|
4468
|
+
defaultMessage: "Recommender's first name",
|
4547
4469
|
description: "This is the label for the field",
|
4548
4470
|
id: "v2.event.tennis-club-membership.action.declare.form.section.recommender.field.firstname.label"
|
4549
4471
|
}
|
4550
4472
|
},
|
4473
|
+
{
|
4474
|
+
id: "recommender.surname",
|
4475
|
+
type: FieldType.TEXT,
|
4476
|
+
required: true,
|
4477
|
+
conditionals: [
|
4478
|
+
{
|
4479
|
+
type: ConditionalType.SHOW,
|
4480
|
+
conditional: field("recommender.none").isFalsy()
|
4481
|
+
}
|
4482
|
+
],
|
4483
|
+
label: {
|
4484
|
+
defaultMessage: "Recommender's surname",
|
4485
|
+
description: "This is the label for the field",
|
4486
|
+
id: "v2.event.tennis-club-membership.action.declare.form.section.recommender.field.surname.label"
|
4487
|
+
}
|
4488
|
+
},
|
4551
4489
|
{
|
4552
4490
|
id: "recommender.id",
|
4553
4491
|
type: FieldType.TEXT,
|
@@ -4578,7 +4516,7 @@ var statusOptions = [
|
|
4578
4516
|
}
|
4579
4517
|
},
|
4580
4518
|
{
|
4581
|
-
value: EventStatus.
|
4519
|
+
value: EventStatus.CREATED,
|
4582
4520
|
label: {
|
4583
4521
|
defaultMessage: "Draft",
|
4584
4522
|
description: "Option for form field: status of record",
|
@@ -4586,7 +4524,7 @@ var statusOptions = [
|
|
4586
4524
|
}
|
4587
4525
|
},
|
4588
4526
|
{
|
4589
|
-
value: EventStatus.
|
4527
|
+
value: EventStatus.NOTIFIED,
|
4590
4528
|
label: {
|
4591
4529
|
defaultMessage: "Notified",
|
4592
4530
|
description: "Option for form field: status of record",
|
@@ -4594,7 +4532,7 @@ var statusOptions = [
|
|
4594
4532
|
}
|
4595
4533
|
},
|
4596
4534
|
{
|
4597
|
-
value: EventStatus.
|
4535
|
+
value: EventStatus.DECLARED,
|
4598
4536
|
label: {
|
4599
4537
|
defaultMessage: "Declared",
|
4600
4538
|
description: "Option for form field: status of record",
|
@@ -4602,7 +4540,7 @@ var statusOptions = [
|
|
4602
4540
|
}
|
4603
4541
|
},
|
4604
4542
|
{
|
4605
|
-
value: EventStatus.
|
4543
|
+
value: EventStatus.VALIDATED,
|
4606
4544
|
label: {
|
4607
4545
|
defaultMessage: "Validated",
|
4608
4546
|
description: "Option for form field: status of record",
|
@@ -4610,7 +4548,7 @@ var statusOptions = [
|
|
4610
4548
|
}
|
4611
4549
|
},
|
4612
4550
|
{
|
4613
|
-
value: EventStatus.
|
4551
|
+
value: EventStatus.REGISTERED,
|
4614
4552
|
label: {
|
4615
4553
|
defaultMessage: "Registered",
|
4616
4554
|
description: "Option for form field: status of record",
|
@@ -4618,7 +4556,7 @@ var statusOptions = [
|
|
4618
4556
|
}
|
4619
4557
|
},
|
4620
4558
|
{
|
4621
|
-
value: EventStatus.
|
4559
|
+
value: EventStatus.CERTIFIED,
|
4622
4560
|
label: {
|
4623
4561
|
defaultMessage: "Certified",
|
4624
4562
|
description: "Option for form field: status of record",
|
@@ -4626,7 +4564,7 @@ var statusOptions = [
|
|
4626
4564
|
}
|
4627
4565
|
},
|
4628
4566
|
{
|
4629
|
-
value: EventStatus.
|
4567
|
+
value: EventStatus.REJECTED,
|
4630
4568
|
label: {
|
4631
4569
|
defaultMessage: "Rejected",
|
4632
4570
|
description: "Option for form field: status of record",
|
@@ -4634,7 +4572,7 @@ var statusOptions = [
|
|
4634
4572
|
}
|
4635
4573
|
},
|
4636
4574
|
{
|
4637
|
-
value: EventStatus.
|
4575
|
+
value: EventStatus.ARCHIVED,
|
4638
4576
|
label: {
|
4639
4577
|
defaultMessage: "Archived",
|
4640
4578
|
description: "Option for form field: status of record",
|
@@ -4698,25 +4636,38 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4698
4636
|
id: "v2.event.tennis-club-membership.label"
|
4699
4637
|
},
|
4700
4638
|
title: {
|
4701
|
-
defaultMessage: "{applicant.
|
4639
|
+
defaultMessage: "{applicant.firstname} {applicant.surname}",
|
4702
4640
|
description: "This is the title of the summary",
|
4703
4641
|
id: "v2.event.tennis-club-membership.title"
|
4704
4642
|
},
|
4705
4643
|
summary: {
|
4706
4644
|
fields: [
|
4707
4645
|
{
|
4708
|
-
|
4646
|
+
id: "applicant.firstname",
|
4709
4647
|
label: {
|
4710
|
-
defaultMessage: "Applicant's name",
|
4648
|
+
defaultMessage: "Applicant's first name",
|
4711
4649
|
description: "This is the label for the field",
|
4712
4650
|
id: "event.tennis-club-membership.summary.field.firstname.label"
|
4713
4651
|
},
|
4652
|
+
value: {
|
4653
|
+
defaultMessage: "{applicant.firstname}",
|
4654
|
+
description: "This is the value to show in the summary",
|
4655
|
+
id: "event.tennis-club-membership.summary.field.firstname"
|
4656
|
+
},
|
4714
4657
|
emptyValueMessage: {
|
4715
4658
|
defaultMessage: "First name is not provided",
|
4716
4659
|
description: "This is the message to show when the field is empty",
|
4717
4660
|
id: "event.tennis-club-membership.summary.field.firstname.empty"
|
4718
4661
|
}
|
4719
4662
|
},
|
4663
|
+
{
|
4664
|
+
fieldId: "applicant.surname",
|
4665
|
+
label: {
|
4666
|
+
defaultMessage: "Applicant's last name",
|
4667
|
+
description: "Label for surname",
|
4668
|
+
id: "v2.event.tennis-club-membership.summary.field.surname.label"
|
4669
|
+
}
|
4670
|
+
},
|
4720
4671
|
{
|
4721
4672
|
fieldId: "applicant.email"
|
4722
4673
|
}
|
@@ -4766,197 +4717,202 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4766
4717
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4767
4718
|
id: "event.tennis-club-membership.action.correction.request.label"
|
4768
4719
|
},
|
4769
|
-
|
4770
|
-
{
|
4771
|
-
id: "correction
|
4772
|
-
|
4773
|
-
|
4774
|
-
|
4775
|
-
|
4776
|
-
|
4777
|
-
|
4778
|
-
|
4779
|
-
{
|
4780
|
-
id: "
|
4781
|
-
|
4782
|
-
|
4783
|
-
id: "correction.requester.relationshop.intro.label",
|
4784
|
-
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
4785
|
-
description: "The title for the corrector form"
|
4786
|
-
}
|
4720
|
+
correctionForm: {
|
4721
|
+
label: {
|
4722
|
+
id: "v2.event.tennis-club-membership.action.request-correction.label",
|
4723
|
+
defaultMessage: "Request correction",
|
4724
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4725
|
+
},
|
4726
|
+
pages: [
|
4727
|
+
{
|
4728
|
+
id: "correction-requester",
|
4729
|
+
type: PageTypes.enum.FORM,
|
4730
|
+
title: {
|
4731
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4732
|
+
defaultMessage: "Correction requester",
|
4733
|
+
description: "This is the title of the section"
|
4787
4734
|
},
|
4788
|
-
|
4789
|
-
|
4790
|
-
|
4791
|
-
|
4792
|
-
|
4793
|
-
|
4794
|
-
|
4735
|
+
fields: [
|
4736
|
+
{
|
4737
|
+
id: "correction.requester.relationshop.intro",
|
4738
|
+
type: "PAGE_HEADER",
|
4739
|
+
label: {
|
4740
|
+
id: "correction.requester.relationshop.intro.label",
|
4741
|
+
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
4742
|
+
description: "The title for the corrector form"
|
4743
|
+
}
|
4795
4744
|
},
|
4796
|
-
|
4797
|
-
|
4798
|
-
|
4799
|
-
|
4800
|
-
|
4801
|
-
|
4802
|
-
|
4803
|
-
description: "Label for informant option in certificate correction form"
|
4804
|
-
}
|
4805
|
-
},
|
4806
|
-
{
|
4807
|
-
value: "ANOTHER_AGENT",
|
4808
|
-
label: {
|
4809
|
-
id: "v2.correction.corrector.anotherAgent",
|
4810
|
-
defaultMessage: "Another registration agent or field agent",
|
4811
|
-
description: "Label for another registration or field agent option in certificate correction form"
|
4812
|
-
}
|
4745
|
+
{
|
4746
|
+
id: "correction.requester.relationship",
|
4747
|
+
type: "RADIO_GROUP",
|
4748
|
+
label: {
|
4749
|
+
id: "v2.correction.corrector.title",
|
4750
|
+
defaultMessage: "Who is requesting a change to this record?",
|
4751
|
+
description: "The title for the corrector form"
|
4813
4752
|
},
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4817
|
-
|
4818
|
-
|
4819
|
-
|
4820
|
-
|
4821
|
-
|
4822
|
-
|
4823
|
-
|
4824
|
-
|
4825
|
-
|
4826
|
-
|
4827
|
-
|
4753
|
+
defaultValue: "",
|
4754
|
+
options: [
|
4755
|
+
{
|
4756
|
+
value: "INFORMANT",
|
4757
|
+
label: {
|
4758
|
+
id: "v2.correction.corrector.informant",
|
4759
|
+
defaultMessage: "Informant",
|
4760
|
+
description: "Label for informant option in certificate correction form"
|
4761
|
+
}
|
4762
|
+
},
|
4763
|
+
{
|
4764
|
+
value: "ANOTHER_AGENT",
|
4765
|
+
label: {
|
4766
|
+
id: "v2.correction.corrector.anotherAgent",
|
4767
|
+
defaultMessage: "Another registration agent or field agent",
|
4768
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
4769
|
+
}
|
4770
|
+
},
|
4771
|
+
{
|
4772
|
+
value: "REGISTRAR",
|
4773
|
+
label: {
|
4774
|
+
id: "v2.correction.corrector.me",
|
4775
|
+
defaultMessage: "Me (Registrar)",
|
4776
|
+
description: "Label for registrar option in certificate correction form"
|
4777
|
+
}
|
4778
|
+
},
|
4779
|
+
{
|
4780
|
+
value: "OTHER",
|
4781
|
+
label: {
|
4782
|
+
id: "v2.correction.corrector.others",
|
4783
|
+
defaultMessage: "Someone else",
|
4784
|
+
description: "Label for someone else option in certificate correction form"
|
4785
|
+
}
|
4828
4786
|
}
|
4829
|
-
|
4830
|
-
]
|
4831
|
-
}
|
4832
|
-
]
|
4833
|
-
},
|
4834
|
-
{
|
4835
|
-
id: "identity-check",
|
4836
|
-
type: PageTypes.enum.FORM,
|
4837
|
-
title: {
|
4838
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4839
|
-
defaultMessage: "Verify their identity",
|
4840
|
-
description: "This is the title of the section"
|
4841
|
-
},
|
4842
|
-
fields: [
|
4843
|
-
{
|
4844
|
-
id: "correction.identity-check.instructions",
|
4845
|
-
type: "PAGE_HEADER",
|
4846
|
-
label: {
|
4847
|
-
id: "correction.corrector.identity.instruction",
|
4848
|
-
defaultMessage: "Please verify the identity of the person making this request",
|
4849
|
-
description: "The title for the corrector form"
|
4787
|
+
]
|
4850
4788
|
}
|
4789
|
+
]
|
4790
|
+
},
|
4791
|
+
{
|
4792
|
+
id: "identity-check",
|
4793
|
+
type: PageTypes.enum.FORM,
|
4794
|
+
title: {
|
4795
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4796
|
+
defaultMessage: "Verify their identity",
|
4797
|
+
description: "This is the title of the section"
|
4851
4798
|
},
|
4852
|
-
|
4853
|
-
|
4854
|
-
|
4855
|
-
|
4856
|
-
|
4857
|
-
|
4858
|
-
|
4799
|
+
fields: [
|
4800
|
+
{
|
4801
|
+
id: "correction.identity-check.instructions",
|
4802
|
+
type: "PAGE_HEADER",
|
4803
|
+
label: {
|
4804
|
+
id: "correction.corrector.identity.instruction",
|
4805
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
4806
|
+
description: "The title for the corrector form"
|
4807
|
+
}
|
4859
4808
|
},
|
4860
|
-
|
4861
|
-
|
4862
|
-
|
4863
|
-
{
|
4864
|
-
|
4865
|
-
|
4866
|
-
|
4867
|
-
|
4868
|
-
|
4809
|
+
{
|
4810
|
+
id: "correction.identity-check.verified",
|
4811
|
+
type: "RADIO_GROUP",
|
4812
|
+
label: {
|
4813
|
+
id: "correction.corrector.identity.verified.label",
|
4814
|
+
defaultMessage: "Identity verified",
|
4815
|
+
description: "The title for the corrector form"
|
4816
|
+
},
|
4817
|
+
defaultValue: "",
|
4818
|
+
required: true,
|
4819
|
+
options: [
|
4820
|
+
{
|
4821
|
+
value: "VERIFIED",
|
4822
|
+
label: {
|
4823
|
+
id: "correction.corrector.identity.verified",
|
4824
|
+
defaultMessage: "I have verified their identity",
|
4825
|
+
description: "Label for verified option in corrector identity check page"
|
4826
|
+
}
|
4869
4827
|
}
|
4870
|
-
|
4871
|
-
]
|
4872
|
-
}
|
4873
|
-
]
|
4874
|
-
}
|
4875
|
-
],
|
4876
|
-
additionalDetailsForm: [
|
4877
|
-
{
|
4878
|
-
id: "correction-request.supporting-documents",
|
4879
|
-
type: PageTypes.enum.FORM,
|
4880
|
-
title: {
|
4881
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4882
|
-
defaultMessage: "Upload supporting documents",
|
4883
|
-
description: "This is the title of the section"
|
4884
|
-
},
|
4885
|
-
fields: [
|
4886
|
-
{
|
4887
|
-
id: "correction.supportingDocs.introduction",
|
4888
|
-
type: "PAGE_HEADER",
|
4889
|
-
label: {
|
4890
|
-
id: "correction.corrector.paragraph.title",
|
4891
|
-
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
4892
|
-
description: "The title for the corrector form"
|
4893
|
-
}
|
4894
|
-
},
|
4895
|
-
{
|
4896
|
-
id: "correction.supportingDocs",
|
4897
|
-
type: FieldType.FILE,
|
4898
|
-
label: {
|
4899
|
-
id: "correction.corrector.title",
|
4900
|
-
defaultMessage: "Upload supporting documents",
|
4901
|
-
description: "The title for the corrector form"
|
4828
|
+
]
|
4902
4829
|
}
|
4830
|
+
]
|
4831
|
+
},
|
4832
|
+
{
|
4833
|
+
id: "correction-request.supporting-documents",
|
4834
|
+
type: PageTypes.enum.FORM,
|
4835
|
+
title: {
|
4836
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4837
|
+
defaultMessage: "Upload supporting documents",
|
4838
|
+
description: "This is the title of the section"
|
4903
4839
|
},
|
4904
|
-
|
4905
|
-
|
4906
|
-
|
4907
|
-
|
4908
|
-
|
4909
|
-
|
4910
|
-
|
4840
|
+
fields: [
|
4841
|
+
{
|
4842
|
+
id: "correction.supportingDocs.introduction",
|
4843
|
+
type: "PAGE_HEADER",
|
4844
|
+
label: {
|
4845
|
+
id: "correction.corrector.paragraph.title",
|
4846
|
+
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
4847
|
+
description: "The title for the corrector form"
|
4848
|
+
}
|
4911
4849
|
},
|
4912
|
-
|
4913
|
-
|
4914
|
-
|
4915
|
-
|
4850
|
+
{
|
4851
|
+
id: "correction.supportingDocs",
|
4852
|
+
type: FieldType.FILE,
|
4853
|
+
label: {
|
4854
|
+
id: "correction.corrector.title",
|
4855
|
+
defaultMessage: "Upload supporting documents",
|
4856
|
+
description: "The title for the corrector form"
|
4916
4857
|
}
|
4917
4858
|
},
|
4918
|
-
|
4919
|
-
|
4920
|
-
|
4921
|
-
|
4922
|
-
|
4923
|
-
|
4924
|
-
|
4859
|
+
{
|
4860
|
+
id: "correction.request.supportingDocuments",
|
4861
|
+
type: "RADIO_GROUP",
|
4862
|
+
label: {
|
4863
|
+
id: "correction.corrector.title",
|
4864
|
+
defaultMessage: "Who is requesting a change to this record?",
|
4865
|
+
description: "The title for the corrector form"
|
4866
|
+
},
|
4867
|
+
defaultValue: "",
|
4868
|
+
configuration: {
|
4869
|
+
styles: {
|
4870
|
+
size: "NORMAL"
|
4925
4871
|
}
|
4926
4872
|
},
|
4927
|
-
|
4928
|
-
|
4929
|
-
|
4930
|
-
|
4931
|
-
|
4932
|
-
|
4873
|
+
options: [
|
4874
|
+
{
|
4875
|
+
value: "ATTEST",
|
4876
|
+
label: {
|
4877
|
+
id: "correction.supportingDocuments.attest.label",
|
4878
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
4879
|
+
description: ""
|
4880
|
+
}
|
4881
|
+
},
|
4882
|
+
{
|
4883
|
+
value: "NOT_NEEDED",
|
4884
|
+
label: {
|
4885
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
4886
|
+
defaultMessage: "No supporting documents required",
|
4887
|
+
description: ""
|
4888
|
+
}
|
4933
4889
|
}
|
4934
|
-
|
4935
|
-
|
4936
|
-
|
4937
|
-
]
|
4938
|
-
},
|
4939
|
-
{
|
4940
|
-
id: "correction-request.additional-details",
|
4941
|
-
type: PageTypes.enum.FORM,
|
4942
|
-
title: {
|
4943
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4944
|
-
defaultMessage: "Reason for correction",
|
4945
|
-
description: "This is the title of the section"
|
4890
|
+
]
|
4891
|
+
}
|
4892
|
+
]
|
4946
4893
|
},
|
4947
|
-
|
4948
|
-
|
4949
|
-
|
4950
|
-
|
4951
|
-
|
4952
|
-
|
4953
|
-
|
4954
|
-
|
4894
|
+
{
|
4895
|
+
id: "correction-request.additional-details",
|
4896
|
+
type: PageTypes.enum.FORM,
|
4897
|
+
title: {
|
4898
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4899
|
+
defaultMessage: "Reason for correction",
|
4900
|
+
description: "This is the title of the section"
|
4901
|
+
},
|
4902
|
+
fields: [
|
4903
|
+
{
|
4904
|
+
id: "correction.request.reason",
|
4905
|
+
type: FieldType.TEXT,
|
4906
|
+
label: {
|
4907
|
+
id: "correction.reason.title",
|
4908
|
+
defaultMessage: "Reason for correction?",
|
4909
|
+
description: "The title for the corrector form"
|
4910
|
+
}
|
4955
4911
|
}
|
4956
|
-
|
4957
|
-
|
4958
|
-
|
4959
|
-
|
4912
|
+
]
|
4913
|
+
}
|
4914
|
+
]
|
4915
|
+
}
|
4960
4916
|
},
|
4961
4917
|
{
|
4962
4918
|
type: ActionType.APPROVE_CORRECTION,
|
@@ -5052,7 +5008,8 @@ var tennisClubMembershipEvent = defineConfig({
|
|
5052
5008
|
id: "v2.event.tennis-club-membership.search.applicants"
|
5053
5009
|
},
|
5054
5010
|
fields: [
|
5055
|
-
field("applicant.
|
5011
|
+
field("applicant.firstname").fuzzy(),
|
5012
|
+
field("applicant.surname").fuzzy(),
|
5056
5013
|
field("applicant.dob").range(),
|
5057
5014
|
field("applicant.email").exact()
|
5058
5015
|
]
|
@@ -5063,7 +5020,10 @@ var tennisClubMembershipEvent = defineConfig({
|
|
5063
5020
|
description: "Recommender details search field section title",
|
5064
5021
|
id: "v2.event.tennis-club-membership.search.recommender"
|
5065
5022
|
},
|
5066
|
-
fields: [
|
5023
|
+
fields: [
|
5024
|
+
field("recommender.firstname").fuzzy(),
|
5025
|
+
field("recommender.surname").fuzzy()
|
5026
|
+
]
|
5067
5027
|
}
|
5068
5028
|
],
|
5069
5029
|
declaration: TENNIS_CLUB_DECLARATION_FORM
|
@@ -5078,21 +5038,21 @@ var footballClubMembershipEvent = defineConfig({
|
|
5078
5038
|
id: "event.football-club-membership.label"
|
5079
5039
|
},
|
5080
5040
|
title: {
|
5081
|
-
defaultMessage: "{applicant.
|
5041
|
+
defaultMessage: "{applicant.firstname} {applicant.surname}",
|
5082
5042
|
description: "This is the title of the summary",
|
5083
5043
|
id: "v2.event.football-club-membership.title"
|
5084
5044
|
},
|
5085
5045
|
summary: {
|
5086
5046
|
fields: [
|
5087
5047
|
{
|
5088
|
-
id: "applicant.
|
5048
|
+
id: "applicant.firstname",
|
5089
5049
|
label: {
|
5090
5050
|
defaultMessage: "Applicant's first name",
|
5091
5051
|
description: "This is the label for the field",
|
5092
5052
|
id: "event.football-club-membership.summary.field.firstname.label"
|
5093
5053
|
},
|
5094
5054
|
value: {
|
5095
|
-
defaultMessage: "{applicant.
|
5055
|
+
defaultMessage: "{applicant.firstname}",
|
5096
5056
|
description: "This is the value to show in the summary",
|
5097
5057
|
id: "event.football-club-membership.summary.field.firstname"
|
5098
5058
|
},
|
@@ -5103,7 +5063,7 @@ var footballClubMembershipEvent = defineConfig({
|
|
5103
5063
|
}
|
5104
5064
|
},
|
5105
5065
|
{
|
5106
|
-
fieldId: "applicant.
|
5066
|
+
fieldId: "applicant.surname",
|
5107
5067
|
label: {
|
5108
5068
|
defaultMessage: "Applicant's last name",
|
5109
5069
|
description: "Label for surname",
|
@@ -5159,197 +5119,202 @@ var footballClubMembershipEvent = defineConfig({
|
|
5159
5119
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
5160
5120
|
id: "event.football-club-membership.action.correction.request.label"
|
5161
5121
|
},
|
5162
|
-
|
5163
|
-
{
|
5164
|
-
id: "correction
|
5165
|
-
|
5166
|
-
|
5167
|
-
|
5168
|
-
|
5169
|
-
|
5170
|
-
|
5171
|
-
|
5172
|
-
{
|
5173
|
-
id: "
|
5174
|
-
|
5175
|
-
|
5176
|
-
id: "correction.requester.relationshop.intro.label",
|
5177
|
-
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
5178
|
-
description: "The title for the corrector form"
|
5179
|
-
}
|
5122
|
+
correctionForm: {
|
5123
|
+
label: {
|
5124
|
+
id: "event.football-club-membership.action.correction.request.label",
|
5125
|
+
defaultMessage: "Request correction",
|
5126
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
5127
|
+
},
|
5128
|
+
pages: [
|
5129
|
+
{
|
5130
|
+
id: "correction-requester",
|
5131
|
+
type: PageTypes.enum.FORM,
|
5132
|
+
title: {
|
5133
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5134
|
+
defaultMessage: "Correction requester",
|
5135
|
+
description: "This is the title of the section"
|
5180
5136
|
},
|
5181
|
-
|
5182
|
-
|
5183
|
-
|
5184
|
-
|
5185
|
-
|
5186
|
-
|
5187
|
-
|
5137
|
+
fields: [
|
5138
|
+
{
|
5139
|
+
id: "correction.requester.relationshop.intro",
|
5140
|
+
type: "PAGE_HEADER",
|
5141
|
+
label: {
|
5142
|
+
id: "correction.requester.relationshop.intro.label",
|
5143
|
+
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
5144
|
+
description: "The title for the corrector form"
|
5145
|
+
}
|
5188
5146
|
},
|
5189
|
-
|
5190
|
-
|
5191
|
-
|
5192
|
-
|
5193
|
-
|
5194
|
-
|
5195
|
-
|
5196
|
-
|
5147
|
+
{
|
5148
|
+
id: "correction.requester.relationship",
|
5149
|
+
type: "RADIO_GROUP",
|
5150
|
+
label: {
|
5151
|
+
id: "v2.correction.corrector.title",
|
5152
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5153
|
+
description: "The title for the corrector form"
|
5154
|
+
},
|
5155
|
+
defaultValue: "",
|
5156
|
+
options: [
|
5157
|
+
{
|
5158
|
+
value: "INFORMANT",
|
5159
|
+
label: {
|
5160
|
+
id: "v2.correction.corrector.informant",
|
5161
|
+
defaultMessage: "Informant",
|
5162
|
+
description: "Label for informant option in certificate correction form"
|
5163
|
+
}
|
5164
|
+
},
|
5165
|
+
{
|
5166
|
+
value: "ANOTHER_AGENT",
|
5167
|
+
label: {
|
5168
|
+
id: "v2.correction.corrector.anotherAgent",
|
5169
|
+
defaultMessage: "Another registration agent or field agent",
|
5170
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
5171
|
+
}
|
5172
|
+
},
|
5173
|
+
{
|
5174
|
+
value: "REGISTRAR",
|
5175
|
+
label: {
|
5176
|
+
id: "v2.correction.corrector.me",
|
5177
|
+
defaultMessage: "Me (Registrar)",
|
5178
|
+
description: "Label for registrar option in certificate correction form"
|
5179
|
+
}
|
5180
|
+
},
|
5181
|
+
{
|
5182
|
+
value: "OTHER",
|
5183
|
+
label: {
|
5184
|
+
id: "v2.correction.corrector.others",
|
5185
|
+
defaultMessage: "Someone else",
|
5186
|
+
description: "Label for someone else option in certificate correction form"
|
5187
|
+
}
|
5197
5188
|
}
|
5189
|
+
]
|
5190
|
+
}
|
5191
|
+
]
|
5192
|
+
},
|
5193
|
+
{
|
5194
|
+
id: "identity-check",
|
5195
|
+
type: PageTypes.enum.FORM,
|
5196
|
+
title: {
|
5197
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5198
|
+
defaultMessage: "Verify their identity",
|
5199
|
+
description: "This is the title of the section"
|
5200
|
+
},
|
5201
|
+
fields: [
|
5202
|
+
{
|
5203
|
+
id: "correction.identity-check.instructions",
|
5204
|
+
type: "PAGE_HEADER",
|
5205
|
+
label: {
|
5206
|
+
id: "correction.corrector.identity.instruction",
|
5207
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
5208
|
+
description: "The title for the corrector form"
|
5209
|
+
}
|
5210
|
+
},
|
5211
|
+
{
|
5212
|
+
id: "correction.identity-check.verified",
|
5213
|
+
type: "RADIO_GROUP",
|
5214
|
+
label: {
|
5215
|
+
id: "correction.corrector.identity.verified.label",
|
5216
|
+
defaultMessage: "Identity verified",
|
5217
|
+
description: "The title for the corrector form"
|
5198
5218
|
},
|
5199
|
-
|
5200
|
-
|
5201
|
-
|
5202
|
-
|
5203
|
-
|
5204
|
-
|
5219
|
+
defaultValue: "",
|
5220
|
+
required: true,
|
5221
|
+
options: [
|
5222
|
+
{
|
5223
|
+
value: "VERIFIED",
|
5224
|
+
label: {
|
5225
|
+
id: "correction.corrector.identity.verified",
|
5226
|
+
defaultMessage: "I have verified their identity",
|
5227
|
+
description: "Label for verified option in corrector identity check page"
|
5228
|
+
}
|
5205
5229
|
}
|
5230
|
+
]
|
5231
|
+
}
|
5232
|
+
]
|
5233
|
+
},
|
5234
|
+
{
|
5235
|
+
id: "correction-request.supporting-documents",
|
5236
|
+
type: PageTypes.enum.FORM,
|
5237
|
+
title: {
|
5238
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5239
|
+
defaultMessage: "Upload supporting documents",
|
5240
|
+
description: "This is the title of the section"
|
5241
|
+
},
|
5242
|
+
fields: [
|
5243
|
+
{
|
5244
|
+
id: "correction.supportingDocs.introduction",
|
5245
|
+
type: "PAGE_HEADER",
|
5246
|
+
label: {
|
5247
|
+
id: "correction.corrector.paragraph.title",
|
5248
|
+
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
5249
|
+
description: "The title for the corrector form"
|
5250
|
+
}
|
5251
|
+
},
|
5252
|
+
{
|
5253
|
+
id: "correction.supportingDocs",
|
5254
|
+
type: FieldType.FILE,
|
5255
|
+
label: {
|
5256
|
+
id: "correction.corrector.title",
|
5257
|
+
defaultMessage: "Upload supporting documents",
|
5258
|
+
description: "The title for the corrector form"
|
5259
|
+
}
|
5260
|
+
},
|
5261
|
+
{
|
5262
|
+
id: "correction.request.supportingDocuments",
|
5263
|
+
type: "RADIO_GROUP",
|
5264
|
+
label: {
|
5265
|
+
id: "correction.corrector.title",
|
5266
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5267
|
+
description: "The title for the corrector form"
|
5206
5268
|
},
|
5207
|
-
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
defaultMessage: "Me (Registrar)",
|
5212
|
-
description: "Label for registrar option in certificate correction form"
|
5269
|
+
defaultValue: "",
|
5270
|
+
configuration: {
|
5271
|
+
styles: {
|
5272
|
+
size: "NORMAL"
|
5213
5273
|
}
|
5214
5274
|
},
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
|
5220
|
-
|
5275
|
+
options: [
|
5276
|
+
{
|
5277
|
+
value: "ATTEST",
|
5278
|
+
label: {
|
5279
|
+
id: "correction.supportingDocuments.attest.label",
|
5280
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
5281
|
+
description: ""
|
5282
|
+
}
|
5283
|
+
},
|
5284
|
+
{
|
5285
|
+
value: "NOT_NEEDED",
|
5286
|
+
label: {
|
5287
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
5288
|
+
defaultMessage: "No supporting documents required",
|
5289
|
+
description: ""
|
5290
|
+
}
|
5221
5291
|
}
|
5222
|
-
|
5223
|
-
]
|
5224
|
-
}
|
5225
|
-
]
|
5226
|
-
},
|
5227
|
-
{
|
5228
|
-
id: "identity-check",
|
5229
|
-
type: PageTypes.enum.FORM,
|
5230
|
-
title: {
|
5231
|
-
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5232
|
-
defaultMessage: "Verify their identity",
|
5233
|
-
description: "This is the title of the section"
|
5234
|
-
},
|
5235
|
-
fields: [
|
5236
|
-
{
|
5237
|
-
id: "correction.identity-check.instructions",
|
5238
|
-
type: "PAGE_HEADER",
|
5239
|
-
label: {
|
5240
|
-
id: "correction.corrector.identity.instruction",
|
5241
|
-
defaultMessage: "Please verify the identity of the person making this request",
|
5242
|
-
description: "The title for the corrector form"
|
5292
|
+
]
|
5243
5293
|
}
|
5294
|
+
]
|
5295
|
+
},
|
5296
|
+
{
|
5297
|
+
id: "correction-request.additional-details",
|
5298
|
+
type: PageTypes.enum.FORM,
|
5299
|
+
title: {
|
5300
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5301
|
+
defaultMessage: "Reason for correction",
|
5302
|
+
description: "This is the title of the section"
|
5244
5303
|
},
|
5245
|
-
|
5246
|
-
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
5250
|
-
|
5251
|
-
|
5252
|
-
|
5253
|
-
defaultValue: "",
|
5254
|
-
required: true,
|
5255
|
-
options: [
|
5256
|
-
{
|
5257
|
-
value: "VERIFIED",
|
5258
|
-
label: {
|
5259
|
-
id: "correction.corrector.identity.verified",
|
5260
|
-
defaultMessage: "I have verified their identity",
|
5261
|
-
description: "Label for verified option in corrector identity check page"
|
5262
|
-
}
|
5304
|
+
fields: [
|
5305
|
+
{
|
5306
|
+
id: "correction.request.reason",
|
5307
|
+
type: FieldType.TEXT,
|
5308
|
+
label: {
|
5309
|
+
id: "correction.reason.title",
|
5310
|
+
defaultMessage: "Reason for correction?",
|
5311
|
+
description: "The title for the corrector form"
|
5263
5312
|
}
|
5264
|
-
]
|
5265
|
-
}
|
5266
|
-
]
|
5267
|
-
}
|
5268
|
-
],
|
5269
|
-
additionalDetailsForm: [
|
5270
|
-
{
|
5271
|
-
id: "correction-request.supporting-documents",
|
5272
|
-
type: PageTypes.enum.FORM,
|
5273
|
-
title: {
|
5274
|
-
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5275
|
-
defaultMessage: "Upload supporting documents",
|
5276
|
-
description: "This is the title of the section"
|
5277
|
-
},
|
5278
|
-
fields: [
|
5279
|
-
{
|
5280
|
-
id: "correction.supportingDocs.introduction",
|
5281
|
-
type: "PAGE_HEADER",
|
5282
|
-
label: {
|
5283
|
-
id: "correction.corrector.paragraph.title",
|
5284
|
-
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
5285
|
-
description: "The title for the corrector form"
|
5286
|
-
}
|
5287
|
-
},
|
5288
|
-
{
|
5289
|
-
id: "correction.supportingDocs",
|
5290
|
-
type: FieldType.FILE,
|
5291
|
-
label: {
|
5292
|
-
id: "correction.corrector.title",
|
5293
|
-
defaultMessage: "Upload supporting documents",
|
5294
|
-
description: "The title for the corrector form"
|
5295
5313
|
}
|
5296
|
-
|
5297
|
-
|
5298
|
-
|
5299
|
-
|
5300
|
-
label: {
|
5301
|
-
id: "correction.corrector.title",
|
5302
|
-
defaultMessage: "Who is requesting a change to this record?",
|
5303
|
-
description: "The title for the corrector form"
|
5304
|
-
},
|
5305
|
-
defaultValue: "",
|
5306
|
-
configuration: {
|
5307
|
-
styles: {
|
5308
|
-
size: "NORMAL"
|
5309
|
-
}
|
5310
|
-
},
|
5311
|
-
options: [
|
5312
|
-
{
|
5313
|
-
value: "ATTEST",
|
5314
|
-
label: {
|
5315
|
-
id: "correction.supportingDocuments.attest.label",
|
5316
|
-
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
5317
|
-
description: ""
|
5318
|
-
}
|
5319
|
-
},
|
5320
|
-
{
|
5321
|
-
value: "NOT_NEEDED",
|
5322
|
-
label: {
|
5323
|
-
id: "correction.supportingDocuments.notNeeded.label",
|
5324
|
-
defaultMessage: "No supporting documents required",
|
5325
|
-
description: ""
|
5326
|
-
}
|
5327
|
-
}
|
5328
|
-
]
|
5329
|
-
}
|
5330
|
-
]
|
5331
|
-
},
|
5332
|
-
{
|
5333
|
-
id: "correction-request.additional-details",
|
5334
|
-
type: PageTypes.enum.FORM,
|
5335
|
-
title: {
|
5336
|
-
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5337
|
-
defaultMessage: "Reason for correction",
|
5338
|
-
description: "This is the title of the section"
|
5339
|
-
},
|
5340
|
-
fields: [
|
5341
|
-
{
|
5342
|
-
id: "correction.request.reason",
|
5343
|
-
type: FieldType.TEXT,
|
5344
|
-
label: {
|
5345
|
-
id: "correction.reason.title",
|
5346
|
-
defaultMessage: "Reason for correction?",
|
5347
|
-
description: "The title for the corrector form"
|
5348
|
-
}
|
5349
|
-
}
|
5350
|
-
]
|
5351
|
-
}
|
5352
|
-
]
|
5314
|
+
]
|
5315
|
+
}
|
5316
|
+
]
|
5317
|
+
}
|
5353
5318
|
},
|
5354
5319
|
{
|
5355
5320
|
type: ActionType.APPROVE_CORRECTION,
|
@@ -5445,7 +5410,8 @@ var footballClubMembershipEvent = defineConfig({
|
|
5445
5410
|
id: "v2.event.football-club-membership.search.applicants"
|
5446
5411
|
},
|
5447
5412
|
fields: [
|
5448
|
-
field("applicant.
|
5413
|
+
field("applicant.firstname").fuzzy(),
|
5414
|
+
field("applicant.surname").fuzzy(),
|
5449
5415
|
field("applicant.dob").range(),
|
5450
5416
|
field("applicant.email").exact()
|
5451
5417
|
]
|
@@ -5456,7 +5422,10 @@ var footballClubMembershipEvent = defineConfig({
|
|
5456
5422
|
description: "Recommender details search field section title",
|
5457
5423
|
id: "v2.event.football-club-membership.search.recommender"
|
5458
5424
|
},
|
5459
|
-
fields: [
|
5425
|
+
fields: [
|
5426
|
+
field("recommender.firstname").fuzzy(),
|
5427
|
+
field("recommender.surname").fuzzy()
|
5428
|
+
]
|
5460
5429
|
}
|
5461
5430
|
],
|
5462
5431
|
declaration: TENNIS_CLUB_DECLARATION_FORM
|
@@ -5521,253 +5490,33 @@ var libraryMembershipEvent = defineConfig({
|
|
5521
5490
|
declaration: libraryMembershipForm
|
5522
5491
|
});
|
5523
5492
|
|
5524
|
-
// ../commons/src/fixtures/v2-birth-event.ts
|
5525
|
-
var child = defineFormPage({
|
5526
|
-
id: "child",
|
5527
|
-
type: PageTypes.enum.FORM,
|
5528
|
-
title: {
|
5529
|
-
defaultMessage: "Child's details",
|
5530
|
-
description: "Form section title for Child",
|
5531
|
-
id: "v2.form.birth.child.title"
|
5532
|
-
},
|
5533
|
-
fields: [
|
5534
|
-
{
|
5535
|
-
id: "child.firstNames",
|
5536
|
-
type: FieldType.TEXT,
|
5537
|
-
required: true,
|
5538
|
-
configuration: { maxLength: 32 },
|
5539
|
-
hideLabel: true,
|
5540
|
-
label: {
|
5541
|
-
defaultMessage: "Child's first name",
|
5542
|
-
description: "This is the label for the field",
|
5543
|
-
id: "v2.event.birth.action.declare.form.section.child.field.name.label"
|
5544
|
-
}
|
5545
|
-
},
|
5546
|
-
{
|
5547
|
-
id: "child.familyName",
|
5548
|
-
type: FieldType.TEXT,
|
5549
|
-
required: true,
|
5550
|
-
configuration: { maxLength: 32 },
|
5551
|
-
hideLabel: true,
|
5552
|
-
label: {
|
5553
|
-
defaultMessage: "Child's last name",
|
5554
|
-
description: "This is the label for the field",
|
5555
|
-
id: "v2.event.birth.action.declare.form.section.child.field.name.label"
|
5556
|
-
}
|
5557
|
-
},
|
5558
|
-
{
|
5559
|
-
id: "child.DoB",
|
5560
|
-
type: "DATE",
|
5561
|
-
required: true,
|
5562
|
-
label: {
|
5563
|
-
defaultMessage: "Date of birth",
|
5564
|
-
description: "This is the label for the field",
|
5565
|
-
id: "v2.event.birth.action.declare.form.section.child.field.dob.label"
|
5566
|
-
}
|
5567
|
-
}
|
5568
|
-
]
|
5569
|
-
});
|
5570
|
-
var mother = defineFormPage({
|
5571
|
-
id: "mother",
|
5572
|
-
type: PageTypes.enum.FORM,
|
5573
|
-
title: {
|
5574
|
-
defaultMessage: "Mother's details",
|
5575
|
-
description: "Form section title for mothers details",
|
5576
|
-
id: "v2.form.section.mother.title"
|
5577
|
-
},
|
5578
|
-
fields: [
|
5579
|
-
{
|
5580
|
-
id: "mother.firstNames",
|
5581
|
-
configuration: { maxLength: 32 },
|
5582
|
-
type: FieldType.TEXT,
|
5583
|
-
required: true,
|
5584
|
-
label: {
|
5585
|
-
defaultMessage: "First name(s)",
|
5586
|
-
description: "This is the label for the field",
|
5587
|
-
id: `v2.event.birth.action.declare.form.section.person.field.firstname.label`
|
5588
|
-
}
|
5589
|
-
},
|
5590
|
-
{
|
5591
|
-
id: `mother.familyName`,
|
5592
|
-
configuration: { maxLength: 32 },
|
5593
|
-
type: FieldType.TEXT,
|
5594
|
-
required: true,
|
5595
|
-
label: {
|
5596
|
-
defaultMessage: "Last name",
|
5597
|
-
description: "This is the label for the field",
|
5598
|
-
id: `v2.event.birth.action.declare.form.section.person.field.surname.label`
|
5599
|
-
}
|
5600
|
-
},
|
5601
|
-
{
|
5602
|
-
id: `mother.DoB`,
|
5603
|
-
type: "DATE",
|
5604
|
-
required: true,
|
5605
|
-
label: {
|
5606
|
-
defaultMessage: "Date of birth",
|
5607
|
-
description: "This is the label for the field",
|
5608
|
-
id: `v2.event.birth.action.declare.form.section.person.field.dob.label`
|
5609
|
-
}
|
5610
|
-
},
|
5611
|
-
{
|
5612
|
-
id: "mother.identifier",
|
5613
|
-
type: FieldType.ID,
|
5614
|
-
required: true,
|
5615
|
-
label: {
|
5616
|
-
defaultMessage: "ID Number",
|
5617
|
-
description: "This is the label for the field",
|
5618
|
-
id: `v2.event.birth.action.declare.form.section.person.field.nid.label`
|
5619
|
-
}
|
5620
|
-
}
|
5621
|
-
]
|
5622
|
-
});
|
5623
|
-
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
5624
|
-
label: {
|
5625
|
-
defaultMessage: "Birth decalration form",
|
5626
|
-
id: "v2.event.birth.action.declare.form.label",
|
5627
|
-
description: "This is what this form is referred as in the system"
|
5628
|
-
},
|
5629
|
-
pages: [child, mother]
|
5630
|
-
});
|
5631
|
-
var v2BirthEvent = defineConfig({
|
5632
|
-
id: BIRTH_EVENT,
|
5633
|
-
title: {
|
5634
|
-
defaultMessage: "{child.name.firstname} {child.name.surname}",
|
5635
|
-
description: "This is the title of the summary",
|
5636
|
-
id: "v2.event.birth.title"
|
5637
|
-
},
|
5638
|
-
label: {
|
5639
|
-
defaultMessage: "Birth",
|
5640
|
-
description: "This is what this event is referred as in the system",
|
5641
|
-
id: "v2.event.birth.label"
|
5642
|
-
},
|
5643
|
-
summary: {
|
5644
|
-
fields: []
|
5645
|
-
},
|
5646
|
-
actions: [],
|
5647
|
-
declaration: BIRTH_DECLARATION_FORM
|
5648
|
-
});
|
5649
|
-
|
5650
5493
|
// ../commons/src/events/test.utils.ts
|
5651
|
-
function
|
5652
|
-
return items[Math.floor(rng() * items.length)];
|
5653
|
-
}
|
5654
|
-
function generateRandomName(rng) {
|
5655
|
-
const firstnames = [
|
5656
|
-
"Danny",
|
5657
|
-
"John",
|
5658
|
-
"Jane",
|
5659
|
-
"Emily",
|
5660
|
-
"Michael",
|
5661
|
-
"Sarah",
|
5662
|
-
"Chris",
|
5663
|
-
"Jessica",
|
5664
|
-
"Sara",
|
5665
|
-
"Sarachella",
|
5666
|
-
"Sarandera",
|
5667
|
-
"Zara"
|
5668
|
-
];
|
5669
|
-
const surnames = [
|
5670
|
-
"Doe",
|
5671
|
-
"Smith",
|
5672
|
-
"Johnson",
|
5673
|
-
"Brown",
|
5674
|
-
"Williams",
|
5675
|
-
"Jones",
|
5676
|
-
"Garcia",
|
5677
|
-
"Miller",
|
5678
|
-
"Saranen",
|
5679
|
-
"Sarajanen",
|
5680
|
-
"Sarthua",
|
5681
|
-
"Tsarakovski",
|
5682
|
-
"Salamander",
|
5683
|
-
"Zarathustra"
|
5684
|
-
];
|
5685
|
-
return {
|
5686
|
-
firstname: pickRandom(rng, firstnames),
|
5687
|
-
surname: pickRandom(rng, surnames)
|
5688
|
-
};
|
5689
|
-
}
|
5690
|
-
function mapFieldTypeToMockValue(field2, i, rng) {
|
5691
|
-
switch (field2.type) {
|
5692
|
-
case FieldType.DIVIDER:
|
5693
|
-
case FieldType.TEXT:
|
5694
|
-
case FieldType.TEXTAREA:
|
5695
|
-
case FieldType.BULLET_LIST:
|
5696
|
-
case FieldType.PAGE_HEADER:
|
5697
|
-
case FieldType.LOCATION:
|
5698
|
-
case FieldType.SELECT:
|
5699
|
-
case FieldType.COUNTRY:
|
5700
|
-
case FieldType.RADIO_GROUP:
|
5701
|
-
case FieldType.PARAGRAPH:
|
5702
|
-
case FieldType.ADMINISTRATIVE_AREA:
|
5703
|
-
case FieldType.FACILITY:
|
5704
|
-
case FieldType.PHONE:
|
5705
|
-
case FieldType.ID:
|
5706
|
-
case FieldType.OFFICE:
|
5707
|
-
return `${field2.id}-${field2.type}-${i}`;
|
5708
|
-
case FieldType.NAME:
|
5709
|
-
return generateRandomName(rng);
|
5710
|
-
case FieldType.NUMBER:
|
5711
|
-
return 19;
|
5712
|
-
case FieldType.EMAIL:
|
5713
|
-
return "test@opencrvs.org";
|
5714
|
-
case FieldType.ADDRESS:
|
5715
|
-
return {
|
5716
|
-
country: "FAR",
|
5717
|
-
addressType: AddressType.DOMESTIC,
|
5718
|
-
province: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
5719
|
-
district: "5ef450bc-712d-48ad-93f3-8da0fa453baa",
|
5720
|
-
urbanOrRural: "URBAN",
|
5721
|
-
town: "Example Town",
|
5722
|
-
residentialArea: "Example Residential Area",
|
5723
|
-
street: "Example Street",
|
5724
|
-
number: "55",
|
5725
|
-
zipCode: "123456"
|
5726
|
-
};
|
5727
|
-
case FieldType.DATE:
|
5728
|
-
return "2021-01-01";
|
5729
|
-
case FieldType.DATE_RANGE:
|
5730
|
-
return ["2021-01-01", "2021-01-02"];
|
5731
|
-
case FieldType.CHECKBOX:
|
5732
|
-
return true;
|
5733
|
-
case FieldType.SIGNATURE:
|
5734
|
-
case FieldType.FILE:
|
5735
|
-
return {
|
5736
|
-
filename: "4f095fc4-4312-4de2-aa38-86dcc0f71044.png",
|
5737
|
-
originalFilename: "abcd.png",
|
5738
|
-
type: "image/png"
|
5739
|
-
};
|
5740
|
-
case FieldType.FILE_WITH_OPTIONS:
|
5741
|
-
case FieldType.DATA:
|
5742
|
-
return void 0;
|
5743
|
-
}
|
5744
|
-
}
|
5745
|
-
function fieldConfigsToActionPayload(fields, rng) {
|
5494
|
+
function fieldConfigsToActionPayload(fields) {
|
5746
5495
|
return fields.reduce(
|
5747
5496
|
(acc, field2, i) => ({
|
5748
5497
|
...acc,
|
5749
|
-
[field2.id]: mapFieldTypeToMockValue(field2, i
|
5498
|
+
[field2.id]: mapFieldTypeToMockValue(field2, i)
|
5750
5499
|
}),
|
5751
5500
|
{}
|
5752
5501
|
);
|
5753
5502
|
}
|
5754
|
-
function generateActionDeclarationInput(configuration, action
|
5503
|
+
function generateActionDeclarationInput(configuration, action) {
|
5755
5504
|
const parsed = DeclarationUpdateActions.safeParse(action);
|
5756
5505
|
if (parsed.success) {
|
5757
5506
|
const fields = getDeclarationFields(configuration);
|
5758
5507
|
const declarationConfig = getDeclaration(configuration);
|
5759
|
-
const declaration = fieldConfigsToActionPayload(fields
|
5508
|
+
const declaration = fieldConfigsToActionPayload(fields);
|
5760
5509
|
return omitHiddenPaginatedFields(declarationConfig, declaration);
|
5761
5510
|
}
|
5762
5511
|
console.warn(`${action} is not a declaration action. Setting data as {}.`);
|
5763
5512
|
return {};
|
5764
5513
|
}
|
5765
|
-
function generateActionAnnotationInput(configuration, action
|
5514
|
+
function generateActionAnnotationInput(configuration, action) {
|
5766
5515
|
const actionConfig = configuration.actions.find(
|
5767
5516
|
(ac) => ac.type === action
|
5768
5517
|
);
|
5769
5518
|
const annotationFields = actionConfig ? getActionAnnotationFields(actionConfig) : [];
|
5770
|
-
const annotation = fieldConfigsToActionPayload(annotationFields
|
5519
|
+
const annotation = fieldConfigsToActionPayload(annotationFields);
|
5771
5520
|
const visibleVerificationPageIds = getVisibleVerificationPageIds(
|
5772
5521
|
findRecordActionPages(configuration, action),
|
5773
5522
|
annotation
|
@@ -5785,226 +5534,198 @@ function generateActionAnnotationInput(configuration, action, rng) {
|
|
5785
5534
|
...visiblePageVerificationMap
|
5786
5535
|
};
|
5787
5536
|
}
|
5788
|
-
|
5789
|
-
|
5790
|
-
|
5537
|
+
var eventPayloadGenerator = {
|
5538
|
+
create: (input = {}) => ({
|
5539
|
+
transactionId: input.transactionId ?? getUUID(),
|
5540
|
+
type: input.type ?? TENNIS_CLUB_MEMBERSHIP
|
5541
|
+
}),
|
5542
|
+
patch: (id, input = {}) => ({
|
5543
|
+
transactionId: input.transactionId ?? getUUID(),
|
5544
|
+
type: input.type ?? TENNIS_CLUB_MEMBERSHIP,
|
5545
|
+
id
|
5546
|
+
}),
|
5547
|
+
draft: ({ eventId, actionType }, input = {}) => (0, import_lodash2.merge)(
|
5548
|
+
{
|
5549
|
+
id: getUUID(),
|
5550
|
+
eventId,
|
5551
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
5552
|
+
transactionId: getUUID(),
|
5553
|
+
action: {
|
5554
|
+
transactionId: getUUID(),
|
5555
|
+
type: actionType,
|
5556
|
+
status: ActionStatus.Accepted,
|
5557
|
+
declaration: {
|
5558
|
+
"applicant.firstname": "Max",
|
5559
|
+
"applicant.surname": "McLaren",
|
5560
|
+
"applicant.dob": "2020-01-02",
|
5561
|
+
"recommender.none": true
|
5562
|
+
},
|
5563
|
+
annotation: {
|
5564
|
+
"correction.requester.relationship": "ANOTHER_AGENT",
|
5565
|
+
"correction.request.reason": "Child's name was incorrect"
|
5566
|
+
},
|
5567
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
5568
|
+
createdBy: "@todo",
|
5569
|
+
createdByRole: "@todo",
|
5570
|
+
createdAtLocation: "@todo"
|
5571
|
+
}
|
5572
|
+
},
|
5573
|
+
input
|
5574
|
+
),
|
5575
|
+
actions: {
|
5576
|
+
declare: (eventId, input = {}) => ({
|
5577
|
+
type: ActionType.DECLARE,
|
5791
5578
|
transactionId: input.transactionId ?? getUUID(),
|
5792
|
-
|
5579
|
+
declaration: input.declaration ?? generateActionDeclarationInput(
|
5580
|
+
tennisClubMembershipEvent,
|
5581
|
+
ActionType.DECLARE
|
5582
|
+
),
|
5583
|
+
annotation: input.annotation ?? generateActionAnnotationInput(
|
5584
|
+
tennisClubMembershipEvent,
|
5585
|
+
ActionType.DECLARE
|
5586
|
+
),
|
5587
|
+
eventId
|
5793
5588
|
}),
|
5794
|
-
|
5589
|
+
/**
|
5590
|
+
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
5591
|
+
*/
|
5592
|
+
notify: (eventId, input = {}) => {
|
5593
|
+
let declaration = input.declaration;
|
5594
|
+
if (!declaration) {
|
5595
|
+
const partialDeclaration = (0, import_lodash2.omitBy)(
|
5596
|
+
generateActionDeclarationInput(
|
5597
|
+
tennisClubMembershipEvent,
|
5598
|
+
ActionType.DECLARE
|
5599
|
+
),
|
5600
|
+
import_lodash2.isString
|
5601
|
+
);
|
5602
|
+
declaration = partialDeclaration;
|
5603
|
+
}
|
5604
|
+
return {
|
5605
|
+
type: ActionType.NOTIFY,
|
5606
|
+
transactionId: input.transactionId ?? getUUID(),
|
5607
|
+
declaration,
|
5608
|
+
eventId
|
5609
|
+
};
|
5610
|
+
},
|
5611
|
+
validate: (eventId, input = {}) => ({
|
5612
|
+
type: ActionType.VALIDATE,
|
5795
5613
|
transactionId: input.transactionId ?? getUUID(),
|
5796
|
-
|
5797
|
-
|
5614
|
+
declaration: input.declaration ?? generateActionDeclarationInput(
|
5615
|
+
tennisClubMembershipEvent,
|
5616
|
+
ActionType.VALIDATE
|
5617
|
+
),
|
5618
|
+
annotation: input.annotation ?? generateActionAnnotationInput(
|
5619
|
+
tennisClubMembershipEvent,
|
5620
|
+
ActionType.VALIDATE
|
5621
|
+
),
|
5622
|
+
duplicates: [],
|
5623
|
+
eventId
|
5798
5624
|
}),
|
5799
|
-
|
5800
|
-
|
5801
|
-
|
5802
|
-
|
5803
|
-
|
5804
|
-
|
5805
|
-
|
5806
|
-
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
|
5813
|
-
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5817
|
-
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
5825
|
-
|
5826
|
-
|
5827
|
-
|
5828
|
-
|
5829
|
-
|
5830
|
-
|
5831
|
-
|
5832
|
-
|
5833
|
-
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5837
|
-
|
5838
|
-
|
5839
|
-
|
5840
|
-
|
5841
|
-
|
5842
|
-
|
5843
|
-
|
5844
|
-
|
5845
|
-
|
5846
|
-
|
5847
|
-
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5851
|
-
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
5855
|
-
|
5856
|
-
|
5857
|
-
|
5858
|
-
|
5859
|
-
|
5860
|
-
|
5861
|
-
|
5862
|
-
|
5863
|
-
|
5864
|
-
transactionId: input.transactionId ?? getUUID(),
|
5865
|
-
declaration,
|
5866
|
-
eventId,
|
5867
|
-
keepAssignment: input.keepAssignment
|
5868
|
-
};
|
5869
|
-
},
|
5870
|
-
validate: (eventId, input = {}) => ({
|
5871
|
-
type: ActionType.VALIDATE,
|
5625
|
+
assign: (eventId, input = {}) => ({
|
5626
|
+
type: ActionType.ASSIGN,
|
5627
|
+
transactionId: input.transactionId ?? getUUID(),
|
5628
|
+
declaration: {},
|
5629
|
+
assignedTo: input.assignedTo ?? getUUID(),
|
5630
|
+
eventId
|
5631
|
+
}),
|
5632
|
+
unassign: (eventId, input = {}) => ({
|
5633
|
+
type: ActionType.UNASSIGN,
|
5634
|
+
transactionId: input.transactionId ?? getUUID(),
|
5635
|
+
declaration: {},
|
5636
|
+
assignedTo: null,
|
5637
|
+
eventId
|
5638
|
+
}),
|
5639
|
+
archive: (eventId, input = {}, isDuplicate) => ({
|
5640
|
+
type: ActionType.ARCHIVE,
|
5641
|
+
transactionId: input.transactionId ?? getUUID(),
|
5642
|
+
declaration: {},
|
5643
|
+
// @TODO: Check whether generator is needed?
|
5644
|
+
annotation: {},
|
5645
|
+
duplicates: [],
|
5646
|
+
eventId,
|
5647
|
+
reason: {
|
5648
|
+
message: `${ActionType.ARCHIVE}`,
|
5649
|
+
isDuplicate: isDuplicate ?? false
|
5650
|
+
}
|
5651
|
+
}),
|
5652
|
+
reject: (eventId, input = {}) => ({
|
5653
|
+
type: ActionType.REJECT,
|
5654
|
+
transactionId: input.transactionId ?? getUUID(),
|
5655
|
+
declaration: {},
|
5656
|
+
annotation: input.annotation ?? generateActionAnnotationInput(
|
5657
|
+
tennisClubMembershipEvent,
|
5658
|
+
ActionType.REJECT
|
5659
|
+
),
|
5660
|
+
duplicates: [],
|
5661
|
+
eventId,
|
5662
|
+
reason: { message: `${ActionType.REJECT}` }
|
5663
|
+
}),
|
5664
|
+
register: (eventId, input = {}) => ({
|
5665
|
+
type: ActionType.REGISTER,
|
5666
|
+
transactionId: input.transactionId ?? getUUID(),
|
5667
|
+
declaration: input.declaration ?? generateActionDeclarationInput(
|
5668
|
+
tennisClubMembershipEvent,
|
5669
|
+
ActionType.REGISTER
|
5670
|
+
),
|
5671
|
+
annotation: input.annotation ?? generateActionAnnotationInput(
|
5672
|
+
tennisClubMembershipEvent,
|
5673
|
+
ActionType.REGISTER
|
5674
|
+
),
|
5675
|
+
eventId
|
5676
|
+
}),
|
5677
|
+
printCertificate: (eventId, input = {}) => ({
|
5678
|
+
type: ActionType.PRINT_CERTIFICATE,
|
5679
|
+
transactionId: input.transactionId ?? getUUID(),
|
5680
|
+
declaration: {},
|
5681
|
+
annotation: input.annotation ?? generateActionAnnotationInput(
|
5682
|
+
tennisClubMembershipEvent,
|
5683
|
+
ActionType.PRINT_CERTIFICATE
|
5684
|
+
),
|
5685
|
+
eventId
|
5686
|
+
}),
|
5687
|
+
correction: {
|
5688
|
+
request: (eventId, input = {}) => ({
|
5689
|
+
type: ActionType.REQUEST_CORRECTION,
|
5872
5690
|
transactionId: input.transactionId ?? getUUID(),
|
5873
5691
|
declaration: input.declaration ?? generateActionDeclarationInput(
|
5874
5692
|
tennisClubMembershipEvent,
|
5875
|
-
ActionType.
|
5876
|
-
rng
|
5693
|
+
ActionType.REQUEST_CORRECTION
|
5877
5694
|
),
|
5878
5695
|
annotation: input.annotation ?? generateActionAnnotationInput(
|
5879
5696
|
tennisClubMembershipEvent,
|
5880
|
-
ActionType.
|
5881
|
-
rng
|
5697
|
+
ActionType.REQUEST_CORRECTION
|
5882
5698
|
),
|
5883
|
-
duplicates: [],
|
5884
|
-
eventId,
|
5885
|
-
...input
|
5886
|
-
}),
|
5887
|
-
assign: (eventId, input = {}) => ({
|
5888
|
-
type: ActionType.ASSIGN,
|
5889
|
-
transactionId: input.transactionId ?? getUUID(),
|
5890
|
-
declaration: {},
|
5891
|
-
assignedTo: input.assignedTo ?? getUUID(),
|
5892
|
-
eventId
|
5893
|
-
}),
|
5894
|
-
unassign: (eventId, input = {}) => ({
|
5895
|
-
type: ActionType.UNASSIGN,
|
5896
|
-
transactionId: input.transactionId ?? getUUID(),
|
5897
|
-
declaration: {},
|
5898
|
-
assignedTo: null,
|
5899
5699
|
eventId
|
5900
5700
|
}),
|
5901
|
-
|
5902
|
-
type: ActionType.
|
5701
|
+
approve: (eventId, requestId, input = {}) => ({
|
5702
|
+
type: ActionType.APPROVE_CORRECTION,
|
5903
5703
|
transactionId: input.transactionId ?? getUUID(),
|
5904
5704
|
declaration: {},
|
5905
|
-
// @TODO: Check whether generator is needed?
|
5906
|
-
annotation: {},
|
5907
|
-
duplicates: [],
|
5908
|
-
eventId,
|
5909
|
-
reason: {
|
5910
|
-
message: `${ActionType.ARCHIVE}`,
|
5911
|
-
isDuplicate: isDuplicate ?? false
|
5912
|
-
},
|
5913
|
-
...input
|
5914
|
-
}),
|
5915
|
-
reject: (eventId, input = {}) => ({
|
5916
|
-
type: ActionType.REJECT,
|
5917
|
-
transactionId: input.transactionId ?? getUUID(),
|
5918
|
-
declaration: {},
|
5919
|
-
annotation: input.annotation ?? generateActionAnnotationInput(
|
5920
|
-
tennisClubMembershipEvent,
|
5921
|
-
ActionType.REJECT,
|
5922
|
-
rng
|
5923
|
-
),
|
5924
|
-
duplicates: [],
|
5925
|
-
eventId,
|
5926
|
-
reason: { message: `${ActionType.REJECT}` },
|
5927
|
-
...input
|
5928
|
-
}),
|
5929
|
-
register: (eventId, input = {}) => ({
|
5930
|
-
type: ActionType.REGISTER,
|
5931
|
-
transactionId: input.transactionId ?? getUUID(),
|
5932
|
-
declaration: input.declaration ?? generateActionDeclarationInput(
|
5933
|
-
tennisClubMembershipEvent,
|
5934
|
-
ActionType.REGISTER,
|
5935
|
-
rng
|
5936
|
-
),
|
5937
5705
|
annotation: input.annotation ?? generateActionAnnotationInput(
|
5938
5706
|
tennisClubMembershipEvent,
|
5939
|
-
ActionType.
|
5940
|
-
rng
|
5707
|
+
ActionType.APPROVE_CORRECTION
|
5941
5708
|
),
|
5942
5709
|
eventId,
|
5943
|
-
|
5710
|
+
requestId
|
5944
5711
|
}),
|
5945
|
-
|
5946
|
-
type: ActionType.
|
5712
|
+
reject: (eventId, requestId, input = {}) => ({
|
5713
|
+
type: ActionType.REJECT_CORRECTION,
|
5947
5714
|
transactionId: input.transactionId ?? getUUID(),
|
5948
5715
|
declaration: {},
|
5949
5716
|
annotation: input.annotation ?? generateActionAnnotationInput(
|
5950
5717
|
tennisClubMembershipEvent,
|
5951
|
-
ActionType.
|
5952
|
-
rng
|
5718
|
+
ActionType.REJECT_CORRECTION
|
5953
5719
|
),
|
5954
5720
|
eventId,
|
5955
|
-
|
5956
|
-
})
|
5957
|
-
correction: {
|
5958
|
-
request: (eventId, input = {}) => ({
|
5959
|
-
type: ActionType.REQUEST_CORRECTION,
|
5960
|
-
transactionId: input.transactionId ?? getUUID(),
|
5961
|
-
declaration: input.declaration ?? generateActionDeclarationInput(
|
5962
|
-
tennisClubMembershipEvent,
|
5963
|
-
ActionType.REQUEST_CORRECTION,
|
5964
|
-
rng
|
5965
|
-
),
|
5966
|
-
annotation: input.annotation ?? generateActionAnnotationInput(
|
5967
|
-
tennisClubMembershipEvent,
|
5968
|
-
ActionType.REQUEST_CORRECTION,
|
5969
|
-
rng
|
5970
|
-
),
|
5971
|
-
eventId,
|
5972
|
-
keepAssignment: input.keepAssignment
|
5973
|
-
}),
|
5974
|
-
approve: (eventId, requestId, input = {}) => ({
|
5975
|
-
type: ActionType.APPROVE_CORRECTION,
|
5976
|
-
transactionId: input.transactionId ?? getUUID(),
|
5977
|
-
declaration: {},
|
5978
|
-
annotation: input.annotation ?? generateActionAnnotationInput(
|
5979
|
-
tennisClubMembershipEvent,
|
5980
|
-
ActionType.APPROVE_CORRECTION,
|
5981
|
-
rng
|
5982
|
-
),
|
5983
|
-
eventId,
|
5984
|
-
requestId,
|
5985
|
-
keepAssignment: input.keepAssignment
|
5986
|
-
}),
|
5987
|
-
reject: (eventId, requestId, input = {}) => ({
|
5988
|
-
type: ActionType.REJECT_CORRECTION,
|
5989
|
-
transactionId: input.transactionId ?? getUUID(),
|
5990
|
-
declaration: {},
|
5991
|
-
annotation: input.annotation ?? generateActionAnnotationInput(
|
5992
|
-
tennisClubMembershipEvent,
|
5993
|
-
ActionType.REJECT_CORRECTION,
|
5994
|
-
rng
|
5995
|
-
),
|
5996
|
-
eventId,
|
5997
|
-
requestId,
|
5998
|
-
keepAssignment: input.keepAssignment
|
5999
|
-
})
|
6000
|
-
}
|
5721
|
+
requestId
|
5722
|
+
})
|
6001
5723
|
}
|
6002
|
-
}
|
6003
|
-
}
|
5724
|
+
}
|
5725
|
+
};
|
6004
5726
|
function generateActionDocument({
|
6005
5727
|
configuration,
|
6006
5728
|
action,
|
6007
|
-
rng = () => 0.1,
|
6008
5729
|
defaults = {}
|
6009
5730
|
}) {
|
6010
5731
|
const actionBase = {
|
@@ -6015,7 +5736,7 @@ function generateActionDocument({
|
|
6015
5736
|
createdByRole: "FIELD_AGENT",
|
6016
5737
|
id: getUUID(),
|
6017
5738
|
createdAtLocation: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
6018
|
-
declaration: generateActionDeclarationInput(configuration, action
|
5739
|
+
declaration: generateActionDeclarationInput(configuration, action),
|
6019
5740
|
annotation: {},
|
6020
5741
|
status: ActionStatus.Accepted,
|
6021
5742
|
transactionId: getUUID(),
|
@@ -6067,14 +5788,13 @@ function generateActionDocument({
|
|
6067
5788
|
}
|
6068
5789
|
function generateEventDocument({
|
6069
5790
|
configuration,
|
6070
|
-
actions
|
6071
|
-
rng = () => 0.1
|
5791
|
+
actions
|
6072
5792
|
}) {
|
6073
5793
|
return {
|
6074
5794
|
trackingId: getUUID(),
|
6075
5795
|
type: configuration.id,
|
6076
5796
|
actions: actions.map(
|
6077
|
-
(action) => generateActionDocument({ configuration, action
|
5797
|
+
(action) => generateActionDocument({ configuration, action })
|
6078
5798
|
),
|
6079
5799
|
// Offset is needed so the createdAt timestamps for events, actions and drafts make logical sense in storybook tests.
|
6080
5800
|
// @TODO: This should be fixed in the future.
|
@@ -6085,16 +5805,10 @@ function generateEventDocument({
|
|
6085
5805
|
updatedAt: new Date(Date.now() - 1e3).toISOString()
|
6086
5806
|
};
|
6087
5807
|
}
|
6088
|
-
function generateEventDraftDocument({
|
6089
|
-
eventId,
|
6090
|
-
actionType,
|
6091
|
-
rng = () => 0.1,
|
6092
|
-
declaration = {}
|
6093
|
-
}) {
|
5808
|
+
function generateEventDraftDocument(eventId, actionType = ActionType.DECLARE, declaration = {}) {
|
6094
5809
|
const action = generateActionDocument({
|
6095
5810
|
configuration: tennisClubMembershipEvent,
|
6096
|
-
action: actionType
|
6097
|
-
rng
|
5811
|
+
action: actionType
|
6098
5812
|
});
|
6099
5813
|
return {
|
6100
5814
|
id: getUUID(),
|
@@ -6110,29 +5824,51 @@ function generateEventDraftDocument({
|
|
6110
5824
|
eventId
|
6111
5825
|
};
|
6112
5826
|
}
|
5827
|
+
function pickRandom(rng, items) {
|
5828
|
+
return items[Math.floor(rng() * items.length)];
|
5829
|
+
}
|
6113
5830
|
function getRandomDatetime(rng, start, end) {
|
6114
5831
|
const range = end.getTime() - start.getTime();
|
6115
5832
|
const offset = Math.floor(rng() * range);
|
6116
5833
|
const randomDate = new Date(start.getTime() + offset);
|
6117
5834
|
return randomDate.toISOString();
|
6118
5835
|
}
|
6119
|
-
function getRandomDate(rng, start, end) {
|
6120
|
-
const datetime = getRandomDatetime(rng, new Date(start), new Date(end));
|
6121
|
-
return datetime.split("T")[0];
|
6122
|
-
}
|
6123
5836
|
function generateRandomApplicant(rng) {
|
6124
|
-
const
|
6125
|
-
|
5837
|
+
const firstNames = [
|
5838
|
+
"Danny",
|
5839
|
+
"John",
|
5840
|
+
"Jane",
|
5841
|
+
"Emily",
|
5842
|
+
"Michael",
|
5843
|
+
"Sarah",
|
5844
|
+
"Chris",
|
5845
|
+
"Jessica"
|
5846
|
+
];
|
5847
|
+
const surnames = [
|
5848
|
+
"Doe",
|
5849
|
+
"Smith",
|
5850
|
+
"Johnson",
|
5851
|
+
"Brown",
|
5852
|
+
"Williams",
|
5853
|
+
"Jones",
|
5854
|
+
"Garcia",
|
5855
|
+
"Miller"
|
5856
|
+
];
|
5857
|
+
const randomFirstName = pickRandom(rng, firstNames);
|
5858
|
+
const randomSurname = pickRandom(rng, surnames);
|
5859
|
+
const randomDob = getRandomDatetime(
|
5860
|
+
rng,
|
5861
|
+
/* @__PURE__ */ new Date("1990-01-01"),
|
5862
|
+
/* @__PURE__ */ new Date("2010-12-31")
|
5863
|
+
).split("T")[0];
|
6126
5864
|
return {
|
6127
5865
|
"recommender.none": true,
|
6128
|
-
"applicant.
|
6129
|
-
|
6130
|
-
surname
|
6131
|
-
},
|
5866
|
+
"applicant.firstname": randomFirstName,
|
5867
|
+
"applicant.surname": randomSurname,
|
6132
5868
|
"applicant.dob": randomDob
|
6133
5869
|
};
|
6134
5870
|
}
|
6135
|
-
function
|
5871
|
+
function createPseudoRandomNumberGenerator(seed) {
|
6136
5872
|
const MODULUS = 2 ** 32;
|
6137
5873
|
const MULTIPLIER = 1664525;
|
6138
5874
|
const INCREMENT = 1013904223;
|
@@ -6158,7 +5894,7 @@ function generateRandomSignature(rng) {
|
|
6158
5894
|
return `/random-bucket/${generateUuid(rng)}.png`;
|
6159
5895
|
}
|
6160
5896
|
var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
6161
|
-
const rng =
|
5897
|
+
const rng = createPseudoRandomNumberGenerator(seed);
|
6162
5898
|
const createdAt = getRandomDatetime(
|
6163
5899
|
rng,
|
6164
5900
|
/* @__PURE__ */ new Date("2024-01-01"),
|
@@ -6167,7 +5903,7 @@ var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
|
6167
5903
|
return {
|
6168
5904
|
id: overrides.id ?? generateUuid(rng),
|
6169
5905
|
type: overrides.type ?? TENNIS_CLUB_MEMBERSHIP,
|
6170
|
-
status: overrides.status ?? pickRandom(rng,
|
5906
|
+
status: overrides.status ?? pickRandom(rng, eventStatuses),
|
6171
5907
|
createdAt: overrides.createdAt ?? createdAt,
|
6172
5908
|
createdBy: overrides.createdBy ?? generateUuid(rng),
|
6173
5909
|
createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
|
@@ -6221,9 +5957,7 @@ function isFieldValueWithoutTemplates(value) {
|
|
6221
5957
|
if (isTemplateVariable(value)) {
|
6222
5958
|
return false;
|
6223
5959
|
}
|
6224
|
-
if (typeof value === "object" &&
|
6225
|
-
//@ts-ignore
|
6226
|
-
Object.values(value).some((val) => isTemplateVariable(val))) {
|
5960
|
+
if (typeof value === "object" && Object.values(value).some((val) => isTemplateVariable(val))) {
|
6227
5961
|
return false;
|
6228
5962
|
}
|
6229
5963
|
return true;
|
@@ -6520,7 +6254,8 @@ var ACTION_ALLOWED_SCOPES = {
|
|
6520
6254
|
[ActionType.REGISTER]: [SCOPES.RECORD_REGISTER],
|
6521
6255
|
[ActionType.PRINT_CERTIFICATE]: [SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES],
|
6522
6256
|
[ActionType.REQUEST_CORRECTION]: [
|
6523
|
-
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION
|
6257
|
+
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION,
|
6258
|
+
SCOPES.RECORD_REGISTRATION_CORRECT
|
6524
6259
|
],
|
6525
6260
|
[ActionType.REJECT_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
|
6526
6261
|
[ActionType.APPROVE_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
|
@@ -6562,7 +6297,7 @@ function filterUnallowedActions(actions, userScopes) {
|
|
6562
6297
|
return hasAnyOfScopes(userScopes, requiredScopes);
|
6563
6298
|
});
|
6564
6299
|
const hasOtherAllowedActions = allowedActions.some(
|
6565
|
-
(action) =>
|
6300
|
+
(action) => action !== ActionType.READ && action !== ActionType.ASSIGN && action !== ActionType.UNASSIGN
|
6566
6301
|
);
|
6567
6302
|
if (hasOtherAllowedActions) {
|
6568
6303
|
return allowedActions;
|
@@ -6628,8 +6363,6 @@ function deserializeQuery(query, user2) {
|
|
6628
6363
|
...query,
|
6629
6364
|
clauses: query.clauses.map(
|
6630
6365
|
(clause) => deserializeQueryExpression(clause, user2)
|
6631
|
-
// SAFETY: This cast should be safe because `query.clauses` has already been validated as non-empty by the Zod schema.
|
6632
|
-
// Without the cast, TypeScript cannot infer the tuple type required by the target interface.
|
6633
6366
|
)
|
6634
6367
|
};
|
6635
6368
|
}
|