@opencrvs/toolkit 1.8.0-rc.ffe24c3 → 1.8.1-rc.0f10027
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 +1766 -14918
- package/dist/commons/conditionals/conditionals.d.ts +0 -12
- package/dist/commons/conditionals/validate.d.ts +5 -0
- package/dist/commons/events/ActionConfig.d.ts +37041 -35133
- package/dist/commons/events/ActionDocument.d.ts +3195 -1626
- package/dist/commons/events/ActionInput.d.ts +2316 -1380
- package/dist/commons/events/ActionType.d.ts +7 -4
- package/dist/commons/events/AdvancedSearchConfig.d.ts +134 -85
- package/dist/commons/events/CompositeFieldValue.d.ts +15 -15
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1162 -760
- package/dist/commons/events/Draft.d.ts +190 -118
- package/dist/commons/events/EventConfig.d.ts +20268 -22409
- package/dist/commons/events/EventDocument.d.ts +1695 -1021
- package/dist/commons/events/EventIndex.d.ts +516 -175
- package/dist/commons/events/EventMetadata.d.ts +6 -4
- package/dist/commons/events/FieldConfig.d.ts +1528 -449
- package/dist/commons/events/FieldType.d.ts +3 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +80 -41
- package/dist/commons/events/FieldValue.d.ts +58 -28
- package/dist/commons/events/FormConfig.d.ts +9263 -2657
- package/dist/commons/events/PageConfig.d.ts +3642 -2028
- package/dist/commons/events/SummaryConfig.d.ts +10 -10
- package/dist/commons/events/User.d.ts +6 -3
- package/dist/commons/events/WorkqueueConfig.d.ts +2243 -1338
- package/dist/commons/events/defineConfig.d.ts +2761 -3252
- package/dist/commons/events/event.d.ts +18 -18
- package/dist/commons/events/field.d.ts +27 -1
- package/dist/commons/events/scopes.d.ts +2 -1
- package/dist/commons/events/test.utils.d.ts +62 -34
- package/dist/commons/events/utils.d.ts +8850 -6796
- package/dist/conditionals/index.js +23 -53
- package/dist/events/index.js +1617 -1344
- package/dist/scopes/index.d.ts +92 -6
- package/dist/scopes/index.js +38 -9
- package/package.json +3 -3
package/dist/events/index.js
CHANGED
@@ -106,6 +106,8 @@ __export(events_exports, {
|
|
106
106
|
Exact: () => Exact,
|
107
107
|
ExactDate: () => ExactDate,
|
108
108
|
ExactStatus: () => ExactStatus,
|
109
|
+
ExactUserType: () => ExactUserType,
|
110
|
+
ExclusiveActions: () => ExclusiveActions,
|
109
111
|
FieldConditional: () => FieldConditional,
|
110
112
|
FieldConfig: () => FieldConfig,
|
111
113
|
FieldConfigSchema: () => FieldConfigSchema,
|
@@ -141,7 +143,6 @@ __export(events_exports, {
|
|
141
143
|
QueryInput: () => QueryInput,
|
142
144
|
QueryType: () => QueryType,
|
143
145
|
Range: () => Range,
|
144
|
-
RangeDate: () => RangeDate,
|
145
146
|
ReadActionInput: () => ReadActionInput,
|
146
147
|
RegisterAction: () => RegisterAction,
|
147
148
|
RegisterActionInput: () => RegisterActionInput,
|
@@ -155,14 +156,19 @@ __export(events_exports, {
|
|
155
156
|
RuralAddressValue: () => RuralAddressValue,
|
156
157
|
SearchField: () => SearchField,
|
157
158
|
SearchQueryParams: () => SearchQueryParams,
|
159
|
+
SearchScopeAccessLevels: () => SearchScopeAccessLevels,
|
160
|
+
SelectDateRangeField: () => SelectDateRangeField,
|
161
|
+
SelectDateRangeOption: () => SelectDateRangeOption,
|
162
|
+
SelectDateRangeValue: () => SelectDateRangeValue,
|
158
163
|
SelectOption: () => SelectOption,
|
159
164
|
ShowConditional: () => ShowConditional,
|
160
165
|
SignatureFieldValue: () => SignatureFieldValue,
|
161
|
-
StatusChangingActions: () => StatusChangingActions,
|
162
166
|
SummaryConfig: () => SummaryConfig,
|
163
167
|
TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
|
168
|
+
TEST_SYSTEM_IANA_TIMEZONE: () => TEST_SYSTEM_IANA_TIMEZONE,
|
164
169
|
TestUserRole: () => TestUserRole,
|
165
170
|
TextValue: () => TextValue,
|
171
|
+
TimeValue: () => TimeValue,
|
166
172
|
TranslationConfig: () => TranslationConfig,
|
167
173
|
UnassignActionInput: () => UnassignActionInput,
|
168
174
|
UrbanAddressUpdateValue: () => UrbanAddressUpdateValue,
|
@@ -172,6 +178,7 @@ __export(events_exports, {
|
|
172
178
|
ValidationConfig: () => ValidationConfig,
|
173
179
|
VerificationActionConfig: () => VerificationActionConfig,
|
174
180
|
VerificationPageConfig: () => VerificationPageConfig,
|
181
|
+
VisibleStatus: () => VisibleStatus,
|
175
182
|
WRITE_ACTION_SCOPES: () => WRITE_ACTION_SCOPES,
|
176
183
|
Within: () => Within,
|
177
184
|
WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
|
@@ -188,11 +195,11 @@ __export(events_exports, {
|
|
188
195
|
alwaysTrue: () => alwaysTrue,
|
189
196
|
and: () => and,
|
190
197
|
annotationActions: () => annotationActions,
|
198
|
+
applyDeclarationToEventIndex: () => applyDeclarationToEventIndex,
|
191
199
|
applyDraftsToEventIndex: () => applyDraftsToEventIndex,
|
192
200
|
areConditionsMet: () => areConditionsMet,
|
193
201
|
compositeFieldTypes: () => compositeFieldTypes,
|
194
202
|
createEmptyDraft: () => createEmptyDraft,
|
195
|
-
createEventConditionals: () => createEventConditionals,
|
196
203
|
createFieldConditionals: () => createFieldConditionals,
|
197
204
|
createPrng: () => createPrng,
|
198
205
|
createValidationSchema: () => createValidationSchema,
|
@@ -243,6 +250,7 @@ __export(events_exports, {
|
|
243
250
|
getAnnotationFromDrafts: () => getAnnotationFromDrafts,
|
244
251
|
getAssignedUserFromActions: () => getAssignedUserFromActions,
|
245
252
|
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
253
|
+
getAvailableActionsForEvent: () => getAvailableActionsForEvent,
|
246
254
|
getCurrentEventState: () => getCurrentEventState,
|
247
255
|
getCurrentEventStateWithDrafts: () => getCurrentEventStateWithDrafts,
|
248
256
|
getDeclaration: () => getDeclaration,
|
@@ -251,6 +259,7 @@ __export(events_exports, {
|
|
251
259
|
getDeclarationPages: () => getDeclarationPages,
|
252
260
|
getEventConfigById: () => getEventConfigById,
|
253
261
|
getMixedPath: () => getMixedPath,
|
262
|
+
getPrintCertificatePages: () => getPrintCertificatePages,
|
254
263
|
getRandomDate: () => getRandomDate,
|
255
264
|
getRandomDatetime: () => getRandomDatetime,
|
256
265
|
getStatusFromActions: () => getStatusFromActions,
|
@@ -289,11 +298,13 @@ __export(events_exports, {
|
|
289
298
|
isParagraphFieldType: () => isParagraphFieldType,
|
290
299
|
isPhoneFieldType: () => isPhoneFieldType,
|
291
300
|
isRadioGroupFieldType: () => isRadioGroupFieldType,
|
301
|
+
isSelectDateRangeFieldType: () => isSelectDateRangeFieldType,
|
292
302
|
isSelectFieldType: () => isSelectFieldType,
|
293
303
|
isSignatureFieldType: () => isSignatureFieldType,
|
294
304
|
isTemplateVariable: () => isTemplateVariable,
|
295
305
|
isTextAreaFieldType: () => isTextAreaFieldType,
|
296
306
|
isTextFieldType: () => isTextFieldType,
|
307
|
+
isTimeFieldType: () => isTimeFieldType,
|
297
308
|
isUndeclaredDraft: () => isUndeclaredDraft,
|
298
309
|
isVerificationPage: () => isVerificationPage,
|
299
310
|
isWriteAction: () => isWriteAction,
|
@@ -307,7 +318,9 @@ __export(events_exports, {
|
|
307
318
|
omitHiddenFields: () => omitHiddenFields,
|
308
319
|
omitHiddenPaginatedFields: () => omitHiddenPaginatedFields,
|
309
320
|
or: () => or,
|
321
|
+
resolveDateOfEvent: () => resolveDateOfEvent,
|
310
322
|
runFieldValidations: () => runFieldValidations,
|
323
|
+
timePeriodToDateRange: () => timePeriodToDateRange,
|
311
324
|
user: () => user,
|
312
325
|
validate: () => validate,
|
313
326
|
validateFieldInput: () => validateFieldInput,
|
@@ -321,7 +334,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
321
334
|
var BIRTH_EVENT = "v2-birth";
|
322
335
|
|
323
336
|
// ../commons/src/events/ActionConfig.ts
|
324
|
-
var
|
337
|
+
var import_zod10 = require("zod");
|
325
338
|
|
326
339
|
// ../commons/src/events/Conditional.ts
|
327
340
|
var import_zod = require("zod");
|
@@ -372,12 +385,6 @@ var FieldConditional = import_zod.z.discriminatedUnion("type", [
|
|
372
385
|
ref: "FieldConditional"
|
373
386
|
});
|
374
387
|
|
375
|
-
// ../commons/src/events/PageConfig.ts
|
376
|
-
var import_zod6 = require("zod");
|
377
|
-
|
378
|
-
// ../commons/src/events/FieldConfig.ts
|
379
|
-
var import_zod5 = require("zod");
|
380
|
-
|
381
388
|
// ../commons/src/events/TranslationConfig.ts
|
382
389
|
var import_zod2 = require("zod");
|
383
390
|
var import_zod_openapi2 = require("zod-openapi");
|
@@ -395,6 +402,110 @@ var TranslationConfig = import_zod2.z.object({
|
|
395
402
|
ref: "TranslationConfig"
|
396
403
|
});
|
397
404
|
|
405
|
+
// ../commons/src/events/ActionType.ts
|
406
|
+
var import_zod3 = require("zod");
|
407
|
+
var ActionType = {
|
408
|
+
// Pre-declaration actions
|
409
|
+
DELETE: "DELETE",
|
410
|
+
CREATE: "CREATE",
|
411
|
+
NOTIFY: "NOTIFY",
|
412
|
+
// Declaration actions
|
413
|
+
DECLARE: "DECLARE",
|
414
|
+
VALIDATE: "VALIDATE",
|
415
|
+
REGISTER: "REGISTER",
|
416
|
+
// Declaration system actions. Non-configurable.
|
417
|
+
DETECT_DUPLICATE: "DETECT_DUPLICATE",
|
418
|
+
REJECT: "REJECT",
|
419
|
+
// REJECT_DECLARATION
|
420
|
+
MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE",
|
421
|
+
// MARK_AS_DUPLICATE
|
422
|
+
ARCHIVE: "ARCHIVE",
|
423
|
+
// Record actions
|
424
|
+
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
425
|
+
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
426
|
+
REJECT_CORRECTION: "REJECT_CORRECTION",
|
427
|
+
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
428
|
+
// General actions
|
429
|
+
READ: "READ",
|
430
|
+
ASSIGN: "ASSIGN",
|
431
|
+
UNASSIGN: "UNASSIGN"
|
432
|
+
};
|
433
|
+
var ConfirmableActions = [
|
434
|
+
ActionType.NOTIFY,
|
435
|
+
ActionType.DECLARE,
|
436
|
+
ActionType.VALIDATE,
|
437
|
+
ActionType.REGISTER,
|
438
|
+
ActionType.REJECT,
|
439
|
+
ActionType.ARCHIVE,
|
440
|
+
ActionType.PRINT_CERTIFICATE,
|
441
|
+
ActionType.REQUEST_CORRECTION,
|
442
|
+
ActionType.APPROVE_CORRECTION,
|
443
|
+
ActionType.REJECT_CORRECTION
|
444
|
+
];
|
445
|
+
var ActionTypes = import_zod3.z.enum([
|
446
|
+
"DELETE",
|
447
|
+
"CREATE",
|
448
|
+
"NOTIFY",
|
449
|
+
"DECLARE",
|
450
|
+
"VALIDATE",
|
451
|
+
"REGISTER",
|
452
|
+
"DETECT_DUPLICATE",
|
453
|
+
"REJECT",
|
454
|
+
"MARKED_AS_DUPLICATE",
|
455
|
+
"ARCHIVE",
|
456
|
+
"PRINT_CERTIFICATE",
|
457
|
+
"REQUEST_CORRECTION",
|
458
|
+
"REJECT_CORRECTION",
|
459
|
+
"APPROVE_CORRECTION",
|
460
|
+
"READ",
|
461
|
+
"ASSIGN",
|
462
|
+
"UNASSIGN"
|
463
|
+
]);
|
464
|
+
var ExclusiveActions = {
|
465
|
+
REVIEW_CORRECTION_REQUEST: "REVIEW_CORRECTION_REQUEST"
|
466
|
+
};
|
467
|
+
var declarationActionValues = [
|
468
|
+
ActionTypes.enum.DECLARE,
|
469
|
+
ActionTypes.enum.VALIDATE,
|
470
|
+
ActionTypes.enum.REGISTER
|
471
|
+
];
|
472
|
+
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
473
|
+
var declarationUpdateActionValues = [
|
474
|
+
...declarationActionValues,
|
475
|
+
ActionTypes.enum.REQUEST_CORRECTION
|
476
|
+
];
|
477
|
+
var DeclarationUpdateActions = ActionTypes.extract(
|
478
|
+
declarationUpdateActionValues
|
479
|
+
);
|
480
|
+
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
481
|
+
var writeActions = ActionTypes.exclude([
|
482
|
+
ActionType.CREATE,
|
483
|
+
ActionType.READ,
|
484
|
+
ActionType.ASSIGN,
|
485
|
+
ActionType.UNASSIGN
|
486
|
+
]);
|
487
|
+
var workqueueActions = ActionTypes.exclude([
|
488
|
+
ActionType.CREATE,
|
489
|
+
ActionType.NOTIFY,
|
490
|
+
ActionType.DETECT_DUPLICATE,
|
491
|
+
ActionType.REJECT,
|
492
|
+
ActionType.MARKED_AS_DUPLICATE,
|
493
|
+
ActionType.ARCHIVE,
|
494
|
+
ActionType.REJECT_CORRECTION,
|
495
|
+
ActionType.APPROVE_CORRECTION
|
496
|
+
]);
|
497
|
+
var META_ACTIONS = [
|
498
|
+
ActionType.ASSIGN,
|
499
|
+
ActionType.UNASSIGN,
|
500
|
+
ActionType.READ
|
501
|
+
];
|
502
|
+
function isMetaAction(actionType) {
|
503
|
+
return META_ACTIONS.includes(actionType);
|
504
|
+
}
|
505
|
+
|
506
|
+
// ../commons/src/events/FieldConfig.ts
|
507
|
+
var import_zod7 = require("zod");
|
508
|
+
|
398
509
|
// ../commons/src/events/FieldType.ts
|
399
510
|
var FieldType = {
|
400
511
|
NAME: "NAME",
|
@@ -407,6 +518,10 @@ var FieldType = {
|
|
407
518
|
EMAIL: "EMAIL",
|
408
519
|
DATE: "DATE",
|
409
520
|
DATE_RANGE: "DATE_RANGE",
|
521
|
+
// // Internal use, only for search functionality
|
522
|
+
SELECT_DATE_RANGE: "SELECT_DATE_RANGE",
|
523
|
+
// Internal use, only for search functionality
|
524
|
+
TIME: "TIME",
|
410
525
|
PARAGRAPH: "PARAGRAPH",
|
411
526
|
PAGE_HEADER: "PAGE_HEADER",
|
412
527
|
RADIO_GROUP: "RADIO_GROUP",
|
@@ -433,10 +548,24 @@ var compositeFieldTypes = [
|
|
433
548
|
];
|
434
549
|
|
435
550
|
// ../commons/src/events/FieldValue.ts
|
551
|
+
var import_zod6 = require("zod");
|
552
|
+
|
553
|
+
// ../commons/src/documents.ts
|
436
554
|
var import_zod4 = require("zod");
|
555
|
+
var import_zod_openapi3 = require("zod-openapi");
|
556
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod4.z);
|
557
|
+
var FullDocumentURL = import_zod4.z.string().brand("FullDocumentURL").describe(
|
558
|
+
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio/bucket-name/document-id.jpg"
|
559
|
+
);
|
560
|
+
var FullDocumentPath = import_zod4.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
561
|
+
"A full absolute path with bucket name, starting from the root of the S3 server, /bucket-name/document-id.jpg"
|
562
|
+
);
|
563
|
+
var DocumentPath = import_zod4.z.string().brand("DocumentPath").describe(
|
564
|
+
"A full identifier starting from the root of the S3 bucket, e.g. /document-id.jpg or /directory/document-id.jpg but never /bucket-name/document-id.jpg"
|
565
|
+
);
|
437
566
|
|
438
567
|
// ../commons/src/events/CompositeFieldValue.ts
|
439
|
-
var
|
568
|
+
var import_zod5 = require("zod");
|
440
569
|
var GeographicalArea = {
|
441
570
|
URBAN: "URBAN",
|
442
571
|
RURAL: "RURAL"
|
@@ -445,101 +574,115 @@ var AddressType = {
|
|
445
574
|
DOMESTIC: "DOMESTIC",
|
446
575
|
INTERNATIONAL: "INTERNATIONAL"
|
447
576
|
};
|
448
|
-
var FileFieldValue =
|
449
|
-
|
450
|
-
originalFilename:
|
451
|
-
type:
|
577
|
+
var FileFieldValue = import_zod5.z.object({
|
578
|
+
path: FullDocumentPath,
|
579
|
+
originalFilename: import_zod5.z.string(),
|
580
|
+
type: import_zod5.z.string()
|
452
581
|
});
|
453
|
-
var AdminStructure =
|
454
|
-
country:
|
455
|
-
addressType:
|
456
|
-
province:
|
457
|
-
district:
|
582
|
+
var AdminStructure = import_zod5.z.object({
|
583
|
+
country: import_zod5.z.string(),
|
584
|
+
addressType: import_zod5.z.literal(AddressType.DOMESTIC),
|
585
|
+
province: import_zod5.z.string(),
|
586
|
+
district: import_zod5.z.string()
|
458
587
|
});
|
459
588
|
var UrbanAddressValue = AdminStructure.extend({
|
460
|
-
urbanOrRural:
|
461
|
-
town:
|
462
|
-
residentialArea:
|
463
|
-
street:
|
464
|
-
number:
|
465
|
-
zipCode:
|
589
|
+
urbanOrRural: import_zod5.z.literal(GeographicalArea.URBAN),
|
590
|
+
town: import_zod5.z.string().optional(),
|
591
|
+
residentialArea: import_zod5.z.string().optional(),
|
592
|
+
street: import_zod5.z.string().optional(),
|
593
|
+
number: import_zod5.z.string().optional(),
|
594
|
+
zipCode: import_zod5.z.string().optional()
|
466
595
|
});
|
467
596
|
var RuralAddressValue = AdminStructure.extend({
|
468
|
-
urbanOrRural:
|
469
|
-
village:
|
597
|
+
urbanOrRural: import_zod5.z.literal(GeographicalArea.RURAL),
|
598
|
+
village: import_zod5.z.string().optional()
|
470
599
|
});
|
471
600
|
var UrbanAddressUpdateValue = AdminStructure.extend({
|
472
|
-
urbanOrRural:
|
473
|
-
town:
|
474
|
-
residentialArea:
|
475
|
-
street:
|
476
|
-
number:
|
477
|
-
zipCode:
|
601
|
+
urbanOrRural: import_zod5.z.literal(GeographicalArea.URBAN),
|
602
|
+
town: import_zod5.z.string().nullish(),
|
603
|
+
residentialArea: import_zod5.z.string().nullish(),
|
604
|
+
street: import_zod5.z.string().nullish(),
|
605
|
+
number: import_zod5.z.string().nullish(),
|
606
|
+
zipCode: import_zod5.z.string().nullish()
|
478
607
|
});
|
479
|
-
var NameFieldValue =
|
480
|
-
firstname:
|
481
|
-
surname:
|
482
|
-
middlename:
|
608
|
+
var NameFieldValue = import_zod5.z.object({
|
609
|
+
firstname: import_zod5.z.string().min(1),
|
610
|
+
surname: import_zod5.z.string().min(1),
|
611
|
+
middlename: import_zod5.z.string().optional()
|
483
612
|
});
|
484
|
-
var NameFieldUpdateValue =
|
485
|
-
firstname:
|
486
|
-
surname:
|
487
|
-
middlename:
|
488
|
-
}).or(
|
613
|
+
var NameFieldUpdateValue = import_zod5.z.object({
|
614
|
+
firstname: import_zod5.z.string().nullish(),
|
615
|
+
surname: import_zod5.z.string().nullish(),
|
616
|
+
middlename: import_zod5.z.string().nullish()
|
617
|
+
}).or(import_zod5.z.null()).or(import_zod5.z.undefined());
|
489
618
|
var RuralAddressUpdateValue = AdminStructure.extend({
|
490
|
-
urbanOrRural:
|
491
|
-
village:
|
619
|
+
urbanOrRural: import_zod5.z.literal(GeographicalArea.RURAL),
|
620
|
+
village: import_zod5.z.string().nullish()
|
492
621
|
});
|
493
|
-
var GenericAddressValue =
|
494
|
-
country:
|
495
|
-
addressType:
|
496
|
-
state:
|
497
|
-
district2:
|
498
|
-
cityOrTown:
|
499
|
-
addressLine1:
|
500
|
-
addressLine2:
|
501
|
-
addressLine3:
|
502
|
-
postcodeOrZip:
|
622
|
+
var GenericAddressValue = import_zod5.z.object({
|
623
|
+
country: import_zod5.z.string(),
|
624
|
+
addressType: import_zod5.z.literal(AddressType.INTERNATIONAL),
|
625
|
+
state: import_zod5.z.string(),
|
626
|
+
district2: import_zod5.z.string(),
|
627
|
+
cityOrTown: import_zod5.z.string().optional(),
|
628
|
+
addressLine1: import_zod5.z.string().optional(),
|
629
|
+
addressLine2: import_zod5.z.string().optional(),
|
630
|
+
addressLine3: import_zod5.z.string().optional(),
|
631
|
+
postcodeOrZip: import_zod5.z.string().optional()
|
503
632
|
});
|
504
|
-
var AddressFieldValue =
|
505
|
-
var GenericAddressUpdateValue =
|
506
|
-
country:
|
507
|
-
addressType:
|
508
|
-
state:
|
509
|
-
district2:
|
510
|
-
cityOrTown:
|
511
|
-
addressLine1:
|
512
|
-
addressLine2:
|
513
|
-
addressLine3:
|
514
|
-
postcodeOrZip:
|
633
|
+
var AddressFieldValue = import_zod5.z.discriminatedUnion("urbanOrRural", [UrbanAddressValue, RuralAddressValue]).or(GenericAddressValue);
|
634
|
+
var GenericAddressUpdateValue = import_zod5.z.object({
|
635
|
+
country: import_zod5.z.string(),
|
636
|
+
addressType: import_zod5.z.literal(AddressType.INTERNATIONAL),
|
637
|
+
state: import_zod5.z.string(),
|
638
|
+
district2: import_zod5.z.string(),
|
639
|
+
cityOrTown: import_zod5.z.string().nullish(),
|
640
|
+
addressLine1: import_zod5.z.string().nullish(),
|
641
|
+
addressLine2: import_zod5.z.string().nullish(),
|
642
|
+
addressLine3: import_zod5.z.string().nullish(),
|
643
|
+
postcodeOrZip: import_zod5.z.string().nullish()
|
515
644
|
});
|
516
|
-
var AddressFieldUpdateValue =
|
645
|
+
var AddressFieldUpdateValue = import_zod5.z.discriminatedUnion("urbanOrRural", [
|
517
646
|
UrbanAddressUpdateValue,
|
518
647
|
RuralAddressUpdateValue
|
519
648
|
]).or(GenericAddressUpdateValue);
|
520
|
-
var FileFieldValueWithOption =
|
521
|
-
|
522
|
-
originalFilename:
|
523
|
-
type:
|
524
|
-
option:
|
649
|
+
var FileFieldValueWithOption = import_zod5.z.object({
|
650
|
+
path: FullDocumentPath,
|
651
|
+
originalFilename: import_zod5.z.string(),
|
652
|
+
type: import_zod5.z.string(),
|
653
|
+
option: import_zod5.z.string()
|
525
654
|
});
|
526
|
-
var FileFieldWithOptionValue =
|
655
|
+
var FileFieldWithOptionValue = import_zod5.z.array(FileFieldValueWithOption);
|
527
656
|
|
528
657
|
// ../commons/src/events/FieldValue.ts
|
529
|
-
var TextValue =
|
658
|
+
var TextValue = import_zod6.z.string();
|
530
659
|
var NonEmptyTextValue = TextValue.min(1);
|
531
|
-
var DateValue =
|
532
|
-
var
|
533
|
-
var
|
534
|
-
var
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
660
|
+
var DateValue = import_zod6.z.string().date().describe("Date in the format YYYY-MM-DD");
|
661
|
+
var TimeValue = import_zod6.z.string().regex(/^([01][0-9]|2[0-3]):[0-5][0-9]$/);
|
662
|
+
var DatetimeValue = import_zod6.z.string().datetime();
|
663
|
+
var SelectDateRangeValue = import_zod6.z.enum([
|
664
|
+
"last7Days",
|
665
|
+
"last30Days",
|
666
|
+
"last90Days",
|
667
|
+
"last365Days"
|
668
|
+
]);
|
669
|
+
var DateRangeFieldValue = import_zod6.z.object({
|
670
|
+
start: DateValue,
|
671
|
+
end: DateValue
|
672
|
+
}).or(DateValue).describe(
|
673
|
+
"Date range with start and end dates in the format YYYY-MM-DD. Inclusive start, exclusive end."
|
674
|
+
);
|
675
|
+
var EmailValue = import_zod6.z.string().email();
|
676
|
+
var CheckboxFieldValue = import_zod6.z.boolean();
|
677
|
+
var NumberFieldValue = import_zod6.z.number();
|
678
|
+
var DataFieldValue = import_zod6.z.undefined();
|
679
|
+
var SignatureFieldValue = import_zod6.z.string();
|
680
|
+
var FieldValue = import_zod6.z.union([
|
540
681
|
TextValue,
|
541
682
|
DateValue,
|
683
|
+
TimeValue,
|
542
684
|
DateRangeFieldValue,
|
685
|
+
SelectDateRangeValue,
|
543
686
|
CheckboxFieldValue,
|
544
687
|
NumberFieldValue,
|
545
688
|
FileFieldValue,
|
@@ -551,10 +694,12 @@ var FieldValue = import_zod4.z.union([
|
|
551
694
|
NameFieldValue,
|
552
695
|
NameFieldUpdateValue
|
553
696
|
]);
|
554
|
-
var FieldUpdateValue =
|
697
|
+
var FieldUpdateValue = import_zod6.z.union([
|
555
698
|
TextValue,
|
556
699
|
DateValue,
|
700
|
+
TimeValue,
|
557
701
|
DateRangeFieldValue,
|
702
|
+
SelectDateRangeValue,
|
558
703
|
CheckboxFieldValue,
|
559
704
|
NumberFieldValue,
|
560
705
|
FileFieldValue,
|
@@ -567,63 +712,68 @@ var FieldUpdateValue = import_zod4.z.union([
|
|
567
712
|
]);
|
568
713
|
|
569
714
|
// ../commons/src/events/FieldConfig.ts
|
570
|
-
var
|
571
|
-
(0,
|
572
|
-
var FieldId =
|
573
|
-
var FieldReference =
|
715
|
+
var import_zod_openapi4 = require("zod-openapi");
|
716
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod7.z);
|
717
|
+
var FieldId = import_zod7.z.string().describe("Unique identifier for the field");
|
718
|
+
var FieldReference = import_zod7.z.object({
|
574
719
|
$$field: FieldId
|
575
720
|
}).describe("Reference to a field by its ID");
|
576
|
-
var
|
577
|
-
var ValidationConfig = import_zod5.z.object({
|
721
|
+
var ValidationConfig = import_zod7.z.object({
|
578
722
|
validator: Conditional,
|
579
723
|
message: TranslationConfig
|
580
724
|
});
|
581
|
-
var BaseField =
|
725
|
+
var BaseField = import_zod7.z.object({
|
582
726
|
id: FieldId,
|
583
|
-
parent: ParentReference,
|
584
|
-
conditionals: import_zod5.z.array(FieldConditional).default([]).optional(),
|
585
|
-
required: import_zod5.z.boolean().default(false).optional(),
|
586
|
-
placeholder: TranslationConfig.optional(),
|
587
|
-
validation: import_zod5.z.array(ValidationConfig).default([]).optional(),
|
588
727
|
label: TranslationConfig,
|
728
|
+
parent: FieldReference.optional().describe(
|
729
|
+
"Reference to a parent field. If a field has a parent, it will be reset when the parent field is changed."
|
730
|
+
),
|
731
|
+
required: import_zod7.z.boolean().default(false).optional(),
|
732
|
+
conditionals: import_zod7.z.array(FieldConditional).default([]).optional(),
|
733
|
+
secured: import_zod7.z.boolean().default(false).optional(),
|
734
|
+
placeholder: TranslationConfig.optional(),
|
735
|
+
validation: import_zod7.z.array(ValidationConfig).default([]).optional(),
|
589
736
|
helperText: TranslationConfig.optional(),
|
590
|
-
hideLabel:
|
737
|
+
hideLabel: import_zod7.z.boolean().default(false).optional(),
|
738
|
+
uncorrectable: import_zod7.z.boolean().default(false).optional().describe(
|
739
|
+
"Indicates if the field can be changed during a record correction."
|
740
|
+
)
|
591
741
|
});
|
592
742
|
var Divider = BaseField.extend({
|
593
|
-
type:
|
743
|
+
type: import_zod7.z.literal(FieldType.DIVIDER)
|
594
744
|
});
|
595
745
|
var TextField = BaseField.extend({
|
596
|
-
type:
|
746
|
+
type: import_zod7.z.literal(FieldType.TEXT),
|
597
747
|
defaultValue: NonEmptyTextValue.optional(),
|
598
|
-
configuration:
|
599
|
-
maxLength:
|
600
|
-
type:
|
748
|
+
configuration: import_zod7.z.object({
|
749
|
+
maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
|
750
|
+
type: import_zod7.z.enum(["text", "password"]).optional(),
|
601
751
|
prefix: TranslationConfig.optional(),
|
602
752
|
postfix: TranslationConfig.optional()
|
603
753
|
}).default({ type: "text" }).optional()
|
604
754
|
}).describe("Text input");
|
605
755
|
var NumberField = BaseField.extend({
|
606
|
-
type:
|
756
|
+
type: import_zod7.z.literal(FieldType.NUMBER),
|
607
757
|
defaultValue: NumberFieldValue.optional(),
|
608
|
-
configuration:
|
609
|
-
min:
|
610
|
-
max:
|
758
|
+
configuration: import_zod7.z.object({
|
759
|
+
min: import_zod7.z.number().optional().describe("Minimum value"),
|
760
|
+
max: import_zod7.z.number().optional().describe("Maximum value"),
|
611
761
|
prefix: TranslationConfig.optional(),
|
612
762
|
postfix: TranslationConfig.optional()
|
613
763
|
}).optional()
|
614
764
|
}).describe("Number input");
|
615
765
|
var TextAreaField = BaseField.extend({
|
616
|
-
type:
|
766
|
+
type: import_zod7.z.literal(FieldType.TEXTAREA),
|
617
767
|
defaultValue: NonEmptyTextValue.optional(),
|
618
|
-
configuration:
|
619
|
-
maxLength:
|
620
|
-
rows:
|
621
|
-
cols:
|
768
|
+
configuration: import_zod7.z.object({
|
769
|
+
maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
|
770
|
+
rows: import_zod7.z.number().optional().describe("Number of visible text lines"),
|
771
|
+
cols: import_zod7.z.number().optional().describe("Number of visible columns"),
|
622
772
|
prefix: TranslationConfig.optional(),
|
623
773
|
postfix: TranslationConfig.optional()
|
624
774
|
}).default({ rows: 4 }).optional()
|
625
775
|
}).describe("Multiline text input");
|
626
|
-
var ImageMimeType =
|
776
|
+
var ImageMimeType = import_zod7.z.enum([
|
627
777
|
"image/png",
|
628
778
|
"image/jpg",
|
629
779
|
"image/jpeg",
|
@@ -632,46 +782,53 @@ var ImageMimeType = import_zod5.z.enum([
|
|
632
782
|
var MimeType = ImageMimeType;
|
633
783
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
634
784
|
var SignatureField = BaseField.extend({
|
635
|
-
type:
|
785
|
+
type: import_zod7.z.literal(FieldType.SIGNATURE),
|
636
786
|
signaturePromptLabel: TranslationConfig.describe(
|
637
787
|
"Title of the signature modal"
|
638
788
|
),
|
639
789
|
defaultValue: SignatureFieldValue.optional(),
|
640
|
-
configuration:
|
641
|
-
maxFileSize:
|
790
|
+
configuration: import_zod7.z.object({
|
791
|
+
maxFileSize: import_zod7.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
642
792
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
643
793
|
}).default({
|
644
794
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
645
795
|
})
|
646
796
|
}).describe("Signature input field");
|
647
797
|
var EmailField = BaseField.extend({
|
648
|
-
type:
|
649
|
-
configuration:
|
650
|
-
maxLength:
|
798
|
+
type: import_zod7.z.literal(FieldType.EMAIL),
|
799
|
+
configuration: import_zod7.z.object({
|
800
|
+
maxLength: import_zod7.z.number().optional().describe("Maximum length of the text")
|
651
801
|
}).default({ maxLength: 10 }).optional(),
|
652
802
|
defaultValue: NonEmptyTextValue.optional()
|
653
803
|
});
|
654
804
|
var DateField = BaseField.extend({
|
655
|
-
type:
|
805
|
+
type: import_zod7.z.literal(FieldType.DATE),
|
656
806
|
defaultValue: DateValue.optional(),
|
657
|
-
configuration:
|
807
|
+
configuration: import_zod7.z.object({
|
658
808
|
notice: TranslationConfig.describe(
|
659
809
|
"Text to display above the date input"
|
660
810
|
).optional()
|
661
811
|
}).optional()
|
662
|
-
}).describe("A single date input (
|
812
|
+
}).describe("A single date input (yyyy-MM-dd)");
|
813
|
+
var TimeField = BaseField.extend({
|
814
|
+
type: import_zod7.z.literal(FieldType.TIME),
|
815
|
+
defaultValue: TimeValue.optional(),
|
816
|
+
configuration: import_zod7.z.object({
|
817
|
+
notice: TranslationConfig.describe(
|
818
|
+
"Text to display above the time input"
|
819
|
+
).optional()
|
820
|
+
}).optional()
|
821
|
+
}).describe("A single date input (HH-mm)");
|
663
822
|
var DateRangeField = BaseField.extend({
|
664
|
-
type:
|
823
|
+
type: import_zod7.z.literal(FieldType.DATE_RANGE),
|
665
824
|
defaultValue: DateRangeFieldValue.optional(),
|
666
|
-
configuration:
|
825
|
+
configuration: import_zod7.z.object({
|
667
826
|
notice: TranslationConfig.describe(
|
668
827
|
"Text to display above the date input"
|
669
828
|
).optional()
|
670
829
|
}).optional()
|
671
|
-
}).describe(
|
672
|
-
|
673
|
-
);
|
674
|
-
var HtmlFontVariant = import_zod5.z.enum([
|
830
|
+
}).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
|
831
|
+
var HtmlFontVariant = import_zod7.z.enum([
|
675
832
|
"reg12",
|
676
833
|
"reg14",
|
677
834
|
"reg16",
|
@@ -681,27 +838,31 @@ var HtmlFontVariant = import_zod5.z.enum([
|
|
681
838
|
"h2",
|
682
839
|
"h1"
|
683
840
|
]);
|
841
|
+
var ParagraphConfiguration = import_zod7.z.object({
|
842
|
+
styles: import_zod7.z.object({
|
843
|
+
fontVariant: HtmlFontVariant.optional().describe(
|
844
|
+
"Font variant to use for the paragraph text"
|
845
|
+
),
|
846
|
+
hint: import_zod7.z.boolean().optional().describe("When true, paragraph is styled as a hint with grey color")
|
847
|
+
}).optional()
|
848
|
+
}).default({});
|
684
849
|
var Paragraph = BaseField.extend({
|
685
|
-
type:
|
850
|
+
type: import_zod7.z.literal(FieldType.PARAGRAPH),
|
686
851
|
defaultValue: NonEmptyTextValue.optional(),
|
687
|
-
configuration:
|
688
|
-
styles: import_zod5.z.object({
|
689
|
-
fontVariant: HtmlFontVariant.optional()
|
690
|
-
}).optional()
|
691
|
-
}).default({})
|
852
|
+
configuration: ParagraphConfiguration
|
692
853
|
}).describe("A read-only HTML <p> paragraph");
|
693
854
|
var PageHeader = BaseField.extend({
|
694
|
-
type:
|
855
|
+
type: import_zod7.z.literal(FieldType.PAGE_HEADER),
|
695
856
|
defaultValue: NonEmptyTextValue.optional()
|
696
857
|
}).describe("A read-only header component for form pages");
|
697
858
|
var File = BaseField.extend({
|
698
|
-
type:
|
859
|
+
type: import_zod7.z.literal(FieldType.FILE),
|
699
860
|
defaultValue: FileFieldValue.optional(),
|
700
|
-
configuration:
|
701
|
-
maxFileSize:
|
861
|
+
configuration: import_zod7.z.object({
|
862
|
+
maxFileSize: import_zod7.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
702
863
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
703
|
-
style:
|
704
|
-
width:
|
864
|
+
style: import_zod7.z.object({
|
865
|
+
width: import_zod7.z.enum(["full", "auto"]).optional().describe(
|
705
866
|
"Whether the file upload button should take the full width of the container or not"
|
706
867
|
)
|
707
868
|
}).optional(),
|
@@ -710,129 +871,148 @@ var File = BaseField.extend({
|
|
710
871
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
711
872
|
})
|
712
873
|
}).describe("File upload");
|
713
|
-
var SelectOption =
|
714
|
-
value:
|
874
|
+
var SelectOption = import_zod7.z.object({
|
875
|
+
value: import_zod7.z.string().describe("The value of the option"),
|
715
876
|
label: TranslationConfig.describe("The label of the option")
|
716
877
|
});
|
717
878
|
var RadioGroup = BaseField.extend({
|
718
|
-
type:
|
879
|
+
type: import_zod7.z.literal(FieldType.RADIO_GROUP),
|
719
880
|
defaultValue: TextValue.optional(),
|
720
|
-
options:
|
721
|
-
configuration:
|
722
|
-
styles:
|
723
|
-
size:
|
881
|
+
options: import_zod7.z.array(SelectOption).describe("A list of options"),
|
882
|
+
configuration: import_zod7.z.object({
|
883
|
+
styles: import_zod7.z.object({
|
884
|
+
size: import_zod7.z.enum(["NORMAL", "LARGE"]).optional()
|
724
885
|
}).optional()
|
725
886
|
}).optional()
|
726
887
|
}).describe("Grouped radio options");
|
727
888
|
var BulletList = BaseField.extend({
|
728
|
-
type:
|
889
|
+
type: import_zod7.z.literal(FieldType.BULLET_LIST),
|
729
890
|
defaultValue: TextValue.optional(),
|
730
|
-
items:
|
731
|
-
configuration:
|
732
|
-
styles:
|
891
|
+
items: import_zod7.z.array(TranslationConfig).describe("A list of items"),
|
892
|
+
configuration: import_zod7.z.object({
|
893
|
+
styles: import_zod7.z.object({
|
733
894
|
fontVariant: HtmlFontVariant.optional()
|
734
895
|
}).optional()
|
735
896
|
}).default({})
|
736
897
|
}).describe("A list of bullet points");
|
737
898
|
var Select = BaseField.extend({
|
738
|
-
type:
|
899
|
+
type: import_zod7.z.literal(FieldType.SELECT),
|
739
900
|
defaultValue: TextValue.optional(),
|
740
|
-
options:
|
901
|
+
options: import_zod7.z.array(SelectOption).describe("A list of options")
|
741
902
|
}).describe("Select input");
|
903
|
+
var SelectDateRangeOption = import_zod7.z.object({
|
904
|
+
value: SelectDateRangeValue.describe("The value of the option"),
|
905
|
+
label: TranslationConfig.describe("The label of the option")
|
906
|
+
});
|
907
|
+
var SelectDateRangeField = BaseField.extend({
|
908
|
+
type: import_zod7.z.literal(FieldType.SELECT_DATE_RANGE),
|
909
|
+
defaultValue: SelectDateRangeValue.optional(),
|
910
|
+
options: import_zod7.z.array(SelectDateRangeOption).describe("A list of options")
|
911
|
+
}).describe("Select input with date range options");
|
742
912
|
var NameField = BaseField.extend({
|
743
|
-
type:
|
744
|
-
defaultValue:
|
913
|
+
type: import_zod7.z.literal(FieldType.NAME),
|
914
|
+
defaultValue: import_zod7.z.object({
|
745
915
|
firstname: NonEmptyTextValue,
|
746
916
|
surname: NonEmptyTextValue
|
747
917
|
}).optional(),
|
748
|
-
configuration:
|
749
|
-
maxLength:
|
918
|
+
configuration: import_zod7.z.object({
|
919
|
+
maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
|
750
920
|
prefix: TranslationConfig.optional(),
|
751
|
-
postfix: TranslationConfig.optional()
|
921
|
+
postfix: TranslationConfig.optional(),
|
922
|
+
includeMiddlename: import_zod7.z.boolean().default(false).optional().describe("To make middle name visible in Name form field"),
|
923
|
+
searchMode: import_zod7.z.boolean().optional()
|
752
924
|
}).optional()
|
753
925
|
}).describe("Name input field");
|
754
926
|
var PhoneField = BaseField.extend({
|
755
927
|
defaultValue: NonEmptyTextValue.optional(),
|
756
|
-
type:
|
928
|
+
type: import_zod7.z.literal(FieldType.PHONE)
|
757
929
|
}).describe("Phone input field");
|
758
930
|
var IdField = BaseField.extend({
|
759
931
|
defaultValue: NonEmptyTextValue.optional(),
|
760
|
-
type:
|
932
|
+
type: import_zod7.z.literal(FieldType.ID)
|
761
933
|
}).describe("ID input field");
|
762
934
|
var Checkbox = BaseField.extend({
|
763
|
-
type:
|
935
|
+
type: import_zod7.z.literal(FieldType.CHECKBOX),
|
764
936
|
defaultValue: CheckboxFieldValue.optional()
|
765
937
|
}).describe("Boolean checkbox field");
|
766
938
|
var Country = BaseField.extend({
|
767
|
-
type:
|
939
|
+
type: import_zod7.z.literal(FieldType.COUNTRY),
|
768
940
|
defaultValue: NonEmptyTextValue.optional()
|
769
941
|
}).describe("Country select field");
|
770
|
-
var AdministrativeAreas =
|
942
|
+
var AdministrativeAreas = import_zod7.z.enum([
|
771
943
|
"ADMIN_STRUCTURE",
|
772
944
|
"HEALTH_FACILITY",
|
773
945
|
"CRVS_OFFICE"
|
774
946
|
]);
|
775
|
-
var AdministrativeAreaConfiguration =
|
776
|
-
partOf:
|
777
|
-
$declaration:
|
947
|
+
var AdministrativeAreaConfiguration = import_zod7.z.object({
|
948
|
+
partOf: import_zod7.z.object({
|
949
|
+
$declaration: import_zod7.z.string()
|
778
950
|
}).optional().describe("Parent location"),
|
779
951
|
type: AdministrativeAreas
|
780
952
|
}).describe("Administrative area options");
|
781
953
|
var AdministrativeArea = BaseField.extend({
|
782
|
-
type:
|
954
|
+
type: import_zod7.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
783
955
|
defaultValue: NonEmptyTextValue.optional(),
|
784
956
|
configuration: AdministrativeAreaConfiguration
|
785
957
|
}).describe("Administrative area input field e.g. facility, office");
|
786
958
|
var Location = BaseField.extend({
|
787
|
-
type:
|
788
|
-
defaultValue: NonEmptyTextValue.optional()
|
959
|
+
type: import_zod7.z.literal(FieldType.LOCATION),
|
960
|
+
defaultValue: NonEmptyTextValue.optional(),
|
961
|
+
configuration: import_zod7.z.object({
|
962
|
+
searchableResource: import_zod7.z.array(import_zod7.z.enum(["locations", "facilities", "offices"])).optional()
|
963
|
+
}).optional()
|
789
964
|
}).describe("Input field for a location");
|
790
965
|
var FileUploadWithOptions = BaseField.extend({
|
791
|
-
type:
|
792
|
-
options:
|
966
|
+
type: import_zod7.z.literal(FieldType.FILE_WITH_OPTIONS),
|
967
|
+
options: import_zod7.z.array(SelectOption).describe("A list of options"),
|
793
968
|
defaultValue: FileFieldWithOptionValue.optional(),
|
794
|
-
configuration:
|
795
|
-
maxFileSize:
|
969
|
+
configuration: import_zod7.z.object({
|
970
|
+
maxFileSize: import_zod7.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
796
971
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
797
972
|
}).default({
|
798
973
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
799
974
|
})
|
800
975
|
});
|
801
976
|
var Facility = BaseField.extend({
|
802
|
-
type:
|
977
|
+
type: import_zod7.z.literal(FieldType.FACILITY),
|
803
978
|
defaultValue: NonEmptyTextValue.optional()
|
804
979
|
}).describe("Input field for a facility");
|
805
980
|
var Office = BaseField.extend({
|
806
|
-
type:
|
981
|
+
type: import_zod7.z.literal(FieldType.OFFICE),
|
807
982
|
defaultValue: NonEmptyTextValue.optional()
|
808
983
|
}).describe("Input field for an office");
|
809
984
|
var Address = BaseField.extend({
|
810
|
-
type:
|
811
|
-
defaultValue: AddressFieldValue.optional()
|
985
|
+
type: import_zod7.z.literal(FieldType.ADDRESS),
|
986
|
+
defaultValue: AddressFieldValue.optional(),
|
987
|
+
configuration: import_zod7.z.object({
|
988
|
+
searchMode: import_zod7.z.boolean().optional()
|
989
|
+
}).optional()
|
812
990
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
813
|
-
var DataEntry =
|
814
|
-
|
991
|
+
var DataEntry = import_zod7.z.union([
|
992
|
+
import_zod7.z.object({
|
815
993
|
label: TranslationConfig,
|
816
|
-
value: TranslationConfig.or(
|
994
|
+
value: TranslationConfig.or(import_zod7.z.string())
|
817
995
|
}),
|
818
|
-
|
819
|
-
fieldId:
|
996
|
+
import_zod7.z.object({
|
997
|
+
fieldId: import_zod7.z.string()
|
820
998
|
})
|
821
999
|
]);
|
822
1000
|
var DataField = BaseField.extend({
|
823
|
-
type:
|
824
|
-
configuration:
|
1001
|
+
type: import_zod7.z.literal(FieldType.DATA),
|
1002
|
+
configuration: import_zod7.z.object({
|
825
1003
|
subtitle: TranslationConfig.optional(),
|
826
|
-
data:
|
1004
|
+
data: import_zod7.z.array(DataEntry)
|
827
1005
|
})
|
828
1006
|
}).describe("Data field for displaying read-only data");
|
829
|
-
var FieldConfig =
|
1007
|
+
var FieldConfig = import_zod7.z.discriminatedUnion("type", [
|
830
1008
|
Address,
|
831
1009
|
TextField,
|
832
1010
|
NumberField,
|
833
1011
|
TextAreaField,
|
834
1012
|
DateField,
|
1013
|
+
TimeField,
|
835
1014
|
DateRangeField,
|
1015
|
+
SelectDateRangeField,
|
836
1016
|
Paragraph,
|
837
1017
|
RadioGroup,
|
838
1018
|
BulletList,
|
@@ -858,14 +1038,18 @@ var FieldConfig = import_zod5.z.discriminatedUnion("type", [
|
|
858
1038
|
ref: "FieldConfig"
|
859
1039
|
});
|
860
1040
|
|
1041
|
+
// ../commons/src/events/FormConfig.ts
|
1042
|
+
var import_zod9 = require("zod");
|
1043
|
+
|
861
1044
|
// ../commons/src/events/PageConfig.ts
|
862
|
-
var
|
863
|
-
|
864
|
-
|
865
|
-
var
|
866
|
-
|
1045
|
+
var import_zod8 = require("zod");
|
1046
|
+
var import_zod_openapi5 = require("zod-openapi");
|
1047
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod8.z);
|
1048
|
+
var PageTypes = import_zod8.z.enum(["FORM", "VERIFICATION"]);
|
1049
|
+
var PageConfigBase = import_zod8.z.object({
|
1050
|
+
id: import_zod8.z.string().describe("Unique identifier for the page"),
|
867
1051
|
title: TranslationConfig.describe("Header title of the page"),
|
868
|
-
fields:
|
1052
|
+
fields: import_zod8.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
869
1053
|
conditional: Conditional.optional().describe(
|
870
1054
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
871
1055
|
)
|
@@ -874,13 +1058,13 @@ var PageConfigBase = import_zod6.z.object({
|
|
874
1058
|
ref: "FormPageConfig"
|
875
1059
|
});
|
876
1060
|
var FormPageConfig = PageConfigBase.extend({
|
877
|
-
type:
|
1061
|
+
type: import_zod8.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
878
1062
|
});
|
879
|
-
var VerificationActionConfig =
|
880
|
-
verify:
|
881
|
-
cancel:
|
1063
|
+
var VerificationActionConfig = import_zod8.z.object({
|
1064
|
+
verify: import_zod8.z.object({ label: TranslationConfig }),
|
1065
|
+
cancel: import_zod8.z.object({
|
882
1066
|
label: TranslationConfig,
|
883
|
-
confirmation:
|
1067
|
+
confirmation: import_zod8.z.object({
|
884
1068
|
title: TranslationConfig,
|
885
1069
|
body: TranslationConfig
|
886
1070
|
})
|
@@ -890,218 +1074,110 @@ var VerificationActionConfig = import_zod6.z.object({
|
|
890
1074
|
ref: "VerificationActionConfig"
|
891
1075
|
});
|
892
1076
|
var VerificationPageConfig = FormPageConfig.extend({
|
893
|
-
type:
|
1077
|
+
type: import_zod8.z.literal(PageTypes.enum.VERIFICATION),
|
894
1078
|
actions: VerificationActionConfig
|
895
1079
|
});
|
896
|
-
var PageConfig =
|
1080
|
+
var PageConfig = import_zod8.z.discriminatedUnion("type", [
|
897
1081
|
FormPageConfig,
|
898
1082
|
VerificationPageConfig
|
899
1083
|
]);
|
900
1084
|
|
901
|
-
// ../commons/src/events/ActionType.ts
|
902
|
-
var import_zod7 = require("zod");
|
903
|
-
var ActionType = {
|
904
|
-
// Pre-declaration actions
|
905
|
-
DELETE: "DELETE",
|
906
|
-
CREATE: "CREATE",
|
907
|
-
NOTIFY: "NOTIFY",
|
908
|
-
// Declaration actions
|
909
|
-
DECLARE: "DECLARE",
|
910
|
-
VALIDATE: "VALIDATE",
|
911
|
-
REGISTER: "REGISTER",
|
912
|
-
// Declaration system actions. Non-configurable.
|
913
|
-
DETECT_DUPLICATE: "DETECT_DUPLICATE",
|
914
|
-
REJECT: "REJECT",
|
915
|
-
// REJECT_DECLARATION
|
916
|
-
MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE",
|
917
|
-
// MARK_AS_DUPLICATE
|
918
|
-
ARCHIVE: "ARCHIVE",
|
919
|
-
// Record actions
|
920
|
-
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
921
|
-
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
922
|
-
REJECT_CORRECTION: "REJECT_CORRECTION",
|
923
|
-
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
924
|
-
// General actions
|
925
|
-
READ: "READ",
|
926
|
-
ASSIGN: "ASSIGN",
|
927
|
-
UNASSIGN: "UNASSIGN"
|
928
|
-
};
|
929
|
-
var ConfirmableActions = [
|
930
|
-
ActionType.NOTIFY,
|
931
|
-
ActionType.DECLARE,
|
932
|
-
ActionType.VALIDATE,
|
933
|
-
ActionType.REGISTER,
|
934
|
-
ActionType.REJECT,
|
935
|
-
ActionType.ARCHIVE,
|
936
|
-
ActionType.PRINT_CERTIFICATE
|
937
|
-
];
|
938
|
-
var ActionTypes = import_zod7.z.enum([
|
939
|
-
"DELETE",
|
940
|
-
"CREATE",
|
941
|
-
"NOTIFY",
|
942
|
-
"DECLARE",
|
943
|
-
"VALIDATE",
|
944
|
-
"REGISTER",
|
945
|
-
"DETECT_DUPLICATE",
|
946
|
-
"REJECT",
|
947
|
-
"MARKED_AS_DUPLICATE",
|
948
|
-
"ARCHIVE",
|
949
|
-
"PRINT_CERTIFICATE",
|
950
|
-
"REQUEST_CORRECTION",
|
951
|
-
"REJECT_CORRECTION",
|
952
|
-
"APPROVE_CORRECTION",
|
953
|
-
"READ",
|
954
|
-
"ASSIGN",
|
955
|
-
"UNASSIGN"
|
956
|
-
]);
|
957
|
-
var declarationActionValues = [
|
958
|
-
ActionTypes.enum.DECLARE,
|
959
|
-
ActionTypes.enum.VALIDATE,
|
960
|
-
ActionTypes.enum.REGISTER
|
961
|
-
];
|
962
|
-
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
963
|
-
var declarationUpdateActionValues = [
|
964
|
-
...declarationActionValues,
|
965
|
-
ActionTypes.enum.REQUEST_CORRECTION
|
966
|
-
];
|
967
|
-
var DeclarationUpdateActions = ActionTypes.extract(
|
968
|
-
declarationUpdateActionValues
|
969
|
-
);
|
970
|
-
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
971
|
-
var writeActions = ActionTypes.exclude([
|
972
|
-
ActionType.CREATE,
|
973
|
-
ActionType.READ,
|
974
|
-
ActionType.ASSIGN,
|
975
|
-
ActionType.UNASSIGN
|
976
|
-
]);
|
977
|
-
var StatusChangingActions = ActionTypes.extract([
|
978
|
-
ActionType.CREATE,
|
979
|
-
ActionType.NOTIFY,
|
980
|
-
ActionType.DECLARE,
|
981
|
-
ActionType.VALIDATE,
|
982
|
-
ActionType.REGISTER,
|
983
|
-
ActionType.REJECT,
|
984
|
-
ActionType.ARCHIVE,
|
985
|
-
ActionType.PRINT_CERTIFICATE
|
986
|
-
]);
|
987
|
-
var workqueueActions = ActionTypes.exclude([
|
988
|
-
ActionType.CREATE,
|
989
|
-
ActionType.NOTIFY,
|
990
|
-
ActionType.DETECT_DUPLICATE,
|
991
|
-
ActionType.REJECT,
|
992
|
-
ActionType.MARKED_AS_DUPLICATE,
|
993
|
-
ActionType.ARCHIVE,
|
994
|
-
ActionType.REQUEST_CORRECTION,
|
995
|
-
ActionType.REJECT_CORRECTION,
|
996
|
-
ActionType.APPROVE_CORRECTION
|
997
|
-
]);
|
998
|
-
var META_ACTIONS = [
|
999
|
-
ActionType.ASSIGN,
|
1000
|
-
ActionType.UNASSIGN,
|
1001
|
-
ActionType.READ
|
1002
|
-
];
|
1003
|
-
function isMetaAction(actionType) {
|
1004
|
-
return META_ACTIONS.includes(actionType);
|
1005
|
-
}
|
1006
|
-
|
1007
1085
|
// ../commons/src/events/FormConfig.ts
|
1008
|
-
var
|
1009
|
-
var DeclarationFormConfig = import_zod8.z.object({
|
1086
|
+
var DeclarationFormConfig = import_zod9.z.object({
|
1010
1087
|
label: TranslationConfig.describe("Human readable description of the form"),
|
1011
|
-
pages:
|
1088
|
+
pages: import_zod9.z.array(FormPageConfig)
|
1012
1089
|
}).describe("Configuration for a declaration form");
|
1013
|
-
var ActionFormConfig =
|
1090
|
+
var ActionFormConfig = import_zod9.z.object({
|
1014
1091
|
label: TranslationConfig.describe("Human readable description of the form"),
|
1015
|
-
pages:
|
1092
|
+
pages: import_zod9.z.array(PageConfig)
|
1016
1093
|
});
|
1017
|
-
var FormConfig =
|
1094
|
+
var FormConfig = import_zod9.z.union([DeclarationFormConfig, ActionFormConfig]);
|
1018
1095
|
|
1019
1096
|
// ../commons/src/events/ActionConfig.ts
|
1020
|
-
var
|
1021
|
-
(0,
|
1022
|
-
var ActionConditional2 =
|
1097
|
+
var import_zod_openapi6 = require("zod-openapi");
|
1098
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod10.z);
|
1099
|
+
var ActionConditional2 = import_zod10.z.discriminatedUnion("type", [
|
1023
1100
|
/** If conditional is defined, the action is shown to the user only if the condition is met */
|
1024
1101
|
ShowConditional,
|
1025
1102
|
/** If conditional is defined, the action is enabled only if the condition is met */
|
1026
1103
|
EnableConditional
|
1027
1104
|
]);
|
1028
|
-
var DeclarationReviewConfig =
|
1105
|
+
var DeclarationReviewConfig = import_zod10.z.object({
|
1029
1106
|
title: TranslationConfig.describe("Title of the review page"),
|
1030
|
-
fields:
|
1107
|
+
fields: import_zod10.z.array(FieldConfig).describe("Fields to be rendered on the review page for annotations.")
|
1031
1108
|
}).describe("Configuration for **declaration** review page.");
|
1032
|
-
var ActionConfigBase =
|
1109
|
+
var ActionConfigBase = import_zod10.z.object({
|
1033
1110
|
label: TranslationConfig,
|
1034
|
-
conditionals:
|
1035
|
-
draft:
|
1111
|
+
conditionals: import_zod10.z.array(ActionConditional2).optional().default([]),
|
1112
|
+
draft: import_zod10.z.boolean().optional()
|
1036
1113
|
});
|
1037
1114
|
var ReadActionConfig = ActionConfigBase.merge(
|
1038
|
-
|
1039
|
-
type:
|
1115
|
+
import_zod10.z.object({
|
1116
|
+
type: import_zod10.z.literal(ActionType.READ),
|
1040
1117
|
review: DeclarationReviewConfig
|
1041
1118
|
})
|
1042
1119
|
);
|
1043
1120
|
var DeclareConfig = ActionConfigBase.merge(
|
1044
|
-
|
1045
|
-
type:
|
1121
|
+
import_zod10.z.object({
|
1122
|
+
type: import_zod10.z.literal(ActionType.DECLARE),
|
1046
1123
|
review: DeclarationReviewConfig
|
1047
1124
|
})
|
1048
1125
|
);
|
1049
1126
|
var ValidateConfig = ActionConfigBase.merge(
|
1050
|
-
|
1051
|
-
type:
|
1127
|
+
import_zod10.z.object({
|
1128
|
+
type: import_zod10.z.literal(ActionType.VALIDATE),
|
1052
1129
|
review: DeclarationReviewConfig
|
1053
1130
|
})
|
1054
1131
|
);
|
1055
1132
|
var RegisterConfig = ActionConfigBase.merge(
|
1056
|
-
|
1057
|
-
type:
|
1133
|
+
import_zod10.z.object({
|
1134
|
+
type: import_zod10.z.literal(ActionType.REGISTER),
|
1058
1135
|
review: DeclarationReviewConfig
|
1059
1136
|
})
|
1060
1137
|
);
|
1061
1138
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
1062
|
-
|
1063
|
-
type:
|
1139
|
+
import_zod10.z.object({
|
1140
|
+
type: import_zod10.z.literal(ActionType.REJECT)
|
1064
1141
|
})
|
1065
1142
|
);
|
1066
1143
|
var MarkedAsDuplicateConfig = ActionConfigBase.merge(
|
1067
|
-
|
1068
|
-
type:
|
1144
|
+
import_zod10.z.object({
|
1145
|
+
type: import_zod10.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1069
1146
|
})
|
1070
1147
|
);
|
1071
1148
|
var ArchiveConfig = ActionConfigBase.merge(
|
1072
|
-
|
1073
|
-
type:
|
1149
|
+
import_zod10.z.object({
|
1150
|
+
type: import_zod10.z.literal(ActionType.ARCHIVE)
|
1074
1151
|
})
|
1075
1152
|
);
|
1076
1153
|
var DeleteConfig = ActionConfigBase.merge(
|
1077
|
-
|
1078
|
-
type:
|
1154
|
+
import_zod10.z.object({
|
1155
|
+
type: import_zod10.z.literal(ActionType.DELETE)
|
1079
1156
|
})
|
1080
1157
|
);
|
1081
1158
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
1082
|
-
|
1083
|
-
type:
|
1159
|
+
import_zod10.z.object({
|
1160
|
+
type: import_zod10.z.literal(ActionType.PRINT_CERTIFICATE),
|
1084
1161
|
printForm: ActionFormConfig
|
1085
1162
|
})
|
1086
1163
|
);
|
1087
1164
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
1088
|
-
|
1089
|
-
type:
|
1090
|
-
|
1091
|
-
additionalDetailsForm: import_zod9.z.array(PageConfig)
|
1165
|
+
import_zod10.z.object({
|
1166
|
+
type: import_zod10.z.literal(ActionType.REQUEST_CORRECTION),
|
1167
|
+
correctionForm: ActionFormConfig
|
1092
1168
|
})
|
1093
1169
|
);
|
1094
1170
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
1095
|
-
|
1096
|
-
type:
|
1171
|
+
import_zod10.z.object({
|
1172
|
+
type: import_zod10.z.literal(ActionType.REJECT_CORRECTION)
|
1097
1173
|
})
|
1098
1174
|
);
|
1099
1175
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
1100
|
-
|
1101
|
-
type:
|
1176
|
+
import_zod10.z.object({
|
1177
|
+
type: import_zod10.z.literal(ActionType.APPROVE_CORRECTION)
|
1102
1178
|
})
|
1103
1179
|
);
|
1104
|
-
var ActionConfig =
|
1180
|
+
var ActionConfig = import_zod10.z.discriminatedUnion("type", [
|
1105
1181
|
/*
|
1106
1182
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
1107
1183
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
@@ -1121,108 +1197,108 @@ var ActionConfig = import_zod9.z.discriminatedUnion("type", [
|
|
1121
1197
|
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
1122
1198
|
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
1123
1199
|
]).openapi({ ref: "ActionConfig" });
|
1124
|
-
var DeclarationActionConfig =
|
1200
|
+
var DeclarationActionConfig = import_zod10.z.discriminatedUnion("type", [
|
1125
1201
|
DeclareConfig,
|
1126
1202
|
ValidateConfig,
|
1127
1203
|
RegisterConfig
|
1128
1204
|
]);
|
1129
1205
|
|
1130
1206
|
// ../commons/src/events/offline/CertificateConfig.ts
|
1131
|
-
var
|
1132
|
-
var FontFamily =
|
1133
|
-
normal:
|
1134
|
-
bold:
|
1135
|
-
italics:
|
1136
|
-
bolditalics:
|
1207
|
+
var import_zod11 = require("zod");
|
1208
|
+
var FontFamily = import_zod11.z.object({
|
1209
|
+
normal: import_zod11.z.string(),
|
1210
|
+
bold: import_zod11.z.string(),
|
1211
|
+
italics: import_zod11.z.string(),
|
1212
|
+
bolditalics: import_zod11.z.string()
|
1137
1213
|
});
|
1138
|
-
var CertificateConfig =
|
1139
|
-
id:
|
1140
|
-
event:
|
1214
|
+
var CertificateConfig = import_zod11.z.object({
|
1215
|
+
id: import_zod11.z.string(),
|
1216
|
+
event: import_zod11.z.string(),
|
1141
1217
|
label: TranslationConfig,
|
1142
|
-
isDefault:
|
1143
|
-
fee:
|
1144
|
-
onTime:
|
1145
|
-
late:
|
1146
|
-
delayed:
|
1218
|
+
isDefault: import_zod11.z.boolean(),
|
1219
|
+
fee: import_zod11.z.object({
|
1220
|
+
onTime: import_zod11.z.number(),
|
1221
|
+
late: import_zod11.z.number(),
|
1222
|
+
delayed: import_zod11.z.number()
|
1147
1223
|
}),
|
1148
|
-
svgUrl:
|
1149
|
-
fonts:
|
1224
|
+
svgUrl: import_zod11.z.string(),
|
1225
|
+
fonts: import_zod11.z.record(FontFamily).optional()
|
1150
1226
|
});
|
1151
1227
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
1152
|
-
hash:
|
1153
|
-
svg:
|
1228
|
+
hash: import_zod11.z.string().optional(),
|
1229
|
+
svg: import_zod11.z.string()
|
1154
1230
|
});
|
1155
1231
|
|
1156
1232
|
// ../commons/src/events/offline/LanguageConfig.ts
|
1157
|
-
var
|
1158
|
-
var LanguageConfig =
|
1159
|
-
lang:
|
1233
|
+
var import_zod12 = require("zod");
|
1234
|
+
var LanguageConfig = import_zod12.z.object({
|
1235
|
+
lang: import_zod12.z.string(),
|
1160
1236
|
/**
|
1161
1237
|
* client.csv contents
|
1162
1238
|
*/
|
1163
|
-
messages:
|
1239
|
+
messages: import_zod12.z.record(import_zod12.z.string())
|
1164
1240
|
});
|
1165
1241
|
|
1166
1242
|
// ../commons/src/events/EventConfig.ts
|
1167
|
-
var
|
1243
|
+
var import_zod21 = require("zod");
|
1168
1244
|
|
1169
1245
|
// ../commons/src/events/DeduplicationConfig.ts
|
1170
|
-
var
|
1171
|
-
var
|
1172
|
-
(0,
|
1173
|
-
var FieldReference2 =
|
1174
|
-
var Matcher =
|
1175
|
-
fieldId:
|
1176
|
-
options:
|
1177
|
-
boost:
|
1246
|
+
var import_zod13 = require("zod");
|
1247
|
+
var import_zod_openapi7 = require("zod-openapi");
|
1248
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod13.z);
|
1249
|
+
var FieldReference2 = import_zod13.z.string();
|
1250
|
+
var Matcher = import_zod13.z.object({
|
1251
|
+
fieldId: import_zod13.z.string(),
|
1252
|
+
options: import_zod13.z.object({
|
1253
|
+
boost: import_zod13.z.number().optional()
|
1178
1254
|
}).optional().default({})
|
1179
1255
|
});
|
1180
1256
|
var FuzzyMatcher = Matcher.extend({
|
1181
|
-
type:
|
1182
|
-
options:
|
1257
|
+
type: import_zod13.z.literal("fuzzy"),
|
1258
|
+
options: import_zod13.z.object({
|
1183
1259
|
/**
|
1184
1260
|
* Names of length 3 or less characters = 0 edits allowed
|
1185
1261
|
* Names of length 4 - 6 characters = 1 edit allowed
|
1186
1262
|
* Names of length >7 characters = 2 edits allowed
|
1187
1263
|
*/
|
1188
|
-
fuzziness:
|
1189
|
-
boost:
|
1264
|
+
fuzziness: import_zod13.z.union([import_zod13.z.string(), import_zod13.z.number()]).optional().default("AUTO:4,7"),
|
1265
|
+
boost: import_zod13.z.number().optional().default(1)
|
1190
1266
|
}).optional().default({})
|
1191
1267
|
});
|
1192
1268
|
var StrictMatcher = Matcher.extend({
|
1193
|
-
type:
|
1194
|
-
options:
|
1195
|
-
boost:
|
1269
|
+
type: import_zod13.z.literal("strict"),
|
1270
|
+
options: import_zod13.z.object({
|
1271
|
+
boost: import_zod13.z.number().optional().default(1)
|
1196
1272
|
}).optional().default({})
|
1197
1273
|
});
|
1198
1274
|
var DateRangeMatcher = Matcher.extend({
|
1199
|
-
type:
|
1200
|
-
options:
|
1201
|
-
days:
|
1275
|
+
type: import_zod13.z.literal("dateRange"),
|
1276
|
+
options: import_zod13.z.object({
|
1277
|
+
days: import_zod13.z.number(),
|
1202
1278
|
origin: FieldReference2,
|
1203
|
-
boost:
|
1279
|
+
boost: import_zod13.z.number().optional().default(1)
|
1204
1280
|
})
|
1205
1281
|
});
|
1206
1282
|
var DateDistanceMatcher = Matcher.extend({
|
1207
|
-
type:
|
1208
|
-
options:
|
1209
|
-
days:
|
1283
|
+
type: import_zod13.z.literal("dateDistance"),
|
1284
|
+
options: import_zod13.z.object({
|
1285
|
+
days: import_zod13.z.number(),
|
1210
1286
|
origin: FieldReference2,
|
1211
|
-
boost:
|
1287
|
+
boost: import_zod13.z.number().optional().default(1)
|
1212
1288
|
})
|
1213
1289
|
});
|
1214
|
-
var And =
|
1215
|
-
type:
|
1290
|
+
var And = import_zod13.z.object({
|
1291
|
+
type: import_zod13.z.literal("and"),
|
1216
1292
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1217
|
-
clauses:
|
1293
|
+
clauses: import_zod13.z.lazy(() => Clause.array())
|
1218
1294
|
});
|
1219
|
-
var Or =
|
1220
|
-
type:
|
1295
|
+
var Or = import_zod13.z.object({
|
1296
|
+
type: import_zod13.z.literal("or"),
|
1221
1297
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1222
|
-
clauses:
|
1298
|
+
clauses: import_zod13.z.lazy(() => Clause.array())
|
1223
1299
|
});
|
1224
|
-
var Clause =
|
1225
|
-
() =>
|
1300
|
+
var Clause = import_zod13.z.lazy(
|
1301
|
+
() => import_zod13.z.discriminatedUnion("type", [
|
1226
1302
|
And,
|
1227
1303
|
Or,
|
1228
1304
|
FuzzyMatcher,
|
@@ -1233,43 +1309,43 @@ var Clause = import_zod12.z.lazy(
|
|
1233
1309
|
).openapi({
|
1234
1310
|
ref: "Clause"
|
1235
1311
|
});
|
1236
|
-
var DeduplicationConfig =
|
1237
|
-
id:
|
1312
|
+
var DeduplicationConfig = import_zod13.z.object({
|
1313
|
+
id: import_zod13.z.string(),
|
1238
1314
|
label: TranslationConfig,
|
1239
1315
|
query: Clause
|
1240
1316
|
});
|
1241
1317
|
|
1242
1318
|
// ../commons/src/events/SummaryConfig.ts
|
1243
|
-
var
|
1244
|
-
var BaseField2 =
|
1319
|
+
var import_zod14 = require("zod");
|
1320
|
+
var BaseField2 = import_zod14.z.object({
|
1245
1321
|
emptyValueMessage: TranslationConfig.optional(),
|
1246
|
-
conditionals:
|
1322
|
+
conditionals: import_zod14.z.array(ShowConditional).default([]).optional()
|
1247
1323
|
});
|
1248
1324
|
var ReferenceField = BaseField2.extend({
|
1249
|
-
fieldId:
|
1325
|
+
fieldId: import_zod14.z.string(),
|
1250
1326
|
label: TranslationConfig.optional().describe(
|
1251
1327
|
"By default, the configured field's label is used. This can be overridden by providing a custom label."
|
1252
1328
|
)
|
1253
1329
|
}).describe("Field directly referencing event data with field id");
|
1254
1330
|
var Field = BaseField2.extend({
|
1255
|
-
id:
|
1331
|
+
id: import_zod14.z.string().describe("Id of summary field"),
|
1256
1332
|
value: TranslationConfig.describe(
|
1257
1333
|
"Summary field value. Can utilise values defined in configuration and EventMetadata"
|
1258
1334
|
),
|
1259
1335
|
label: TranslationConfig
|
1260
1336
|
}).describe("Custom configured field");
|
1261
|
-
var SummaryConfig =
|
1262
|
-
fields:
|
1337
|
+
var SummaryConfig = import_zod14.z.object({
|
1338
|
+
fields: import_zod14.z.array(import_zod14.z.union([Field, ReferenceField])).describe("Fields rendered in summary view.")
|
1263
1339
|
}).describe("Configuration for summary in event.");
|
1264
1340
|
|
1265
1341
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
1266
|
-
var
|
1267
|
-
var MatchType =
|
1268
|
-
var BaseField3 =
|
1269
|
-
config:
|
1342
|
+
var import_zod15 = require("zod");
|
1343
|
+
var MatchType = import_zod15.z.enum(["fuzzy", "exact", "range", "within"]);
|
1344
|
+
var BaseField3 = import_zod15.z.object({
|
1345
|
+
config: import_zod15.z.object({
|
1270
1346
|
type: MatchType.describe("Determines the type of field")
|
1271
1347
|
}),
|
1272
|
-
options:
|
1348
|
+
options: import_zod15.z.array(SelectOption).optional(),
|
1273
1349
|
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
1274
1350
|
`
|
1275
1351
|
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
@@ -1290,7 +1366,7 @@ var BaseField3 = import_zod14.z.object({
|
|
1290
1366
|
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
1291
1367
|
`
|
1292
1368
|
),
|
1293
|
-
conditionals:
|
1369
|
+
conditionals: import_zod15.z.array(FieldConditional).default([]).optional().describe(
|
1294
1370
|
`
|
1295
1371
|
In advanced search, we sometimes need to override the default field visibility conditionals.
|
1296
1372
|
|
@@ -1304,50 +1380,60 @@ var BaseField3 = import_zod14.z.object({
|
|
1304
1380
|
are always rendered in the advanced search form.
|
1305
1381
|
`
|
1306
1382
|
),
|
1307
|
-
validations:
|
1383
|
+
validations: import_zod15.z.array(ValidationConfig).default([]).optional().describe(
|
1308
1384
|
`In advanced search, we sometimes need to override the default field validations.`
|
1309
1385
|
)
|
1310
1386
|
});
|
1311
|
-
var SearchQueryParams =
|
1312
|
-
eventType:
|
1387
|
+
var SearchQueryParams = import_zod15.z.object({
|
1388
|
+
eventType: import_zod15.z.string().optional().describe(
|
1313
1389
|
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
1314
1390
|
)
|
1315
1391
|
}).catchall(FieldValue);
|
1316
1392
|
var FieldConfigSchema = BaseField3.extend({
|
1317
|
-
fieldId:
|
1318
|
-
fieldType:
|
1393
|
+
fieldId: import_zod15.z.string(),
|
1394
|
+
fieldType: import_zod15.z.literal("field"),
|
1395
|
+
alternateFieldIds: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
1396
|
+
`Sometimes there might be need to search a value against multiple field of same FormField type. For example
|
1397
|
+
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1398
|
+
add a one field as fieldId, and accomodate others in alternateFieldIds`
|
1399
|
+
),
|
1400
|
+
excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
|
1401
|
+
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1402
|
+
is select field, which has 3 options, FACILITY, PRIVATE_HOME, OTHER. Upon selecting any of the option, pops up another field
|
1403
|
+
related to the selected option, whose value is required in the search query. But child.placeOfBirth itself is not needed in the query.
|
1404
|
+
In such case, populate this field (excludeInSearchQuery) with boolean true`)
|
1319
1405
|
});
|
1320
|
-
var EventFieldId =
|
1406
|
+
var EventFieldId = import_zod15.z.enum([
|
1321
1407
|
"trackingId",
|
1322
1408
|
"status",
|
1323
|
-
"
|
1324
|
-
"
|
1409
|
+
"legalStatuses.REGISTERED.acceptedAt",
|
1410
|
+
"legalStatuses.REGISTERED.createdAtLocation",
|
1325
1411
|
"updatedAt"
|
1326
1412
|
]);
|
1327
1413
|
var EventFieldConfigSchema = BaseField3.extend({
|
1328
1414
|
fieldId: EventFieldId,
|
1329
|
-
fieldType:
|
1415
|
+
fieldType: import_zod15.z.literal("event")
|
1330
1416
|
});
|
1331
|
-
var SearchField =
|
1417
|
+
var SearchField = import_zod15.z.discriminatedUnion("fieldType", [
|
1332
1418
|
FieldConfigSchema,
|
1333
1419
|
EventFieldConfigSchema
|
1334
1420
|
]);
|
1335
|
-
var AdvancedSearchConfig =
|
1421
|
+
var AdvancedSearchConfig = import_zod15.z.object({
|
1336
1422
|
title: TranslationConfig.describe("Advanced search tab title"),
|
1337
|
-
fields:
|
1423
|
+
fields: import_zod15.z.array(SearchField).describe("Advanced search fields.")
|
1338
1424
|
});
|
1339
1425
|
|
1340
1426
|
// ../commons/src/events/utils.ts
|
1341
1427
|
var import_lodash = require("lodash");
|
1342
1428
|
|
1343
1429
|
// ../commons/src/events/ActionDocument.ts
|
1344
|
-
var
|
1345
|
-
var
|
1430
|
+
var import_zod19 = require("zod");
|
1431
|
+
var import_zod_openapi8 = require("zod-openapi");
|
1346
1432
|
|
1347
1433
|
// ../commons/src/uuid.ts
|
1348
1434
|
var import_uuid = require("uuid");
|
1349
|
-
var
|
1350
|
-
var UUID =
|
1435
|
+
var import_zod16 = require("zod");
|
1436
|
+
var UUID = import_zod16.z.string().uuid().brand("UUID");
|
1351
1437
|
function getUUID() {
|
1352
1438
|
return (0, import_uuid.v4)();
|
1353
1439
|
}
|
@@ -1357,10 +1443,10 @@ var CreatedAtLocation = UUID.nullish();
|
|
1357
1443
|
|
1358
1444
|
// ../commons/src/authentication.ts
|
1359
1445
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
1360
|
-
var
|
1446
|
+
var import_zod18 = require("zod");
|
1361
1447
|
|
1362
1448
|
// ../commons/src/scopes.ts
|
1363
|
-
var
|
1449
|
+
var import_zod17 = require("zod");
|
1364
1450
|
var SCOPES = {
|
1365
1451
|
// TODO v1.8 legacy scopes
|
1366
1452
|
NATLSYSADMIN: "natlsysadmin",
|
@@ -1473,108 +1559,108 @@ var SCOPES = {
|
|
1473
1559
|
// data seeding
|
1474
1560
|
USER_DATA_SEEDING: "user.data-seeding"
|
1475
1561
|
};
|
1476
|
-
var LegacyScopes =
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1562
|
+
var LegacyScopes = import_zod17.z.union([
|
1563
|
+
import_zod17.z.literal(SCOPES.NATLSYSADMIN),
|
1564
|
+
import_zod17.z.literal(SCOPES.BYPASSRATELIMIT),
|
1565
|
+
import_zod17.z.literal(SCOPES.DECLARE),
|
1566
|
+
import_zod17.z.literal(SCOPES.REGISTER),
|
1567
|
+
import_zod17.z.literal(SCOPES.VALIDATE),
|
1568
|
+
import_zod17.z.literal(SCOPES.DEMO),
|
1569
|
+
import_zod17.z.literal(SCOPES.CERTIFY),
|
1570
|
+
import_zod17.z.literal(SCOPES.PERFORMANCE),
|
1571
|
+
import_zod17.z.literal(SCOPES.SYSADMIN),
|
1572
|
+
import_zod17.z.literal(SCOPES.TEAMS),
|
1573
|
+
import_zod17.z.literal(SCOPES.CONFIG)
|
1488
1574
|
]);
|
1489
|
-
var IntegrationScopes =
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1575
|
+
var IntegrationScopes = import_zod17.z.union([
|
1576
|
+
import_zod17.z.literal(SCOPES.WEBHOOK),
|
1577
|
+
import_zod17.z.literal(SCOPES.NATIONALID),
|
1578
|
+
import_zod17.z.literal(SCOPES.NOTIFICATION_API),
|
1579
|
+
import_zod17.z.literal(SCOPES.RECORDSEARCH)
|
1494
1580
|
]);
|
1495
|
-
var DeclareScopes =
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1581
|
+
var DeclareScopes = import_zod17.z.union([
|
1582
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE),
|
1583
|
+
import_zod17.z.literal(SCOPES.RECORD_IMPORT),
|
1584
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
1585
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
1586
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
1587
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
1588
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
1589
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
1590
|
+
import_zod17.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
1591
|
+
import_zod17.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
|
1506
1592
|
]);
|
1507
|
-
var UnassignScope =
|
1508
|
-
var ValidateScopes =
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1593
|
+
var UnassignScope = import_zod17.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
|
1594
|
+
var ValidateScopes = import_zod17.z.union([
|
1595
|
+
import_zod17.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
1596
|
+
import_zod17.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
1597
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
1598
|
+
import_zod17.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
1599
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
1600
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
|
1515
1601
|
]);
|
1516
|
-
var RegisterScope =
|
1517
|
-
var CertifyScopes =
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1602
|
+
var RegisterScope = import_zod17.z.literal(SCOPES.RECORD_REGISTER);
|
1603
|
+
var CertifyScopes = import_zod17.z.union([
|
1604
|
+
import_zod17.z.literal(SCOPES.RECORD_EXPORT_RECORDS),
|
1605
|
+
import_zod17.z.literal(SCOPES.RECORD_DECLARATION_PRINT),
|
1606
|
+
import_zod17.z.literal(SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS),
|
1607
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_PRINT),
|
1608
|
+
import_zod17.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
1609
|
+
import_zod17.z.literal(SCOPES.RECORD_PRINT_CERTIFIED_COPIES),
|
1610
|
+
import_zod17.z.literal(SCOPES.RECORD_BULK_PRINT_CERTIFIED_COPIES),
|
1611
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_VERIFY_CERTIFIED_COPIES)
|
1526
1612
|
]);
|
1527
|
-
var CorrectionScopes =
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1613
|
+
var CorrectionScopes = import_zod17.z.union([
|
1614
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
1615
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
1616
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REVOCATION),
|
1617
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_REVOKE),
|
1618
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REINSTATEMENT),
|
1619
|
+
import_zod17.z.literal(SCOPES.RECORD_REGISTRATION_REINSTATE),
|
1620
|
+
import_zod17.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
1621
|
+
import_zod17.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
|
1536
1622
|
]);
|
1537
|
-
var SearchScopes =
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1623
|
+
var SearchScopes = import_zod17.z.union([
|
1624
|
+
import_zod17.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
1625
|
+
import_zod17.z.literal(SCOPES.SEARCH_BIRTH),
|
1626
|
+
import_zod17.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
1627
|
+
import_zod17.z.literal(SCOPES.SEARCH_DEATH),
|
1628
|
+
import_zod17.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
1629
|
+
import_zod17.z.literal(SCOPES.SEARCH_MARRIAGE)
|
1544
1630
|
]);
|
1545
|
-
var AuditScopes =
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1631
|
+
var AuditScopes = import_zod17.z.union([
|
1632
|
+
import_zod17.z.literal(SCOPES.RECORD_READ),
|
1633
|
+
import_zod17.z.literal(SCOPES.RECORD_READ_AUDIT),
|
1634
|
+
import_zod17.z.literal(SCOPES.RECORD_READ_COMMENTS),
|
1635
|
+
import_zod17.z.literal(SCOPES.RECORD_CREATE_COMMENTS)
|
1550
1636
|
]);
|
1551
|
-
var ProfileScopes =
|
1552
|
-
|
1553
|
-
|
1637
|
+
var ProfileScopes = import_zod17.z.union([
|
1638
|
+
import_zod17.z.literal(SCOPES.PROFILE_UPDATE),
|
1639
|
+
import_zod17.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE)
|
1554
1640
|
]);
|
1555
|
-
var PerformanceScopes =
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1641
|
+
var PerformanceScopes = import_zod17.z.union([
|
1642
|
+
import_zod17.z.literal(SCOPES.PERFORMANCE_READ),
|
1643
|
+
import_zod17.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
1644
|
+
import_zod17.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
|
1559
1645
|
]);
|
1560
|
-
var OrganisationScopes =
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1646
|
+
var OrganisationScopes = import_zod17.z.union([
|
1647
|
+
import_zod17.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
1648
|
+
import_zod17.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
1649
|
+
import_zod17.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
|
1564
1650
|
]);
|
1565
|
-
var UserScopes =
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1651
|
+
var UserScopes = import_zod17.z.union([
|
1652
|
+
import_zod17.z.literal(SCOPES.USER_READ),
|
1653
|
+
import_zod17.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
1654
|
+
import_zod17.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
1655
|
+
import_zod17.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
1656
|
+
import_zod17.z.literal(SCOPES.USER_CREATE),
|
1657
|
+
import_zod17.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
1658
|
+
import_zod17.z.literal(SCOPES.USER_UPDATE),
|
1659
|
+
import_zod17.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
|
1574
1660
|
]);
|
1575
|
-
var ConfigScope =
|
1576
|
-
var DataSeedingScope =
|
1577
|
-
var LiteralScopes =
|
1661
|
+
var ConfigScope = import_zod17.z.literal(SCOPES.CONFIG_UPDATE_ALL);
|
1662
|
+
var DataSeedingScope = import_zod17.z.literal(SCOPES.USER_DATA_SEEDING);
|
1663
|
+
var LiteralScopes = import_zod17.z.union([
|
1578
1664
|
LegacyScopes,
|
1579
1665
|
IntegrationScopes,
|
1580
1666
|
UnassignScope,
|
@@ -1593,39 +1679,47 @@ var LiteralScopes = import_zod16.z.union([
|
|
1593
1679
|
DataSeedingScope
|
1594
1680
|
]);
|
1595
1681
|
var rawConfigurableScopeRegex = /^([a-zA-Z\.]+)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
1596
|
-
var rawConfigurableScope =
|
1597
|
-
var CreateUserScope =
|
1598
|
-
type:
|
1599
|
-
options:
|
1600
|
-
role:
|
1682
|
+
var rawConfigurableScope = import_zod17.z.string().regex(rawConfigurableScopeRegex);
|
1683
|
+
var CreateUserScope = import_zod17.z.object({
|
1684
|
+
type: import_zod17.z.literal("user.create"),
|
1685
|
+
options: import_zod17.z.object({
|
1686
|
+
role: import_zod17.z.array(import_zod17.z.string())
|
1601
1687
|
})
|
1602
1688
|
});
|
1603
|
-
var EditUserScope =
|
1604
|
-
type:
|
1605
|
-
options:
|
1606
|
-
role:
|
1689
|
+
var EditUserScope = import_zod17.z.object({
|
1690
|
+
type: import_zod17.z.literal("user.edit"),
|
1691
|
+
options: import_zod17.z.object({
|
1692
|
+
role: import_zod17.z.array(import_zod17.z.string())
|
1607
1693
|
})
|
1608
1694
|
});
|
1609
|
-
var WorkqueueScope =
|
1610
|
-
type:
|
1611
|
-
options:
|
1612
|
-
id:
|
1695
|
+
var WorkqueueScope = import_zod17.z.object({
|
1696
|
+
type: import_zod17.z.literal("workqueue"),
|
1697
|
+
options: import_zod17.z.object({
|
1698
|
+
id: import_zod17.z.array(import_zod17.z.string())
|
1613
1699
|
})
|
1614
1700
|
});
|
1615
|
-
var NotifyRecordScope =
|
1616
|
-
type:
|
1617
|
-
options:
|
1618
|
-
event:
|
1701
|
+
var NotifyRecordScope = import_zod17.z.object({
|
1702
|
+
type: import_zod17.z.literal("record.notify"),
|
1703
|
+
options: import_zod17.z.object({
|
1704
|
+
event: import_zod17.z.array(import_zod17.z.string())
|
1619
1705
|
})
|
1620
1706
|
});
|
1621
|
-
var
|
1707
|
+
var SearchScope = import_zod17.z.object({
|
1708
|
+
type: import_zod17.z.literal("search"),
|
1709
|
+
options: import_zod17.z.object({
|
1710
|
+
event: import_zod17.z.array(import_zod17.z.string()).length(1),
|
1711
|
+
access: import_zod17.z.array(import_zod17.z.enum(["my-jurisdiction", "all"])).length(1)
|
1712
|
+
})
|
1713
|
+
});
|
1714
|
+
var ConfigurableRawScopes = import_zod17.z.discriminatedUnion("type", [
|
1715
|
+
SearchScope,
|
1622
1716
|
CreateUserScope,
|
1623
1717
|
EditUserScope,
|
1624
1718
|
WorkqueueScope,
|
1625
1719
|
NotifyRecordScope
|
1626
1720
|
]);
|
1627
1721
|
var scopes = Object.values(SCOPES);
|
1628
|
-
var ActionScopes =
|
1722
|
+
var ActionScopes = import_zod17.z.union([
|
1629
1723
|
DeclareScopes,
|
1630
1724
|
ValidateScopes,
|
1631
1725
|
RegisterScope,
|
@@ -1776,30 +1870,30 @@ var DEFAULT_ROLES_DEFINITION = [
|
|
1776
1870
|
]
|
1777
1871
|
}
|
1778
1872
|
];
|
1779
|
-
var TokenUserType =
|
1780
|
-
var TokenWithBearer =
|
1873
|
+
var TokenUserType = import_zod18.z.enum(["user", "system"]);
|
1874
|
+
var TokenWithBearer = import_zod18.z.string().regex(/^Bearer\s/);
|
1781
1875
|
|
1782
1876
|
// ../commons/src/events/ActionDocument.ts
|
1783
|
-
(0,
|
1784
|
-
var ActionUpdate =
|
1785
|
-
var EventState =
|
1877
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod19.z);
|
1878
|
+
var ActionUpdate = import_zod19.z.record(import_zod19.z.string(), FieldUpdateValue);
|
1879
|
+
var EventState = import_zod19.z.record(import_zod19.z.string(), FieldValue);
|
1786
1880
|
var ActionStatus = {
|
1787
1881
|
Requested: "Requested",
|
1788
1882
|
Accepted: "Accepted",
|
1789
1883
|
Rejected: "Rejected"
|
1790
1884
|
};
|
1791
|
-
var ActionBase =
|
1885
|
+
var ActionBase = import_zod19.z.object({
|
1792
1886
|
id: UUID,
|
1793
|
-
transactionId:
|
1887
|
+
transactionId: import_zod19.z.string(),
|
1794
1888
|
createdByUserType: TokenUserType,
|
1795
|
-
createdAt:
|
1796
|
-
createdBy:
|
1797
|
-
createdByRole:
|
1798
|
-
createdBySignature:
|
1889
|
+
createdAt: import_zod19.z.string().datetime(),
|
1890
|
+
createdBy: import_zod19.z.string(),
|
1891
|
+
createdByRole: import_zod19.z.string(),
|
1892
|
+
createdBySignature: import_zod19.z.string().nullish().describe("Reference to signature of the user who created the action"),
|
1799
1893
|
createdAtLocation: CreatedAtLocation,
|
1800
1894
|
declaration: ActionUpdate,
|
1801
1895
|
annotation: ActionUpdate.optional().nullable(),
|
1802
|
-
status:
|
1896
|
+
status: import_zod19.z.enum([
|
1803
1897
|
ActionStatus.Requested,
|
1804
1898
|
ActionStatus.Accepted,
|
1805
1899
|
ActionStatus.Rejected
|
@@ -1810,91 +1904,92 @@ var ActionBase = import_zod18.z.object({
|
|
1810
1904
|
)
|
1811
1905
|
});
|
1812
1906
|
var AssignedAction = ActionBase.merge(
|
1813
|
-
|
1814
|
-
type:
|
1815
|
-
assignedTo:
|
1907
|
+
import_zod19.z.object({
|
1908
|
+
type: import_zod19.z.literal(ActionType.ASSIGN),
|
1909
|
+
assignedTo: import_zod19.z.string()
|
1816
1910
|
})
|
1817
1911
|
);
|
1818
1912
|
var UnassignedAction = ActionBase.merge(
|
1819
|
-
|
1820
|
-
type:
|
1913
|
+
import_zod19.z.object({
|
1914
|
+
type: import_zod19.z.literal(ActionType.UNASSIGN)
|
1821
1915
|
})
|
1822
1916
|
);
|
1823
1917
|
var RegisterAction = ActionBase.merge(
|
1824
|
-
|
1825
|
-
type:
|
1826
|
-
registrationNumber:
|
1918
|
+
import_zod19.z.object({
|
1919
|
+
type: import_zod19.z.literal(ActionType.REGISTER),
|
1920
|
+
registrationNumber: import_zod19.z.string().optional()
|
1827
1921
|
})
|
1828
1922
|
);
|
1829
1923
|
var DeclareAction = ActionBase.merge(
|
1830
|
-
|
1831
|
-
type:
|
1924
|
+
import_zod19.z.object({
|
1925
|
+
type: import_zod19.z.literal(ActionType.DECLARE)
|
1832
1926
|
})
|
1833
1927
|
);
|
1834
1928
|
var ValidateAction = ActionBase.merge(
|
1835
|
-
|
1836
|
-
type:
|
1929
|
+
import_zod19.z.object({
|
1930
|
+
type: import_zod19.z.literal(ActionType.VALIDATE)
|
1837
1931
|
})
|
1838
1932
|
);
|
1839
|
-
var RejectionReason =
|
1840
|
-
message:
|
1841
|
-
isDuplicate:
|
1933
|
+
var RejectionReason = import_zod19.z.object({
|
1934
|
+
message: import_zod19.z.string().min(1, { message: "Message cannot be empty" }).describe("Message describing reason for rejection or archiving"),
|
1935
|
+
isDuplicate: import_zod19.z.boolean().optional().describe("If a declaration is duplicated")
|
1842
1936
|
});
|
1843
1937
|
var RejectAction = ActionBase.merge(
|
1844
|
-
|
1845
|
-
type:
|
1938
|
+
import_zod19.z.object({
|
1939
|
+
type: import_zod19.z.literal(ActionType.REJECT),
|
1846
1940
|
reason: RejectionReason
|
1847
1941
|
})
|
1848
1942
|
);
|
1849
1943
|
var MarkAsDuplicateAction = ActionBase.merge(
|
1850
|
-
|
1851
|
-
type:
|
1944
|
+
import_zod19.z.object({
|
1945
|
+
type: import_zod19.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1852
1946
|
})
|
1853
1947
|
);
|
1854
1948
|
var ArchiveAction = ActionBase.merge(
|
1855
|
-
|
1856
|
-
type:
|
1949
|
+
import_zod19.z.object({
|
1950
|
+
type: import_zod19.z.literal(ActionType.ARCHIVE),
|
1857
1951
|
reason: RejectionReason
|
1858
1952
|
})
|
1859
1953
|
);
|
1860
1954
|
var CreatedAction = ActionBase.merge(
|
1861
|
-
|
1862
|
-
type:
|
1955
|
+
import_zod19.z.object({
|
1956
|
+
type: import_zod19.z.literal(ActionType.CREATE)
|
1863
1957
|
})
|
1864
1958
|
);
|
1865
1959
|
var NotifiedAction = ActionBase.merge(
|
1866
|
-
|
1867
|
-
type:
|
1960
|
+
import_zod19.z.object({
|
1961
|
+
type: import_zod19.z.literal(ActionType.NOTIFY)
|
1868
1962
|
})
|
1869
1963
|
);
|
1870
1964
|
var PrintCertificateAction = ActionBase.merge(
|
1871
|
-
|
1872
|
-
type:
|
1965
|
+
import_zod19.z.object({
|
1966
|
+
type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE)
|
1873
1967
|
})
|
1874
1968
|
);
|
1875
1969
|
var RequestedCorrectionAction = ActionBase.merge(
|
1876
|
-
|
1877
|
-
type:
|
1970
|
+
import_zod19.z.object({
|
1971
|
+
type: import_zod19.z.literal(ActionType.REQUEST_CORRECTION)
|
1878
1972
|
})
|
1879
1973
|
);
|
1880
1974
|
var ApprovedCorrectionAction = ActionBase.merge(
|
1881
|
-
|
1882
|
-
type:
|
1883
|
-
requestId:
|
1975
|
+
import_zod19.z.object({
|
1976
|
+
type: import_zod19.z.literal(ActionType.APPROVE_CORRECTION),
|
1977
|
+
requestId: import_zod19.z.string()
|
1884
1978
|
})
|
1885
1979
|
);
|
1886
1980
|
var RejectedCorrectionAction = ActionBase.merge(
|
1887
|
-
|
1888
|
-
type:
|
1889
|
-
requestId:
|
1981
|
+
import_zod19.z.object({
|
1982
|
+
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION),
|
1983
|
+
requestId: import_zod19.z.string(),
|
1984
|
+
reason: RejectionReason
|
1890
1985
|
})
|
1891
1986
|
);
|
1892
1987
|
var ReadAction = ActionBase.merge(
|
1893
|
-
|
1894
|
-
type:
|
1988
|
+
import_zod19.z.object({
|
1989
|
+
type: import_zod19.z.literal(ActionType.READ)
|
1895
1990
|
})
|
1896
1991
|
);
|
1897
|
-
var ActionDocument =
|
1992
|
+
var ActionDocument = import_zod19.z.discriminatedUnion("type", [
|
1898
1993
|
CreatedAction.openapi({ ref: "CreatedAction" }),
|
1899
1994
|
ValidateAction.openapi({ ref: "ValidateAction" }),
|
1900
1995
|
RejectAction.openapi({ ref: "RejectAction" }),
|
@@ -1917,20 +2012,20 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
1917
2012
|
declaration: true,
|
1918
2013
|
annotation: true
|
1919
2014
|
}).merge(
|
1920
|
-
|
1921
|
-
type:
|
1922
|
-
status:
|
2015
|
+
import_zod19.z.object({
|
2016
|
+
type: import_zod19.z.enum(ConfirmableActions),
|
2017
|
+
status: import_zod19.z.literal(ActionStatus.Rejected)
|
1923
2018
|
})
|
1924
2019
|
);
|
1925
|
-
var Action =
|
1926
|
-
var ResolvedUser =
|
1927
|
-
id:
|
1928
|
-
role:
|
1929
|
-
name:
|
1930
|
-
|
1931
|
-
use:
|
1932
|
-
given:
|
1933
|
-
family:
|
2020
|
+
var Action = import_zod19.z.union([ActionDocument, AsyncRejectActionDocument]);
|
2021
|
+
var ResolvedUser = import_zod19.z.object({
|
2022
|
+
id: import_zod19.z.string(),
|
2023
|
+
role: import_zod19.z.string(),
|
2024
|
+
name: import_zod19.z.array(
|
2025
|
+
import_zod19.z.object({
|
2026
|
+
use: import_zod19.z.string(),
|
2027
|
+
given: import_zod19.z.array(import_zod19.z.string()),
|
2028
|
+
family: import_zod19.z.string()
|
1934
2029
|
})
|
1935
2030
|
)
|
1936
2031
|
});
|
@@ -1941,19 +2036,25 @@ var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
1941
2036
|
var import_date_fns = require("date-fns");
|
1942
2037
|
|
1943
2038
|
// ../commons/src/events/FieldTypeMapping.ts
|
1944
|
-
var
|
2039
|
+
var import_zod20 = require("zod");
|
1945
2040
|
function mapFieldTypeToZod(type, required) {
|
1946
2041
|
let schema;
|
1947
2042
|
switch (type) {
|
1948
2043
|
case FieldType.DATE:
|
1949
2044
|
schema = DateValue;
|
1950
2045
|
break;
|
2046
|
+
case FieldType.TIME:
|
2047
|
+
schema = TimeValue;
|
2048
|
+
break;
|
1951
2049
|
case FieldType.EMAIL:
|
1952
2050
|
schema = EmailValue;
|
1953
2051
|
break;
|
1954
2052
|
case FieldType.DATE_RANGE:
|
1955
2053
|
schema = DateRangeFieldValue;
|
1956
2054
|
break;
|
2055
|
+
case FieldType.SELECT_DATE_RANGE:
|
2056
|
+
schema = SelectDateRangeValue;
|
2057
|
+
break;
|
1957
2058
|
case FieldType.TEXT:
|
1958
2059
|
case FieldType.TEXTAREA:
|
1959
2060
|
case FieldType.DIVIDER:
|
@@ -2001,7 +2102,7 @@ function createValidationSchema(config) {
|
|
2001
2102
|
for (const field2 of config) {
|
2002
2103
|
shape[field2.id] = mapFieldTypeToZod(field2.type, field2.required);
|
2003
2104
|
}
|
2004
|
-
return
|
2105
|
+
return import_zod20.z.object(shape);
|
2005
2106
|
}
|
2006
2107
|
function mapFieldTypeToEmptyValue(field2) {
|
2007
2108
|
switch (field2.type) {
|
@@ -2021,8 +2122,10 @@ function mapFieldTypeToEmptyValue(field2) {
|
|
2021
2122
|
case FieldType.NUMBER:
|
2022
2123
|
case FieldType.EMAIL:
|
2023
2124
|
case FieldType.DATE:
|
2125
|
+
case FieldType.TIME:
|
2024
2126
|
case FieldType.CHECKBOX:
|
2025
2127
|
case FieldType.DATE_RANGE:
|
2128
|
+
case FieldType.SELECT_DATE_RANGE:
|
2026
2129
|
case FieldType.DATA:
|
2027
2130
|
case FieldType.NAME:
|
2028
2131
|
case FieldType.PHONE:
|
@@ -2045,7 +2148,7 @@ function mapFieldTypeToEmptyValue(field2) {
|
|
2045
2148
|
case FieldType.SIGNATURE:
|
2046
2149
|
case FieldType.FILE:
|
2047
2150
|
return {
|
2048
|
-
|
2151
|
+
path: "",
|
2049
2152
|
originalFilename: "",
|
2050
2153
|
type: ""
|
2051
2154
|
};
|
@@ -2059,9 +2162,15 @@ var isParagraphFieldType = (field2) => {
|
|
2059
2162
|
var isDateFieldType = (field2) => {
|
2060
2163
|
return field2.config.type === FieldType.DATE;
|
2061
2164
|
};
|
2165
|
+
var isTimeFieldType = (field2) => {
|
2166
|
+
return field2.config.type === FieldType.TIME;
|
2167
|
+
};
|
2062
2168
|
var isDateRangeFieldType = (field2) => {
|
2063
2169
|
return field2.config.type === FieldType.DATE_RANGE;
|
2064
2170
|
};
|
2171
|
+
var isSelectDateRangeFieldType = (field2) => {
|
2172
|
+
return field2.config.type === FieldType.SELECT_DATE_RANGE;
|
2173
|
+
};
|
2065
2174
|
var isPageHeaderFieldType = (field2) => {
|
2066
2175
|
return field2.config.type === FieldType.PAGE_HEADER;
|
2067
2176
|
};
|
@@ -2141,6 +2250,29 @@ var ajv = new import_ajv.default({
|
|
2141
2250
|
allowUnionTypes: true
|
2142
2251
|
});
|
2143
2252
|
(0, import_ajv_formats.default)(ajv);
|
2253
|
+
ajv.addKeyword({
|
2254
|
+
keyword: "daysFromNow",
|
2255
|
+
type: "string",
|
2256
|
+
schemaType: "object",
|
2257
|
+
$data: true,
|
2258
|
+
errors: true,
|
2259
|
+
validate(schema, data, _, dataContext) {
|
2260
|
+
if (!(dataContext && dataContext.rootData && typeof dataContext.rootData === "object" && "$now" in dataContext.rootData && typeof dataContext.rootData.$now === "string")) {
|
2261
|
+
throw new Error("Validation context must contain $now");
|
2262
|
+
}
|
2263
|
+
const { days, clause } = schema;
|
2264
|
+
if (typeof data !== "string") {
|
2265
|
+
return false;
|
2266
|
+
}
|
2267
|
+
const date = new Date(data);
|
2268
|
+
if (isNaN(date.getTime())) {
|
2269
|
+
return false;
|
2270
|
+
}
|
2271
|
+
const now = new Date(dataContext.rootData.$now);
|
2272
|
+
const offsetDate = new Date(now.getTime() + days * 24 * 60 * 60 * 1e3);
|
2273
|
+
return clause === "after" ? (0, import_date_fns.isAfter)(date, offsetDate) : (0, import_date_fns.isBefore)(date, offsetDate);
|
2274
|
+
}
|
2275
|
+
});
|
2144
2276
|
function validate(schema, data) {
|
2145
2277
|
return ajv.validate(schema, data);
|
2146
2278
|
}
|
@@ -2206,7 +2338,7 @@ var errorMessages = {
|
|
2206
2338
|
id: "v2.error.invalidEmail"
|
2207
2339
|
},
|
2208
2340
|
requiredField: {
|
2209
|
-
defaultMessage: "Required
|
2341
|
+
defaultMessage: "Required",
|
2210
2342
|
description: "Error message when required field is missing",
|
2211
2343
|
id: "v2.error.required"
|
2212
2344
|
},
|
@@ -2219,6 +2351,11 @@ var errorMessages = {
|
|
2219
2351
|
defaultMessage: "Unexpected field",
|
2220
2352
|
description: "Error message when field is not expected",
|
2221
2353
|
id: "v2.error.unexpectedField"
|
2354
|
+
},
|
2355
|
+
correctionNotAllowed: {
|
2356
|
+
defaultMessage: "Correction not allowed for field",
|
2357
|
+
description: "Error message when correction is not allowed for field",
|
2358
|
+
id: "v2.error.correctionNotAllowed"
|
2222
2359
|
}
|
2223
2360
|
};
|
2224
2361
|
function createIntlError(message) {
|
@@ -2279,13 +2416,8 @@ function validateFieldInput({
|
|
2279
2416
|
field: field2,
|
2280
2417
|
value
|
2281
2418
|
}) {
|
2282
|
-
const
|
2283
|
-
|
2284
|
-
{
|
2285
|
-
// @ts-expect-error
|
2286
|
-
errorMap: zodToIntlErrorMap
|
2287
|
-
}
|
2288
|
-
);
|
2419
|
+
const zodType = mapFieldTypeToZod(field2.type, field2.required);
|
2420
|
+
const rawError = zodType.safeParse(value, { errorMap: zodToIntlErrorMap });
|
2289
2421
|
return rawError.error?.issues.map((issue) => issue.message) ?? [];
|
2290
2422
|
}
|
2291
2423
|
function runFieldValidations({
|
@@ -2366,6 +2498,7 @@ function joinValues(values, separator = " ") {
|
|
2366
2498
|
}
|
2367
2499
|
|
2368
2500
|
// ../commons/src/events/utils.ts
|
2501
|
+
var import_date_fns2 = require("date-fns");
|
2369
2502
|
function isDeclarationActionConfig(action) {
|
2370
2503
|
return DeclarationActions.safeParse(action.type).success;
|
2371
2504
|
}
|
@@ -2378,12 +2511,18 @@ function getDeclarationPages(configuration) {
|
|
2378
2511
|
function getDeclaration(configuration) {
|
2379
2512
|
return configuration.declaration;
|
2380
2513
|
}
|
2514
|
+
function getPrintCertificatePages(configuration) {
|
2515
|
+
const action = configuration.actions.find(
|
2516
|
+
(a) => a.type === ActionType.PRINT_CERTIFICATE
|
2517
|
+
);
|
2518
|
+
return getOrThrow(
|
2519
|
+
action?.printForm.pages,
|
2520
|
+
`${ActionType.PRINT_CERTIFICATE} action does not have print form set.`
|
2521
|
+
);
|
2522
|
+
}
|
2381
2523
|
var getActionAnnotationFields = (actionConfig) => {
|
2382
2524
|
if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
|
2383
|
-
return
|
2384
|
-
...actionConfig.onboardingForm.flatMap(({ fields }) => fields),
|
2385
|
-
...actionConfig.additionalDetailsForm.flatMap(({ fields }) => fields)
|
2386
|
-
];
|
2525
|
+
return actionConfig.correctionForm.pages.flatMap(({ fields }) => fields);
|
2387
2526
|
}
|
2388
2527
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
2389
2528
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
@@ -2406,7 +2545,7 @@ function getDeclarationFieldById(config, fieldId) {
|
|
2406
2545
|
var findRecordActionPages = (config, actionType) => {
|
2407
2546
|
const action = config.actions.find((a) => a.type === actionType);
|
2408
2547
|
if (action?.type === ActionType.REQUEST_CORRECTION) {
|
2409
|
-
return
|
2548
|
+
return action.correctionForm.pages;
|
2410
2549
|
}
|
2411
2550
|
if (action?.type === ActionType.PRINT_CERTIFICATE) {
|
2412
2551
|
return action.printForm.pages;
|
@@ -2480,13 +2619,10 @@ function getVisibleVerificationPageIds(pages, annotation) {
|
|
2480
2619
|
}
|
2481
2620
|
function getActionVerificationPageIds(actionConfig, annotation) {
|
2482
2621
|
if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
|
2483
|
-
return
|
2484
|
-
|
2485
|
-
|
2486
|
-
|
2487
|
-
annotation
|
2488
|
-
)
|
2489
|
-
];
|
2622
|
+
return getVisibleVerificationPageIds(
|
2623
|
+
actionConfig.correctionForm.pages,
|
2624
|
+
annotation
|
2625
|
+
);
|
2490
2626
|
}
|
2491
2627
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
2492
2628
|
return getVisibleVerificationPageIds(
|
@@ -2565,12 +2701,33 @@ function getEventConfigById(eventConfigs, id) {
|
|
2565
2701
|
);
|
2566
2702
|
return getOrThrow(eventConfig, `Event config for ${id} not found`);
|
2567
2703
|
}
|
2704
|
+
function timePeriodToDateRange(value) {
|
2705
|
+
let startDate;
|
2706
|
+
switch (value) {
|
2707
|
+
case "last7Days":
|
2708
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 6);
|
2709
|
+
break;
|
2710
|
+
case "last30Days":
|
2711
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 29);
|
2712
|
+
break;
|
2713
|
+
case "last90Days":
|
2714
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 89);
|
2715
|
+
break;
|
2716
|
+
case "last365Days":
|
2717
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 364);
|
2718
|
+
break;
|
2719
|
+
}
|
2720
|
+
return {
|
2721
|
+
startDate: startDate.toISOString(),
|
2722
|
+
endDate: (/* @__PURE__ */ new Date()).toISOString()
|
2723
|
+
};
|
2724
|
+
}
|
2568
2725
|
|
2569
2726
|
// ../commons/src/events/EventConfig.ts
|
2570
|
-
var
|
2571
|
-
(0,
|
2572
|
-
var EventConfig =
|
2573
|
-
id:
|
2727
|
+
var import_zod_openapi9 = require("zod-openapi");
|
2728
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod21.z);
|
2729
|
+
var EventConfig = import_zod21.z.object({
|
2730
|
+
id: import_zod21.z.string().describe(
|
2574
2731
|
'A machine-readable identifier for the event, e.g. "birth" or "death"'
|
2575
2732
|
),
|
2576
2733
|
dateOfEvent: FieldReference.optional(),
|
@@ -2580,10 +2737,10 @@ var EventConfig = import_zod20.z.object({
|
|
2580
2737
|
),
|
2581
2738
|
summary: SummaryConfig,
|
2582
2739
|
label: TranslationConfig,
|
2583
|
-
actions:
|
2740
|
+
actions: import_zod21.z.array(ActionConfig),
|
2584
2741
|
declaration: DeclarationFormConfig,
|
2585
|
-
deduplication:
|
2586
|
-
advancedSearch:
|
2742
|
+
deduplication: import_zod21.z.array(DeduplicationConfig).optional().default([]),
|
2743
|
+
advancedSearch: import_zod21.z.array(AdvancedSearchConfig).optional().default([])
|
2587
2744
|
}).superRefine((event2, ctx) => {
|
2588
2745
|
const allFields = findAllFields(event2);
|
2589
2746
|
const fieldIds = allFields.map((field2) => field2.id);
|
@@ -2615,6 +2772,28 @@ var EventConfig = import_zod20.z.object({
|
|
2615
2772
|
path: ["advancedSearch"]
|
2616
2773
|
});
|
2617
2774
|
}
|
2775
|
+
event2.advancedSearch.forEach((section, sectionIndex) => {
|
2776
|
+
section.fields.forEach((field2, fieldIndex) => {
|
2777
|
+
if ("alternateFieldIds" in field2 && Array.isArray(field2.alternateFieldIds)) {
|
2778
|
+
const invalidAltIds = field2.alternateFieldIds.filter(
|
2779
|
+
(id) => !fieldIds.includes(id)
|
2780
|
+
);
|
2781
|
+
if (invalidAltIds.length > 0) {
|
2782
|
+
ctx.addIssue({
|
2783
|
+
code: "custom",
|
2784
|
+
message: `Invalid alternateFieldIds: ${invalidAltIds.join(", ")}`,
|
2785
|
+
path: [
|
2786
|
+
"advancedSearch",
|
2787
|
+
sectionIndex,
|
2788
|
+
"fields",
|
2789
|
+
fieldIndex,
|
2790
|
+
"alternateFieldIds"
|
2791
|
+
]
|
2792
|
+
});
|
2793
|
+
}
|
2794
|
+
}
|
2795
|
+
});
|
2796
|
+
});
|
2618
2797
|
if (event2.dateOfEvent) {
|
2619
2798
|
const eventDateFieldId = getDeclarationFields(event2).find(
|
2620
2799
|
({ id }) => id === event2.dateOfEvent?.$$field
|
@@ -2645,16 +2824,17 @@ var definePage = (page) => PageConfig.parse(page);
|
|
2645
2824
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
2646
2825
|
|
2647
2826
|
// ../commons/src/events/WorkqueueConfig.ts
|
2648
|
-
var
|
2827
|
+
var import_zod28 = require("zod");
|
2649
2828
|
|
2650
2829
|
// ../commons/src/events/serializers/user/serializer.ts
|
2651
|
-
var
|
2652
|
-
var SerializedUserField =
|
2653
|
-
$userField:
|
2830
|
+
var import_zod22 = require("zod");
|
2831
|
+
var SerializedUserField = import_zod22.z.object({
|
2832
|
+
$userField: import_zod22.z.enum([
|
2654
2833
|
"id",
|
2655
2834
|
"name",
|
2656
2835
|
"role",
|
2657
|
-
"
|
2836
|
+
"signature",
|
2837
|
+
"avatar",
|
2658
2838
|
"primaryOfficeId"
|
2659
2839
|
])
|
2660
2840
|
});
|
@@ -2726,41 +2906,6 @@ var user = Object.assign(userSerializer, {
|
|
2726
2906
|
required: ["$user"]
|
2727
2907
|
})
|
2728
2908
|
});
|
2729
|
-
function createEventConditionals() {
|
2730
|
-
return {
|
2731
|
-
/**
|
2732
|
-
* Checks if the event contains a specific action type.
|
2733
|
-
* @param action - The action type to check for.
|
2734
|
-
*/
|
2735
|
-
hasAction: (action) => defineConditional({
|
2736
|
-
type: "object",
|
2737
|
-
properties: {
|
2738
|
-
$event: {
|
2739
|
-
type: "object",
|
2740
|
-
properties: {
|
2741
|
-
actions: {
|
2742
|
-
type: "array",
|
2743
|
-
contains: {
|
2744
|
-
type: "object",
|
2745
|
-
properties: {
|
2746
|
-
type: {
|
2747
|
-
const: action
|
2748
|
-
}
|
2749
|
-
},
|
2750
|
-
required: ["type"]
|
2751
|
-
}
|
2752
|
-
}
|
2753
|
-
},
|
2754
|
-
required: ["actions"]
|
2755
|
-
}
|
2756
|
-
},
|
2757
|
-
required: ["$event"]
|
2758
|
-
})
|
2759
|
-
};
|
2760
|
-
}
|
2761
|
-
function getDateFromNow(days) {
|
2762
|
-
return new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString().split("T")[0];
|
2763
|
-
}
|
2764
2909
|
function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
|
2765
2910
|
return {
|
2766
2911
|
type: "object",
|
@@ -2779,6 +2924,20 @@ function isFieldReference(value) {
|
|
2779
2924
|
return typeof value === "object" && value !== null && "$$field" in value;
|
2780
2925
|
}
|
2781
2926
|
function createFieldConditionals(fieldId) {
|
2927
|
+
const getDayRange = (days, clause) => ({
|
2928
|
+
type: "object",
|
2929
|
+
properties: {
|
2930
|
+
[fieldId]: {
|
2931
|
+
type: "string",
|
2932
|
+
format: "date",
|
2933
|
+
daysFromNow: {
|
2934
|
+
days,
|
2935
|
+
clause
|
2936
|
+
}
|
2937
|
+
}
|
2938
|
+
},
|
2939
|
+
required: [fieldId]
|
2940
|
+
});
|
2782
2941
|
const getDateRange = (date, clause) => ({
|
2783
2942
|
type: "object",
|
2784
2943
|
properties: {
|
@@ -2797,12 +2956,8 @@ function createFieldConditionals(fieldId) {
|
|
2797
2956
|
$$field: fieldId,
|
2798
2957
|
isAfter: () => ({
|
2799
2958
|
days: (days) => ({
|
2800
|
-
inPast: () => defineFormConditional(
|
2801
|
-
|
2802
|
-
),
|
2803
|
-
inFuture: () => defineFormConditional(
|
2804
|
-
getDateRange(getDateFromNow(-days), "formatMinimum")
|
2805
|
-
)
|
2959
|
+
inPast: () => defineFormConditional(getDayRange(-days, "after")),
|
2960
|
+
inFuture: () => defineFormConditional(getDayRange(days, "after"))
|
2806
2961
|
}),
|
2807
2962
|
date: (date) => {
|
2808
2963
|
if (isFieldReference(date)) {
|
@@ -2817,16 +2972,12 @@ function createFieldConditionals(fieldId) {
|
|
2817
2972
|
}
|
2818
2973
|
return defineFormConditional(getDateRange(date, "formatMinimum"));
|
2819
2974
|
},
|
2820
|
-
now: () => defineFormConditional(getDateRange(
|
2975
|
+
now: () => defineFormConditional(getDateRange({ $data: "/$now" }, "formatMinimum"))
|
2821
2976
|
}),
|
2822
2977
|
isBefore: () => ({
|
2823
2978
|
days: (days) => ({
|
2824
|
-
inPast: () => defineFormConditional(
|
2825
|
-
|
2826
|
-
),
|
2827
|
-
inFuture: () => defineFormConditional(
|
2828
|
-
getDateRange(getDateFromNow(-days), "formatMaximum")
|
2829
|
-
)
|
2979
|
+
inPast: () => defineFormConditional(getDayRange(days, "before")),
|
2980
|
+
inFuture: () => defineFormConditional(getDayRange(-days, "before"))
|
2830
2981
|
}),
|
2831
2982
|
date: (date) => {
|
2832
2983
|
if (isFieldReference(date)) {
|
@@ -2841,7 +2992,7 @@ function createFieldConditionals(fieldId) {
|
|
2841
2992
|
}
|
2842
2993
|
return defineFormConditional(getDateRange(date, "formatMaximum"));
|
2843
2994
|
},
|
2844
|
-
now: () => defineFormConditional(getDateRange(
|
2995
|
+
now: () => defineFormConditional(getDateRange({ $data: "/$now" }, "formatMaximum"))
|
2845
2996
|
}),
|
2846
2997
|
isEqualTo: (value) => {
|
2847
2998
|
if (isFieldReference(value)) {
|
@@ -2933,8 +3084,7 @@ function createFieldConditionals(fieldId) {
|
|
2933
3084
|
pattern: "^[\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*( [\\p{Script=Latin}0-9'._-]*(\\([\\p{Script=Latin}0-9'._-]+\\))?[\\p{Script=Latin}0-9'._-]*)*$",
|
2934
3085
|
description: "Name must contain only letters, numbers, and allowed special characters ('._-). No double spaces."
|
2935
3086
|
}
|
2936
|
-
}
|
2937
|
-
required: [fieldId]
|
3087
|
+
}
|
2938
3088
|
}),
|
2939
3089
|
/**
|
2940
3090
|
* Checks if the field value matches a given regular expression pattern.
|
@@ -2990,7 +3140,7 @@ function createSearchConfig(baseField) {
|
|
2990
3140
|
*
|
2991
3141
|
* @returns An object containing the field ID and a configuration object with a type of 'range'.
|
2992
3142
|
*
|
2993
|
-
* @example event('
|
3143
|
+
* @example event('legalStatuses.REGISTERED.acceptedAt').range()
|
2994
3144
|
* // {
|
2995
3145
|
* // ...
|
2996
3146
|
* // config: { type: 'range' }
|
@@ -3025,26 +3175,65 @@ function createSearchConfig(baseField) {
|
|
3025
3175
|
fuzzy: () => ({
|
3026
3176
|
...baseField,
|
3027
3177
|
config: { type: "fuzzy" }
|
3178
|
+
}),
|
3179
|
+
/**
|
3180
|
+
* Creates a configuration for matching locations and the child locations
|
3181
|
+
* @returns An object containing the field ID and a configuration object with a type of 'within'.
|
3182
|
+
* @example field('createdAtLocation').within()
|
3183
|
+
* // {
|
3184
|
+
* // ...
|
3185
|
+
* // config: { type: 'within' }
|
3186
|
+
* // }
|
3187
|
+
*/
|
3188
|
+
within: () => ({
|
3189
|
+
...baseField,
|
3190
|
+
config: { type: "within" }
|
3028
3191
|
})
|
3029
3192
|
};
|
3030
3193
|
}
|
3031
3194
|
|
3032
3195
|
// ../commons/src/event-config/event-configuration.ts
|
3033
|
-
function createEventFieldConfig(fieldId
|
3196
|
+
function createEventFieldConfig(fieldId) {
|
3034
3197
|
const baseField = {
|
3035
3198
|
fieldId,
|
3036
|
-
options,
|
3037
3199
|
fieldType: "event"
|
3038
3200
|
};
|
3039
3201
|
return createSearchConfig(baseField);
|
3040
3202
|
}
|
3041
3203
|
|
3042
3204
|
// ../commons/src/events/event.ts
|
3043
|
-
function eventFn(fieldId
|
3044
|
-
return createEventFieldConfig(fieldId
|
3205
|
+
function eventFn(fieldId) {
|
3206
|
+
return createEventFieldConfig(fieldId);
|
3045
3207
|
}
|
3046
3208
|
var event = Object.assign(eventFn, {
|
3047
|
-
|
3209
|
+
/**
|
3210
|
+
* Checks if the event contains a specific action type.
|
3211
|
+
* @param action - The action type to check for.
|
3212
|
+
*/
|
3213
|
+
hasAction: (action) => defineConditional({
|
3214
|
+
type: "object",
|
3215
|
+
properties: {
|
3216
|
+
$event: {
|
3217
|
+
type: "object",
|
3218
|
+
properties: {
|
3219
|
+
actions: {
|
3220
|
+
type: "array",
|
3221
|
+
contains: {
|
3222
|
+
type: "object",
|
3223
|
+
properties: {
|
3224
|
+
type: {
|
3225
|
+
const: action
|
3226
|
+
}
|
3227
|
+
},
|
3228
|
+
required: ["type"]
|
3229
|
+
}
|
3230
|
+
}
|
3231
|
+
},
|
3232
|
+
required: ["actions"]
|
3233
|
+
}
|
3234
|
+
},
|
3235
|
+
required: ["$event"]
|
3236
|
+
}),
|
3048
3237
|
field(field2) {
|
3049
3238
|
return {
|
3050
3239
|
$event: field2
|
@@ -3053,83 +3242,83 @@ var event = Object.assign(eventFn, {
|
|
3053
3242
|
});
|
3054
3243
|
|
3055
3244
|
// ../commons/src/events/WorkqueueColumnConfig.ts
|
3056
|
-
var
|
3245
|
+
var import_zod24 = require("zod");
|
3057
3246
|
|
3058
3247
|
// ../commons/src/events/EventMetadata.ts
|
3059
|
-
var
|
3060
|
-
var EventStatus =
|
3248
|
+
var import_zod23 = require("zod");
|
3249
|
+
var EventStatus = import_zod23.z.enum([
|
3061
3250
|
"CREATED",
|
3062
3251
|
"NOTIFIED",
|
3063
3252
|
"DECLARED",
|
3064
3253
|
"VALIDATED",
|
3065
3254
|
"REGISTERED",
|
3066
3255
|
"CERTIFIED",
|
3067
|
-
"REJECTED",
|
3068
3256
|
"ARCHIVED"
|
3069
3257
|
]);
|
3258
|
+
var VisibleStatus = import_zod23.z.enum([...EventStatus.options, "REJECTED"]);
|
3070
3259
|
var InherentFlags = {
|
3071
3260
|
PRINTED: "printed",
|
3072
3261
|
INCOMPLETE: "incomplete",
|
3073
3262
|
REJECTED: "rejected",
|
3074
3263
|
CORRECTION_REQUESTED: "correction-requested"
|
3075
3264
|
};
|
3076
|
-
var Flag =
|
3265
|
+
var Flag = import_zod23.z.string().regex(
|
3077
3266
|
new RegExp(
|
3078
3267
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
3079
3268
|
ActionStatus
|
3080
3269
|
).join("|").toLowerCase()})$`
|
3081
3270
|
),
|
3082
3271
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
3083
|
-
).or(
|
3084
|
-
var ZodDate =
|
3085
|
-
var ActionCreationMetadata =
|
3086
|
-
createdAt:
|
3087
|
-
createdBy:
|
3272
|
+
).or(import_zod23.z.nativeEnum(InherentFlags));
|
3273
|
+
var ZodDate = import_zod23.z.string().date();
|
3274
|
+
var ActionCreationMetadata = import_zod23.z.object({
|
3275
|
+
createdAt: import_zod23.z.string().datetime().describe("The timestamp when the action request was created."),
|
3276
|
+
createdBy: import_zod23.z.string().describe("ID of the user who created the action request."),
|
3088
3277
|
createdAtLocation: CreatedAtLocation.describe(
|
3089
3278
|
"Location of the user who created the action request."
|
3090
3279
|
),
|
3091
|
-
createdByUserType:
|
3092
|
-
acceptedAt:
|
3093
|
-
createdByRole:
|
3094
|
-
createdBySignature:
|
3280
|
+
createdByUserType: import_zod23.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
3281
|
+
acceptedAt: import_zod23.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
3282
|
+
createdByRole: import_zod23.z.string().describe("Role of the user at the time of action request creation."),
|
3283
|
+
createdBySignature: import_zod23.z.string().nullish().describe("Signature of the user who created the action request.")
|
3095
3284
|
});
|
3096
3285
|
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
3097
|
-
registrationNumber:
|
3286
|
+
registrationNumber: import_zod23.z.string().describe(
|
3098
3287
|
"Registration number of the event. Always present for accepted registrations."
|
3099
3288
|
)
|
3100
3289
|
});
|
3101
|
-
var LegalStatuses =
|
3290
|
+
var LegalStatuses = import_zod23.z.object({
|
3102
3291
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
3103
3292
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
3104
3293
|
});
|
3105
|
-
var EventMetadata =
|
3294
|
+
var EventMetadata = import_zod23.z.object({
|
3106
3295
|
id: UUID,
|
3107
|
-
type:
|
3296
|
+
type: import_zod23.z.string().describe("The type of event, such as birth, death, or marriage."),
|
3108
3297
|
status: EventStatus,
|
3109
3298
|
legalStatuses: LegalStatuses.describe(
|
3110
3299
|
"Metadata related to the legal registration of the event, such as who registered it and when."
|
3111
3300
|
),
|
3112
|
-
createdAt:
|
3301
|
+
createdAt: import_zod23.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
3113
3302
|
dateOfEvent: ZodDate.nullish(),
|
3114
|
-
createdBy:
|
3115
|
-
createdByUserType:
|
3116
|
-
updatedByUserRole:
|
3303
|
+
createdBy: import_zod23.z.string().describe("ID of the user who created the event."),
|
3304
|
+
createdByUserType: import_zod23.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
|
3305
|
+
updatedByUserRole: import_zod23.z.string().describe("Role of the user who last changed the status."),
|
3117
3306
|
createdAtLocation: CreatedAtLocation.describe(
|
3118
3307
|
"Location of the user who created the event."
|
3119
3308
|
),
|
3120
|
-
createdBySignature:
|
3309
|
+
createdBySignature: import_zod23.z.string().nullish().describe("Signature of the user who created the event."),
|
3121
3310
|
updatedAtLocation: UUID.nullish().describe(
|
3122
3311
|
"Location of the user who last changed the status."
|
3123
3312
|
),
|
3124
|
-
updatedAt:
|
3313
|
+
updatedAt: import_zod23.z.string().datetime().describe(
|
3125
3314
|
"Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
|
3126
3315
|
),
|
3127
|
-
assignedTo:
|
3128
|
-
updatedBy:
|
3129
|
-
trackingId:
|
3316
|
+
assignedTo: import_zod23.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
3317
|
+
updatedBy: import_zod23.z.string().nullish().describe("ID of the user who last changed the status."),
|
3318
|
+
trackingId: import_zod23.z.string().describe(
|
3130
3319
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
3131
3320
|
),
|
3132
|
-
flags:
|
3321
|
+
flags: import_zod23.z.array(Flag)
|
3133
3322
|
});
|
3134
3323
|
var EventMetadataKeysArray = [
|
3135
3324
|
"id",
|
@@ -3149,7 +3338,7 @@ var EventMetadataKeysArray = [
|
|
3149
3338
|
"legalStatuses",
|
3150
3339
|
"flags"
|
3151
3340
|
];
|
3152
|
-
var EventMetadataKeys =
|
3341
|
+
var EventMetadataKeys = import_zod23.z.enum(EventMetadataKeysArray);
|
3153
3342
|
var eventMetadataLabelMap = {
|
3154
3343
|
"event.assignedTo": {
|
3155
3344
|
id: "event.assignedTo.label",
|
@@ -3234,11 +3423,11 @@ var WorkqueueColumnKeysArray = [
|
|
3234
3423
|
"title",
|
3235
3424
|
"outbox"
|
3236
3425
|
];
|
3237
|
-
var WorkqueueColumnKeys =
|
3238
|
-
var WorkqueueColumnValue =
|
3426
|
+
var WorkqueueColumnKeys = import_zod24.z.enum(WorkqueueColumnKeysArray);
|
3427
|
+
var WorkqueueColumnValue = import_zod24.z.object({
|
3239
3428
|
$event: WorkqueueColumnKeys
|
3240
3429
|
});
|
3241
|
-
var WorkqueueColumn =
|
3430
|
+
var WorkqueueColumn = import_zod24.z.object({
|
3242
3431
|
label: TranslationConfig,
|
3243
3432
|
value: WorkqueueColumnValue
|
3244
3433
|
});
|
@@ -3249,115 +3438,130 @@ function defineWorkqueuesColumns(workqueueColumns) {
|
|
3249
3438
|
}
|
3250
3439
|
|
3251
3440
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
3252
|
-
var
|
3441
|
+
var import_zod26 = require("zod");
|
3253
3442
|
|
3254
3443
|
// ../commons/src/events/EventIndex.ts
|
3255
|
-
var
|
3256
|
-
var
|
3257
|
-
(0,
|
3444
|
+
var import_zod25 = require("zod");
|
3445
|
+
var import_zod_openapi10 = require("zod-openapi");
|
3446
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod25.z);
|
3258
3447
|
var EventIndex = EventMetadata.extend({
|
3259
3448
|
declaration: EventState
|
3260
3449
|
}).openapi({
|
3261
3450
|
ref: "EventIndex"
|
3262
3451
|
});
|
3263
|
-
var EventSearchIndex =
|
3264
|
-
|
3265
|
-
type:
|
3452
|
+
var EventSearchIndex = import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).and(
|
3453
|
+
import_zod25.z.object({
|
3454
|
+
type: import_zod25.z.string()
|
3266
3455
|
// Ensures "type" (event-id) exists and is a string
|
3267
3456
|
})
|
3268
3457
|
).openapi({
|
3269
3458
|
ref: "EventSearchIndex"
|
3270
3459
|
});
|
3271
|
-
var Fuzzy =
|
3460
|
+
var Fuzzy = import_zod25.z.object({ type: import_zod25.z.literal("fuzzy"), term: import_zod25.z.string() }).openapi({
|
3272
3461
|
ref: "Fuzzy"
|
3273
3462
|
});
|
3274
|
-
var Exact =
|
3463
|
+
var Exact = import_zod25.z.object({ type: import_zod25.z.literal("exact"), term: import_zod25.z.string() }).openapi({
|
3275
3464
|
ref: "Exact"
|
3276
3465
|
});
|
3277
|
-
var ExactStatus =
|
3278
|
-
type:
|
3466
|
+
var ExactStatus = import_zod25.z.object({
|
3467
|
+
type: import_zod25.z.literal("exact"),
|
3279
3468
|
term: EventStatus
|
3280
3469
|
}).openapi({
|
3281
3470
|
ref: "ExactStatus"
|
3282
3471
|
});
|
3283
|
-
var
|
3284
|
-
type:
|
3285
|
-
|
3472
|
+
var ExactUserType = import_zod25.z.object({
|
3473
|
+
type: import_zod25.z.literal("exact"),
|
3474
|
+
term: TokenUserType
|
3475
|
+
}).openapi({
|
3476
|
+
ref: "ExactUserType"
|
3477
|
+
});
|
3478
|
+
var AnyOf = import_zod25.z.object({
|
3479
|
+
type: import_zod25.z.literal("anyOf"),
|
3480
|
+
terms: import_zod25.z.array(import_zod25.z.string())
|
3286
3481
|
}).openapi({
|
3287
3482
|
ref: "AnyOf"
|
3288
3483
|
});
|
3289
|
-
var AnyOfStatus =
|
3290
|
-
type:
|
3291
|
-
terms:
|
3484
|
+
var AnyOfStatus = import_zod25.z.object({
|
3485
|
+
type: import_zod25.z.literal("anyOf"),
|
3486
|
+
terms: import_zod25.z.array(EventStatus)
|
3292
3487
|
}).openapi({
|
3293
3488
|
ref: "AnyOfStatus"
|
3294
3489
|
});
|
3295
|
-
var Range =
|
3296
|
-
type:
|
3297
|
-
gte:
|
3298
|
-
lte:
|
3490
|
+
var Range = import_zod25.z.object({
|
3491
|
+
type: import_zod25.z.literal("range"),
|
3492
|
+
gte: import_zod25.z.string(),
|
3493
|
+
lte: import_zod25.z.string()
|
3299
3494
|
}).openapi({
|
3300
3495
|
ref: "Range"
|
3301
3496
|
});
|
3302
|
-
var ContainsFlags =
|
3303
|
-
anyOf:
|
3304
|
-
noneOf:
|
3497
|
+
var ContainsFlags = import_zod25.z.object({
|
3498
|
+
anyOf: import_zod25.z.array(Flag).optional(),
|
3499
|
+
noneOf: import_zod25.z.array(Flag).optional()
|
3305
3500
|
}).openapi({
|
3306
3501
|
ref: "ContainsFlags"
|
3307
3502
|
});
|
3308
|
-
var Within =
|
3503
|
+
var Within = import_zod25.z.object({ type: import_zod25.z.literal("within"), location: import_zod25.z.string() }).openapi({
|
3309
3504
|
ref: "Within"
|
3310
3505
|
});
|
3311
|
-
var RangeDate =
|
3312
|
-
|
3313
|
-
|
3314
|
-
|
3315
|
-
|
3316
|
-
});
|
3506
|
+
var RangeDate = import_zod25.z.object({
|
3507
|
+
type: import_zod25.z.literal("range"),
|
3508
|
+
gte: import_zod25.z.string().date().or(import_zod25.z.string().datetime()),
|
3509
|
+
lte: import_zod25.z.string().date().or(import_zod25.z.string().datetime())
|
3510
|
+
}).openapi({ ref: "RangeDate" });
|
3317
3511
|
var ExactDate = Exact.extend({
|
3318
|
-
term:
|
3512
|
+
term: import_zod25.z.string().date().or(import_zod25.z.string().datetime())
|
3319
3513
|
}).openapi({
|
3320
3514
|
ref: "ExactDate"
|
3321
3515
|
});
|
3322
|
-
var
|
3516
|
+
var TimePeriod = import_zod25.z.object({
|
3517
|
+
type: import_zod25.z.literal("timePeriod"),
|
3518
|
+
term: SelectDateRangeValue
|
3519
|
+
}).openapi({
|
3520
|
+
ref: "TimePeriod"
|
3521
|
+
});
|
3522
|
+
var DateCondition = import_zod25.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
|
3323
3523
|
ref: "DateCondition"
|
3324
3524
|
});
|
3325
|
-
var QueryInput =
|
3326
|
-
() =>
|
3327
|
-
|
3328
|
-
|
3525
|
+
var QueryInput = import_zod25.z.lazy(
|
3526
|
+
() => import_zod25.z.union([
|
3527
|
+
import_zod25.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
|
3528
|
+
import_zod25.z.record(import_zod25.z.string(), QueryInput)
|
3329
3529
|
])
|
3330
3530
|
).openapi({
|
3331
3531
|
ref: "QueryInput"
|
3332
3532
|
});
|
3333
|
-
var QueryExpression =
|
3334
|
-
id:
|
3335
|
-
eventType:
|
3336
|
-
status:
|
3337
|
-
createdAt:
|
3338
|
-
updatedAt:
|
3339
|
-
"
|
3340
|
-
"
|
3341
|
-
|
3533
|
+
var QueryExpression = import_zod25.z.object({
|
3534
|
+
id: import_zod25.z.optional(import_zod25.z.string()),
|
3535
|
+
eventType: import_zod25.z.string(),
|
3536
|
+
status: import_zod25.z.optional(import_zod25.z.union([AnyOfStatus, ExactStatus])),
|
3537
|
+
createdAt: import_zod25.z.optional(DateCondition),
|
3538
|
+
updatedAt: import_zod25.z.optional(DateCondition),
|
3539
|
+
"legalStatuses.REGISTERED.acceptedAt": import_zod25.z.optional(DateCondition),
|
3540
|
+
"legalStatuses.DECLARED.createdAtLocation": import_zod25.z.optional(
|
3541
|
+
import_zod25.z.union([Within, Exact])
|
3342
3542
|
),
|
3343
|
-
"
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3543
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod25.z.optional(
|
3544
|
+
import_zod25.z.union([Within, Exact])
|
3545
|
+
),
|
3546
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod25.z.optional(Exact),
|
3547
|
+
createdAtLocation: import_zod25.z.optional(import_zod25.z.union([Within, Exact])),
|
3548
|
+
updatedAtLocation: import_zod25.z.optional(import_zod25.z.union([Within, Exact])),
|
3549
|
+
assignedTo: import_zod25.z.optional(Exact),
|
3550
|
+
createdByUserType: import_zod25.z.optional(ExactUserType),
|
3551
|
+
createdBy: import_zod25.z.optional(Exact),
|
3552
|
+
updatedBy: import_zod25.z.optional(Exact),
|
3553
|
+
trackingId: import_zod25.z.optional(Exact),
|
3554
|
+
flags: import_zod25.z.optional(ContainsFlags),
|
3555
|
+
// @todo: The type for this comes out as "any"
|
3352
3556
|
data: QueryInput
|
3353
3557
|
}).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
|
3354
3558
|
message: "At least one query field must be specified."
|
3355
3559
|
}).openapi({
|
3356
3560
|
ref: "QueryExpression"
|
3357
3561
|
});
|
3358
|
-
var QueryType =
|
3359
|
-
type:
|
3360
|
-
clauses:
|
3562
|
+
var QueryType = import_zod25.z.object({
|
3563
|
+
type: import_zod25.z.literal("and").or(import_zod25.z.literal("or")).openapi({ default: "and" }),
|
3564
|
+
clauses: import_zod25.z.preprocess(
|
3361
3565
|
(val) => {
|
3362
3566
|
if (typeof val === "string") {
|
3363
3567
|
return [JSON.parse(val)];
|
@@ -3367,7 +3571,7 @@ var QueryType = import_zod24.z.object({
|
|
3367
3571
|
}
|
3368
3572
|
return val;
|
3369
3573
|
},
|
3370
|
-
|
3574
|
+
import_zod25.z.array(QueryExpression).nonempty("At least one clause is required.").openapi({
|
3371
3575
|
default: [
|
3372
3576
|
{
|
3373
3577
|
eventType: TENNIS_CLUB_MEMBERSHIP,
|
@@ -3388,58 +3592,62 @@ var QueryType = import_zod24.z.object({
|
|
3388
3592
|
}).openapi({
|
3389
3593
|
ref: "QueryType"
|
3390
3594
|
});
|
3595
|
+
var SearchScopeAccessLevels = {
|
3596
|
+
MY_JURISDICTION: "my-jurisdiction",
|
3597
|
+
ALL: "all"
|
3598
|
+
};
|
3391
3599
|
|
3392
3600
|
// ../commons/src/events/CountryConfigQueryInput.ts
|
3393
|
-
var SerializableExact =
|
3394
|
-
type:
|
3395
|
-
term:
|
3601
|
+
var SerializableExact = import_zod26.z.object({
|
3602
|
+
type: import_zod26.z.literal("exact"),
|
3603
|
+
term: import_zod26.z.union([import_zod26.z.string(), SerializedUserField])
|
3396
3604
|
});
|
3397
|
-
var SerializableWithin =
|
3398
|
-
type:
|
3399
|
-
location:
|
3605
|
+
var SerializableWithin = import_zod26.z.object({
|
3606
|
+
type: import_zod26.z.literal("within"),
|
3607
|
+
location: import_zod26.z.union([import_zod26.z.string(), SerializedUserField])
|
3400
3608
|
});
|
3401
|
-
var SerializedQueryExpression =
|
3402
|
-
eventType:
|
3403
|
-
status:
|
3404
|
-
createdAt:
|
3405
|
-
updatedAt:
|
3406
|
-
"
|
3407
|
-
"
|
3408
|
-
|
3609
|
+
var SerializedQueryExpression = import_zod26.z.object({
|
3610
|
+
eventType: import_zod26.z.string(),
|
3611
|
+
status: import_zod26.z.optional(import_zod26.z.union([AnyOfStatus, ExactStatus])),
|
3612
|
+
createdAt: import_zod26.z.optional(DateCondition),
|
3613
|
+
updatedAt: import_zod26.z.optional(DateCondition),
|
3614
|
+
"legalStatuses.REGISTERED.createdAt": import_zod26.z.optional(DateCondition),
|
3615
|
+
"legalStatuses.REGISTERED.createdAtLocation": import_zod26.z.optional(
|
3616
|
+
import_zod26.z.union([Within, Exact])
|
3409
3617
|
),
|
3410
|
-
"
|
3411
|
-
createdAtLocation:
|
3412
|
-
|
3618
|
+
"legalStatuses.REGISTERED.registrationNumber": import_zod26.z.optional(Exact),
|
3619
|
+
createdAtLocation: import_zod26.z.optional(
|
3620
|
+
import_zod26.z.union([SerializableWithin, SerializableExact])
|
3413
3621
|
),
|
3414
|
-
updatedAtLocation:
|
3415
|
-
|
3622
|
+
updatedAtLocation: import_zod26.z.optional(
|
3623
|
+
import_zod26.z.union([SerializableWithin, SerializableExact])
|
3416
3624
|
),
|
3417
|
-
assignedTo:
|
3418
|
-
createdBy:
|
3419
|
-
createdByUserType:
|
3420
|
-
updatedBy:
|
3421
|
-
trackingId:
|
3422
|
-
flags:
|
3625
|
+
assignedTo: import_zod26.z.optional(SerializableExact),
|
3626
|
+
createdBy: import_zod26.z.optional(SerializableExact),
|
3627
|
+
createdByUserType: ExactUserType,
|
3628
|
+
updatedBy: import_zod26.z.optional(SerializableExact),
|
3629
|
+
trackingId: import_zod26.z.optional(Exact),
|
3630
|
+
flags: import_zod26.z.optional(ContainsFlags),
|
3423
3631
|
data: QueryInput
|
3424
3632
|
}).partial();
|
3425
|
-
var Or2 =
|
3426
|
-
type:
|
3427
|
-
clauses:
|
3633
|
+
var Or2 = import_zod26.z.object({
|
3634
|
+
type: import_zod26.z.literal("or"),
|
3635
|
+
clauses: import_zod26.z.array(SerializedQueryExpression)
|
3428
3636
|
});
|
3429
|
-
var And2 =
|
3430
|
-
type:
|
3431
|
-
clauses:
|
3637
|
+
var And2 = import_zod26.z.object({
|
3638
|
+
type: import_zod26.z.literal("and"),
|
3639
|
+
clauses: import_zod26.z.array(SerializedQueryExpression)
|
3432
3640
|
});
|
3433
|
-
var CountryConfigQueryType =
|
3434
|
-
var CountryConfigQueryInputType =
|
3641
|
+
var CountryConfigQueryType = import_zod26.z.discriminatedUnion("type", [And2, Or2]);
|
3642
|
+
var CountryConfigQueryInputType = import_zod26.z.union([
|
3435
3643
|
SerializedQueryExpression,
|
3436
3644
|
And2,
|
3437
3645
|
Or2
|
3438
3646
|
]);
|
3439
3647
|
|
3440
3648
|
// ../commons/src/icons.ts
|
3441
|
-
var
|
3442
|
-
var AvailableIcons =
|
3649
|
+
var import_zod27 = require("zod");
|
3650
|
+
var AvailableIcons = import_zod27.z.enum([
|
3443
3651
|
"Archived",
|
3444
3652
|
"Assigned",
|
3445
3653
|
"Certified",
|
@@ -3477,7 +3685,6 @@ var AvailableIcons = import_zod26.z.enum([
|
|
3477
3685
|
"Copy",
|
3478
3686
|
"Database",
|
3479
3687
|
"DotsThreeVertical",
|
3480
|
-
"DownloadSimple",
|
3481
3688
|
"ArrowCounterClockwise",
|
3482
3689
|
"MagnifyingGlassMinus",
|
3483
3690
|
"MagnifyingGlassPlus",
|
@@ -3561,42 +3768,42 @@ var mandatoryColumns = defineWorkqueuesColumns([
|
|
3561
3768
|
value: event.field("updatedAt")
|
3562
3769
|
}
|
3563
3770
|
]);
|
3564
|
-
var WorkqueueActionsWithDefault =
|
3771
|
+
var WorkqueueActionsWithDefault = import_zod28.z.enum([
|
3565
3772
|
...workqueueActions.options,
|
3566
3773
|
"DEFAULT"
|
3567
3774
|
]);
|
3568
|
-
var WorkqueueConfig =
|
3569
|
-
slug:
|
3775
|
+
var WorkqueueConfig = import_zod28.z.object({
|
3776
|
+
slug: import_zod28.z.string().describe("Determines the url of the workqueue."),
|
3570
3777
|
name: TranslationConfig.describe(
|
3571
3778
|
"Title of the workflow (both in navigation and on the page)"
|
3572
3779
|
),
|
3573
3780
|
query: CountryConfigQueryType,
|
3574
|
-
actions:
|
3575
|
-
|
3781
|
+
actions: import_zod28.z.array(
|
3782
|
+
import_zod28.z.object({
|
3576
3783
|
type: WorkqueueActionsWithDefault,
|
3577
|
-
conditionals:
|
3784
|
+
conditionals: import_zod28.z.array(Conditional).optional()
|
3578
3785
|
})
|
3579
3786
|
),
|
3580
|
-
columns:
|
3787
|
+
columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3581
3788
|
icon: AvailableIcons
|
3582
3789
|
}).describe("Configuration for workqueue.");
|
3583
3790
|
var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
3584
3791
|
query: true,
|
3585
3792
|
columns: true
|
3586
3793
|
});
|
3587
|
-
var WorkqueueConfigInput =
|
3588
|
-
slug:
|
3794
|
+
var WorkqueueConfigInput = import_zod28.z.object({
|
3795
|
+
slug: import_zod28.z.string().describe("Determines the url of the workqueue."),
|
3589
3796
|
name: TranslationConfig.describe(
|
3590
3797
|
"Title of the workflow (both in navigation and on the page)"
|
3591
3798
|
),
|
3592
3799
|
query: CountryConfigQueryInputType,
|
3593
|
-
actions:
|
3594
|
-
|
3800
|
+
actions: import_zod28.z.array(
|
3801
|
+
import_zod28.z.object({
|
3595
3802
|
type: WorkqueueActionsWithDefault,
|
3596
|
-
conditionals:
|
3803
|
+
conditionals: import_zod28.z.array(Conditional).optional()
|
3597
3804
|
})
|
3598
3805
|
),
|
3599
|
-
columns:
|
3806
|
+
columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3600
3807
|
icon: AvailableIcons
|
3601
3808
|
});
|
3602
3809
|
function defineWorkqueue(workqueueInput) {
|
@@ -3607,10 +3814,10 @@ function defineWorkqueue(workqueueInput) {
|
|
3607
3814
|
function defineWorkqueues(workqueues) {
|
3608
3815
|
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
3609
3816
|
}
|
3610
|
-
var WorkqueueCountInput =
|
3611
|
-
|
3817
|
+
var WorkqueueCountInput = import_zod28.z.array(
|
3818
|
+
import_zod28.z.object({ slug: import_zod28.z.string(), query: QueryType })
|
3612
3819
|
);
|
3613
|
-
var WorkqueueCountOutput =
|
3820
|
+
var WorkqueueCountOutput = import_zod28.z.record(import_zod28.z.string(), import_zod28.z.number());
|
3614
3821
|
|
3615
3822
|
// ../commons/src/events/workqueueDefaultColumns.ts
|
3616
3823
|
var defaultWorkqueueColumns = [
|
@@ -3633,42 +3840,42 @@ var defaultWorkqueueColumns = [
|
|
3633
3840
|
];
|
3634
3841
|
|
3635
3842
|
// ../commons/src/events/Draft.ts
|
3636
|
-
var
|
3843
|
+
var import_zod30 = require("zod");
|
3637
3844
|
|
3638
3845
|
// ../commons/src/events/ActionInput.ts
|
3639
|
-
var
|
3640
|
-
var
|
3641
|
-
(0,
|
3642
|
-
var BaseActionInput =
|
3846
|
+
var import_zod29 = require("zod");
|
3847
|
+
var import_zod_openapi11 = require("zod-openapi");
|
3848
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod29.z);
|
3849
|
+
var BaseActionInput = import_zod29.z.object({
|
3643
3850
|
eventId: UUID,
|
3644
|
-
transactionId:
|
3851
|
+
transactionId: import_zod29.z.string(),
|
3645
3852
|
declaration: ActionUpdate.default({}),
|
3646
3853
|
annotation: ActionUpdate.optional(),
|
3647
3854
|
originalActionId: UUID.optional(),
|
3648
3855
|
// should not be part of base action.
|
3649
|
-
keepAssignment:
|
3856
|
+
keepAssignment: import_zod29.z.boolean().optional()
|
3650
3857
|
});
|
3651
3858
|
var CreateActionInput = BaseActionInput.merge(
|
3652
|
-
|
3653
|
-
type:
|
3859
|
+
import_zod29.z.object({
|
3860
|
+
type: import_zod29.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
3654
3861
|
createdAtLocation: CreatedAtLocation
|
3655
3862
|
})
|
3656
3863
|
);
|
3657
3864
|
var RegisterActionInput = BaseActionInput.merge(
|
3658
|
-
|
3659
|
-
type:
|
3660
|
-
registrationNumber:
|
3865
|
+
import_zod29.z.object({
|
3866
|
+
type: import_zod29.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
3867
|
+
registrationNumber: import_zod29.z.string().optional()
|
3661
3868
|
})
|
3662
3869
|
).strict();
|
3663
3870
|
var ValidateActionInput = BaseActionInput.merge(
|
3664
|
-
|
3665
|
-
type:
|
3666
|
-
duplicates:
|
3871
|
+
import_zod29.z.object({
|
3872
|
+
type: import_zod29.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE),
|
3873
|
+
duplicates: import_zod29.z.array(import_zod29.z.string())
|
3667
3874
|
})
|
3668
3875
|
);
|
3669
3876
|
var NotifyActionInput = BaseActionInput.merge(
|
3670
|
-
|
3671
|
-
type:
|
3877
|
+
import_zod29.z.object({
|
3878
|
+
type: import_zod29.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
3672
3879
|
})
|
3673
3880
|
).openapi({
|
3674
3881
|
default: {
|
@@ -3680,68 +3887,69 @@ var NotifyActionInput = BaseActionInput.merge(
|
|
3680
3887
|
}
|
3681
3888
|
});
|
3682
3889
|
var DeclareActionInput = BaseActionInput.merge(
|
3683
|
-
|
3684
|
-
type:
|
3890
|
+
import_zod29.z.object({
|
3891
|
+
type: import_zod29.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
3685
3892
|
})
|
3686
3893
|
);
|
3687
3894
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
3688
|
-
|
3689
|
-
type:
|
3895
|
+
import_zod29.z.object({
|
3896
|
+
type: import_zod29.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE)
|
3690
3897
|
})
|
3691
3898
|
);
|
3692
3899
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
3693
|
-
|
3694
|
-
type:
|
3900
|
+
import_zod29.z.object({
|
3901
|
+
type: import_zod29.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
3695
3902
|
reason: RejectionReason
|
3696
3903
|
})
|
3697
3904
|
);
|
3698
3905
|
var MarkedAsDuplicateActionInput = BaseActionInput.merge(
|
3699
|
-
|
3700
|
-
type:
|
3906
|
+
import_zod29.z.object({
|
3907
|
+
type: import_zod29.z.literal(ActionType.MARKED_AS_DUPLICATE).default(ActionType.MARKED_AS_DUPLICATE)
|
3701
3908
|
})
|
3702
3909
|
);
|
3703
3910
|
var ArchiveActionInput = BaseActionInput.merge(
|
3704
|
-
|
3705
|
-
type:
|
3911
|
+
import_zod29.z.object({
|
3912
|
+
type: import_zod29.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
3706
3913
|
reason: RejectionReason
|
3707
3914
|
})
|
3708
3915
|
);
|
3709
3916
|
var AssignActionInput = BaseActionInput.merge(
|
3710
|
-
|
3711
|
-
type:
|
3712
|
-
assignedTo:
|
3917
|
+
import_zod29.z.object({
|
3918
|
+
type: import_zod29.z.literal(ActionType.ASSIGN).default(ActionType.ASSIGN),
|
3919
|
+
assignedTo: import_zod29.z.string()
|
3713
3920
|
})
|
3714
3921
|
);
|
3715
3922
|
var UnassignActionInput = BaseActionInput.merge(
|
3716
|
-
|
3717
|
-
type:
|
3718
|
-
assignedTo:
|
3923
|
+
import_zod29.z.object({
|
3924
|
+
type: import_zod29.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
3925
|
+
assignedTo: import_zod29.z.literal(null).default(null)
|
3719
3926
|
})
|
3720
3927
|
);
|
3721
3928
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
3722
|
-
|
3723
|
-
type:
|
3929
|
+
import_zod29.z.object({
|
3930
|
+
type: import_zod29.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
3724
3931
|
})
|
3725
3932
|
);
|
3726
3933
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
3727
|
-
|
3728
|
-
requestId:
|
3729
|
-
type:
|
3934
|
+
import_zod29.z.object({
|
3935
|
+
requestId: import_zod29.z.string(),
|
3936
|
+
type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
3937
|
+
reason: RejectionReason
|
3730
3938
|
})
|
3731
3939
|
);
|
3732
3940
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
3733
|
-
|
3734
|
-
requestId:
|
3735
|
-
type:
|
3941
|
+
import_zod29.z.object({
|
3942
|
+
requestId: import_zod29.z.string(),
|
3943
|
+
type: import_zod29.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
3736
3944
|
})
|
3737
3945
|
);
|
3738
3946
|
var ReadActionInput = BaseActionInput.merge(
|
3739
|
-
|
3740
|
-
type:
|
3947
|
+
import_zod29.z.object({
|
3948
|
+
type: import_zod29.z.literal(ActionType.READ).default(ActionType.READ)
|
3741
3949
|
})
|
3742
3950
|
);
|
3743
|
-
var DeleteActionInput =
|
3744
|
-
var ActionInput =
|
3951
|
+
var DeleteActionInput = import_zod29.z.object({ eventId: UUID });
|
3952
|
+
var ActionInput = import_zod29.z.discriminatedUnion("type", [
|
3745
3953
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
3746
3954
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
3747
3955
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
@@ -3770,18 +3978,18 @@ var ActionInput = import_zod28.z.discriminatedUnion("type", [
|
|
3770
3978
|
});
|
3771
3979
|
|
3772
3980
|
// ../commons/src/events/Draft.ts
|
3773
|
-
var Draft =
|
3981
|
+
var Draft = import_zod30.z.object({
|
3774
3982
|
id: UUID,
|
3775
3983
|
eventId: UUID,
|
3776
|
-
transactionId:
|
3777
|
-
createdAt:
|
3984
|
+
transactionId: import_zod30.z.string(),
|
3985
|
+
createdAt: import_zod30.z.string().datetime(),
|
3778
3986
|
action: ActionBase.extend({
|
3779
3987
|
type: ActionTypes
|
3780
3988
|
}).omit({ id: true })
|
3781
3989
|
});
|
3782
3990
|
var DraftInput = BaseActionInput.extend({
|
3783
3991
|
type: ActionTypes,
|
3784
|
-
status:
|
3992
|
+
status: import_zod30.z.enum([
|
3785
3993
|
ActionStatus.Requested,
|
3786
3994
|
ActionStatus.Accepted,
|
3787
3995
|
ActionStatus.Rejected
|
@@ -3789,27 +3997,28 @@ var DraftInput = BaseActionInput.extend({
|
|
3789
3997
|
});
|
3790
3998
|
|
3791
3999
|
// ../commons/src/events/EventInput.ts
|
3792
|
-
var
|
4000
|
+
var import_zod31 = require("zod");
|
3793
4001
|
var import_uuid8 = require("uuid");
|
3794
|
-
var EventInput =
|
3795
|
-
transactionId:
|
3796
|
-
type:
|
4002
|
+
var EventInput = import_zod31.z.object({
|
4003
|
+
transactionId: import_zod31.z.string(),
|
4004
|
+
type: import_zod31.z.string()
|
3797
4005
|
}).openapi({ default: { transactionId: (0, import_uuid8.v4)(), type: "v2.birth" } });
|
3798
4006
|
|
3799
4007
|
// ../commons/src/events/EventDocument.ts
|
3800
|
-
var
|
3801
|
-
var
|
3802
|
-
(0,
|
3803
|
-
var EventDocument =
|
4008
|
+
var import_zod32 = require("zod");
|
4009
|
+
var import_zod_openapi12 = require("zod-openapi");
|
4010
|
+
(0, import_zod_openapi12.extendZodWithOpenApi)(import_zod32.z);
|
4011
|
+
var EventDocument = import_zod32.z.object({
|
3804
4012
|
id: UUID,
|
3805
|
-
type:
|
3806
|
-
createdAt:
|
3807
|
-
updatedAt:
|
3808
|
-
actions:
|
3809
|
-
trackingId:
|
4013
|
+
type: import_zod32.z.string(),
|
4014
|
+
createdAt: import_zod32.z.string().datetime(),
|
4015
|
+
updatedAt: import_zod32.z.string().datetime(),
|
4016
|
+
actions: import_zod32.z.array(Action),
|
4017
|
+
trackingId: import_zod32.z.string()
|
3810
4018
|
}).openapi({ ref: "EventDocument" });
|
3811
4019
|
|
3812
4020
|
// ../commons/src/events/state/utils.ts
|
4021
|
+
var import_lodash2 = require("lodash");
|
3813
4022
|
function getActionRequests(actionType, actions) {
|
3814
4023
|
const filtered = actions.filter((action) => action.type === actionType);
|
3815
4024
|
const accept = filtered.find(
|
@@ -3848,29 +4057,38 @@ function getDeclarationActionCreationMetadata(actionType, actions) {
|
|
3848
4057
|
registrationNumber
|
3849
4058
|
};
|
3850
4059
|
}
|
4060
|
+
var updateActions = ActionTypes.extract([
|
4061
|
+
ActionType.CREATE,
|
4062
|
+
ActionType.NOTIFY,
|
4063
|
+
ActionType.DECLARE,
|
4064
|
+
ActionType.VALIDATE,
|
4065
|
+
ActionType.REGISTER,
|
4066
|
+
ActionType.REJECT,
|
4067
|
+
ActionType.ARCHIVE,
|
4068
|
+
ActionType.PRINT_CERTIFICATE,
|
4069
|
+
ActionType.REQUEST_CORRECTION
|
4070
|
+
]);
|
3851
4071
|
function getActionUpdateMetadata(actions) {
|
3852
4072
|
const createAction = getOrThrow(
|
3853
4073
|
actions.find((action) => action.type === ActionType.CREATE),
|
3854
4074
|
`Event has no ${ActionType.CREATE} action`
|
3855
4075
|
);
|
3856
|
-
|
3857
|
-
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3862
|
-
|
3863
|
-
|
3864
|
-
|
3865
|
-
|
4076
|
+
const metadataFields = [
|
4077
|
+
"createdAt",
|
4078
|
+
"createdBy",
|
4079
|
+
"createdByUserType",
|
4080
|
+
"createdAtLocation",
|
4081
|
+
"createdByRole"
|
4082
|
+
];
|
4083
|
+
return actions.filter(({ type }) => updateActions.safeParse(type).success).filter(({ status }) => status === ActionStatus.Accepted).reduce(
|
4084
|
+
(_, action) => {
|
4085
|
+
if (action.originalActionId) {
|
4086
|
+
const originalAction = actions.find(({ id }) => id === action.originalActionId) ?? action;
|
4087
|
+
return (0, import_lodash2.pick)(originalAction, metadataFields);
|
4088
|
+
}
|
4089
|
+
return (0, import_lodash2.pick)(action, metadataFields);
|
3866
4090
|
},
|
3867
|
-
|
3868
|
-
createdAt: createAction.createdAt,
|
3869
|
-
createdBy: createAction.createdBy,
|
3870
|
-
createdByUserType: createAction.createdByUserType,
|
3871
|
-
createdAtLocation: createAction.createdAtLocation,
|
3872
|
-
createdByRole: createAction.createdByRole
|
3873
|
-
}
|
4091
|
+
(0, import_lodash2.pick)(createAction, metadataFields)
|
3874
4092
|
);
|
3875
4093
|
}
|
3876
4094
|
function getLegalStatuses(actions) {
|
@@ -3916,7 +4134,7 @@ function isDeclarationIncomplete(actions) {
|
|
3916
4134
|
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
3917
4135
|
}
|
3918
4136
|
function isRejected(actions) {
|
3919
|
-
return
|
4137
|
+
return actions.at(-1)?.type === ActionType.REJECT;
|
3920
4138
|
}
|
3921
4139
|
function getFlagsFromActions(actions) {
|
3922
4140
|
const sortedActions = actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
@@ -3958,8 +4176,6 @@ function getStatusFromActions(actions) {
|
|
3958
4176
|
return EventStatus.enum.VALIDATED;
|
3959
4177
|
case ActionType.REGISTER:
|
3960
4178
|
return EventStatus.enum.REGISTERED;
|
3961
|
-
case ActionType.REJECT:
|
3962
|
-
return EventStatus.enum.REJECTED;
|
3963
4179
|
case ActionType.ARCHIVE:
|
3964
4180
|
return EventStatus.enum.ARCHIVED;
|
3965
4181
|
case ActionType.NOTIFY:
|
@@ -3968,6 +4184,7 @@ function getStatusFromActions(actions) {
|
|
3968
4184
|
return EventStatus.enum.CERTIFIED;
|
3969
4185
|
case ActionType.ASSIGN:
|
3970
4186
|
case ActionType.UNASSIGN:
|
4187
|
+
case ActionType.REJECT:
|
3971
4188
|
case ActionType.REQUEST_CORRECTION:
|
3972
4189
|
case ActionType.APPROVE_CORRECTION:
|
3973
4190
|
case ActionType.MARKED_AS_DUPLICATE:
|
@@ -4003,7 +4220,8 @@ function getAssignedUserSignatureFromActions(actions) {
|
|
4003
4220
|
function aggregateActionDeclarations(actions) {
|
4004
4221
|
const excludedActions = [
|
4005
4222
|
ActionType.REQUEST_CORRECTION,
|
4006
|
-
ActionType.PRINT_CERTIFICATE
|
4223
|
+
ActionType.PRINT_CERTIFICATE,
|
4224
|
+
ActionType.REJECT_CORRECTION
|
4007
4225
|
];
|
4008
4226
|
return actions.reduce((declaration, action) => {
|
4009
4227
|
if (excludedActions.some((excludedAction) => excludedAction === action.type)) {
|
@@ -4044,6 +4262,13 @@ function getAcceptedActions(event2) {
|
|
4044
4262
|
);
|
4045
4263
|
}
|
4046
4264
|
var DEFAULT_DATE_OF_EVENT_PROPERTY = "createdAt";
|
4265
|
+
function resolveDateOfEvent(eventMetadata, declaration, config) {
|
4266
|
+
if (!config.dateOfEvent) {
|
4267
|
+
return eventMetadata[DEFAULT_DATE_OF_EVENT_PROPERTY].split("T")[0];
|
4268
|
+
}
|
4269
|
+
const parsedDate = ZodDate.safeParse(declaration[config.dateOfEvent.$$field]);
|
4270
|
+
return parsedDate.success ? parsedDate.data : void 0;
|
4271
|
+
}
|
4047
4272
|
function getCurrentEventState(event2, config) {
|
4048
4273
|
const creationAction = event2.actions.find(
|
4049
4274
|
(action) => action.type === ActionType.CREATE
|
@@ -4057,17 +4282,6 @@ function getCurrentEventState(event2, config) {
|
|
4057
4282
|
const requestActionMetadata = getActionUpdateMetadata(event2.actions);
|
4058
4283
|
const acceptedActionMetadata = getActionUpdateMetadata(acceptedActions);
|
4059
4284
|
const declaration = aggregateActionDeclarations(acceptedActions);
|
4060
|
-
let dateOfEvent;
|
4061
|
-
if (config.dateOfEvent) {
|
4062
|
-
const parsedDate = ZodDate.safeParse(
|
4063
|
-
declaration[config.dateOfEvent.$$field]
|
4064
|
-
);
|
4065
|
-
if (parsedDate.success) {
|
4066
|
-
dateOfEvent = parsedDate.data;
|
4067
|
-
}
|
4068
|
-
} else {
|
4069
|
-
dateOfEvent = event2[DEFAULT_DATE_OF_EVENT_PROPERTY].split("T")[0];
|
4070
|
-
}
|
4071
4285
|
return deepDropNulls({
|
4072
4286
|
id: event2.id,
|
4073
4287
|
type: event2.type,
|
@@ -4086,7 +4300,7 @@ function getCurrentEventState(event2, config) {
|
|
4086
4300
|
declaration,
|
4087
4301
|
trackingId: event2.trackingId,
|
4088
4302
|
updatedByUserRole: requestActionMetadata.createdByRole,
|
4089
|
-
dateOfEvent,
|
4303
|
+
dateOfEvent: resolveDateOfEvent(event2, declaration, config),
|
4090
4304
|
flags: getFlagsFromActions(event2.actions)
|
4091
4305
|
});
|
4092
4306
|
}
|
@@ -4115,19 +4329,32 @@ function getCurrentEventStateWithDrafts({
|
|
4115
4329
|
};
|
4116
4330
|
return getCurrentEventState(withDrafts, configuration);
|
4117
4331
|
}
|
4118
|
-
function
|
4332
|
+
function applyDeclarationToEventIndex(eventIndex, declaration, eventConfiguration) {
|
4333
|
+
const updatedDeclaration = deepMerge(eventIndex.declaration, declaration);
|
4334
|
+
return {
|
4335
|
+
...eventIndex,
|
4336
|
+
dateOfEvent: resolveDateOfEvent(
|
4337
|
+
eventIndex,
|
4338
|
+
updatedDeclaration,
|
4339
|
+
eventConfiguration
|
4340
|
+
),
|
4341
|
+
declaration: updatedDeclaration
|
4342
|
+
};
|
4343
|
+
}
|
4344
|
+
function applyDraftsToEventIndex(eventIndex, drafts, eventConfiguration) {
|
4119
4345
|
const indexedAt = eventIndex.updatedAt;
|
4120
4346
|
const activeDrafts = drafts.filter(({ createdAt }) => new Date(createdAt) > new Date(indexedAt)).map((draft) => draft.action).sort();
|
4121
4347
|
if (activeDrafts.length === 0) {
|
4122
4348
|
return eventIndex;
|
4123
4349
|
}
|
4124
|
-
return
|
4125
|
-
|
4126
|
-
|
4127
|
-
|
4128
|
-
|
4129
|
-
|
4130
|
-
|
4350
|
+
return applyDeclarationToEventIndex(
|
4351
|
+
{
|
4352
|
+
...eventIndex,
|
4353
|
+
updatedAt: activeDrafts[activeDrafts.length - 1].createdAt
|
4354
|
+
},
|
4355
|
+
activeDrafts[activeDrafts.length - 1].declaration,
|
4356
|
+
eventConfiguration
|
4357
|
+
);
|
4131
4358
|
}
|
4132
4359
|
function getAnnotationFromDrafts(drafts) {
|
4133
4360
|
const actions = drafts.map((draft) => draft.action);
|
@@ -4168,23 +4395,24 @@ function generateTransactionId() {
|
|
4168
4395
|
}
|
4169
4396
|
|
4170
4397
|
// ../commons/src/events/User.ts
|
4171
|
-
var
|
4172
|
-
var User =
|
4173
|
-
id:
|
4174
|
-
name:
|
4175
|
-
|
4176
|
-
use:
|
4177
|
-
given:
|
4178
|
-
family:
|
4398
|
+
var import_zod33 = require("zod");
|
4399
|
+
var User = import_zod33.z.object({
|
4400
|
+
id: import_zod33.z.string(),
|
4401
|
+
name: import_zod33.z.array(
|
4402
|
+
import_zod33.z.object({
|
4403
|
+
use: import_zod33.z.string(),
|
4404
|
+
given: import_zod33.z.array(import_zod33.z.string()),
|
4405
|
+
family: import_zod33.z.string()
|
4179
4406
|
})
|
4180
4407
|
),
|
4181
|
-
role:
|
4182
|
-
|
4408
|
+
role: import_zod33.z.string(),
|
4409
|
+
avatar: FullDocumentPath.optional(),
|
4410
|
+
signature: FullDocumentPath.optional()
|
4183
4411
|
});
|
4184
4412
|
|
4185
4413
|
// ../commons/src/events/test.utils.ts
|
4186
|
-
var
|
4187
|
-
var
|
4414
|
+
var import_lodash3 = require("lodash");
|
4415
|
+
var import_date_fns4 = require("date-fns");
|
4188
4416
|
|
4189
4417
|
// ../commons/src/field-config/field-configuration.ts
|
4190
4418
|
function createFieldConfig(fieldId, options) {
|
@@ -4205,7 +4433,7 @@ function field(fieldId, options = {}) {
|
|
4205
4433
|
}
|
4206
4434
|
|
4207
4435
|
// ../commons/src/fixtures/forms.ts
|
4208
|
-
var
|
4436
|
+
var import_date_fns3 = require("date-fns");
|
4209
4437
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
4210
4438
|
label: {
|
4211
4439
|
id: "v2.event.tennis-club-membership.action.certificate.form.label",
|
@@ -4924,6 +5152,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
4924
5152
|
id: "applicant.email",
|
4925
5153
|
type: "EMAIL",
|
4926
5154
|
required: false,
|
5155
|
+
uncorrectable: true,
|
4927
5156
|
conditionals: [],
|
4928
5157
|
label: {
|
4929
5158
|
defaultMessage: "Applicant's email",
|
@@ -5003,6 +5232,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
5003
5232
|
id: "applicant.address",
|
5004
5233
|
type: "ADDRESS",
|
5005
5234
|
required: true,
|
5235
|
+
secured: true,
|
5006
5236
|
conditionals: [],
|
5007
5237
|
label: {
|
5008
5238
|
defaultMessage: "Applicant's address",
|
@@ -5147,7 +5377,7 @@ var statusOptions = [
|
|
5147
5377
|
}
|
5148
5378
|
},
|
5149
5379
|
{
|
5150
|
-
value:
|
5380
|
+
value: VisibleStatus.enum.REJECTED,
|
5151
5381
|
label: {
|
5152
5382
|
defaultMessage: "Rejected",
|
5153
5383
|
description: "Option for form field: status of record",
|
@@ -5170,7 +5400,7 @@ var timePeriodOptions = [
|
|
5170
5400
|
description: "Label for option of time period select: last 7 days",
|
5171
5401
|
id: "form.section.label.timePeriodLast7Days"
|
5172
5402
|
},
|
5173
|
-
value: `${(0,
|
5403
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
5174
5404
|
/* @__PURE__ */ new Date(),
|
5175
5405
|
"yyyy-MM-dd"
|
5176
5406
|
)}`
|
@@ -5181,7 +5411,7 @@ var timePeriodOptions = [
|
|
5181
5411
|
description: "Label for option of time period select: last 30 days",
|
5182
5412
|
id: "form.section.label.timePeriodLast30Days"
|
5183
5413
|
},
|
5184
|
-
value: `${(0,
|
5414
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
5185
5415
|
/* @__PURE__ */ new Date(),
|
5186
5416
|
"yyyy-MM-dd"
|
5187
5417
|
)}`
|
@@ -5192,7 +5422,7 @@ var timePeriodOptions = [
|
|
5192
5422
|
description: "Label for option of time period select: last 90 days",
|
5193
5423
|
id: "form.section.label.timePeriodLast90Days"
|
5194
5424
|
},
|
5195
|
-
value: `${(0,
|
5425
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
5196
5426
|
/* @__PURE__ */ new Date(),
|
5197
5427
|
"yyyy-MM-dd"
|
5198
5428
|
)}`
|
@@ -5203,7 +5433,7 @@ var timePeriodOptions = [
|
|
5203
5433
|
description: "Label for option of time period select: last year",
|
5204
5434
|
id: "form.section.label.timePeriodLastYear"
|
5205
5435
|
},
|
5206
|
-
value: `${(0,
|
5436
|
+
value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
|
5207
5437
|
/* @__PURE__ */ new Date(),
|
5208
5438
|
"yyyy-MM-dd"
|
5209
5439
|
)}`
|
@@ -5287,197 +5517,202 @@ var tennisClubMembershipEvent = defineConfig({
|
|
5287
5517
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
5288
5518
|
id: "event.tennis-club-membership.action.correction.request.label"
|
5289
5519
|
},
|
5290
|
-
|
5291
|
-
{
|
5292
|
-
id: "correction
|
5293
|
-
|
5294
|
-
|
5295
|
-
|
5296
|
-
|
5297
|
-
|
5298
|
-
|
5299
|
-
|
5300
|
-
{
|
5301
|
-
id: "
|
5302
|
-
|
5303
|
-
|
5304
|
-
id: "correction.requester.relationshop.intro.label",
|
5305
|
-
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.",
|
5306
|
-
description: "The title for the corrector form"
|
5307
|
-
}
|
5520
|
+
correctionForm: {
|
5521
|
+
label: {
|
5522
|
+
id: "v2.event.tennis-club-membership.action.request-correction.label",
|
5523
|
+
defaultMessage: "Request correction",
|
5524
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
5525
|
+
},
|
5526
|
+
pages: [
|
5527
|
+
{
|
5528
|
+
id: "correction-requester",
|
5529
|
+
type: PageTypes.enum.FORM,
|
5530
|
+
title: {
|
5531
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
5532
|
+
defaultMessage: "Correction requester",
|
5533
|
+
description: "This is the title of the section"
|
5308
5534
|
},
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5535
|
+
fields: [
|
5536
|
+
{
|
5537
|
+
id: "correction.requester.relationshop.intro",
|
5538
|
+
type: "PAGE_HEADER",
|
5539
|
+
label: {
|
5540
|
+
id: "correction.requester.relationshop.intro.label",
|
5541
|
+
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.",
|
5542
|
+
description: "The title for the corrector form"
|
5543
|
+
}
|
5316
5544
|
},
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5322
|
-
|
5323
|
-
|
5324
|
-
description: "Label for informant option in certificate correction form"
|
5325
|
-
}
|
5326
|
-
},
|
5327
|
-
{
|
5328
|
-
value: "ANOTHER_AGENT",
|
5329
|
-
label: {
|
5330
|
-
id: "v2.correction.corrector.anotherAgent",
|
5331
|
-
defaultMessage: "Another registration agent or field agent",
|
5332
|
-
description: "Label for another registration or field agent option in certificate correction form"
|
5333
|
-
}
|
5334
|
-
},
|
5335
|
-
{
|
5336
|
-
value: "REGISTRAR",
|
5337
|
-
label: {
|
5338
|
-
id: "v2.correction.corrector.me",
|
5339
|
-
defaultMessage: "Me (Registrar)",
|
5340
|
-
description: "Label for registrar option in certificate correction form"
|
5341
|
-
}
|
5545
|
+
{
|
5546
|
+
id: "correction.requester.relationship",
|
5547
|
+
type: "RADIO_GROUP",
|
5548
|
+
label: {
|
5549
|
+
id: "v2.correction.corrector.title",
|
5550
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5551
|
+
description: "The title for the corrector form"
|
5342
5552
|
},
|
5343
|
-
|
5344
|
-
|
5345
|
-
|
5346
|
-
|
5347
|
-
|
5348
|
-
|
5553
|
+
defaultValue: "",
|
5554
|
+
options: [
|
5555
|
+
{
|
5556
|
+
value: "INFORMANT",
|
5557
|
+
label: {
|
5558
|
+
id: "v2.correction.corrector.informant",
|
5559
|
+
defaultMessage: "Informant",
|
5560
|
+
description: "Label for informant option in certificate correction form"
|
5561
|
+
}
|
5562
|
+
},
|
5563
|
+
{
|
5564
|
+
value: "ANOTHER_AGENT",
|
5565
|
+
label: {
|
5566
|
+
id: "v2.correction.corrector.anotherAgent",
|
5567
|
+
defaultMessage: "Another registration agent or field agent",
|
5568
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
5569
|
+
}
|
5570
|
+
},
|
5571
|
+
{
|
5572
|
+
value: "REGISTRAR",
|
5573
|
+
label: {
|
5574
|
+
id: "v2.correction.corrector.me",
|
5575
|
+
defaultMessage: "Me (Registrar)",
|
5576
|
+
description: "Label for registrar option in certificate correction form"
|
5577
|
+
}
|
5578
|
+
},
|
5579
|
+
{
|
5580
|
+
value: "OTHER",
|
5581
|
+
label: {
|
5582
|
+
id: "v2.correction.corrector.others",
|
5583
|
+
defaultMessage: "Someone else",
|
5584
|
+
description: "Label for someone else option in certificate correction form"
|
5585
|
+
}
|
5349
5586
|
}
|
5350
|
-
|
5351
|
-
]
|
5352
|
-
}
|
5353
|
-
]
|
5354
|
-
},
|
5355
|
-
{
|
5356
|
-
id: "identity-check",
|
5357
|
-
type: PageTypes.enum.FORM,
|
5358
|
-
title: {
|
5359
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
5360
|
-
defaultMessage: "Verify their identity",
|
5361
|
-
description: "This is the title of the section"
|
5362
|
-
},
|
5363
|
-
fields: [
|
5364
|
-
{
|
5365
|
-
id: "correction.identity-check.instructions",
|
5366
|
-
type: "PAGE_HEADER",
|
5367
|
-
label: {
|
5368
|
-
id: "correction.corrector.identity.instruction",
|
5369
|
-
defaultMessage: "Please verify the identity of the person making this request",
|
5370
|
-
description: "The title for the corrector form"
|
5587
|
+
]
|
5371
5588
|
}
|
5589
|
+
]
|
5590
|
+
},
|
5591
|
+
{
|
5592
|
+
id: "identity-check",
|
5593
|
+
type: PageTypes.enum.FORM,
|
5594
|
+
title: {
|
5595
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
5596
|
+
defaultMessage: "Verify their identity",
|
5597
|
+
description: "This is the title of the section"
|
5372
5598
|
},
|
5373
|
-
|
5374
|
-
|
5375
|
-
|
5376
|
-
|
5377
|
-
|
5378
|
-
|
5379
|
-
|
5599
|
+
fields: [
|
5600
|
+
{
|
5601
|
+
id: "correction.identity-check.instructions",
|
5602
|
+
type: "PAGE_HEADER",
|
5603
|
+
label: {
|
5604
|
+
id: "correction.corrector.identity.instruction",
|
5605
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
5606
|
+
description: "The title for the corrector form"
|
5607
|
+
}
|
5380
5608
|
},
|
5381
|
-
|
5382
|
-
|
5383
|
-
|
5384
|
-
{
|
5385
|
-
|
5386
|
-
|
5387
|
-
|
5388
|
-
|
5389
|
-
|
5609
|
+
{
|
5610
|
+
id: "correction.identity-check.verified",
|
5611
|
+
type: "RADIO_GROUP",
|
5612
|
+
label: {
|
5613
|
+
id: "correction.corrector.identity.verified.label",
|
5614
|
+
defaultMessage: "Identity verified",
|
5615
|
+
description: "The title for the corrector form"
|
5616
|
+
},
|
5617
|
+
defaultValue: "",
|
5618
|
+
required: true,
|
5619
|
+
options: [
|
5620
|
+
{
|
5621
|
+
value: "VERIFIED",
|
5622
|
+
label: {
|
5623
|
+
id: "correction.corrector.identity.verified",
|
5624
|
+
defaultMessage: "I have verified their identity",
|
5625
|
+
description: "Label for verified option in corrector identity check page"
|
5626
|
+
}
|
5390
5627
|
}
|
5391
|
-
|
5392
|
-
]
|
5393
|
-
}
|
5394
|
-
]
|
5395
|
-
}
|
5396
|
-
],
|
5397
|
-
additionalDetailsForm: [
|
5398
|
-
{
|
5399
|
-
id: "correction-request.supporting-documents",
|
5400
|
-
type: PageTypes.enum.FORM,
|
5401
|
-
title: {
|
5402
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
5403
|
-
defaultMessage: "Upload supporting documents",
|
5404
|
-
description: "This is the title of the section"
|
5405
|
-
},
|
5406
|
-
fields: [
|
5407
|
-
{
|
5408
|
-
id: "correction.supportingDocs.introduction",
|
5409
|
-
type: "PAGE_HEADER",
|
5410
|
-
label: {
|
5411
|
-
id: "correction.corrector.paragraph.title",
|
5412
|
-
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.",
|
5413
|
-
description: "The title for the corrector form"
|
5414
|
-
}
|
5415
|
-
},
|
5416
|
-
{
|
5417
|
-
id: "correction.supportingDocs",
|
5418
|
-
type: FieldType.FILE,
|
5419
|
-
label: {
|
5420
|
-
id: "correction.corrector.title",
|
5421
|
-
defaultMessage: "Upload supporting documents",
|
5422
|
-
description: "The title for the corrector form"
|
5628
|
+
]
|
5423
5629
|
}
|
5630
|
+
]
|
5631
|
+
},
|
5632
|
+
{
|
5633
|
+
id: "correction-request.supporting-documents",
|
5634
|
+
type: PageTypes.enum.FORM,
|
5635
|
+
title: {
|
5636
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
5637
|
+
defaultMessage: "Upload supporting documents",
|
5638
|
+
description: "This is the title of the section"
|
5424
5639
|
},
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5429
|
-
|
5430
|
-
|
5431
|
-
|
5640
|
+
fields: [
|
5641
|
+
{
|
5642
|
+
id: "correction.supportingDocs.introduction",
|
5643
|
+
type: "PAGE_HEADER",
|
5644
|
+
label: {
|
5645
|
+
id: "correction.corrector.paragraph.title",
|
5646
|
+
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.",
|
5647
|
+
description: "The title for the corrector form"
|
5648
|
+
}
|
5432
5649
|
},
|
5433
|
-
|
5434
|
-
|
5435
|
-
|
5436
|
-
|
5650
|
+
{
|
5651
|
+
id: "correction.supportingDocs",
|
5652
|
+
type: FieldType.FILE,
|
5653
|
+
label: {
|
5654
|
+
id: "correction.corrector.title",
|
5655
|
+
defaultMessage: "Upload supporting documents",
|
5656
|
+
description: "The title for the corrector form"
|
5437
5657
|
}
|
5438
5658
|
},
|
5439
|
-
|
5440
|
-
|
5441
|
-
|
5442
|
-
|
5443
|
-
|
5444
|
-
|
5445
|
-
|
5659
|
+
{
|
5660
|
+
id: "correction.request.supportingDocuments",
|
5661
|
+
type: "RADIO_GROUP",
|
5662
|
+
label: {
|
5663
|
+
id: "correction.corrector.title",
|
5664
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5665
|
+
description: "The title for the corrector form"
|
5666
|
+
},
|
5667
|
+
defaultValue: "",
|
5668
|
+
configuration: {
|
5669
|
+
styles: {
|
5670
|
+
size: "NORMAL"
|
5446
5671
|
}
|
5447
5672
|
},
|
5448
|
-
|
5449
|
-
|
5450
|
-
|
5451
|
-
|
5452
|
-
|
5453
|
-
|
5673
|
+
options: [
|
5674
|
+
{
|
5675
|
+
value: "ATTEST",
|
5676
|
+
label: {
|
5677
|
+
id: "correction.supportingDocuments.attest.label",
|
5678
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
5679
|
+
description: ""
|
5680
|
+
}
|
5681
|
+
},
|
5682
|
+
{
|
5683
|
+
value: "NOT_NEEDED",
|
5684
|
+
label: {
|
5685
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
5686
|
+
defaultMessage: "No supporting documents required",
|
5687
|
+
description: ""
|
5688
|
+
}
|
5454
5689
|
}
|
5455
|
-
|
5456
|
-
|
5457
|
-
|
5458
|
-
]
|
5459
|
-
},
|
5460
|
-
{
|
5461
|
-
id: "correction-request.additional-details",
|
5462
|
-
type: PageTypes.enum.FORM,
|
5463
|
-
title: {
|
5464
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
5465
|
-
defaultMessage: "Reason for correction",
|
5466
|
-
description: "This is the title of the section"
|
5690
|
+
]
|
5691
|
+
}
|
5692
|
+
]
|
5467
5693
|
},
|
5468
|
-
|
5469
|
-
|
5470
|
-
|
5471
|
-
|
5472
|
-
|
5473
|
-
|
5474
|
-
|
5475
|
-
|
5694
|
+
{
|
5695
|
+
id: "correction-request.additional-details",
|
5696
|
+
type: PageTypes.enum.FORM,
|
5697
|
+
title: {
|
5698
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
5699
|
+
defaultMessage: "Reason for correction",
|
5700
|
+
description: "This is the title of the section"
|
5701
|
+
},
|
5702
|
+
fields: [
|
5703
|
+
{
|
5704
|
+
id: "correction.request.reason",
|
5705
|
+
type: FieldType.TEXT,
|
5706
|
+
label: {
|
5707
|
+
id: "correction.reason.title",
|
5708
|
+
defaultMessage: "Reason for correction?",
|
5709
|
+
description: "The title for the corrector form"
|
5710
|
+
}
|
5476
5711
|
}
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5712
|
+
]
|
5713
|
+
}
|
5714
|
+
]
|
5715
|
+
}
|
5481
5716
|
},
|
5482
5717
|
{
|
5483
5718
|
type: ActionType.APPROVE_CORRECTION,
|
@@ -5560,10 +5795,10 @@ var tennisClubMembershipEvent = defineConfig({
|
|
5560
5795
|
id: "v2.advancedSearch.form.registrationDetails"
|
5561
5796
|
},
|
5562
5797
|
fields: [
|
5563
|
-
event("
|
5564
|
-
event("
|
5565
|
-
event("status"
|
5566
|
-
event("updatedAt"
|
5798
|
+
event("legalStatuses.REGISTERED.createdAtLocation").exact(),
|
5799
|
+
event("legalStatuses.REGISTERED.acceptedAt").range(),
|
5800
|
+
event("status").exact(),
|
5801
|
+
event("updatedAt").range()
|
5567
5802
|
]
|
5568
5803
|
},
|
5569
5804
|
{
|
@@ -5680,197 +5915,202 @@ var footballClubMembershipEvent = defineConfig({
|
|
5680
5915
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
5681
5916
|
id: "event.football-club-membership.action.correction.request.label"
|
5682
5917
|
},
|
5683
|
-
|
5684
|
-
{
|
5685
|
-
id: "correction
|
5686
|
-
|
5687
|
-
|
5688
|
-
|
5689
|
-
|
5690
|
-
|
5691
|
-
|
5692
|
-
|
5693
|
-
{
|
5694
|
-
id: "
|
5695
|
-
|
5696
|
-
|
5697
|
-
id: "correction.requester.relationshop.intro.label",
|
5698
|
-
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.",
|
5699
|
-
description: "The title for the corrector form"
|
5700
|
-
}
|
5918
|
+
correctionForm: {
|
5919
|
+
label: {
|
5920
|
+
id: "event.football-club-membership.action.correction.request.label",
|
5921
|
+
defaultMessage: "Request correction",
|
5922
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
5923
|
+
},
|
5924
|
+
pages: [
|
5925
|
+
{
|
5926
|
+
id: "correction-requester",
|
5927
|
+
type: PageTypes.enum.FORM,
|
5928
|
+
title: {
|
5929
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5930
|
+
defaultMessage: "Correction requester",
|
5931
|
+
description: "This is the title of the section"
|
5701
5932
|
},
|
5702
|
-
|
5703
|
-
|
5704
|
-
|
5705
|
-
|
5706
|
-
|
5707
|
-
|
5708
|
-
|
5933
|
+
fields: [
|
5934
|
+
{
|
5935
|
+
id: "correction.requester.relationshop.intro",
|
5936
|
+
type: "PAGE_HEADER",
|
5937
|
+
label: {
|
5938
|
+
id: "correction.requester.relationshop.intro.label",
|
5939
|
+
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.",
|
5940
|
+
description: "The title for the corrector form"
|
5941
|
+
}
|
5709
5942
|
},
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
description: "Label for informant option in certificate correction form"
|
5718
|
-
}
|
5719
|
-
},
|
5720
|
-
{
|
5721
|
-
value: "ANOTHER_AGENT",
|
5722
|
-
label: {
|
5723
|
-
id: "v2.correction.corrector.anotherAgent",
|
5724
|
-
defaultMessage: "Another registration agent or field agent",
|
5725
|
-
description: "Label for another registration or field agent option in certificate correction form"
|
5726
|
-
}
|
5727
|
-
},
|
5728
|
-
{
|
5729
|
-
value: "REGISTRAR",
|
5730
|
-
label: {
|
5731
|
-
id: "v2.correction.corrector.me",
|
5732
|
-
defaultMessage: "Me (Registrar)",
|
5733
|
-
description: "Label for registrar option in certificate correction form"
|
5734
|
-
}
|
5943
|
+
{
|
5944
|
+
id: "correction.requester.relationship",
|
5945
|
+
type: "RADIO_GROUP",
|
5946
|
+
label: {
|
5947
|
+
id: "v2.correction.corrector.title",
|
5948
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5949
|
+
description: "The title for the corrector form"
|
5735
5950
|
},
|
5736
|
-
|
5737
|
-
|
5738
|
-
|
5739
|
-
|
5740
|
-
|
5741
|
-
|
5951
|
+
defaultValue: "",
|
5952
|
+
options: [
|
5953
|
+
{
|
5954
|
+
value: "INFORMANT",
|
5955
|
+
label: {
|
5956
|
+
id: "v2.correction.corrector.informant",
|
5957
|
+
defaultMessage: "Informant",
|
5958
|
+
description: "Label for informant option in certificate correction form"
|
5959
|
+
}
|
5960
|
+
},
|
5961
|
+
{
|
5962
|
+
value: "ANOTHER_AGENT",
|
5963
|
+
label: {
|
5964
|
+
id: "v2.correction.corrector.anotherAgent",
|
5965
|
+
defaultMessage: "Another registration agent or field agent",
|
5966
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
5967
|
+
}
|
5968
|
+
},
|
5969
|
+
{
|
5970
|
+
value: "REGISTRAR",
|
5971
|
+
label: {
|
5972
|
+
id: "v2.correction.corrector.me",
|
5973
|
+
defaultMessage: "Me (Registrar)",
|
5974
|
+
description: "Label for registrar option in certificate correction form"
|
5975
|
+
}
|
5976
|
+
},
|
5977
|
+
{
|
5978
|
+
value: "OTHER",
|
5979
|
+
label: {
|
5980
|
+
id: "v2.correction.corrector.others",
|
5981
|
+
defaultMessage: "Someone else",
|
5982
|
+
description: "Label for someone else option in certificate correction form"
|
5983
|
+
}
|
5742
5984
|
}
|
5743
|
-
|
5744
|
-
]
|
5745
|
-
}
|
5746
|
-
]
|
5747
|
-
},
|
5748
|
-
{
|
5749
|
-
id: "identity-check",
|
5750
|
-
type: PageTypes.enum.FORM,
|
5751
|
-
title: {
|
5752
|
-
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5753
|
-
defaultMessage: "Verify their identity",
|
5754
|
-
description: "This is the title of the section"
|
5755
|
-
},
|
5756
|
-
fields: [
|
5757
|
-
{
|
5758
|
-
id: "correction.identity-check.instructions",
|
5759
|
-
type: "PAGE_HEADER",
|
5760
|
-
label: {
|
5761
|
-
id: "correction.corrector.identity.instruction",
|
5762
|
-
defaultMessage: "Please verify the identity of the person making this request",
|
5763
|
-
description: "The title for the corrector form"
|
5985
|
+
]
|
5764
5986
|
}
|
5987
|
+
]
|
5988
|
+
},
|
5989
|
+
{
|
5990
|
+
id: "identity-check",
|
5991
|
+
type: PageTypes.enum.FORM,
|
5992
|
+
title: {
|
5993
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5994
|
+
defaultMessage: "Verify their identity",
|
5995
|
+
description: "This is the title of the section"
|
5765
5996
|
},
|
5766
|
-
|
5767
|
-
|
5768
|
-
|
5769
|
-
|
5770
|
-
|
5771
|
-
|
5772
|
-
|
5997
|
+
fields: [
|
5998
|
+
{
|
5999
|
+
id: "correction.identity-check.instructions",
|
6000
|
+
type: "PAGE_HEADER",
|
6001
|
+
label: {
|
6002
|
+
id: "correction.corrector.identity.instruction",
|
6003
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
6004
|
+
description: "The title for the corrector form"
|
6005
|
+
}
|
5773
6006
|
},
|
5774
|
-
|
5775
|
-
|
5776
|
-
|
5777
|
-
{
|
5778
|
-
|
5779
|
-
|
5780
|
-
|
5781
|
-
|
5782
|
-
|
6007
|
+
{
|
6008
|
+
id: "correction.identity-check.verified",
|
6009
|
+
type: "RADIO_GROUP",
|
6010
|
+
label: {
|
6011
|
+
id: "correction.corrector.identity.verified.label",
|
6012
|
+
defaultMessage: "Identity verified",
|
6013
|
+
description: "The title for the corrector form"
|
6014
|
+
},
|
6015
|
+
defaultValue: "",
|
6016
|
+
required: true,
|
6017
|
+
options: [
|
6018
|
+
{
|
6019
|
+
value: "VERIFIED",
|
6020
|
+
label: {
|
6021
|
+
id: "correction.corrector.identity.verified",
|
6022
|
+
defaultMessage: "I have verified their identity",
|
6023
|
+
description: "Label for verified option in corrector identity check page"
|
6024
|
+
}
|
5783
6025
|
}
|
5784
|
-
|
5785
|
-
]
|
5786
|
-
}
|
5787
|
-
]
|
5788
|
-
}
|
5789
|
-
],
|
5790
|
-
additionalDetailsForm: [
|
5791
|
-
{
|
5792
|
-
id: "correction-request.supporting-documents",
|
5793
|
-
type: PageTypes.enum.FORM,
|
5794
|
-
title: {
|
5795
|
-
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5796
|
-
defaultMessage: "Upload supporting documents",
|
5797
|
-
description: "This is the title of the section"
|
5798
|
-
},
|
5799
|
-
fields: [
|
5800
|
-
{
|
5801
|
-
id: "correction.supportingDocs.introduction",
|
5802
|
-
type: "PAGE_HEADER",
|
5803
|
-
label: {
|
5804
|
-
id: "correction.corrector.paragraph.title",
|
5805
|
-
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.",
|
5806
|
-
description: "The title for the corrector form"
|
5807
|
-
}
|
5808
|
-
},
|
5809
|
-
{
|
5810
|
-
id: "correction.supportingDocs",
|
5811
|
-
type: FieldType.FILE,
|
5812
|
-
label: {
|
5813
|
-
id: "correction.corrector.title",
|
5814
|
-
defaultMessage: "Upload supporting documents",
|
5815
|
-
description: "The title for the corrector form"
|
6026
|
+
]
|
5816
6027
|
}
|
6028
|
+
]
|
6029
|
+
},
|
6030
|
+
{
|
6031
|
+
id: "correction-request.supporting-documents",
|
6032
|
+
type: PageTypes.enum.FORM,
|
6033
|
+
title: {
|
6034
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
6035
|
+
defaultMessage: "Upload supporting documents",
|
6036
|
+
description: "This is the title of the section"
|
5817
6037
|
},
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
6038
|
+
fields: [
|
6039
|
+
{
|
6040
|
+
id: "correction.supportingDocs.introduction",
|
6041
|
+
type: "PAGE_HEADER",
|
6042
|
+
label: {
|
6043
|
+
id: "correction.corrector.paragraph.title",
|
6044
|
+
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.",
|
6045
|
+
description: "The title for the corrector form"
|
6046
|
+
}
|
5825
6047
|
},
|
5826
|
-
|
5827
|
-
|
5828
|
-
|
5829
|
-
|
6048
|
+
{
|
6049
|
+
id: "correction.supportingDocs",
|
6050
|
+
type: FieldType.FILE,
|
6051
|
+
label: {
|
6052
|
+
id: "correction.corrector.title",
|
6053
|
+
defaultMessage: "Upload supporting documents",
|
6054
|
+
description: "The title for the corrector form"
|
5830
6055
|
}
|
5831
6056
|
},
|
5832
|
-
|
5833
|
-
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5837
|
-
|
5838
|
-
|
6057
|
+
{
|
6058
|
+
id: "correction.request.supportingDocuments",
|
6059
|
+
type: "RADIO_GROUP",
|
6060
|
+
label: {
|
6061
|
+
id: "correction.corrector.title",
|
6062
|
+
defaultMessage: "Who is requesting a change to this record?",
|
6063
|
+
description: "The title for the corrector form"
|
6064
|
+
},
|
6065
|
+
defaultValue: "",
|
6066
|
+
configuration: {
|
6067
|
+
styles: {
|
6068
|
+
size: "NORMAL"
|
5839
6069
|
}
|
5840
6070
|
},
|
5841
|
-
|
5842
|
-
|
5843
|
-
|
5844
|
-
|
5845
|
-
|
5846
|
-
|
6071
|
+
options: [
|
6072
|
+
{
|
6073
|
+
value: "ATTEST",
|
6074
|
+
label: {
|
6075
|
+
id: "correction.supportingDocuments.attest.label",
|
6076
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
6077
|
+
description: ""
|
6078
|
+
}
|
6079
|
+
},
|
6080
|
+
{
|
6081
|
+
value: "NOT_NEEDED",
|
6082
|
+
label: {
|
6083
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
6084
|
+
defaultMessage: "No supporting documents required",
|
6085
|
+
description: ""
|
6086
|
+
}
|
5847
6087
|
}
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5851
|
-
]
|
5852
|
-
},
|
5853
|
-
{
|
5854
|
-
id: "correction-request.additional-details",
|
5855
|
-
type: PageTypes.enum.FORM,
|
5856
|
-
title: {
|
5857
|
-
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5858
|
-
defaultMessage: "Reason for correction",
|
5859
|
-
description: "This is the title of the section"
|
6088
|
+
]
|
6089
|
+
}
|
6090
|
+
]
|
5860
6091
|
},
|
5861
|
-
|
5862
|
-
|
5863
|
-
|
5864
|
-
|
5865
|
-
|
5866
|
-
|
5867
|
-
|
5868
|
-
|
6092
|
+
{
|
6093
|
+
id: "correction-request.additional-details",
|
6094
|
+
type: PageTypes.enum.FORM,
|
6095
|
+
title: {
|
6096
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
6097
|
+
defaultMessage: "Reason for correction",
|
6098
|
+
description: "This is the title of the section"
|
6099
|
+
},
|
6100
|
+
fields: [
|
6101
|
+
{
|
6102
|
+
id: "correction.request.reason",
|
6103
|
+
type: FieldType.TEXT,
|
6104
|
+
label: {
|
6105
|
+
id: "correction.reason.title",
|
6106
|
+
defaultMessage: "Reason for correction?",
|
6107
|
+
description: "The title for the corrector form"
|
6108
|
+
}
|
5869
6109
|
}
|
5870
|
-
|
5871
|
-
|
5872
|
-
|
5873
|
-
|
6110
|
+
]
|
6111
|
+
}
|
6112
|
+
]
|
6113
|
+
}
|
5874
6114
|
},
|
5875
6115
|
{
|
5876
6116
|
type: ActionType.APPROVE_CORRECTION,
|
@@ -5953,10 +6193,10 @@ var footballClubMembershipEvent = defineConfig({
|
|
5953
6193
|
id: "v2.advancedSearch.form.registrationDetails"
|
5954
6194
|
},
|
5955
6195
|
fields: [
|
5956
|
-
event("
|
5957
|
-
event("
|
5958
|
-
event("status"
|
5959
|
-
event("updatedAt"
|
6196
|
+
event("legalStatuses.REGISTERED.createdAtLocation").exact(),
|
6197
|
+
event("legalStatuses.REGISTERED.acceptedAt").range(),
|
6198
|
+
event("status").exact(),
|
6199
|
+
event("updatedAt").range()
|
5960
6200
|
]
|
5961
6201
|
},
|
5962
6202
|
{
|
@@ -6169,8 +6409,9 @@ var v2BirthEvent = defineConfig({
|
|
6169
6409
|
});
|
6170
6410
|
|
6171
6411
|
// ../commons/src/events/test.utils.ts
|
6172
|
-
var
|
6173
|
-
var
|
6412
|
+
var import_zod34 = require("zod");
|
6413
|
+
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
6414
|
+
var TestUserRole = import_zod34.z.enum([
|
6174
6415
|
"FIELD_AGENT",
|
6175
6416
|
"LOCAL_REGISTRAR",
|
6176
6417
|
"LOCAL_SYSTEM_ADMIN",
|
@@ -6225,6 +6466,7 @@ function mapFieldTypeToMockValue(field2, i, rng) {
|
|
6225
6466
|
case FieldType.PAGE_HEADER:
|
6226
6467
|
case FieldType.LOCATION:
|
6227
6468
|
case FieldType.SELECT:
|
6469
|
+
case FieldType.SELECT_DATE_RANGE:
|
6228
6470
|
case FieldType.COUNTRY:
|
6229
6471
|
case FieldType.RADIO_GROUP:
|
6230
6472
|
case FieldType.PARAGRAPH:
|
@@ -6255,14 +6497,19 @@ function mapFieldTypeToMockValue(field2, i, rng) {
|
|
6255
6497
|
};
|
6256
6498
|
case FieldType.DATE:
|
6257
6499
|
return "2021-01-01";
|
6500
|
+
case FieldType.TIME:
|
6501
|
+
return "09:33";
|
6258
6502
|
case FieldType.DATE_RANGE:
|
6259
|
-
return
|
6503
|
+
return {
|
6504
|
+
start: "2021-01-01",
|
6505
|
+
end: "2021-01-31"
|
6506
|
+
};
|
6260
6507
|
case FieldType.CHECKBOX:
|
6261
6508
|
return true;
|
6262
6509
|
case FieldType.SIGNATURE:
|
6263
6510
|
case FieldType.FILE:
|
6264
6511
|
return {
|
6265
|
-
|
6512
|
+
path: "/ocrvs/4f095fc4-4312-4de2-aa38-86dcc0f71044.png",
|
6266
6513
|
originalFilename: "abcd.png",
|
6267
6514
|
type: "image/png"
|
6268
6515
|
};
|
@@ -6325,7 +6572,11 @@ function eventPayloadGenerator(rng) {
|
|
6325
6572
|
type: input.type ?? TENNIS_CLUB_MEMBERSHIP,
|
6326
6573
|
id
|
6327
6574
|
}),
|
6328
|
-
draft: ({
|
6575
|
+
draft: ({
|
6576
|
+
eventId,
|
6577
|
+
actionType,
|
6578
|
+
annotation
|
6579
|
+
}, input = {}) => (0, import_lodash3.merge)(
|
6329
6580
|
{
|
6330
6581
|
id: getUUID(),
|
6331
6582
|
eventId,
|
@@ -6341,11 +6592,16 @@ function eventPayloadGenerator(rng) {
|
|
6341
6592
|
surname: "McLaren"
|
6342
6593
|
},
|
6343
6594
|
"applicant.dob": "2020-01-02",
|
6344
|
-
"
|
6595
|
+
"applicant.image": {
|
6596
|
+
path: "/ocrvs/e56d1dd3-2cd4-452a-b54e-bf3e2d830605.png",
|
6597
|
+
originalFilename: "Screenshot.png",
|
6598
|
+
type: "image/png"
|
6599
|
+
}
|
6345
6600
|
},
|
6346
6601
|
annotation: {
|
6347
6602
|
"correction.requester.relationship": "ANOTHER_AGENT",
|
6348
|
-
"correction.request.reason": "Child's name was incorrect"
|
6603
|
+
"correction.request.reason": "Child's name was incorrect",
|
6604
|
+
...annotation
|
6349
6605
|
},
|
6350
6606
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
6351
6607
|
createdBy: "@todo",
|
@@ -6379,13 +6635,13 @@ function eventPayloadGenerator(rng) {
|
|
6379
6635
|
notify: (eventId, input = {}) => {
|
6380
6636
|
let declaration = input.declaration;
|
6381
6637
|
if (!declaration) {
|
6382
|
-
const partialDeclaration = (0,
|
6638
|
+
const partialDeclaration = (0, import_lodash3.omitBy)(
|
6383
6639
|
generateActionDeclarationInput(
|
6384
6640
|
tennisClubMembershipEvent,
|
6385
6641
|
ActionType.DECLARE,
|
6386
6642
|
rng
|
6387
6643
|
),
|
6388
|
-
|
6644
|
+
import_lodash3.isString
|
6389
6645
|
);
|
6390
6646
|
declaration = partialDeclaration;
|
6391
6647
|
}
|
@@ -6488,10 +6744,13 @@ function eventPayloadGenerator(rng) {
|
|
6488
6744
|
request: (eventId, input = {}) => ({
|
6489
6745
|
type: ActionType.REQUEST_CORRECTION,
|
6490
6746
|
transactionId: input.transactionId ?? getUUID(),
|
6491
|
-
declaration: input.declaration ??
|
6492
|
-
|
6493
|
-
|
6494
|
-
|
6747
|
+
declaration: input.declaration ?? (0, import_lodash3.omit)(
|
6748
|
+
generateActionDeclarationInput(
|
6749
|
+
tennisClubMembershipEvent,
|
6750
|
+
ActionType.REQUEST_CORRECTION,
|
6751
|
+
rng
|
6752
|
+
),
|
6753
|
+
["applicant.email"]
|
6495
6754
|
),
|
6496
6755
|
annotation: input.annotation ?? generateActionAnnotationInput(
|
6497
6756
|
tennisClubMembershipEvent,
|
@@ -6514,7 +6773,7 @@ function eventPayloadGenerator(rng) {
|
|
6514
6773
|
requestId,
|
6515
6774
|
keepAssignment: input.keepAssignment
|
6516
6775
|
}),
|
6517
|
-
reject: (eventId, requestId, input
|
6776
|
+
reject: (eventId, requestId, input) => ({
|
6518
6777
|
type: ActionType.REJECT_CORRECTION,
|
6519
6778
|
transactionId: input.transactionId ?? getUUID(),
|
6520
6779
|
declaration: {},
|
@@ -6525,7 +6784,8 @@ function eventPayloadGenerator(rng) {
|
|
6525
6784
|
),
|
6526
6785
|
eventId,
|
6527
6786
|
requestId,
|
6528
|
-
keepAssignment: input.keepAssignment
|
6787
|
+
keepAssignment: input.keepAssignment,
|
6788
|
+
reason: input.reason ?? { message: "" }
|
6529
6789
|
})
|
6530
6790
|
}
|
6531
6791
|
}
|
@@ -6584,7 +6844,8 @@ function generateActionDocument({
|
|
6584
6844
|
return {
|
6585
6845
|
...actionBase,
|
6586
6846
|
requestId: getUUID(),
|
6587
|
-
type: action
|
6847
|
+
type: action,
|
6848
|
+
reason: { message: "Correction rejection" }
|
6588
6849
|
};
|
6589
6850
|
case ActionType.REGISTER:
|
6590
6851
|
return {
|
@@ -6712,7 +6973,7 @@ var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
|
6712
6973
|
createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
|
6713
6974
|
updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
|
6714
6975
|
createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
|
6715
|
-
updatedAt: overrides.updatedAt ?? (0,
|
6976
|
+
updatedAt: overrides.updatedAt ?? (0, import_date_fns4.addDays)(new Date(createdAt), 1).toISOString(),
|
6716
6977
|
assignedTo: overrides.assignedTo ?? null,
|
6717
6978
|
updatedBy: overrides.updatedBy ?? generateUuid(rng),
|
6718
6979
|
updatedByUserRole: overrides.updatedByUserRole ?? "FIELD_AGENT",
|
@@ -6784,7 +7045,7 @@ function isFieldConfigDefaultValue(value) {
|
|
6784
7045
|
}
|
6785
7046
|
|
6786
7047
|
// ../commons/src/events/scopes.ts
|
6787
|
-
var
|
7048
|
+
var import_lodash4 = require("lodash");
|
6788
7049
|
var CONFIG_GET_ALLOWED_SCOPES = [
|
6789
7050
|
SCOPES.RECORD_DECLARE,
|
6790
7051
|
SCOPES.RECORD_READ,
|
@@ -6831,7 +7092,11 @@ var ACTION_ALLOWED_SCOPES = {
|
|
6831
7092
|
[ActionType.REGISTER]: [SCOPES.RECORD_REGISTER],
|
6832
7093
|
[ActionType.PRINT_CERTIFICATE]: [SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES],
|
6833
7094
|
[ActionType.REQUEST_CORRECTION]: [
|
6834
|
-
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION
|
7095
|
+
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION,
|
7096
|
+
SCOPES.RECORD_REGISTRATION_CORRECT
|
7097
|
+
],
|
7098
|
+
[ExclusiveActions.REVIEW_CORRECTION_REQUEST]: [
|
7099
|
+
SCOPES.RECORD_REGISTRATION_CORRECT
|
6835
7100
|
],
|
6836
7101
|
[ActionType.REJECT_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
|
6837
7102
|
[ActionType.APPROVE_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
|
@@ -6868,19 +7133,19 @@ var WRITE_ACTION_SCOPES = [
|
|
6868
7133
|
...ACTION_ALLOWED_SCOPES[ActionType.PRINT_CERTIFICATE]
|
6869
7134
|
];
|
6870
7135
|
function hasAnyOfScopes(a, b) {
|
6871
|
-
return (0,
|
7136
|
+
return (0, import_lodash4.intersection)(a, b).length > 0;
|
6872
7137
|
}
|
6873
7138
|
|
6874
7139
|
// ../commons/src/events/serializers/user/deserializer.ts
|
6875
|
-
var
|
7140
|
+
var import_zod35 = require("zod");
|
6876
7141
|
var UserWithPrimaryOffice = User.extend({
|
6877
|
-
primaryOfficeId:
|
7142
|
+
primaryOfficeId: import_zod35.z.string()
|
6878
7143
|
});
|
6879
7144
|
function userDeserializer(serializedUserField, user2) {
|
6880
7145
|
if (typeof serializedUserField === "string") {
|
6881
7146
|
return serializedUserField;
|
6882
7147
|
}
|
6883
|
-
if (serializedUserField.$userField === "name" || serializedUserField.$userField === "
|
7148
|
+
if (serializedUserField.$userField === "name" || serializedUserField.$userField === "signature" || serializedUserField.$userField === "avatar") {
|
6884
7149
|
throw new Error(
|
6885
7150
|
`Deserializer for ${serializedUserField.$userField} is not implemented yet`
|
6886
7151
|
);
|
@@ -6962,20 +7227,21 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
6962
7227
|
ActionType.ARCHIVE,
|
6963
7228
|
ActionType.REJECT
|
6964
7229
|
],
|
6965
|
-
[EventStatus.enum.REJECTED]: [
|
6966
|
-
ActionType.READ,
|
6967
|
-
ActionType.DECLARE,
|
6968
|
-
ActionType.VALIDATE
|
6969
|
-
],
|
6970
7230
|
[EventStatus.enum.REGISTERED]: [
|
6971
7231
|
ActionType.READ,
|
6972
7232
|
ActionType.PRINT_CERTIFICATE,
|
6973
|
-
ActionType.REQUEST_CORRECTION
|
7233
|
+
ActionType.REQUEST_CORRECTION,
|
7234
|
+
ActionType.APPROVE_CORRECTION,
|
7235
|
+
ActionType.REJECT_CORRECTION,
|
7236
|
+
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
6974
7237
|
],
|
6975
7238
|
[EventStatus.enum.CERTIFIED]: [
|
6976
7239
|
ActionType.READ,
|
6977
7240
|
ActionType.PRINT_CERTIFICATE,
|
6978
|
-
ActionType.REQUEST_CORRECTION
|
7241
|
+
ActionType.REQUEST_CORRECTION,
|
7242
|
+
ActionType.APPROVE_CORRECTION,
|
7243
|
+
ActionType.REJECT_CORRECTION,
|
7244
|
+
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
6979
7245
|
],
|
6980
7246
|
[EventStatus.enum.ARCHIVED]: [
|
6981
7247
|
ActionType.READ,
|
@@ -6983,3 +7249,10 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
6983
7249
|
ActionType.UNASSIGN
|
6984
7250
|
]
|
6985
7251
|
};
|
7252
|
+
var getAvailableActionsForEvent = (event2) => {
|
7253
|
+
return event2.flags.includes(InherentFlags.REJECTED) ? [
|
7254
|
+
ActionType.READ,
|
7255
|
+
event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
|
7256
|
+
ActionType.ARCHIVE
|
7257
|
+
] : AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
|
7258
|
+
};
|