@opencrvs/toolkit 1.8.0-rc.ffe24c3 → 1.8.1-rc.1e3e9b5

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.
Files changed (35) hide show
  1. package/dist/commons/api/router.d.ts +1742 -14918
  2. package/dist/commons/conditionals/conditionals.d.ts +0 -12
  3. package/dist/commons/conditionals/validate.d.ts +5 -0
  4. package/dist/commons/events/ActionConfig.d.ts +37041 -35133
  5. package/dist/commons/events/ActionDocument.d.ts +3159 -1626
  6. package/dist/commons/events/ActionInput.d.ts +2280 -1380
  7. package/dist/commons/events/ActionType.d.ts +7 -4
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +100 -51
  9. package/dist/commons/events/CompositeFieldValue.d.ts +15 -15
  10. package/dist/commons/events/CountryConfigQueryInput.d.ts +1162 -760
  11. package/dist/commons/events/Draft.d.ts +190 -118
  12. package/dist/commons/events/EventConfig.d.ts +20824 -22965
  13. package/dist/commons/events/EventDocument.d.ts +1669 -1021
  14. package/dist/commons/events/EventIndex.d.ts +394 -175
  15. package/dist/commons/events/EventMetadata.d.ts +6 -4
  16. package/dist/commons/events/FieldConfig.d.ts +1528 -449
  17. package/dist/commons/events/FieldType.d.ts +3 -1
  18. package/dist/commons/events/FieldTypeMapping.d.ts +80 -41
  19. package/dist/commons/events/FieldValue.d.ts +58 -28
  20. package/dist/commons/events/FormConfig.d.ts +9263 -2657
  21. package/dist/commons/events/PageConfig.d.ts +3642 -2028
  22. package/dist/commons/events/SummaryConfig.d.ts +10 -10
  23. package/dist/commons/events/User.d.ts +6 -3
  24. package/dist/commons/events/WorkqueueConfig.d.ts +2153 -1337
  25. package/dist/commons/events/defineConfig.d.ts +2759 -3250
  26. package/dist/commons/events/event.d.ts +10 -18
  27. package/dist/commons/events/field.d.ts +13 -1
  28. package/dist/commons/events/scopes.d.ts +2 -1
  29. package/dist/commons/events/test.utils.d.ts +58 -34
  30. package/dist/commons/events/utils.d.ts +8848 -6794
  31. package/dist/conditionals/index.js +23 -53
  32. package/dist/events/index.js +1594 -1341
  33. package/dist/scopes/index.d.ts +92 -6
  34. package/dist/scopes/index.js +38 -9
  35. package/package.json +3 -3
@@ -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 import_zod9 = require("zod");
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 import_zod3 = require("zod");
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 = import_zod3.z.object({
449
- filename: import_zod3.z.string(),
450
- originalFilename: import_zod3.z.string(),
451
- type: import_zod3.z.string()
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 = import_zod3.z.object({
454
- country: import_zod3.z.string(),
455
- addressType: import_zod3.z.literal(AddressType.DOMESTIC),
456
- province: import_zod3.z.string(),
457
- district: import_zod3.z.string()
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: import_zod3.z.literal(GeographicalArea.URBAN),
461
- town: import_zod3.z.string().optional(),
462
- residentialArea: import_zod3.z.string().optional(),
463
- street: import_zod3.z.string().optional(),
464
- number: import_zod3.z.string().optional(),
465
- zipCode: import_zod3.z.string().optional()
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: import_zod3.z.literal(GeographicalArea.RURAL),
469
- village: import_zod3.z.string().optional()
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: import_zod3.z.literal(GeographicalArea.URBAN),
473
- town: import_zod3.z.string().nullish(),
474
- residentialArea: import_zod3.z.string().nullish(),
475
- street: import_zod3.z.string().nullish(),
476
- number: import_zod3.z.string().nullish(),
477
- zipCode: import_zod3.z.string().nullish()
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 = import_zod3.z.object({
480
- firstname: import_zod3.z.string(),
481
- surname: import_zod3.z.string(),
482
- middlename: import_zod3.z.string().optional()
608
+ var NameFieldValue = import_zod5.z.object({
609
+ firstname: import_zod5.z.string(),
610
+ surname: import_zod5.z.string(),
611
+ middlename: import_zod5.z.string().optional()
483
612
  });
484
- var NameFieldUpdateValue = import_zod3.z.object({
485
- firstname: import_zod3.z.string(),
486
- surname: import_zod3.z.string(),
487
- middlename: import_zod3.z.string().nullish()
488
- }).or(import_zod3.z.null()).or(import_zod3.z.undefined());
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: import_zod3.z.literal(GeographicalArea.RURAL),
491
- village: import_zod3.z.string().nullish()
619
+ urbanOrRural: import_zod5.z.literal(GeographicalArea.RURAL),
620
+ village: import_zod5.z.string().nullish()
492
621
  });
493
- var GenericAddressValue = import_zod3.z.object({
494
- country: import_zod3.z.string(),
495
- addressType: import_zod3.z.literal(AddressType.INTERNATIONAL),
496
- state: import_zod3.z.string(),
497
- district2: import_zod3.z.string(),
498
- cityOrTown: import_zod3.z.string().optional(),
499
- addressLine1: import_zod3.z.string().optional(),
500
- addressLine2: import_zod3.z.string().optional(),
501
- addressLine3: import_zod3.z.string().optional(),
502
- postcodeOrZip: import_zod3.z.string().optional()
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 = import_zod3.z.discriminatedUnion("urbanOrRural", [UrbanAddressValue, RuralAddressValue]).or(GenericAddressValue);
505
- var GenericAddressUpdateValue = import_zod3.z.object({
506
- country: import_zod3.z.string(),
507
- addressType: import_zod3.z.literal(AddressType.INTERNATIONAL),
508
- state: import_zod3.z.string(),
509
- district2: import_zod3.z.string(),
510
- cityOrTown: import_zod3.z.string().nullish(),
511
- addressLine1: import_zod3.z.string().nullish(),
512
- addressLine2: import_zod3.z.string().nullish(),
513
- addressLine3: import_zod3.z.string().nullish(),
514
- postcodeOrZip: import_zod3.z.string().nullish()
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 = import_zod3.z.discriminatedUnion("urbanOrRural", [
645
+ var AddressFieldUpdateValue = import_zod5.z.discriminatedUnion("urbanOrRural", [
517
646
  UrbanAddressUpdateValue,
518
647
  RuralAddressUpdateValue
519
648
  ]).or(GenericAddressUpdateValue);
520
- var FileFieldValueWithOption = import_zod3.z.object({
521
- filename: import_zod3.z.string(),
522
- originalFilename: import_zod3.z.string(),
523
- type: import_zod3.z.string(),
524
- option: import_zod3.z.string()
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 = import_zod3.z.array(FileFieldValueWithOption);
655
+ var FileFieldWithOptionValue = import_zod5.z.array(FileFieldValueWithOption);
527
656
 
528
657
  // ../commons/src/events/FieldValue.ts
529
- var TextValue = import_zod4.z.string();
658
+ var TextValue = import_zod6.z.string();
530
659
  var NonEmptyTextValue = TextValue.min(1);
531
- var DateValue = import_zod4.z.string().date().describe("Date in the format YYYY-MM-DD");
532
- var DatetimeValue = import_zod4.z.string().datetime();
533
- var DateRangeFieldValue = DateValue.or(import_zod4.z.tuple([DateValue, DateValue]));
534
- var EmailValue = import_zod4.z.string().email();
535
- var CheckboxFieldValue = import_zod4.z.boolean();
536
- var NumberFieldValue = import_zod4.z.number();
537
- var DataFieldValue = import_zod4.z.undefined();
538
- var SignatureFieldValue = import_zod4.z.string();
539
- var FieldValue = import_zod4.z.union([
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 = import_zod4.z.union([
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 import_zod_openapi3 = require("zod-openapi");
571
- (0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
572
- var FieldId = import_zod5.z.string().describe("Unique identifier for the field");
573
- var FieldReference = import_zod5.z.object({
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 ParentReference = FieldReference.optional();
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 = import_zod5.z.object({
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: import_zod5.z.boolean().default(false).optional()
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: import_zod5.z.literal(FieldType.DIVIDER)
743
+ type: import_zod7.z.literal(FieldType.DIVIDER)
594
744
  });
595
745
  var TextField = BaseField.extend({
596
- type: import_zod5.z.literal(FieldType.TEXT),
746
+ type: import_zod7.z.literal(FieldType.TEXT),
597
747
  defaultValue: NonEmptyTextValue.optional(),
598
- configuration: import_zod5.z.object({
599
- maxLength: import_zod5.z.number().optional().describe("Maximum length of the text"),
600
- type: import_zod5.z.enum(["text", "password"]).optional(),
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: import_zod5.z.literal(FieldType.NUMBER),
756
+ type: import_zod7.z.literal(FieldType.NUMBER),
607
757
  defaultValue: NumberFieldValue.optional(),
608
- configuration: import_zod5.z.object({
609
- min: import_zod5.z.number().optional().describe("Minimum value"),
610
- max: import_zod5.z.number().optional().describe("Maximum value"),
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: import_zod5.z.literal(FieldType.TEXTAREA),
766
+ type: import_zod7.z.literal(FieldType.TEXTAREA),
617
767
  defaultValue: NonEmptyTextValue.optional(),
618
- configuration: import_zod5.z.object({
619
- maxLength: import_zod5.z.number().optional().describe("Maximum length of the text"),
620
- rows: import_zod5.z.number().optional().describe("Number of visible text lines"),
621
- cols: import_zod5.z.number().optional().describe("Number of visible columns"),
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 = import_zod5.z.enum([
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: import_zod5.z.literal(FieldType.SIGNATURE),
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: import_zod5.z.object({
641
- maxFileSize: import_zod5.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
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: import_zod5.z.literal(FieldType.EMAIL),
649
- configuration: import_zod5.z.object({
650
- maxLength: import_zod5.z.number().optional().describe("Maximum length of the text")
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: import_zod5.z.literal(FieldType.DATE),
805
+ type: import_zod7.z.literal(FieldType.DATE),
656
806
  defaultValue: DateValue.optional(),
657
- configuration: import_zod5.z.object({
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 (dd-mm-YYYY)");
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: import_zod5.z.literal(FieldType.DATE_RANGE),
823
+ type: import_zod7.z.literal(FieldType.DATE_RANGE),
665
824
  defaultValue: DateRangeFieldValue.optional(),
666
- configuration: import_zod5.z.object({
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
- "A date range input ({ rangeStart: dd-mm-YYYY, rangeEnd: dd-mm-YYYY })"
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: import_zod5.z.literal(FieldType.PARAGRAPH),
850
+ type: import_zod7.z.literal(FieldType.PARAGRAPH),
686
851
  defaultValue: NonEmptyTextValue.optional(),
687
- configuration: import_zod5.z.object({
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: import_zod5.z.literal(FieldType.PAGE_HEADER),
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: import_zod5.z.literal(FieldType.FILE),
859
+ type: import_zod7.z.literal(FieldType.FILE),
699
860
  defaultValue: FileFieldValue.optional(),
700
- configuration: import_zod5.z.object({
701
- maxFileSize: import_zod5.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
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: import_zod5.z.object({
704
- width: import_zod5.z.enum(["full", "auto"]).optional().describe(
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 = import_zod5.z.object({
714
- value: import_zod5.z.string().describe("The value of the option"),
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: import_zod5.z.literal(FieldType.RADIO_GROUP),
879
+ type: import_zod7.z.literal(FieldType.RADIO_GROUP),
719
880
  defaultValue: TextValue.optional(),
720
- options: import_zod5.z.array(SelectOption).describe("A list of options"),
721
- configuration: import_zod5.z.object({
722
- styles: import_zod5.z.object({
723
- size: import_zod5.z.enum(["NORMAL", "LARGE"]).optional()
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: import_zod5.z.literal(FieldType.BULLET_LIST),
889
+ type: import_zod7.z.literal(FieldType.BULLET_LIST),
729
890
  defaultValue: TextValue.optional(),
730
- items: import_zod5.z.array(TranslationConfig).describe("A list of items"),
731
- configuration: import_zod5.z.object({
732
- styles: import_zod5.z.object({
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: import_zod5.z.literal(FieldType.SELECT),
899
+ type: import_zod7.z.literal(FieldType.SELECT),
739
900
  defaultValue: TextValue.optional(),
740
- options: import_zod5.z.array(SelectOption).describe("A list of 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: import_zod5.z.literal(FieldType.NAME),
744
- defaultValue: import_zod5.z.object({
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: import_zod5.z.object({
749
- maxLength: import_zod5.z.number().optional().describe("Maximum length of the text"),
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: import_zod5.z.literal(FieldType.PHONE)
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: import_zod5.z.literal(FieldType.ID)
932
+ type: import_zod7.z.literal(FieldType.ID)
761
933
  }).describe("ID input field");
762
934
  var Checkbox = BaseField.extend({
763
- type: import_zod5.z.literal(FieldType.CHECKBOX),
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: import_zod5.z.literal(FieldType.COUNTRY),
939
+ type: import_zod7.z.literal(FieldType.COUNTRY),
768
940
  defaultValue: NonEmptyTextValue.optional()
769
941
  }).describe("Country select field");
770
- var AdministrativeAreas = import_zod5.z.enum([
942
+ var AdministrativeAreas = import_zod7.z.enum([
771
943
  "ADMIN_STRUCTURE",
772
944
  "HEALTH_FACILITY",
773
945
  "CRVS_OFFICE"
774
946
  ]);
775
- var AdministrativeAreaConfiguration = import_zod5.z.object({
776
- partOf: import_zod5.z.object({
777
- $declaration: import_zod5.z.string()
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: import_zod5.z.literal(FieldType.ADMINISTRATIVE_AREA),
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: import_zod5.z.literal(FieldType.LOCATION),
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: import_zod5.z.literal(FieldType.FILE_WITH_OPTIONS),
792
- options: import_zod5.z.array(SelectOption).describe("A list of 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: import_zod5.z.object({
795
- maxFileSize: import_zod5.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
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: import_zod5.z.literal(FieldType.FACILITY),
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: import_zod5.z.literal(FieldType.OFFICE),
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: import_zod5.z.literal(FieldType.ADDRESS),
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 = import_zod5.z.union([
814
- import_zod5.z.object({
991
+ var DataEntry = import_zod7.z.union([
992
+ import_zod7.z.object({
815
993
  label: TranslationConfig,
816
- value: TranslationConfig.or(import_zod5.z.string())
994
+ value: TranslationConfig.or(import_zod7.z.string())
817
995
  }),
818
- import_zod5.z.object({
819
- fieldId: import_zod5.z.string()
996
+ import_zod7.z.object({
997
+ fieldId: import_zod7.z.string()
820
998
  })
821
999
  ]);
822
1000
  var DataField = BaseField.extend({
823
- type: import_zod5.z.literal(FieldType.DATA),
824
- configuration: import_zod5.z.object({
1001
+ type: import_zod7.z.literal(FieldType.DATA),
1002
+ configuration: import_zod7.z.object({
825
1003
  subtitle: TranslationConfig.optional(),
826
- data: import_zod5.z.array(DataEntry)
1004
+ data: import_zod7.z.array(DataEntry)
827
1005
  })
828
1006
  }).describe("Data field for displaying read-only data");
829
- var FieldConfig = import_zod5.z.discriminatedUnion("type", [
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 import_zod_openapi4 = require("zod-openapi");
863
- (0, import_zod_openapi4.extendZodWithOpenApi)(import_zod6.z);
864
- var PageTypes = import_zod6.z.enum(["FORM", "VERIFICATION"]);
865
- var PageConfigBase = import_zod6.z.object({
866
- id: import_zod6.z.string().describe("Unique identifier for the page"),
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: import_zod6.z.array(FieldConfig).describe("Fields to be rendered on the page"),
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: import_zod6.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
1061
+ type: import_zod8.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
878
1062
  });
879
- var VerificationActionConfig = import_zod6.z.object({
880
- verify: import_zod6.z.object({ label: TranslationConfig }),
881
- cancel: import_zod6.z.object({
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: import_zod6.z.object({
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: import_zod6.z.literal(PageTypes.enum.VERIFICATION),
1077
+ type: import_zod8.z.literal(PageTypes.enum.VERIFICATION),
894
1078
  actions: VerificationActionConfig
895
1079
  });
896
- var PageConfig = import_zod6.z.discriminatedUnion("type", [
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 import_zod8 = require("zod");
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: import_zod8.z.array(FormPageConfig)
1088
+ pages: import_zod9.z.array(FormPageConfig)
1012
1089
  }).describe("Configuration for a declaration form");
1013
- var ActionFormConfig = import_zod8.z.object({
1090
+ var ActionFormConfig = import_zod9.z.object({
1014
1091
  label: TranslationConfig.describe("Human readable description of the form"),
1015
- pages: import_zod8.z.array(PageConfig)
1092
+ pages: import_zod9.z.array(PageConfig)
1016
1093
  });
1017
- var FormConfig = import_zod8.z.union([DeclarationFormConfig, ActionFormConfig]);
1094
+ var FormConfig = import_zod9.z.union([DeclarationFormConfig, ActionFormConfig]);
1018
1095
 
1019
1096
  // ../commons/src/events/ActionConfig.ts
1020
- var import_zod_openapi5 = require("zod-openapi");
1021
- (0, import_zod_openapi5.extendZodWithOpenApi)(import_zod9.z);
1022
- var ActionConditional2 = import_zod9.z.discriminatedUnion("type", [
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 = import_zod9.z.object({
1105
+ var DeclarationReviewConfig = import_zod10.z.object({
1029
1106
  title: TranslationConfig.describe("Title of the review page"),
1030
- fields: import_zod9.z.array(FieldConfig).describe("Fields to be rendered on the review page for annotations.")
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 = import_zod9.z.object({
1109
+ var ActionConfigBase = import_zod10.z.object({
1033
1110
  label: TranslationConfig,
1034
- conditionals: import_zod9.z.array(ActionConditional2).optional().default([]),
1035
- draft: import_zod9.z.boolean().optional()
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
- import_zod9.z.object({
1039
- type: import_zod9.z.literal(ActionType.READ),
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
- import_zod9.z.object({
1045
- type: import_zod9.z.literal(ActionType.DECLARE),
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
- import_zod9.z.object({
1051
- type: import_zod9.z.literal(ActionType.VALIDATE),
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
- import_zod9.z.object({
1057
- type: import_zod9.z.literal(ActionType.REGISTER),
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
- import_zod9.z.object({
1063
- type: import_zod9.z.literal(ActionType.REJECT)
1139
+ import_zod10.z.object({
1140
+ type: import_zod10.z.literal(ActionType.REJECT)
1064
1141
  })
1065
1142
  );
1066
1143
  var MarkedAsDuplicateConfig = ActionConfigBase.merge(
1067
- import_zod9.z.object({
1068
- type: import_zod9.z.literal(ActionType.MARKED_AS_DUPLICATE)
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
- import_zod9.z.object({
1073
- type: import_zod9.z.literal(ActionType.ARCHIVE)
1149
+ import_zod10.z.object({
1150
+ type: import_zod10.z.literal(ActionType.ARCHIVE)
1074
1151
  })
1075
1152
  );
1076
1153
  var DeleteConfig = ActionConfigBase.merge(
1077
- import_zod9.z.object({
1078
- type: import_zod9.z.literal(ActionType.DELETE)
1154
+ import_zod10.z.object({
1155
+ type: import_zod10.z.literal(ActionType.DELETE)
1079
1156
  })
1080
1157
  );
1081
1158
  var PrintCertificateActionConfig = ActionConfigBase.merge(
1082
- import_zod9.z.object({
1083
- type: import_zod9.z.literal(ActionType.PRINT_CERTIFICATE),
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
- import_zod9.z.object({
1089
- type: import_zod9.z.literal(ActionType.REQUEST_CORRECTION),
1090
- onboardingForm: import_zod9.z.array(PageConfig),
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
- import_zod9.z.object({
1096
- type: import_zod9.z.literal(ActionType.REJECT_CORRECTION)
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
- import_zod9.z.object({
1101
- type: import_zod9.z.literal(ActionType.APPROVE_CORRECTION)
1176
+ import_zod10.z.object({
1177
+ type: import_zod10.z.literal(ActionType.APPROVE_CORRECTION)
1102
1178
  })
1103
1179
  );
1104
- var ActionConfig = import_zod9.z.discriminatedUnion("type", [
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 = import_zod9.z.discriminatedUnion("type", [
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 import_zod10 = require("zod");
1132
- var FontFamily = import_zod10.z.object({
1133
- normal: import_zod10.z.string(),
1134
- bold: import_zod10.z.string(),
1135
- italics: import_zod10.z.string(),
1136
- bolditalics: import_zod10.z.string()
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 = import_zod10.z.object({
1139
- id: import_zod10.z.string(),
1140
- event: import_zod10.z.string(),
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: import_zod10.z.boolean(),
1143
- fee: import_zod10.z.object({
1144
- onTime: import_zod10.z.number(),
1145
- late: import_zod10.z.number(),
1146
- delayed: import_zod10.z.number()
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: import_zod10.z.string(),
1149
- fonts: import_zod10.z.record(FontFamily).optional()
1224
+ svgUrl: import_zod11.z.string(),
1225
+ fonts: import_zod11.z.record(FontFamily).optional()
1150
1226
  });
1151
1227
  var CertificateTemplateConfig = CertificateConfig.extend({
1152
- hash: import_zod10.z.string().optional(),
1153
- svg: import_zod10.z.string()
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 import_zod11 = require("zod");
1158
- var LanguageConfig = import_zod11.z.object({
1159
- lang: import_zod11.z.string(),
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: import_zod11.z.record(import_zod11.z.string())
1239
+ messages: import_zod12.z.record(import_zod12.z.string())
1164
1240
  });
1165
1241
 
1166
1242
  // ../commons/src/events/EventConfig.ts
1167
- var import_zod20 = require("zod");
1243
+ var import_zod21 = require("zod");
1168
1244
 
1169
1245
  // ../commons/src/events/DeduplicationConfig.ts
1170
- var import_zod12 = require("zod");
1171
- var import_zod_openapi6 = require("zod-openapi");
1172
- (0, import_zod_openapi6.extendZodWithOpenApi)(import_zod12.z);
1173
- var FieldReference2 = import_zod12.z.string();
1174
- var Matcher = import_zod12.z.object({
1175
- fieldId: import_zod12.z.string(),
1176
- options: import_zod12.z.object({
1177
- boost: import_zod12.z.number().optional()
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: import_zod12.z.literal("fuzzy"),
1182
- options: import_zod12.z.object({
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: import_zod12.z.union([import_zod12.z.string(), import_zod12.z.number()]).optional().default("AUTO:4,7"),
1189
- boost: import_zod12.z.number().optional().default(1)
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: import_zod12.z.literal("strict"),
1194
- options: import_zod12.z.object({
1195
- boost: import_zod12.z.number().optional().default(1)
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: import_zod12.z.literal("dateRange"),
1200
- options: import_zod12.z.object({
1201
- days: import_zod12.z.number(),
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: import_zod12.z.number().optional().default(1)
1279
+ boost: import_zod13.z.number().optional().default(1)
1204
1280
  })
1205
1281
  });
1206
1282
  var DateDistanceMatcher = Matcher.extend({
1207
- type: import_zod12.z.literal("dateDistance"),
1208
- options: import_zod12.z.object({
1209
- days: import_zod12.z.number(),
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: import_zod12.z.number().optional().default(1)
1287
+ boost: import_zod13.z.number().optional().default(1)
1212
1288
  })
1213
1289
  });
1214
- var And = import_zod12.z.object({
1215
- type: import_zod12.z.literal("and"),
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: import_zod12.z.lazy(() => Clause.array())
1293
+ clauses: import_zod13.z.lazy(() => Clause.array())
1218
1294
  });
1219
- var Or = import_zod12.z.object({
1220
- type: import_zod12.z.literal("or"),
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: import_zod12.z.lazy(() => Clause.array())
1298
+ clauses: import_zod13.z.lazy(() => Clause.array())
1223
1299
  });
1224
- var Clause = import_zod12.z.lazy(
1225
- () => import_zod12.z.discriminatedUnion("type", [
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 = import_zod12.z.object({
1237
- id: import_zod12.z.string(),
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 import_zod13 = require("zod");
1244
- var BaseField2 = import_zod13.z.object({
1319
+ var import_zod14 = require("zod");
1320
+ var BaseField2 = import_zod14.z.object({
1245
1321
  emptyValueMessage: TranslationConfig.optional(),
1246
- conditionals: import_zod13.z.array(ShowConditional).default([]).optional()
1322
+ conditionals: import_zod14.z.array(ShowConditional).default([]).optional()
1247
1323
  });
1248
1324
  var ReferenceField = BaseField2.extend({
1249
- fieldId: import_zod13.z.string(),
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: import_zod13.z.string().describe("Id of summary field"),
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 = import_zod13.z.object({
1262
- fields: import_zod13.z.array(import_zod13.z.union([Field, ReferenceField])).describe("Fields rendered in summary view.")
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 import_zod14 = require("zod");
1267
- var MatchType = import_zod14.z.enum(["fuzzy", "exact", "range"]);
1268
- var BaseField3 = import_zod14.z.object({
1269
- config: import_zod14.z.object({
1342
+ var import_zod15 = require("zod");
1343
+ var MatchType = import_zod15.z.enum(["fuzzy", "exact", "range"]);
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: import_zod14.z.array(SelectOption).optional(),
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: import_zod14.z.array(FieldConditional).default([]).optional().describe(
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: import_zod14.z.array(ValidationConfig).default([]).optional().describe(
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 = import_zod14.z.object({
1312
- eventType: import_zod14.z.string().optional().describe(
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: import_zod14.z.string(),
1318
- fieldType: import_zod14.z.literal("field")
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 = import_zod14.z.enum([
1406
+ var EventFieldId = import_zod15.z.enum([
1321
1407
  "trackingId",
1322
1408
  "status",
1323
- "legalStatus.REGISTERED.createdAt",
1324
- "legalStatus.REGISTERED.createdAtLocation",
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: import_zod14.z.literal("event")
1415
+ fieldType: import_zod15.z.literal("event")
1330
1416
  });
1331
- var SearchField = import_zod14.z.discriminatedUnion("fieldType", [
1417
+ var SearchField = import_zod15.z.discriminatedUnion("fieldType", [
1332
1418
  FieldConfigSchema,
1333
1419
  EventFieldConfigSchema
1334
1420
  ]);
1335
- var AdvancedSearchConfig = import_zod14.z.object({
1421
+ var AdvancedSearchConfig = import_zod15.z.object({
1336
1422
  title: TranslationConfig.describe("Advanced search tab title"),
1337
- fields: import_zod14.z.array(SearchField).describe("Advanced search 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 import_zod18 = require("zod");
1345
- var import_zod_openapi7 = require("zod-openapi");
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 import_zod15 = require("zod");
1350
- var UUID = import_zod15.z.string().uuid().brand("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 import_zod17 = require("zod");
1446
+ var import_zod18 = require("zod");
1361
1447
 
1362
1448
  // ../commons/src/scopes.ts
1363
- var import_zod16 = require("zod");
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 = import_zod16.z.union([
1477
- import_zod16.z.literal(SCOPES.NATLSYSADMIN),
1478
- import_zod16.z.literal(SCOPES.BYPASSRATELIMIT),
1479
- import_zod16.z.literal(SCOPES.DECLARE),
1480
- import_zod16.z.literal(SCOPES.REGISTER),
1481
- import_zod16.z.literal(SCOPES.VALIDATE),
1482
- import_zod16.z.literal(SCOPES.DEMO),
1483
- import_zod16.z.literal(SCOPES.CERTIFY),
1484
- import_zod16.z.literal(SCOPES.PERFORMANCE),
1485
- import_zod16.z.literal(SCOPES.SYSADMIN),
1486
- import_zod16.z.literal(SCOPES.TEAMS),
1487
- import_zod16.z.literal(SCOPES.CONFIG)
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 = import_zod16.z.union([
1490
- import_zod16.z.literal(SCOPES.WEBHOOK),
1491
- import_zod16.z.literal(SCOPES.NATIONALID),
1492
- import_zod16.z.literal(SCOPES.NOTIFICATION_API),
1493
- import_zod16.z.literal(SCOPES.RECORDSEARCH)
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 = import_zod16.z.union([
1496
- import_zod16.z.literal(SCOPES.RECORD_DECLARE),
1497
- import_zod16.z.literal(SCOPES.RECORD_IMPORT),
1498
- import_zod16.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
1499
- import_zod16.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
1500
- import_zod16.z.literal(SCOPES.RECORD_DECLARE_DEATH),
1501
- import_zod16.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
1502
- import_zod16.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
1503
- import_zod16.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
1504
- import_zod16.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
1505
- import_zod16.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW)
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 = import_zod16.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS);
1508
- var ValidateScopes = import_zod16.z.union([
1509
- import_zod16.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
1510
- import_zod16.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
1511
- import_zod16.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
1512
- import_zod16.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
1513
- import_zod16.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
1514
- import_zod16.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE)
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 = import_zod16.z.literal(SCOPES.RECORD_REGISTER);
1517
- var CertifyScopes = import_zod16.z.union([
1518
- import_zod16.z.literal(SCOPES.RECORD_EXPORT_RECORDS),
1519
- import_zod16.z.literal(SCOPES.RECORD_DECLARATION_PRINT),
1520
- import_zod16.z.literal(SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS),
1521
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_PRINT),
1522
- import_zod16.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
1523
- import_zod16.z.literal(SCOPES.RECORD_PRINT_CERTIFIED_COPIES),
1524
- import_zod16.z.literal(SCOPES.RECORD_BULK_PRINT_CERTIFIED_COPIES),
1525
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_VERIFY_CERTIFIED_COPIES)
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 = import_zod16.z.union([
1528
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
1529
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
1530
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REVOCATION),
1531
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_REVOKE),
1532
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REINSTATEMENT),
1533
- import_zod16.z.literal(SCOPES.RECORD_REGISTRATION_REINSTATE),
1534
- import_zod16.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
1535
- import_zod16.z.literal(SCOPES.RECORD_REJECT_REGISTRATION)
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 = import_zod16.z.union([
1538
- import_zod16.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
1539
- import_zod16.z.literal(SCOPES.SEARCH_BIRTH),
1540
- import_zod16.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
1541
- import_zod16.z.literal(SCOPES.SEARCH_DEATH),
1542
- import_zod16.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
1543
- import_zod16.z.literal(SCOPES.SEARCH_MARRIAGE)
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 = import_zod16.z.union([
1546
- import_zod16.z.literal(SCOPES.RECORD_READ),
1547
- import_zod16.z.literal(SCOPES.RECORD_READ_AUDIT),
1548
- import_zod16.z.literal(SCOPES.RECORD_READ_COMMENTS),
1549
- import_zod16.z.literal(SCOPES.RECORD_CREATE_COMMENTS)
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 = import_zod16.z.union([
1552
- import_zod16.z.literal(SCOPES.PROFILE_UPDATE),
1553
- import_zod16.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE)
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 = import_zod16.z.union([
1556
- import_zod16.z.literal(SCOPES.PERFORMANCE_READ),
1557
- import_zod16.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
1558
- import_zod16.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS)
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 = import_zod16.z.union([
1561
- import_zod16.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
1562
- import_zod16.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
1563
- import_zod16.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION)
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 = import_zod16.z.union([
1566
- import_zod16.z.literal(SCOPES.USER_READ),
1567
- import_zod16.z.literal(SCOPES.USER_READ_MY_OFFICE),
1568
- import_zod16.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
1569
- import_zod16.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
1570
- import_zod16.z.literal(SCOPES.USER_CREATE),
1571
- import_zod16.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
1572
- import_zod16.z.literal(SCOPES.USER_UPDATE),
1573
- import_zod16.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION)
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 = import_zod16.z.literal(SCOPES.CONFIG_UPDATE_ALL);
1576
- var DataSeedingScope = import_zod16.z.literal(SCOPES.USER_DATA_SEEDING);
1577
- var LiteralScopes = import_zod16.z.union([
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 = import_zod16.z.string().regex(rawConfigurableScopeRegex);
1597
- var CreateUserScope = import_zod16.z.object({
1598
- type: import_zod16.z.literal("user.create"),
1599
- options: import_zod16.z.object({
1600
- role: import_zod16.z.array(import_zod16.z.string())
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())
1687
+ })
1688
+ });
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())
1601
1693
  })
1602
1694
  });
1603
- var EditUserScope = import_zod16.z.object({
1604
- type: import_zod16.z.literal("user.edit"),
1605
- options: import_zod16.z.object({
1606
- role: import_zod16.z.array(import_zod16.z.string())
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())
1607
1699
  })
1608
1700
  });
1609
- var WorkqueueScope = import_zod16.z.object({
1610
- type: import_zod16.z.literal("workqueue"),
1611
- options: import_zod16.z.object({
1612
- id: import_zod16.z.array(import_zod16.z.string())
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())
1613
1705
  })
1614
1706
  });
1615
- var NotifyRecordScope = import_zod16.z.object({
1616
- type: import_zod16.z.literal("record.notify"),
1617
- options: import_zod16.z.object({
1618
- event: import_zod16.z.array(import_zod16.z.string())
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)
1619
1712
  })
1620
1713
  });
1621
- var ConfigurableScopes = import_zod16.z.discriminatedUnion("type", [
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 = import_zod16.z.union([
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 = import_zod17.z.enum(["user", "system"]);
1780
- var TokenWithBearer = import_zod17.z.string().regex(/^Bearer\s/);
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, import_zod_openapi7.extendZodWithOpenApi)(import_zod18.z);
1784
- var ActionUpdate = import_zod18.z.record(import_zod18.z.string(), FieldUpdateValue);
1785
- var EventState = import_zod18.z.record(import_zod18.z.string(), FieldValue);
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 = import_zod18.z.object({
1885
+ var ActionBase = import_zod19.z.object({
1792
1886
  id: UUID,
1793
- transactionId: import_zod18.z.string(),
1887
+ transactionId: import_zod19.z.string(),
1794
1888
  createdByUserType: TokenUserType,
1795
- createdAt: import_zod18.z.string().datetime(),
1796
- createdBy: import_zod18.z.string(),
1797
- createdByRole: import_zod18.z.string(),
1798
- createdBySignature: import_zod18.z.string().nullish().describe("Reference to signature of the user who created the action"),
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: import_zod18.z.enum([
1896
+ status: import_zod19.z.enum([
1803
1897
  ActionStatus.Requested,
1804
1898
  ActionStatus.Accepted,
1805
1899
  ActionStatus.Rejected
@@ -1810,91 +1904,91 @@ var ActionBase = import_zod18.z.object({
1810
1904
  )
1811
1905
  });
1812
1906
  var AssignedAction = ActionBase.merge(
1813
- import_zod18.z.object({
1814
- type: import_zod18.z.literal(ActionType.ASSIGN),
1815
- assignedTo: import_zod18.z.string()
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
- import_zod18.z.object({
1820
- type: import_zod18.z.literal(ActionType.UNASSIGN)
1913
+ import_zod19.z.object({
1914
+ type: import_zod19.z.literal(ActionType.UNASSIGN)
1821
1915
  })
1822
1916
  );
1823
1917
  var RegisterAction = ActionBase.merge(
1824
- import_zod18.z.object({
1825
- type: import_zod18.z.literal(ActionType.REGISTER),
1826
- registrationNumber: import_zod18.z.string().optional()
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
- import_zod18.z.object({
1831
- type: import_zod18.z.literal(ActionType.DECLARE)
1924
+ import_zod19.z.object({
1925
+ type: import_zod19.z.literal(ActionType.DECLARE)
1832
1926
  })
1833
1927
  );
1834
1928
  var ValidateAction = ActionBase.merge(
1835
- import_zod18.z.object({
1836
- type: import_zod18.z.literal(ActionType.VALIDATE)
1929
+ import_zod19.z.object({
1930
+ type: import_zod19.z.literal(ActionType.VALIDATE)
1837
1931
  })
1838
1932
  );
1839
- var RejectionReason = import_zod18.z.object({
1840
- message: import_zod18.z.string().min(1, { message: "Message cannot be empty" }).describe("Message describing reason for rejection or archiving"),
1841
- isDuplicate: import_zod18.z.boolean().optional().describe("If a declaration is duplicated")
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
- import_zod18.z.object({
1845
- type: import_zod18.z.literal(ActionType.REJECT),
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
- import_zod18.z.object({
1851
- type: import_zod18.z.literal(ActionType.MARKED_AS_DUPLICATE)
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
- import_zod18.z.object({
1856
- type: import_zod18.z.literal(ActionType.ARCHIVE),
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
- import_zod18.z.object({
1862
- type: import_zod18.z.literal(ActionType.CREATE)
1955
+ import_zod19.z.object({
1956
+ type: import_zod19.z.literal(ActionType.CREATE)
1863
1957
  })
1864
1958
  );
1865
1959
  var NotifiedAction = ActionBase.merge(
1866
- import_zod18.z.object({
1867
- type: import_zod18.z.literal(ActionType.NOTIFY)
1960
+ import_zod19.z.object({
1961
+ type: import_zod19.z.literal(ActionType.NOTIFY)
1868
1962
  })
1869
1963
  );
1870
1964
  var PrintCertificateAction = ActionBase.merge(
1871
- import_zod18.z.object({
1872
- type: import_zod18.z.literal(ActionType.PRINT_CERTIFICATE)
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
- import_zod18.z.object({
1877
- type: import_zod18.z.literal(ActionType.REQUEST_CORRECTION)
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
- import_zod18.z.object({
1882
- type: import_zod18.z.literal(ActionType.APPROVE_CORRECTION),
1883
- requestId: import_zod18.z.string()
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
- import_zod18.z.object({
1888
- type: import_zod18.z.literal(ActionType.REJECT_CORRECTION),
1889
- requestId: import_zod18.z.string()
1981
+ import_zod19.z.object({
1982
+ type: import_zod19.z.literal(ActionType.REJECT_CORRECTION),
1983
+ requestId: import_zod19.z.string()
1890
1984
  })
1891
1985
  );
1892
1986
  var ReadAction = ActionBase.merge(
1893
- import_zod18.z.object({
1894
- type: import_zod18.z.literal(ActionType.READ)
1987
+ import_zod19.z.object({
1988
+ type: import_zod19.z.literal(ActionType.READ)
1895
1989
  })
1896
1990
  );
1897
- var ActionDocument = import_zod18.z.discriminatedUnion("type", [
1991
+ var ActionDocument = import_zod19.z.discriminatedUnion("type", [
1898
1992
  CreatedAction.openapi({ ref: "CreatedAction" }),
1899
1993
  ValidateAction.openapi({ ref: "ValidateAction" }),
1900
1994
  RejectAction.openapi({ ref: "RejectAction" }),
@@ -1917,20 +2011,20 @@ var AsyncRejectActionDocument = ActionBase.omit({
1917
2011
  declaration: true,
1918
2012
  annotation: true
1919
2013
  }).merge(
1920
- import_zod18.z.object({
1921
- type: import_zod18.z.enum(ConfirmableActions),
1922
- status: import_zod18.z.literal(ActionStatus.Rejected)
2014
+ import_zod19.z.object({
2015
+ type: import_zod19.z.enum(ConfirmableActions),
2016
+ status: import_zod19.z.literal(ActionStatus.Rejected)
1923
2017
  })
1924
2018
  );
1925
- var Action = import_zod18.z.union([ActionDocument, AsyncRejectActionDocument]);
1926
- var ResolvedUser = import_zod18.z.object({
1927
- id: import_zod18.z.string(),
1928
- role: import_zod18.z.string(),
1929
- name: import_zod18.z.array(
1930
- import_zod18.z.object({
1931
- use: import_zod18.z.string(),
1932
- given: import_zod18.z.array(import_zod18.z.string()),
1933
- family: import_zod18.z.string()
2019
+ var Action = import_zod19.z.union([ActionDocument, AsyncRejectActionDocument]);
2020
+ var ResolvedUser = import_zod19.z.object({
2021
+ id: import_zod19.z.string(),
2022
+ role: import_zod19.z.string(),
2023
+ name: import_zod19.z.array(
2024
+ import_zod19.z.object({
2025
+ use: import_zod19.z.string(),
2026
+ given: import_zod19.z.array(import_zod19.z.string()),
2027
+ family: import_zod19.z.string()
1934
2028
  })
1935
2029
  )
1936
2030
  });
@@ -1941,19 +2035,25 @@ var import_ajv_formats = __toESM(require("ajv-formats"));
1941
2035
  var import_date_fns = require("date-fns");
1942
2036
 
1943
2037
  // ../commons/src/events/FieldTypeMapping.ts
1944
- var import_zod19 = require("zod");
2038
+ var import_zod20 = require("zod");
1945
2039
  function mapFieldTypeToZod(type, required) {
1946
2040
  let schema;
1947
2041
  switch (type) {
1948
2042
  case FieldType.DATE:
1949
2043
  schema = DateValue;
1950
2044
  break;
2045
+ case FieldType.TIME:
2046
+ schema = TimeValue;
2047
+ break;
1951
2048
  case FieldType.EMAIL:
1952
2049
  schema = EmailValue;
1953
2050
  break;
1954
2051
  case FieldType.DATE_RANGE:
1955
2052
  schema = DateRangeFieldValue;
1956
2053
  break;
2054
+ case FieldType.SELECT_DATE_RANGE:
2055
+ schema = SelectDateRangeValue;
2056
+ break;
1957
2057
  case FieldType.TEXT:
1958
2058
  case FieldType.TEXTAREA:
1959
2059
  case FieldType.DIVIDER:
@@ -2001,7 +2101,7 @@ function createValidationSchema(config) {
2001
2101
  for (const field2 of config) {
2002
2102
  shape[field2.id] = mapFieldTypeToZod(field2.type, field2.required);
2003
2103
  }
2004
- return import_zod19.z.object(shape);
2104
+ return import_zod20.z.object(shape);
2005
2105
  }
2006
2106
  function mapFieldTypeToEmptyValue(field2) {
2007
2107
  switch (field2.type) {
@@ -2021,8 +2121,10 @@ function mapFieldTypeToEmptyValue(field2) {
2021
2121
  case FieldType.NUMBER:
2022
2122
  case FieldType.EMAIL:
2023
2123
  case FieldType.DATE:
2124
+ case FieldType.TIME:
2024
2125
  case FieldType.CHECKBOX:
2025
2126
  case FieldType.DATE_RANGE:
2127
+ case FieldType.SELECT_DATE_RANGE:
2026
2128
  case FieldType.DATA:
2027
2129
  case FieldType.NAME:
2028
2130
  case FieldType.PHONE:
@@ -2045,7 +2147,7 @@ function mapFieldTypeToEmptyValue(field2) {
2045
2147
  case FieldType.SIGNATURE:
2046
2148
  case FieldType.FILE:
2047
2149
  return {
2048
- filename: "",
2150
+ path: "",
2049
2151
  originalFilename: "",
2050
2152
  type: ""
2051
2153
  };
@@ -2059,9 +2161,15 @@ var isParagraphFieldType = (field2) => {
2059
2161
  var isDateFieldType = (field2) => {
2060
2162
  return field2.config.type === FieldType.DATE;
2061
2163
  };
2164
+ var isTimeFieldType = (field2) => {
2165
+ return field2.config.type === FieldType.TIME;
2166
+ };
2062
2167
  var isDateRangeFieldType = (field2) => {
2063
2168
  return field2.config.type === FieldType.DATE_RANGE;
2064
2169
  };
2170
+ var isSelectDateRangeFieldType = (field2) => {
2171
+ return field2.config.type === FieldType.SELECT_DATE_RANGE;
2172
+ };
2065
2173
  var isPageHeaderFieldType = (field2) => {
2066
2174
  return field2.config.type === FieldType.PAGE_HEADER;
2067
2175
  };
@@ -2141,6 +2249,29 @@ var ajv = new import_ajv.default({
2141
2249
  allowUnionTypes: true
2142
2250
  });
2143
2251
  (0, import_ajv_formats.default)(ajv);
2252
+ ajv.addKeyword({
2253
+ keyword: "daysFromNow",
2254
+ type: "string",
2255
+ schemaType: "object",
2256
+ $data: true,
2257
+ errors: true,
2258
+ validate(schema, data, _, dataContext) {
2259
+ if (!(dataContext && dataContext.rootData && typeof dataContext.rootData === "object" && "$now" in dataContext.rootData && typeof dataContext.rootData.$now === "string")) {
2260
+ throw new Error("Validation context must contain $now");
2261
+ }
2262
+ const { days, clause } = schema;
2263
+ if (typeof data !== "string") {
2264
+ return false;
2265
+ }
2266
+ const date = new Date(data);
2267
+ if (isNaN(date.getTime())) {
2268
+ return false;
2269
+ }
2270
+ const now = new Date(dataContext.rootData.$now);
2271
+ const offsetDate = new Date(now.getTime() + days * 24 * 60 * 60 * 1e3);
2272
+ return clause === "after" ? (0, import_date_fns.isAfter)(date, offsetDate) : (0, import_date_fns.isBefore)(date, offsetDate);
2273
+ }
2274
+ });
2144
2275
  function validate(schema, data) {
2145
2276
  return ajv.validate(schema, data);
2146
2277
  }
@@ -2206,7 +2337,7 @@ var errorMessages = {
2206
2337
  id: "v2.error.invalidEmail"
2207
2338
  },
2208
2339
  requiredField: {
2209
- defaultMessage: "Required for registration",
2340
+ defaultMessage: "Required",
2210
2341
  description: "Error message when required field is missing",
2211
2342
  id: "v2.error.required"
2212
2343
  },
@@ -2219,6 +2350,11 @@ var errorMessages = {
2219
2350
  defaultMessage: "Unexpected field",
2220
2351
  description: "Error message when field is not expected",
2221
2352
  id: "v2.error.unexpectedField"
2353
+ },
2354
+ correctionNotAllowed: {
2355
+ defaultMessage: "Correction not allowed for field",
2356
+ description: "Error message when correction is not allowed for field",
2357
+ id: "v2.error.correctionNotAllowed"
2222
2358
  }
2223
2359
  };
2224
2360
  function createIntlError(message) {
@@ -2279,13 +2415,8 @@ function validateFieldInput({
2279
2415
  field: field2,
2280
2416
  value
2281
2417
  }) {
2282
- const rawError = mapFieldTypeToZod(field2.type, field2.required).safeParse(
2283
- value,
2284
- {
2285
- // @ts-expect-error
2286
- errorMap: zodToIntlErrorMap
2287
- }
2288
- );
2418
+ const zodType = mapFieldTypeToZod(field2.type, field2.required);
2419
+ const rawError = zodType.safeParse(value, { errorMap: zodToIntlErrorMap });
2289
2420
  return rawError.error?.issues.map((issue) => issue.message) ?? [];
2290
2421
  }
2291
2422
  function runFieldValidations({
@@ -2366,6 +2497,7 @@ function joinValues(values, separator = " ") {
2366
2497
  }
2367
2498
 
2368
2499
  // ../commons/src/events/utils.ts
2500
+ var import_date_fns2 = require("date-fns");
2369
2501
  function isDeclarationActionConfig(action) {
2370
2502
  return DeclarationActions.safeParse(action.type).success;
2371
2503
  }
@@ -2378,12 +2510,18 @@ function getDeclarationPages(configuration) {
2378
2510
  function getDeclaration(configuration) {
2379
2511
  return configuration.declaration;
2380
2512
  }
2513
+ function getPrintCertificatePages(configuration) {
2514
+ const action = configuration.actions.find(
2515
+ (a) => a.type === ActionType.PRINT_CERTIFICATE
2516
+ );
2517
+ return getOrThrow(
2518
+ action?.printForm.pages,
2519
+ `${ActionType.PRINT_CERTIFICATE} action does not have print form set.`
2520
+ );
2521
+ }
2381
2522
  var getActionAnnotationFields = (actionConfig) => {
2382
2523
  if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
2383
- return [
2384
- ...actionConfig.onboardingForm.flatMap(({ fields }) => fields),
2385
- ...actionConfig.additionalDetailsForm.flatMap(({ fields }) => fields)
2386
- ];
2524
+ return actionConfig.correctionForm.pages.flatMap(({ fields }) => fields);
2387
2525
  }
2388
2526
  if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
2389
2527
  return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
@@ -2406,7 +2544,7 @@ function getDeclarationFieldById(config, fieldId) {
2406
2544
  var findRecordActionPages = (config, actionType) => {
2407
2545
  const action = config.actions.find((a) => a.type === actionType);
2408
2546
  if (action?.type === ActionType.REQUEST_CORRECTION) {
2409
- return [...action.onboardingForm, ...action.additionalDetailsForm];
2547
+ return action.correctionForm.pages;
2410
2548
  }
2411
2549
  if (action?.type === ActionType.PRINT_CERTIFICATE) {
2412
2550
  return action.printForm.pages;
@@ -2480,13 +2618,10 @@ function getVisibleVerificationPageIds(pages, annotation) {
2480
2618
  }
2481
2619
  function getActionVerificationPageIds(actionConfig, annotation) {
2482
2620
  if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
2483
- return [
2484
- ...getVisibleVerificationPageIds(actionConfig.onboardingForm, annotation),
2485
- ...getVisibleVerificationPageIds(
2486
- actionConfig.additionalDetailsForm,
2487
- annotation
2488
- )
2489
- ];
2621
+ return getVisibleVerificationPageIds(
2622
+ actionConfig.correctionForm.pages,
2623
+ annotation
2624
+ );
2490
2625
  }
2491
2626
  if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
2492
2627
  return getVisibleVerificationPageIds(
@@ -2565,12 +2700,33 @@ function getEventConfigById(eventConfigs, id) {
2565
2700
  );
2566
2701
  return getOrThrow(eventConfig, `Event config for ${id} not found`);
2567
2702
  }
2703
+ function timePeriodToDateRange(value) {
2704
+ let startDate;
2705
+ switch (value) {
2706
+ case "last7Days":
2707
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 6);
2708
+ break;
2709
+ case "last30Days":
2710
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 29);
2711
+ break;
2712
+ case "last90Days":
2713
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 89);
2714
+ break;
2715
+ case "last365Days":
2716
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 364);
2717
+ break;
2718
+ }
2719
+ return {
2720
+ startDate: startDate.toISOString(),
2721
+ endDate: (/* @__PURE__ */ new Date()).toISOString()
2722
+ };
2723
+ }
2568
2724
 
2569
2725
  // ../commons/src/events/EventConfig.ts
2570
- var import_zod_openapi8 = require("zod-openapi");
2571
- (0, import_zod_openapi8.extendZodWithOpenApi)(import_zod20.z);
2572
- var EventConfig = import_zod20.z.object({
2573
- id: import_zod20.z.string().describe(
2726
+ var import_zod_openapi9 = require("zod-openapi");
2727
+ (0, import_zod_openapi9.extendZodWithOpenApi)(import_zod21.z);
2728
+ var EventConfig = import_zod21.z.object({
2729
+ id: import_zod21.z.string().describe(
2574
2730
  'A machine-readable identifier for the event, e.g. "birth" or "death"'
2575
2731
  ),
2576
2732
  dateOfEvent: FieldReference.optional(),
@@ -2580,10 +2736,10 @@ var EventConfig = import_zod20.z.object({
2580
2736
  ),
2581
2737
  summary: SummaryConfig,
2582
2738
  label: TranslationConfig,
2583
- actions: import_zod20.z.array(ActionConfig),
2739
+ actions: import_zod21.z.array(ActionConfig),
2584
2740
  declaration: DeclarationFormConfig,
2585
- deduplication: import_zod20.z.array(DeduplicationConfig).optional().default([]),
2586
- advancedSearch: import_zod20.z.array(AdvancedSearchConfig).optional().default([])
2741
+ deduplication: import_zod21.z.array(DeduplicationConfig).optional().default([]),
2742
+ advancedSearch: import_zod21.z.array(AdvancedSearchConfig).optional().default([])
2587
2743
  }).superRefine((event2, ctx) => {
2588
2744
  const allFields = findAllFields(event2);
2589
2745
  const fieldIds = allFields.map((field2) => field2.id);
@@ -2615,6 +2771,28 @@ var EventConfig = import_zod20.z.object({
2615
2771
  path: ["advancedSearch"]
2616
2772
  });
2617
2773
  }
2774
+ event2.advancedSearch.forEach((section, sectionIndex) => {
2775
+ section.fields.forEach((field2, fieldIndex) => {
2776
+ if ("alternateFieldIds" in field2 && Array.isArray(field2.alternateFieldIds)) {
2777
+ const invalidAltIds = field2.alternateFieldIds.filter(
2778
+ (id) => !fieldIds.includes(id)
2779
+ );
2780
+ if (invalidAltIds.length > 0) {
2781
+ ctx.addIssue({
2782
+ code: "custom",
2783
+ message: `Invalid alternateFieldIds: ${invalidAltIds.join(", ")}`,
2784
+ path: [
2785
+ "advancedSearch",
2786
+ sectionIndex,
2787
+ "fields",
2788
+ fieldIndex,
2789
+ "alternateFieldIds"
2790
+ ]
2791
+ });
2792
+ }
2793
+ }
2794
+ });
2795
+ });
2618
2796
  if (event2.dateOfEvent) {
2619
2797
  const eventDateFieldId = getDeclarationFields(event2).find(
2620
2798
  ({ id }) => id === event2.dateOfEvent?.$$field
@@ -2645,16 +2823,17 @@ var definePage = (page) => PageConfig.parse(page);
2645
2823
  var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
2646
2824
 
2647
2825
  // ../commons/src/events/WorkqueueConfig.ts
2648
- var import_zod27 = require("zod");
2826
+ var import_zod28 = require("zod");
2649
2827
 
2650
2828
  // ../commons/src/events/serializers/user/serializer.ts
2651
- var import_zod21 = require("zod");
2652
- var SerializedUserField = import_zod21.z.object({
2653
- $userField: import_zod21.z.enum([
2829
+ var import_zod22 = require("zod");
2830
+ var SerializedUserField = import_zod22.z.object({
2831
+ $userField: import_zod22.z.enum([
2654
2832
  "id",
2655
2833
  "name",
2656
2834
  "role",
2657
- "signatureFilename",
2835
+ "signature",
2836
+ "avatar",
2658
2837
  "primaryOfficeId"
2659
2838
  ])
2660
2839
  });
@@ -2726,41 +2905,6 @@ var user = Object.assign(userSerializer, {
2726
2905
  required: ["$user"]
2727
2906
  })
2728
2907
  });
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
2908
  function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
2765
2909
  return {
2766
2910
  type: "object",
@@ -2779,6 +2923,20 @@ function isFieldReference(value) {
2779
2923
  return typeof value === "object" && value !== null && "$$field" in value;
2780
2924
  }
2781
2925
  function createFieldConditionals(fieldId) {
2926
+ const getDayRange = (days, clause) => ({
2927
+ type: "object",
2928
+ properties: {
2929
+ [fieldId]: {
2930
+ type: "string",
2931
+ format: "date",
2932
+ daysFromNow: {
2933
+ days,
2934
+ clause
2935
+ }
2936
+ }
2937
+ },
2938
+ required: [fieldId]
2939
+ });
2782
2940
  const getDateRange = (date, clause) => ({
2783
2941
  type: "object",
2784
2942
  properties: {
@@ -2797,12 +2955,8 @@ function createFieldConditionals(fieldId) {
2797
2955
  $$field: fieldId,
2798
2956
  isAfter: () => ({
2799
2957
  days: (days) => ({
2800
- inPast: () => defineFormConditional(
2801
- getDateRange(getDateFromNow(days), "formatMinimum")
2802
- ),
2803
- inFuture: () => defineFormConditional(
2804
- getDateRange(getDateFromNow(-days), "formatMinimum")
2805
- )
2958
+ inPast: () => defineFormConditional(getDayRange(-days, "after")),
2959
+ inFuture: () => defineFormConditional(getDayRange(days, "after"))
2806
2960
  }),
2807
2961
  date: (date) => {
2808
2962
  if (isFieldReference(date)) {
@@ -2817,16 +2971,12 @@ function createFieldConditionals(fieldId) {
2817
2971
  }
2818
2972
  return defineFormConditional(getDateRange(date, "formatMinimum"));
2819
2973
  },
2820
- now: () => defineFormConditional(getDateRange(getDateFromNow(0), "formatMinimum"))
2974
+ now: () => defineFormConditional(getDateRange({ $data: "/$now" }, "formatMinimum"))
2821
2975
  }),
2822
2976
  isBefore: () => ({
2823
2977
  days: (days) => ({
2824
- inPast: () => defineFormConditional(
2825
- getDateRange(getDateFromNow(days), "formatMaximum")
2826
- ),
2827
- inFuture: () => defineFormConditional(
2828
- getDateRange(getDateFromNow(-days), "formatMaximum")
2829
- )
2978
+ inPast: () => defineFormConditional(getDayRange(days, "before")),
2979
+ inFuture: () => defineFormConditional(getDayRange(-days, "before"))
2830
2980
  }),
2831
2981
  date: (date) => {
2832
2982
  if (isFieldReference(date)) {
@@ -2841,7 +2991,7 @@ function createFieldConditionals(fieldId) {
2841
2991
  }
2842
2992
  return defineFormConditional(getDateRange(date, "formatMaximum"));
2843
2993
  },
2844
- now: () => defineFormConditional(getDateRange(getDateFromNow(0), "formatMaximum"))
2994
+ now: () => defineFormConditional(getDateRange({ $data: "/$now" }, "formatMaximum"))
2845
2995
  }),
2846
2996
  isEqualTo: (value) => {
2847
2997
  if (isFieldReference(value)) {
@@ -2933,8 +3083,7 @@ function createFieldConditionals(fieldId) {
2933
3083
  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
3084
  description: "Name must contain only letters, numbers, and allowed special characters ('._-). No double spaces."
2935
3085
  }
2936
- },
2937
- required: [fieldId]
3086
+ }
2938
3087
  }),
2939
3088
  /**
2940
3089
  * Checks if the field value matches a given regular expression pattern.
@@ -2990,7 +3139,7 @@ function createSearchConfig(baseField) {
2990
3139
  *
2991
3140
  * @returns An object containing the field ID and a configuration object with a type of 'range'.
2992
3141
  *
2993
- * @example event('legalStatus.REGISTERED.createdAt').range()
3142
+ * @example event('legalStatuses.REGISTERED.acceptedAt').range()
2994
3143
  * // {
2995
3144
  * // ...
2996
3145
  * // config: { type: 'range' }
@@ -3030,21 +3179,47 @@ function createSearchConfig(baseField) {
3030
3179
  }
3031
3180
 
3032
3181
  // ../commons/src/event-config/event-configuration.ts
3033
- function createEventFieldConfig(fieldId, options) {
3182
+ function createEventFieldConfig(fieldId) {
3034
3183
  const baseField = {
3035
3184
  fieldId,
3036
- options,
3037
3185
  fieldType: "event"
3038
3186
  };
3039
3187
  return createSearchConfig(baseField);
3040
3188
  }
3041
3189
 
3042
3190
  // ../commons/src/events/event.ts
3043
- function eventFn(fieldId, options) {
3044
- return createEventFieldConfig(fieldId, options);
3191
+ function eventFn(fieldId) {
3192
+ return createEventFieldConfig(fieldId);
3045
3193
  }
3046
3194
  var event = Object.assign(eventFn, {
3047
- ...createEventConditionals(),
3195
+ /**
3196
+ * Checks if the event contains a specific action type.
3197
+ * @param action - The action type to check for.
3198
+ */
3199
+ hasAction: (action) => defineConditional({
3200
+ type: "object",
3201
+ properties: {
3202
+ $event: {
3203
+ type: "object",
3204
+ properties: {
3205
+ actions: {
3206
+ type: "array",
3207
+ contains: {
3208
+ type: "object",
3209
+ properties: {
3210
+ type: {
3211
+ const: action
3212
+ }
3213
+ },
3214
+ required: ["type"]
3215
+ }
3216
+ }
3217
+ },
3218
+ required: ["actions"]
3219
+ }
3220
+ },
3221
+ required: ["$event"]
3222
+ }),
3048
3223
  field(field2) {
3049
3224
  return {
3050
3225
  $event: field2
@@ -3053,83 +3228,83 @@ var event = Object.assign(eventFn, {
3053
3228
  });
3054
3229
 
3055
3230
  // ../commons/src/events/WorkqueueColumnConfig.ts
3056
- var import_zod23 = require("zod");
3231
+ var import_zod24 = require("zod");
3057
3232
 
3058
3233
  // ../commons/src/events/EventMetadata.ts
3059
- var import_zod22 = require("zod");
3060
- var EventStatus = import_zod22.z.enum([
3234
+ var import_zod23 = require("zod");
3235
+ var EventStatus = import_zod23.z.enum([
3061
3236
  "CREATED",
3062
3237
  "NOTIFIED",
3063
3238
  "DECLARED",
3064
3239
  "VALIDATED",
3065
3240
  "REGISTERED",
3066
3241
  "CERTIFIED",
3067
- "REJECTED",
3068
3242
  "ARCHIVED"
3069
3243
  ]);
3244
+ var VisibleStatus = import_zod23.z.enum([...EventStatus.options, "REJECTED"]);
3070
3245
  var InherentFlags = {
3071
3246
  PRINTED: "printed",
3072
3247
  INCOMPLETE: "incomplete",
3073
3248
  REJECTED: "rejected",
3074
3249
  CORRECTION_REQUESTED: "correction-requested"
3075
3250
  };
3076
- var Flag = import_zod22.z.string().regex(
3251
+ var Flag = import_zod23.z.string().regex(
3077
3252
  new RegExp(
3078
3253
  `^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
3079
3254
  ActionStatus
3080
3255
  ).join("|").toLowerCase()})$`
3081
3256
  ),
3082
3257
  "Flag must be in the format ActionType:ActionStatus (lowerCase)"
3083
- ).or(import_zod22.z.nativeEnum(InherentFlags));
3084
- var ZodDate = import_zod22.z.string().date();
3085
- var ActionCreationMetadata = import_zod22.z.object({
3086
- createdAt: import_zod22.z.string().datetime().describe("The timestamp when the action request was created."),
3087
- createdBy: import_zod22.z.string().describe("ID of the user who created the action request."),
3258
+ ).or(import_zod23.z.nativeEnum(InherentFlags));
3259
+ var ZodDate = import_zod23.z.string().date();
3260
+ var ActionCreationMetadata = import_zod23.z.object({
3261
+ createdAt: import_zod23.z.string().datetime().describe("The timestamp when the action request was created."),
3262
+ createdBy: import_zod23.z.string().describe("ID of the user who created the action request."),
3088
3263
  createdAtLocation: CreatedAtLocation.describe(
3089
3264
  "Location of the user who created the action request."
3090
3265
  ),
3091
- createdByUserType: import_zod22.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
3092
- acceptedAt: import_zod22.z.string().datetime().describe("Timestamp when the action request was accepted."),
3093
- createdByRole: import_zod22.z.string().describe("Role of the user at the time of action request creation."),
3094
- createdBySignature: import_zod22.z.string().nullish().describe("Signature of the user who created the action request.")
3266
+ createdByUserType: import_zod23.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
3267
+ acceptedAt: import_zod23.z.string().datetime().describe("Timestamp when the action request was accepted."),
3268
+ createdByRole: import_zod23.z.string().describe("Role of the user at the time of action request creation."),
3269
+ createdBySignature: import_zod23.z.string().nullish().describe("Signature of the user who created the action request.")
3095
3270
  });
3096
3271
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
3097
- registrationNumber: import_zod22.z.string().describe(
3272
+ registrationNumber: import_zod23.z.string().describe(
3098
3273
  "Registration number of the event. Always present for accepted registrations."
3099
3274
  )
3100
3275
  });
3101
- var LegalStatuses = import_zod22.z.object({
3276
+ var LegalStatuses = import_zod23.z.object({
3102
3277
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
3103
3278
  [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
3104
3279
  });
3105
- var EventMetadata = import_zod22.z.object({
3280
+ var EventMetadata = import_zod23.z.object({
3106
3281
  id: UUID,
3107
- type: import_zod22.z.string().describe("The type of event, such as birth, death, or marriage."),
3282
+ type: import_zod23.z.string().describe("The type of event, such as birth, death, or marriage."),
3108
3283
  status: EventStatus,
3109
3284
  legalStatuses: LegalStatuses.describe(
3110
3285
  "Metadata related to the legal registration of the event, such as who registered it and when."
3111
3286
  ),
3112
- createdAt: import_zod22.z.string().datetime().describe("The timestamp when the event was first created and saved."),
3287
+ createdAt: import_zod23.z.string().datetime().describe("The timestamp when the event was first created and saved."),
3113
3288
  dateOfEvent: ZodDate.nullish(),
3114
- createdBy: import_zod22.z.string().describe("ID of the user who created the event."),
3115
- createdByUserType: import_zod22.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
3116
- updatedByUserRole: import_zod22.z.string().describe("Role of the user who last changed the status."),
3289
+ createdBy: import_zod23.z.string().describe("ID of the user who created the event."),
3290
+ createdByUserType: import_zod23.z.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
3291
+ updatedByUserRole: import_zod23.z.string().describe("Role of the user who last changed the status."),
3117
3292
  createdAtLocation: CreatedAtLocation.describe(
3118
3293
  "Location of the user who created the event."
3119
3294
  ),
3120
- createdBySignature: import_zod22.z.string().nullish().describe("Signature of the user who created the event."),
3295
+ createdBySignature: import_zod23.z.string().nullish().describe("Signature of the user who created the event."),
3121
3296
  updatedAtLocation: UUID.nullish().describe(
3122
3297
  "Location of the user who last changed the status."
3123
3298
  ),
3124
- updatedAt: import_zod22.z.string().datetime().describe(
3299
+ updatedAt: import_zod23.z.string().datetime().describe(
3125
3300
  "Timestamp of the most recent *accepted* status change. Possibly 3rd party update, if action is validation asynchronously."
3126
3301
  ),
3127
- assignedTo: import_zod22.z.string().nullish().describe("ID of the user currently assigned to the event."),
3128
- updatedBy: import_zod22.z.string().nullish().describe("ID of the user who last changed the status."),
3129
- trackingId: import_zod22.z.string().describe(
3302
+ assignedTo: import_zod23.z.string().nullish().describe("ID of the user currently assigned to the event."),
3303
+ updatedBy: import_zod23.z.string().nullish().describe("ID of the user who last changed the status."),
3304
+ trackingId: import_zod23.z.string().describe(
3130
3305
  "System-generated tracking ID used by informants or registrars to look up the event."
3131
3306
  ),
3132
- flags: import_zod22.z.array(Flag)
3307
+ flags: import_zod23.z.array(Flag)
3133
3308
  });
3134
3309
  var EventMetadataKeysArray = [
3135
3310
  "id",
@@ -3149,7 +3324,7 @@ var EventMetadataKeysArray = [
3149
3324
  "legalStatuses",
3150
3325
  "flags"
3151
3326
  ];
3152
- var EventMetadataKeys = import_zod22.z.enum(EventMetadataKeysArray);
3327
+ var EventMetadataKeys = import_zod23.z.enum(EventMetadataKeysArray);
3153
3328
  var eventMetadataLabelMap = {
3154
3329
  "event.assignedTo": {
3155
3330
  id: "event.assignedTo.label",
@@ -3234,11 +3409,11 @@ var WorkqueueColumnKeysArray = [
3234
3409
  "title",
3235
3410
  "outbox"
3236
3411
  ];
3237
- var WorkqueueColumnKeys = import_zod23.z.enum(WorkqueueColumnKeysArray);
3238
- var WorkqueueColumnValue = import_zod23.z.object({
3412
+ var WorkqueueColumnKeys = import_zod24.z.enum(WorkqueueColumnKeysArray);
3413
+ var WorkqueueColumnValue = import_zod24.z.object({
3239
3414
  $event: WorkqueueColumnKeys
3240
3415
  });
3241
- var WorkqueueColumn = import_zod23.z.object({
3416
+ var WorkqueueColumn = import_zod24.z.object({
3242
3417
  label: TranslationConfig,
3243
3418
  value: WorkqueueColumnValue
3244
3419
  });
@@ -3249,115 +3424,127 @@ function defineWorkqueuesColumns(workqueueColumns) {
3249
3424
  }
3250
3425
 
3251
3426
  // ../commons/src/events/CountryConfigQueryInput.ts
3252
- var import_zod25 = require("zod");
3427
+ var import_zod26 = require("zod");
3253
3428
 
3254
3429
  // ../commons/src/events/EventIndex.ts
3255
- var import_zod24 = require("zod");
3256
- var import_zod_openapi9 = require("zod-openapi");
3257
- (0, import_zod_openapi9.extendZodWithOpenApi)(import_zod24.z);
3430
+ var import_zod25 = require("zod");
3431
+ var import_zod_openapi10 = require("zod-openapi");
3432
+ (0, import_zod_openapi10.extendZodWithOpenApi)(import_zod25.z);
3258
3433
  var EventIndex = EventMetadata.extend({
3259
3434
  declaration: EventState
3260
3435
  }).openapi({
3261
3436
  ref: "EventIndex"
3262
3437
  });
3263
- var EventSearchIndex = import_zod24.z.record(import_zod24.z.string(), import_zod24.z.any()).and(
3264
- import_zod24.z.object({
3265
- type: import_zod24.z.string()
3438
+ var EventSearchIndex = import_zod25.z.record(import_zod25.z.string(), import_zod25.z.any()).and(
3439
+ import_zod25.z.object({
3440
+ type: import_zod25.z.string()
3266
3441
  // Ensures "type" (event-id) exists and is a string
3267
3442
  })
3268
3443
  ).openapi({
3269
3444
  ref: "EventSearchIndex"
3270
3445
  });
3271
- var Fuzzy = import_zod24.z.object({ type: import_zod24.z.literal("fuzzy"), term: import_zod24.z.string() }).openapi({
3446
+ var Fuzzy = import_zod25.z.object({ type: import_zod25.z.literal("fuzzy"), term: import_zod25.z.string() }).openapi({
3272
3447
  ref: "Fuzzy"
3273
3448
  });
3274
- var Exact = import_zod24.z.object({ type: import_zod24.z.literal("exact"), term: import_zod24.z.string() }).openapi({
3449
+ var Exact = import_zod25.z.object({ type: import_zod25.z.literal("exact"), term: import_zod25.z.string() }).openapi({
3275
3450
  ref: "Exact"
3276
3451
  });
3277
- var ExactStatus = import_zod24.z.object({
3278
- type: import_zod24.z.literal("exact"),
3452
+ var ExactStatus = import_zod25.z.object({
3453
+ type: import_zod25.z.literal("exact"),
3279
3454
  term: EventStatus
3280
3455
  }).openapi({
3281
3456
  ref: "ExactStatus"
3282
3457
  });
3283
- var AnyOf = import_zod24.z.object({
3284
- type: import_zod24.z.literal("anyOf"),
3285
- terms: import_zod24.z.array(import_zod24.z.string())
3458
+ var ExactUserType = import_zod25.z.object({
3459
+ type: import_zod25.z.literal("exact"),
3460
+ term: TokenUserType
3461
+ }).openapi({
3462
+ ref: "ExactUserType"
3463
+ });
3464
+ var AnyOf = import_zod25.z.object({
3465
+ type: import_zod25.z.literal("anyOf"),
3466
+ terms: import_zod25.z.array(import_zod25.z.string())
3286
3467
  }).openapi({
3287
3468
  ref: "AnyOf"
3288
3469
  });
3289
- var AnyOfStatus = import_zod24.z.object({
3290
- type: import_zod24.z.literal("anyOf"),
3291
- terms: import_zod24.z.array(EventStatus)
3470
+ var AnyOfStatus = import_zod25.z.object({
3471
+ type: import_zod25.z.literal("anyOf"),
3472
+ terms: import_zod25.z.array(EventStatus)
3292
3473
  }).openapi({
3293
3474
  ref: "AnyOfStatus"
3294
3475
  });
3295
- var Range = import_zod24.z.object({
3296
- type: import_zod24.z.literal("range"),
3297
- gte: import_zod24.z.string(),
3298
- lte: import_zod24.z.string()
3476
+ var Range = import_zod25.z.object({
3477
+ type: import_zod25.z.literal("range"),
3478
+ gte: import_zod25.z.string(),
3479
+ lte: import_zod25.z.string()
3299
3480
  }).openapi({
3300
3481
  ref: "Range"
3301
3482
  });
3302
- var ContainsFlags = import_zod24.z.object({
3303
- anyOf: import_zod24.z.array(Flag).optional(),
3304
- noneOf: import_zod24.z.array(Flag).optional()
3483
+ var ContainsFlags = import_zod25.z.object({
3484
+ anyOf: import_zod25.z.array(Flag).optional(),
3485
+ noneOf: import_zod25.z.array(Flag).optional()
3305
3486
  }).openapi({
3306
3487
  ref: "ContainsFlags"
3307
3488
  });
3308
- var Within = import_zod24.z.object({ type: import_zod24.z.literal("within"), location: import_zod24.z.string() }).openapi({
3489
+ var Within = import_zod25.z.object({ type: import_zod25.z.literal("within"), location: import_zod25.z.string() }).openapi({
3309
3490
  ref: "Within"
3310
3491
  });
3311
- var RangeDate = Range.extend({
3312
- gte: import_zod24.z.string().date().or(import_zod24.z.string().datetime()),
3313
- lte: import_zod24.z.string().date().or(import_zod24.z.string().datetime())
3314
- }).openapi({
3315
- ref: "RangeDate"
3316
- });
3492
+ var RangeDate = import_zod25.z.object({
3493
+ type: import_zod25.z.literal("range"),
3494
+ gte: import_zod25.z.string().date().or(import_zod25.z.string().datetime()),
3495
+ lte: import_zod25.z.string().date().or(import_zod25.z.string().datetime())
3496
+ }).openapi({ ref: "RangeDate" });
3317
3497
  var ExactDate = Exact.extend({
3318
- term: import_zod24.z.string().date().or(import_zod24.z.string().datetime())
3498
+ term: import_zod25.z.string().date().or(import_zod25.z.string().datetime())
3319
3499
  }).openapi({
3320
3500
  ref: "ExactDate"
3321
3501
  });
3322
- var DateCondition = import_zod24.z.union([ExactDate, RangeDate]).openapi({
3502
+ var TimePeriod = import_zod25.z.object({
3503
+ type: import_zod25.z.literal("timePeriod"),
3504
+ term: SelectDateRangeValue
3505
+ }).openapi({
3506
+ ref: "TimePeriod"
3507
+ });
3508
+ var DateCondition = import_zod25.z.union([ExactDate, RangeDate, TimePeriod]).openapi({
3323
3509
  ref: "DateCondition"
3324
3510
  });
3325
- var QueryInput = import_zod24.z.lazy(
3326
- () => import_zod24.z.union([
3327
- import_zod24.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
3328
- import_zod24.z.record(import_zod24.z.string(), QueryInput)
3511
+ var QueryInput = import_zod25.z.lazy(
3512
+ () => import_zod25.z.union([
3513
+ import_zod25.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf]),
3514
+ import_zod25.z.record(import_zod25.z.string(), QueryInput)
3329
3515
  ])
3330
3516
  ).openapi({
3331
3517
  ref: "QueryInput"
3332
3518
  });
3333
- var QueryExpression = import_zod24.z.object({
3334
- id: import_zod24.z.optional(import_zod24.z.string()),
3335
- eventType: import_zod24.z.string(),
3336
- status: import_zod24.z.optional(import_zod24.z.union([AnyOfStatus, ExactStatus])),
3337
- createdAt: import_zod24.z.optional(DateCondition),
3338
- updatedAt: import_zod24.z.optional(DateCondition),
3339
- "legalStatus.REGISTERED.createdAt": import_zod24.z.optional(DateCondition),
3340
- "legalStatus.REGISTERED.createdAtLocation": import_zod24.z.optional(
3341
- import_zod24.z.union([Within, Exact])
3519
+ var QueryExpression = import_zod25.z.object({
3520
+ id: import_zod25.z.optional(import_zod25.z.string()),
3521
+ eventType: import_zod25.z.string(),
3522
+ status: import_zod25.z.optional(import_zod25.z.union([AnyOfStatus, ExactStatus])),
3523
+ createdAt: import_zod25.z.optional(DateCondition),
3524
+ updatedAt: import_zod25.z.optional(DateCondition),
3525
+ "legalStatuses.REGISTERED.acceptedAt": import_zod25.z.optional(DateCondition),
3526
+ "legalStatuses.REGISTERED.createdAtLocation": import_zod25.z.optional(
3527
+ import_zod25.z.union([Within, Exact])
3342
3528
  ),
3343
- "legalStatus.REGISTERED.registrationNumber": import_zod24.z.optional(Exact),
3344
- createdAtLocation: import_zod24.z.optional(import_zod24.z.union([Within, Exact])),
3345
- updatedAtLocation: import_zod24.z.optional(import_zod24.z.union([Within, Exact])),
3346
- assignedTo: import_zod24.z.optional(Exact),
3347
- createdByUserType: TokenUserType,
3348
- createdBy: import_zod24.z.optional(Exact),
3349
- updatedBy: import_zod24.z.optional(Exact),
3350
- trackingId: import_zod24.z.optional(Exact),
3351
- flags: import_zod24.z.optional(ContainsFlags),
3529
+ "legalStatuses.REGISTERED.registrationNumber": import_zod25.z.optional(Exact),
3530
+ createdAtLocation: import_zod25.z.optional(import_zod25.z.union([Within, Exact])),
3531
+ updatedAtLocation: import_zod25.z.optional(import_zod25.z.union([Within, Exact])),
3532
+ assignedTo: import_zod25.z.optional(Exact),
3533
+ createdByUserType: import_zod25.z.optional(ExactUserType),
3534
+ createdBy: import_zod25.z.optional(Exact),
3535
+ updatedBy: import_zod25.z.optional(Exact),
3536
+ trackingId: import_zod25.z.optional(Exact),
3537
+ flags: import_zod25.z.optional(ContainsFlags),
3538
+ // @todo: The type for this comes out as "any"
3352
3539
  data: QueryInput
3353
3540
  }).partial().refine((obj) => Object.values(obj).some((val) => val !== void 0), {
3354
3541
  message: "At least one query field must be specified."
3355
3542
  }).openapi({
3356
3543
  ref: "QueryExpression"
3357
3544
  });
3358
- var QueryType = import_zod24.z.object({
3359
- type: import_zod24.z.literal("and").or(import_zod24.z.literal("or")).openapi({ default: "and" }),
3360
- clauses: import_zod24.z.preprocess(
3545
+ var QueryType = import_zod25.z.object({
3546
+ type: import_zod25.z.literal("and").or(import_zod25.z.literal("or")).openapi({ default: "and" }),
3547
+ clauses: import_zod25.z.preprocess(
3361
3548
  (val) => {
3362
3549
  if (typeof val === "string") {
3363
3550
  return [JSON.parse(val)];
@@ -3367,7 +3554,7 @@ var QueryType = import_zod24.z.object({
3367
3554
  }
3368
3555
  return val;
3369
3556
  },
3370
- import_zod24.z.array(QueryExpression).nonempty("At least one clause is required.").openapi({
3557
+ import_zod25.z.array(QueryExpression).nonempty("At least one clause is required.").openapi({
3371
3558
  default: [
3372
3559
  {
3373
3560
  eventType: TENNIS_CLUB_MEMBERSHIP,
@@ -3388,58 +3575,62 @@ var QueryType = import_zod24.z.object({
3388
3575
  }).openapi({
3389
3576
  ref: "QueryType"
3390
3577
  });
3578
+ var SearchScopeAccessLevels = {
3579
+ MY_JURISDICTION: "my-jurisdiction",
3580
+ ALL: "all"
3581
+ };
3391
3582
 
3392
3583
  // ../commons/src/events/CountryConfigQueryInput.ts
3393
- var SerializableExact = import_zod25.z.object({
3394
- type: import_zod25.z.literal("exact"),
3395
- term: import_zod25.z.union([import_zod25.z.string(), SerializedUserField])
3584
+ var SerializableExact = import_zod26.z.object({
3585
+ type: import_zod26.z.literal("exact"),
3586
+ term: import_zod26.z.union([import_zod26.z.string(), SerializedUserField])
3396
3587
  });
3397
- var SerializableWithin = import_zod25.z.object({
3398
- type: import_zod25.z.literal("within"),
3399
- location: import_zod25.z.union([import_zod25.z.string(), SerializedUserField])
3588
+ var SerializableWithin = import_zod26.z.object({
3589
+ type: import_zod26.z.literal("within"),
3590
+ location: import_zod26.z.union([import_zod26.z.string(), SerializedUserField])
3400
3591
  });
3401
- var SerializedQueryExpression = import_zod25.z.object({
3402
- eventType: import_zod25.z.string(),
3403
- status: import_zod25.z.optional(import_zod25.z.union([AnyOfStatus, ExactStatus])),
3404
- createdAt: import_zod25.z.optional(DateCondition),
3405
- updatedAt: import_zod25.z.optional(DateCondition),
3406
- "legalStatus.REGISTERED.createdAt": import_zod25.z.optional(DateCondition),
3407
- "legalStatus.REGISTERED.createdAtLocation": import_zod25.z.optional(
3408
- import_zod25.z.union([Within, Exact])
3592
+ var SerializedQueryExpression = import_zod26.z.object({
3593
+ eventType: import_zod26.z.string(),
3594
+ status: import_zod26.z.optional(import_zod26.z.union([AnyOfStatus, ExactStatus])),
3595
+ createdAt: import_zod26.z.optional(DateCondition),
3596
+ updatedAt: import_zod26.z.optional(DateCondition),
3597
+ "legalStatuses.REGISTERED.createdAt": import_zod26.z.optional(DateCondition),
3598
+ "legalStatuses.REGISTERED.createdAtLocation": import_zod26.z.optional(
3599
+ import_zod26.z.union([Within, Exact])
3409
3600
  ),
3410
- "legalStatus.REGISTERED.registrationNumber": import_zod25.z.optional(Exact),
3411
- createdAtLocation: import_zod25.z.optional(
3412
- import_zod25.z.union([SerializableWithin, SerializableExact])
3601
+ "legalStatuses.REGISTERED.registrationNumber": import_zod26.z.optional(Exact),
3602
+ createdAtLocation: import_zod26.z.optional(
3603
+ import_zod26.z.union([SerializableWithin, SerializableExact])
3413
3604
  ),
3414
- updatedAtLocation: import_zod25.z.optional(
3415
- import_zod25.z.union([SerializableWithin, SerializableExact])
3605
+ updatedAtLocation: import_zod26.z.optional(
3606
+ import_zod26.z.union([SerializableWithin, SerializableExact])
3416
3607
  ),
3417
- assignedTo: import_zod25.z.optional(SerializableExact),
3418
- createdBy: import_zod25.z.optional(SerializableExact),
3419
- createdByUserType: TokenUserType,
3420
- updatedBy: import_zod25.z.optional(SerializableExact),
3421
- trackingId: import_zod25.z.optional(Exact),
3422
- flags: import_zod25.z.optional(ContainsFlags),
3608
+ assignedTo: import_zod26.z.optional(SerializableExact),
3609
+ createdBy: import_zod26.z.optional(SerializableExact),
3610
+ createdByUserType: ExactUserType,
3611
+ updatedBy: import_zod26.z.optional(SerializableExact),
3612
+ trackingId: import_zod26.z.optional(Exact),
3613
+ flags: import_zod26.z.optional(ContainsFlags),
3423
3614
  data: QueryInput
3424
3615
  }).partial();
3425
- var Or2 = import_zod25.z.object({
3426
- type: import_zod25.z.literal("or"),
3427
- clauses: import_zod25.z.array(SerializedQueryExpression)
3616
+ var Or2 = import_zod26.z.object({
3617
+ type: import_zod26.z.literal("or"),
3618
+ clauses: import_zod26.z.array(SerializedQueryExpression)
3428
3619
  });
3429
- var And2 = import_zod25.z.object({
3430
- type: import_zod25.z.literal("and"),
3431
- clauses: import_zod25.z.array(SerializedQueryExpression)
3620
+ var And2 = import_zod26.z.object({
3621
+ type: import_zod26.z.literal("and"),
3622
+ clauses: import_zod26.z.array(SerializedQueryExpression)
3432
3623
  });
3433
- var CountryConfigQueryType = import_zod25.z.discriminatedUnion("type", [And2, Or2]);
3434
- var CountryConfigQueryInputType = import_zod25.z.union([
3624
+ var CountryConfigQueryType = import_zod26.z.discriminatedUnion("type", [And2, Or2]);
3625
+ var CountryConfigQueryInputType = import_zod26.z.union([
3435
3626
  SerializedQueryExpression,
3436
3627
  And2,
3437
3628
  Or2
3438
3629
  ]);
3439
3630
 
3440
3631
  // ../commons/src/icons.ts
3441
- var import_zod26 = require("zod");
3442
- var AvailableIcons = import_zod26.z.enum([
3632
+ var import_zod27 = require("zod");
3633
+ var AvailableIcons = import_zod27.z.enum([
3443
3634
  "Archived",
3444
3635
  "Assigned",
3445
3636
  "Certified",
@@ -3477,7 +3668,6 @@ var AvailableIcons = import_zod26.z.enum([
3477
3668
  "Copy",
3478
3669
  "Database",
3479
3670
  "DotsThreeVertical",
3480
- "DownloadSimple",
3481
3671
  "ArrowCounterClockwise",
3482
3672
  "MagnifyingGlassMinus",
3483
3673
  "MagnifyingGlassPlus",
@@ -3561,42 +3751,42 @@ var mandatoryColumns = defineWorkqueuesColumns([
3561
3751
  value: event.field("updatedAt")
3562
3752
  }
3563
3753
  ]);
3564
- var WorkqueueActionsWithDefault = import_zod27.z.enum([
3754
+ var WorkqueueActionsWithDefault = import_zod28.z.enum([
3565
3755
  ...workqueueActions.options,
3566
3756
  "DEFAULT"
3567
3757
  ]);
3568
- var WorkqueueConfig = import_zod27.z.object({
3569
- slug: import_zod27.z.string().describe("Determines the url of the workqueue."),
3758
+ var WorkqueueConfig = import_zod28.z.object({
3759
+ slug: import_zod28.z.string().describe("Determines the url of the workqueue."),
3570
3760
  name: TranslationConfig.describe(
3571
3761
  "Title of the workflow (both in navigation and on the page)"
3572
3762
  ),
3573
3763
  query: CountryConfigQueryType,
3574
- actions: import_zod27.z.array(
3575
- import_zod27.z.object({
3764
+ actions: import_zod28.z.array(
3765
+ import_zod28.z.object({
3576
3766
  type: WorkqueueActionsWithDefault,
3577
- conditionals: import_zod27.z.array(Conditional).optional()
3767
+ conditionals: import_zod28.z.array(Conditional).optional()
3578
3768
  })
3579
3769
  ),
3580
- columns: import_zod27.z.array(WorkqueueColumn).default(mandatoryColumns),
3770
+ columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
3581
3771
  icon: AvailableIcons
3582
3772
  }).describe("Configuration for workqueue.");
3583
3773
  var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
3584
3774
  query: true,
3585
3775
  columns: true
3586
3776
  });
3587
- var WorkqueueConfigInput = import_zod27.z.object({
3588
- slug: import_zod27.z.string().describe("Determines the url of the workqueue."),
3777
+ var WorkqueueConfigInput = import_zod28.z.object({
3778
+ slug: import_zod28.z.string().describe("Determines the url of the workqueue."),
3589
3779
  name: TranslationConfig.describe(
3590
3780
  "Title of the workflow (both in navigation and on the page)"
3591
3781
  ),
3592
3782
  query: CountryConfigQueryInputType,
3593
- actions: import_zod27.z.array(
3594
- import_zod27.z.object({
3783
+ actions: import_zod28.z.array(
3784
+ import_zod28.z.object({
3595
3785
  type: WorkqueueActionsWithDefault,
3596
- conditionals: import_zod27.z.array(Conditional).optional()
3786
+ conditionals: import_zod28.z.array(Conditional).optional()
3597
3787
  })
3598
3788
  ),
3599
- columns: import_zod27.z.array(WorkqueueColumn).default(mandatoryColumns),
3789
+ columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
3600
3790
  icon: AvailableIcons
3601
3791
  });
3602
3792
  function defineWorkqueue(workqueueInput) {
@@ -3607,10 +3797,10 @@ function defineWorkqueue(workqueueInput) {
3607
3797
  function defineWorkqueues(workqueues) {
3608
3798
  return workqueues.map((workqueue) => defineWorkqueue(workqueue));
3609
3799
  }
3610
- var WorkqueueCountInput = import_zod27.z.array(
3611
- import_zod27.z.object({ slug: import_zod27.z.string(), query: QueryType })
3800
+ var WorkqueueCountInput = import_zod28.z.array(
3801
+ import_zod28.z.object({ slug: import_zod28.z.string(), query: QueryType })
3612
3802
  );
3613
- var WorkqueueCountOutput = import_zod27.z.record(import_zod27.z.string(), import_zod27.z.number());
3803
+ var WorkqueueCountOutput = import_zod28.z.record(import_zod28.z.string(), import_zod28.z.number());
3614
3804
 
3615
3805
  // ../commons/src/events/workqueueDefaultColumns.ts
3616
3806
  var defaultWorkqueueColumns = [
@@ -3633,42 +3823,42 @@ var defaultWorkqueueColumns = [
3633
3823
  ];
3634
3824
 
3635
3825
  // ../commons/src/events/Draft.ts
3636
- var import_zod29 = require("zod");
3826
+ var import_zod30 = require("zod");
3637
3827
 
3638
3828
  // ../commons/src/events/ActionInput.ts
3639
- var import_zod28 = require("zod");
3640
- var import_zod_openapi10 = require("zod-openapi");
3641
- (0, import_zod_openapi10.extendZodWithOpenApi)(import_zod28.z);
3642
- var BaseActionInput = import_zod28.z.object({
3829
+ var import_zod29 = require("zod");
3830
+ var import_zod_openapi11 = require("zod-openapi");
3831
+ (0, import_zod_openapi11.extendZodWithOpenApi)(import_zod29.z);
3832
+ var BaseActionInput = import_zod29.z.object({
3643
3833
  eventId: UUID,
3644
- transactionId: import_zod28.z.string(),
3834
+ transactionId: import_zod29.z.string(),
3645
3835
  declaration: ActionUpdate.default({}),
3646
3836
  annotation: ActionUpdate.optional(),
3647
3837
  originalActionId: UUID.optional(),
3648
3838
  // should not be part of base action.
3649
- keepAssignment: import_zod28.z.boolean().optional()
3839
+ keepAssignment: import_zod29.z.boolean().optional()
3650
3840
  });
3651
3841
  var CreateActionInput = BaseActionInput.merge(
3652
- import_zod28.z.object({
3653
- type: import_zod28.z.literal(ActionType.CREATE).default(ActionType.CREATE),
3842
+ import_zod29.z.object({
3843
+ type: import_zod29.z.literal(ActionType.CREATE).default(ActionType.CREATE),
3654
3844
  createdAtLocation: CreatedAtLocation
3655
3845
  })
3656
3846
  );
3657
3847
  var RegisterActionInput = BaseActionInput.merge(
3658
- import_zod28.z.object({
3659
- type: import_zod28.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
3660
- registrationNumber: import_zod28.z.string().optional()
3848
+ import_zod29.z.object({
3849
+ type: import_zod29.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
3850
+ registrationNumber: import_zod29.z.string().optional()
3661
3851
  })
3662
3852
  ).strict();
3663
3853
  var ValidateActionInput = BaseActionInput.merge(
3664
- import_zod28.z.object({
3665
- type: import_zod28.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE),
3666
- duplicates: import_zod28.z.array(import_zod28.z.string())
3854
+ import_zod29.z.object({
3855
+ type: import_zod29.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE),
3856
+ duplicates: import_zod29.z.array(import_zod29.z.string())
3667
3857
  })
3668
3858
  );
3669
3859
  var NotifyActionInput = BaseActionInput.merge(
3670
- import_zod28.z.object({
3671
- type: import_zod28.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
3860
+ import_zod29.z.object({
3861
+ type: import_zod29.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
3672
3862
  })
3673
3863
  ).openapi({
3674
3864
  default: {
@@ -3680,68 +3870,68 @@ var NotifyActionInput = BaseActionInput.merge(
3680
3870
  }
3681
3871
  });
3682
3872
  var DeclareActionInput = BaseActionInput.merge(
3683
- import_zod28.z.object({
3684
- type: import_zod28.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
3873
+ import_zod29.z.object({
3874
+ type: import_zod29.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
3685
3875
  })
3686
3876
  );
3687
3877
  var PrintCertificateActionInput = BaseActionInput.merge(
3688
- import_zod28.z.object({
3689
- type: import_zod28.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE)
3878
+ import_zod29.z.object({
3879
+ type: import_zod29.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE)
3690
3880
  })
3691
3881
  );
3692
3882
  var RejectDeclarationActionInput = BaseActionInput.merge(
3693
- import_zod28.z.object({
3694
- type: import_zod28.z.literal(ActionType.REJECT).default(ActionType.REJECT),
3883
+ import_zod29.z.object({
3884
+ type: import_zod29.z.literal(ActionType.REJECT).default(ActionType.REJECT),
3695
3885
  reason: RejectionReason
3696
3886
  })
3697
3887
  );
3698
3888
  var MarkedAsDuplicateActionInput = BaseActionInput.merge(
3699
- import_zod28.z.object({
3700
- type: import_zod28.z.literal(ActionType.MARKED_AS_DUPLICATE).default(ActionType.MARKED_AS_DUPLICATE)
3889
+ import_zod29.z.object({
3890
+ type: import_zod29.z.literal(ActionType.MARKED_AS_DUPLICATE).default(ActionType.MARKED_AS_DUPLICATE)
3701
3891
  })
3702
3892
  );
3703
3893
  var ArchiveActionInput = BaseActionInput.merge(
3704
- import_zod28.z.object({
3705
- type: import_zod28.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
3894
+ import_zod29.z.object({
3895
+ type: import_zod29.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
3706
3896
  reason: RejectionReason
3707
3897
  })
3708
3898
  );
3709
3899
  var AssignActionInput = BaseActionInput.merge(
3710
- import_zod28.z.object({
3711
- type: import_zod28.z.literal(ActionType.ASSIGN).default(ActionType.ASSIGN),
3712
- assignedTo: import_zod28.z.string()
3900
+ import_zod29.z.object({
3901
+ type: import_zod29.z.literal(ActionType.ASSIGN).default(ActionType.ASSIGN),
3902
+ assignedTo: import_zod29.z.string()
3713
3903
  })
3714
3904
  );
3715
3905
  var UnassignActionInput = BaseActionInput.merge(
3716
- import_zod28.z.object({
3717
- type: import_zod28.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
3718
- assignedTo: import_zod28.z.literal(null).default(null)
3906
+ import_zod29.z.object({
3907
+ type: import_zod29.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
3908
+ assignedTo: import_zod29.z.literal(null).default(null)
3719
3909
  })
3720
3910
  );
3721
3911
  var RequestCorrectionActionInput = BaseActionInput.merge(
3722
- import_zod28.z.object({
3723
- type: import_zod28.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
3912
+ import_zod29.z.object({
3913
+ type: import_zod29.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
3724
3914
  })
3725
3915
  );
3726
3916
  var RejectCorrectionActionInput = BaseActionInput.merge(
3727
- import_zod28.z.object({
3728
- requestId: import_zod28.z.string(),
3729
- type: import_zod28.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
3917
+ import_zod29.z.object({
3918
+ requestId: import_zod29.z.string(),
3919
+ type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
3730
3920
  })
3731
3921
  );
3732
3922
  var ApproveCorrectionActionInput = BaseActionInput.merge(
3733
- import_zod28.z.object({
3734
- requestId: import_zod28.z.string(),
3735
- type: import_zod28.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
3923
+ import_zod29.z.object({
3924
+ requestId: import_zod29.z.string(),
3925
+ type: import_zod29.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
3736
3926
  })
3737
3927
  );
3738
3928
  var ReadActionInput = BaseActionInput.merge(
3739
- import_zod28.z.object({
3740
- type: import_zod28.z.literal(ActionType.READ).default(ActionType.READ)
3929
+ import_zod29.z.object({
3930
+ type: import_zod29.z.literal(ActionType.READ).default(ActionType.READ)
3741
3931
  })
3742
3932
  );
3743
- var DeleteActionInput = import_zod28.z.object({ eventId: UUID });
3744
- var ActionInput = import_zod28.z.discriminatedUnion("type", [
3933
+ var DeleteActionInput = import_zod29.z.object({ eventId: UUID });
3934
+ var ActionInput = import_zod29.z.discriminatedUnion("type", [
3745
3935
  CreateActionInput.openapi({ ref: "CreateActionInput" }),
3746
3936
  ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
3747
3937
  RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
@@ -3770,18 +3960,18 @@ var ActionInput = import_zod28.z.discriminatedUnion("type", [
3770
3960
  });
3771
3961
 
3772
3962
  // ../commons/src/events/Draft.ts
3773
- var Draft = import_zod29.z.object({
3963
+ var Draft = import_zod30.z.object({
3774
3964
  id: UUID,
3775
3965
  eventId: UUID,
3776
- transactionId: import_zod29.z.string(),
3777
- createdAt: import_zod29.z.string().datetime(),
3966
+ transactionId: import_zod30.z.string(),
3967
+ createdAt: import_zod30.z.string().datetime(),
3778
3968
  action: ActionBase.extend({
3779
3969
  type: ActionTypes
3780
3970
  }).omit({ id: true })
3781
3971
  });
3782
3972
  var DraftInput = BaseActionInput.extend({
3783
3973
  type: ActionTypes,
3784
- status: import_zod29.z.enum([
3974
+ status: import_zod30.z.enum([
3785
3975
  ActionStatus.Requested,
3786
3976
  ActionStatus.Accepted,
3787
3977
  ActionStatus.Rejected
@@ -3789,27 +3979,28 @@ var DraftInput = BaseActionInput.extend({
3789
3979
  });
3790
3980
 
3791
3981
  // ../commons/src/events/EventInput.ts
3792
- var import_zod30 = require("zod");
3982
+ var import_zod31 = require("zod");
3793
3983
  var import_uuid8 = require("uuid");
3794
- var EventInput = import_zod30.z.object({
3795
- transactionId: import_zod30.z.string(),
3796
- type: import_zod30.z.string()
3984
+ var EventInput = import_zod31.z.object({
3985
+ transactionId: import_zod31.z.string(),
3986
+ type: import_zod31.z.string()
3797
3987
  }).openapi({ default: { transactionId: (0, import_uuid8.v4)(), type: "v2.birth" } });
3798
3988
 
3799
3989
  // ../commons/src/events/EventDocument.ts
3800
- var import_zod31 = require("zod");
3801
- var import_zod_openapi11 = require("zod-openapi");
3802
- (0, import_zod_openapi11.extendZodWithOpenApi)(import_zod31.z);
3803
- var EventDocument = import_zod31.z.object({
3990
+ var import_zod32 = require("zod");
3991
+ var import_zod_openapi12 = require("zod-openapi");
3992
+ (0, import_zod_openapi12.extendZodWithOpenApi)(import_zod32.z);
3993
+ var EventDocument = import_zod32.z.object({
3804
3994
  id: UUID,
3805
- type: import_zod31.z.string(),
3806
- createdAt: import_zod31.z.string().datetime(),
3807
- updatedAt: import_zod31.z.string().datetime(),
3808
- actions: import_zod31.z.array(Action),
3809
- trackingId: import_zod31.z.string()
3995
+ type: import_zod32.z.string(),
3996
+ createdAt: import_zod32.z.string().datetime(),
3997
+ updatedAt: import_zod32.z.string().datetime(),
3998
+ actions: import_zod32.z.array(Action),
3999
+ trackingId: import_zod32.z.string()
3810
4000
  }).openapi({ ref: "EventDocument" });
3811
4001
 
3812
4002
  // ../commons/src/events/state/utils.ts
4003
+ var import_lodash2 = require("lodash");
3813
4004
  function getActionRequests(actionType, actions) {
3814
4005
  const filtered = actions.filter((action) => action.type === actionType);
3815
4006
  const accept = filtered.find(
@@ -3848,29 +4039,38 @@ function getDeclarationActionCreationMetadata(actionType, actions) {
3848
4039
  registrationNumber
3849
4040
  };
3850
4041
  }
4042
+ var updateActions = ActionTypes.extract([
4043
+ ActionType.CREATE,
4044
+ ActionType.NOTIFY,
4045
+ ActionType.DECLARE,
4046
+ ActionType.VALIDATE,
4047
+ ActionType.REGISTER,
4048
+ ActionType.REJECT,
4049
+ ActionType.ARCHIVE,
4050
+ ActionType.PRINT_CERTIFICATE,
4051
+ ActionType.REQUEST_CORRECTION
4052
+ ]);
3851
4053
  function getActionUpdateMetadata(actions) {
3852
4054
  const createAction = getOrThrow(
3853
4055
  actions.find((action) => action.type === ActionType.CREATE),
3854
4056
  `Event has no ${ActionType.CREATE} action`
3855
4057
  );
3856
- return StatusChangingActions.options.reduce(
3857
- (metadata, actionType) => {
3858
- const { accept, request } = getActionRequests(actionType, actions);
3859
- return {
3860
- createdAt: request?.createdAt ?? accept?.createdAt ?? metadata.createdAt,
3861
- createdBy: request?.createdBy ?? accept?.createdBy ?? metadata.createdBy,
3862
- createdByUserType: request?.createdByUserType ?? accept?.createdByUserType ?? metadata.createdByUserType,
3863
- createdAtLocation: request?.createdAtLocation ?? accept?.createdAtLocation ?? metadata.createdAtLocation,
3864
- createdByRole: request?.createdByRole ?? accept?.createdByRole ?? metadata.createdByRole
3865
- };
4058
+ const metadataFields = [
4059
+ "createdAt",
4060
+ "createdBy",
4061
+ "createdByUserType",
4062
+ "createdAtLocation",
4063
+ "createdByRole"
4064
+ ];
4065
+ return actions.filter(({ type }) => updateActions.safeParse(type).success).filter(({ status }) => status === ActionStatus.Accepted).reduce(
4066
+ (_, action) => {
4067
+ if (action.originalActionId) {
4068
+ const originalAction = actions.find(({ id }) => id === action.originalActionId) ?? action;
4069
+ return (0, import_lodash2.pick)(originalAction, metadataFields);
4070
+ }
4071
+ return (0, import_lodash2.pick)(action, metadataFields);
3866
4072
  },
3867
- {
3868
- createdAt: createAction.createdAt,
3869
- createdBy: createAction.createdBy,
3870
- createdByUserType: createAction.createdByUserType,
3871
- createdAtLocation: createAction.createdAtLocation,
3872
- createdByRole: createAction.createdByRole
3873
- }
4073
+ (0, import_lodash2.pick)(createAction, metadataFields)
3874
4074
  );
3875
4075
  }
3876
4076
  function getLegalStatuses(actions) {
@@ -3916,7 +4116,7 @@ function isDeclarationIncomplete(actions) {
3916
4116
  return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
3917
4117
  }
3918
4118
  function isRejected(actions) {
3919
- return getStatusFromActions(actions) === EventStatus.enum.REJECTED;
4119
+ return actions.at(-1)?.type === ActionType.REJECT;
3920
4120
  }
3921
4121
  function getFlagsFromActions(actions) {
3922
4122
  const sortedActions = actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
@@ -3958,8 +4158,6 @@ function getStatusFromActions(actions) {
3958
4158
  return EventStatus.enum.VALIDATED;
3959
4159
  case ActionType.REGISTER:
3960
4160
  return EventStatus.enum.REGISTERED;
3961
- case ActionType.REJECT:
3962
- return EventStatus.enum.REJECTED;
3963
4161
  case ActionType.ARCHIVE:
3964
4162
  return EventStatus.enum.ARCHIVED;
3965
4163
  case ActionType.NOTIFY:
@@ -3968,6 +4166,7 @@ function getStatusFromActions(actions) {
3968
4166
  return EventStatus.enum.CERTIFIED;
3969
4167
  case ActionType.ASSIGN:
3970
4168
  case ActionType.UNASSIGN:
4169
+ case ActionType.REJECT:
3971
4170
  case ActionType.REQUEST_CORRECTION:
3972
4171
  case ActionType.APPROVE_CORRECTION:
3973
4172
  case ActionType.MARKED_AS_DUPLICATE:
@@ -4003,7 +4202,8 @@ function getAssignedUserSignatureFromActions(actions) {
4003
4202
  function aggregateActionDeclarations(actions) {
4004
4203
  const excludedActions = [
4005
4204
  ActionType.REQUEST_CORRECTION,
4006
- ActionType.PRINT_CERTIFICATE
4205
+ ActionType.PRINT_CERTIFICATE,
4206
+ ActionType.REJECT_CORRECTION
4007
4207
  ];
4008
4208
  return actions.reduce((declaration, action) => {
4009
4209
  if (excludedActions.some((excludedAction) => excludedAction === action.type)) {
@@ -4044,6 +4244,13 @@ function getAcceptedActions(event2) {
4044
4244
  );
4045
4245
  }
4046
4246
  var DEFAULT_DATE_OF_EVENT_PROPERTY = "createdAt";
4247
+ function resolveDateOfEvent(eventMetadata, declaration, config) {
4248
+ if (!config.dateOfEvent) {
4249
+ return eventMetadata[DEFAULT_DATE_OF_EVENT_PROPERTY].split("T")[0];
4250
+ }
4251
+ const parsedDate = ZodDate.safeParse(declaration[config.dateOfEvent.$$field]);
4252
+ return parsedDate.success ? parsedDate.data : void 0;
4253
+ }
4047
4254
  function getCurrentEventState(event2, config) {
4048
4255
  const creationAction = event2.actions.find(
4049
4256
  (action) => action.type === ActionType.CREATE
@@ -4057,17 +4264,6 @@ function getCurrentEventState(event2, config) {
4057
4264
  const requestActionMetadata = getActionUpdateMetadata(event2.actions);
4058
4265
  const acceptedActionMetadata = getActionUpdateMetadata(acceptedActions);
4059
4266
  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
4267
  return deepDropNulls({
4072
4268
  id: event2.id,
4073
4269
  type: event2.type,
@@ -4086,7 +4282,7 @@ function getCurrentEventState(event2, config) {
4086
4282
  declaration,
4087
4283
  trackingId: event2.trackingId,
4088
4284
  updatedByUserRole: requestActionMetadata.createdByRole,
4089
- dateOfEvent,
4285
+ dateOfEvent: resolveDateOfEvent(event2, declaration, config),
4090
4286
  flags: getFlagsFromActions(event2.actions)
4091
4287
  });
4092
4288
  }
@@ -4115,19 +4311,32 @@ function getCurrentEventStateWithDrafts({
4115
4311
  };
4116
4312
  return getCurrentEventState(withDrafts, configuration);
4117
4313
  }
4118
- function applyDraftsToEventIndex(eventIndex, drafts) {
4314
+ function applyDeclarationToEventIndex(eventIndex, declaration, eventConfiguration) {
4315
+ const updatedDeclaration = deepMerge(eventIndex.declaration, declaration);
4316
+ return {
4317
+ ...eventIndex,
4318
+ dateOfEvent: resolveDateOfEvent(
4319
+ eventIndex,
4320
+ updatedDeclaration,
4321
+ eventConfiguration
4322
+ ),
4323
+ declaration: updatedDeclaration
4324
+ };
4325
+ }
4326
+ function applyDraftsToEventIndex(eventIndex, drafts, eventConfiguration) {
4119
4327
  const indexedAt = eventIndex.updatedAt;
4120
4328
  const activeDrafts = drafts.filter(({ createdAt }) => new Date(createdAt) > new Date(indexedAt)).map((draft) => draft.action).sort();
4121
4329
  if (activeDrafts.length === 0) {
4122
4330
  return eventIndex;
4123
4331
  }
4124
- return {
4125
- ...eventIndex,
4126
- declaration: {
4127
- ...eventIndex.declaration,
4128
- ...activeDrafts[activeDrafts.length - 1].declaration
4129
- }
4130
- };
4332
+ return applyDeclarationToEventIndex(
4333
+ {
4334
+ ...eventIndex,
4335
+ updatedAt: activeDrafts[activeDrafts.length - 1].createdAt
4336
+ },
4337
+ activeDrafts[activeDrafts.length - 1].declaration,
4338
+ eventConfiguration
4339
+ );
4131
4340
  }
4132
4341
  function getAnnotationFromDrafts(drafts) {
4133
4342
  const actions = drafts.map((draft) => draft.action);
@@ -4168,23 +4377,24 @@ function generateTransactionId() {
4168
4377
  }
4169
4378
 
4170
4379
  // ../commons/src/events/User.ts
4171
- var import_zod32 = require("zod");
4172
- var User = import_zod32.z.object({
4173
- id: import_zod32.z.string(),
4174
- name: import_zod32.z.array(
4175
- import_zod32.z.object({
4176
- use: import_zod32.z.string(),
4177
- given: import_zod32.z.array(import_zod32.z.string()),
4178
- family: import_zod32.z.string()
4380
+ var import_zod33 = require("zod");
4381
+ var User = import_zod33.z.object({
4382
+ id: import_zod33.z.string(),
4383
+ name: import_zod33.z.array(
4384
+ import_zod33.z.object({
4385
+ use: import_zod33.z.string(),
4386
+ given: import_zod33.z.array(import_zod33.z.string()),
4387
+ family: import_zod33.z.string()
4179
4388
  })
4180
4389
  ),
4181
- role: import_zod32.z.string(),
4182
- signatureFilename: import_zod32.z.string().optional()
4390
+ role: import_zod33.z.string(),
4391
+ avatar: FullDocumentPath.optional(),
4392
+ signature: FullDocumentPath.optional()
4183
4393
  });
4184
4394
 
4185
4395
  // ../commons/src/events/test.utils.ts
4186
- var import_lodash2 = require("lodash");
4187
- var import_addDays = __toESM(require("date-fns/addDays"));
4396
+ var import_lodash3 = require("lodash");
4397
+ var import_date_fns4 = require("date-fns");
4188
4398
 
4189
4399
  // ../commons/src/field-config/field-configuration.ts
4190
4400
  function createFieldConfig(fieldId, options) {
@@ -4205,7 +4415,7 @@ function field(fieldId, options = {}) {
4205
4415
  }
4206
4416
 
4207
4417
  // ../commons/src/fixtures/forms.ts
4208
- var import_date_fns2 = require("date-fns");
4418
+ var import_date_fns3 = require("date-fns");
4209
4419
  var PRINT_CERTIFICATE_FORM = defineActionForm({
4210
4420
  label: {
4211
4421
  id: "v2.event.tennis-club-membership.action.certificate.form.label",
@@ -4924,6 +5134,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
4924
5134
  id: "applicant.email",
4925
5135
  type: "EMAIL",
4926
5136
  required: false,
5137
+ uncorrectable: true,
4927
5138
  conditionals: [],
4928
5139
  label: {
4929
5140
  defaultMessage: "Applicant's email",
@@ -5003,6 +5214,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
5003
5214
  id: "applicant.address",
5004
5215
  type: "ADDRESS",
5005
5216
  required: true,
5217
+ secured: true,
5006
5218
  conditionals: [],
5007
5219
  label: {
5008
5220
  defaultMessage: "Applicant's address",
@@ -5147,7 +5359,7 @@ var statusOptions = [
5147
5359
  }
5148
5360
  },
5149
5361
  {
5150
- value: EventStatus.enum.REJECTED,
5362
+ value: VisibleStatus.enum.REJECTED,
5151
5363
  label: {
5152
5364
  defaultMessage: "Rejected",
5153
5365
  description: "Option for form field: status of record",
@@ -5170,7 +5382,7 @@ var timePeriodOptions = [
5170
5382
  description: "Label for option of time period select: last 7 days",
5171
5383
  id: "form.section.label.timePeriodLast7Days"
5172
5384
  },
5173
- value: `${(0, import_date_fns2.format)((0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
5385
+ value: `${(0, import_date_fns3.format)((0, import_date_fns3.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5174
5386
  /* @__PURE__ */ new Date(),
5175
5387
  "yyyy-MM-dd"
5176
5388
  )}`
@@ -5181,7 +5393,7 @@ var timePeriodOptions = [
5181
5393
  description: "Label for option of time period select: last 30 days",
5182
5394
  id: "form.section.label.timePeriodLast30Days"
5183
5395
  },
5184
- value: `${(0, import_date_fns2.format)((0, import_date_fns2.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
5396
+ value: `${(0, import_date_fns3.format)((0, import_date_fns3.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5185
5397
  /* @__PURE__ */ new Date(),
5186
5398
  "yyyy-MM-dd"
5187
5399
  )}`
@@ -5192,7 +5404,7 @@ var timePeriodOptions = [
5192
5404
  description: "Label for option of time period select: last 90 days",
5193
5405
  id: "form.section.label.timePeriodLast90Days"
5194
5406
  },
5195
- value: `${(0, import_date_fns2.format)((0, import_date_fns2.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
5407
+ value: `${(0, import_date_fns3.format)((0, import_date_fns3.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5196
5408
  /* @__PURE__ */ new Date(),
5197
5409
  "yyyy-MM-dd"
5198
5410
  )}`
@@ -5203,7 +5415,7 @@ var timePeriodOptions = [
5203
5415
  description: "Label for option of time period select: last year",
5204
5416
  id: "form.section.label.timePeriodLastYear"
5205
5417
  },
5206
- value: `${(0, import_date_fns2.format)((0, import_date_fns2.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
5418
+ value: `${(0, import_date_fns3.format)((0, import_date_fns3.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns3.format)(
5207
5419
  /* @__PURE__ */ new Date(),
5208
5420
  "yyyy-MM-dd"
5209
5421
  )}`
@@ -5287,197 +5499,202 @@ var tennisClubMembershipEvent = defineConfig({
5287
5499
  description: "This is shown as the action name anywhere the user can trigger the action from",
5288
5500
  id: "event.tennis-club-membership.action.correction.request.label"
5289
5501
  },
5290
- onboardingForm: [
5291
- {
5292
- id: "correction-requester",
5293
- type: PageTypes.enum.FORM,
5294
- title: {
5295
- id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
5296
- defaultMessage: "Correction requester",
5297
- description: "This is the title of the section"
5298
- },
5299
- fields: [
5300
- {
5301
- id: "correction.requester.relationshop.intro",
5302
- type: "PAGE_HEADER",
5303
- label: {
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
- }
5502
+ correctionForm: {
5503
+ label: {
5504
+ id: "v2.event.tennis-club-membership.action.request-correction.label",
5505
+ defaultMessage: "Request correction",
5506
+ description: "This is shown as the action name anywhere the user can trigger the action from"
5507
+ },
5508
+ pages: [
5509
+ {
5510
+ id: "correction-requester",
5511
+ type: PageTypes.enum.FORM,
5512
+ title: {
5513
+ id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
5514
+ defaultMessage: "Correction requester",
5515
+ description: "This is the title of the section"
5308
5516
  },
5309
- {
5310
- id: "correction.requester.relationship",
5311
- type: "RADIO_GROUP",
5312
- label: {
5313
- id: "v2.correction.corrector.title",
5314
- defaultMessage: "Who is requesting a change to this record?",
5315
- description: "The title for the corrector form"
5517
+ fields: [
5518
+ {
5519
+ id: "correction.requester.relationshop.intro",
5520
+ type: "PAGE_HEADER",
5521
+ label: {
5522
+ id: "correction.requester.relationshop.intro.label",
5523
+ 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.",
5524
+ description: "The title for the corrector form"
5525
+ }
5316
5526
  },
5317
- defaultValue: "",
5318
- options: [
5319
- {
5320
- value: "INFORMANT",
5321
- label: {
5322
- id: "v2.correction.corrector.informant",
5323
- defaultMessage: "Informant",
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
- }
5527
+ {
5528
+ id: "correction.requester.relationship",
5529
+ type: "RADIO_GROUP",
5530
+ label: {
5531
+ id: "v2.correction.corrector.title",
5532
+ defaultMessage: "Who is requesting a change to this record?",
5533
+ description: "The title for the corrector form"
5342
5534
  },
5343
- {
5344
- value: "OTHER",
5345
- label: {
5346
- id: "v2.correction.corrector.others",
5347
- defaultMessage: "Someone else",
5348
- description: "Label for someone else option in certificate correction form"
5535
+ defaultValue: "",
5536
+ options: [
5537
+ {
5538
+ value: "INFORMANT",
5539
+ label: {
5540
+ id: "v2.correction.corrector.informant",
5541
+ defaultMessage: "Informant",
5542
+ description: "Label for informant option in certificate correction form"
5543
+ }
5544
+ },
5545
+ {
5546
+ value: "ANOTHER_AGENT",
5547
+ label: {
5548
+ id: "v2.correction.corrector.anotherAgent",
5549
+ defaultMessage: "Another registration agent or field agent",
5550
+ description: "Label for another registration or field agent option in certificate correction form"
5551
+ }
5552
+ },
5553
+ {
5554
+ value: "REGISTRAR",
5555
+ label: {
5556
+ id: "v2.correction.corrector.me",
5557
+ defaultMessage: "Me (Registrar)",
5558
+ description: "Label for registrar option in certificate correction form"
5559
+ }
5560
+ },
5561
+ {
5562
+ value: "OTHER",
5563
+ label: {
5564
+ id: "v2.correction.corrector.others",
5565
+ defaultMessage: "Someone else",
5566
+ description: "Label for someone else option in certificate correction form"
5567
+ }
5349
5568
  }
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"
5569
+ ]
5371
5570
  }
5571
+ ]
5572
+ },
5573
+ {
5574
+ id: "identity-check",
5575
+ type: PageTypes.enum.FORM,
5576
+ title: {
5577
+ id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
5578
+ defaultMessage: "Verify their identity",
5579
+ description: "This is the title of the section"
5372
5580
  },
5373
- {
5374
- id: "correction.identity-check.verified",
5375
- type: "RADIO_GROUP",
5376
- label: {
5377
- id: "correction.corrector.identity.verified.label",
5378
- defaultMessage: "Identity verified",
5379
- description: "The title for the corrector form"
5581
+ fields: [
5582
+ {
5583
+ id: "correction.identity-check.instructions",
5584
+ type: "PAGE_HEADER",
5585
+ label: {
5586
+ id: "correction.corrector.identity.instruction",
5587
+ defaultMessage: "Please verify the identity of the person making this request",
5588
+ description: "The title for the corrector form"
5589
+ }
5380
5590
  },
5381
- defaultValue: "",
5382
- required: true,
5383
- options: [
5384
- {
5385
- value: "VERIFIED",
5386
- label: {
5387
- id: "correction.corrector.identity.verified",
5388
- defaultMessage: "I have verified their identity",
5389
- description: "Label for verified option in corrector identity check page"
5591
+ {
5592
+ id: "correction.identity-check.verified",
5593
+ type: "RADIO_GROUP",
5594
+ label: {
5595
+ id: "correction.corrector.identity.verified.label",
5596
+ defaultMessage: "Identity verified",
5597
+ description: "The title for the corrector form"
5598
+ },
5599
+ defaultValue: "",
5600
+ required: true,
5601
+ options: [
5602
+ {
5603
+ value: "VERIFIED",
5604
+ label: {
5605
+ id: "correction.corrector.identity.verified",
5606
+ defaultMessage: "I have verified their identity",
5607
+ description: "Label for verified option in corrector identity check page"
5608
+ }
5390
5609
  }
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"
5610
+ ]
5423
5611
  }
5612
+ ]
5613
+ },
5614
+ {
5615
+ id: "correction-request.supporting-documents",
5616
+ type: PageTypes.enum.FORM,
5617
+ title: {
5618
+ id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
5619
+ defaultMessage: "Upload supporting documents",
5620
+ description: "This is the title of the section"
5424
5621
  },
5425
- {
5426
- id: "correction.request.supportingDocuments",
5427
- type: "RADIO_GROUP",
5428
- label: {
5429
- id: "correction.corrector.title",
5430
- defaultMessage: "Who is requesting a change to this record?",
5431
- description: "The title for the corrector form"
5622
+ fields: [
5623
+ {
5624
+ id: "correction.supportingDocs.introduction",
5625
+ type: "PAGE_HEADER",
5626
+ label: {
5627
+ id: "correction.corrector.paragraph.title",
5628
+ 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.",
5629
+ description: "The title for the corrector form"
5630
+ }
5432
5631
  },
5433
- defaultValue: "",
5434
- configuration: {
5435
- styles: {
5436
- size: "NORMAL"
5632
+ {
5633
+ id: "correction.supportingDocs",
5634
+ type: FieldType.FILE,
5635
+ label: {
5636
+ id: "correction.corrector.title",
5637
+ defaultMessage: "Upload supporting documents",
5638
+ description: "The title for the corrector form"
5437
5639
  }
5438
5640
  },
5439
- options: [
5440
- {
5441
- value: "ATTEST",
5442
- label: {
5443
- id: "correction.supportingDocuments.attest.label",
5444
- defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
5445
- description: ""
5641
+ {
5642
+ id: "correction.request.supportingDocuments",
5643
+ type: "RADIO_GROUP",
5644
+ label: {
5645
+ id: "correction.corrector.title",
5646
+ defaultMessage: "Who is requesting a change to this record?",
5647
+ description: "The title for the corrector form"
5648
+ },
5649
+ defaultValue: "",
5650
+ configuration: {
5651
+ styles: {
5652
+ size: "NORMAL"
5446
5653
  }
5447
5654
  },
5448
- {
5449
- value: "NOT_NEEDED",
5450
- label: {
5451
- id: "correction.supportingDocuments.notNeeded.label",
5452
- defaultMessage: "No supporting documents required",
5453
- description: ""
5655
+ options: [
5656
+ {
5657
+ value: "ATTEST",
5658
+ label: {
5659
+ id: "correction.supportingDocuments.attest.label",
5660
+ defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
5661
+ description: ""
5662
+ }
5663
+ },
5664
+ {
5665
+ value: "NOT_NEEDED",
5666
+ label: {
5667
+ id: "correction.supportingDocuments.notNeeded.label",
5668
+ defaultMessage: "No supporting documents required",
5669
+ description: ""
5670
+ }
5454
5671
  }
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"
5672
+ ]
5673
+ }
5674
+ ]
5467
5675
  },
5468
- fields: [
5469
- {
5470
- id: "correction.request.reason",
5471
- type: FieldType.TEXT,
5472
- label: {
5473
- id: "correction.reason.title",
5474
- defaultMessage: "Reason for correction?",
5475
- description: "The title for the corrector form"
5676
+ {
5677
+ id: "correction-request.additional-details",
5678
+ type: PageTypes.enum.FORM,
5679
+ title: {
5680
+ id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
5681
+ defaultMessage: "Reason for correction",
5682
+ description: "This is the title of the section"
5683
+ },
5684
+ fields: [
5685
+ {
5686
+ id: "correction.request.reason",
5687
+ type: FieldType.TEXT,
5688
+ label: {
5689
+ id: "correction.reason.title",
5690
+ defaultMessage: "Reason for correction?",
5691
+ description: "The title for the corrector form"
5692
+ }
5476
5693
  }
5477
- }
5478
- ]
5479
- }
5480
- ]
5694
+ ]
5695
+ }
5696
+ ]
5697
+ }
5481
5698
  },
5482
5699
  {
5483
5700
  type: ActionType.APPROVE_CORRECTION,
@@ -5560,10 +5777,10 @@ var tennisClubMembershipEvent = defineConfig({
5560
5777
  id: "v2.advancedSearch.form.registrationDetails"
5561
5778
  },
5562
5779
  fields: [
5563
- event("legalStatus.REGISTERED.createdAtLocation").exact(),
5564
- event("legalStatus.REGISTERED.createdAt").range(),
5565
- event("status", statusOptions).exact(),
5566
- event("updatedAt", timePeriodOptions).range()
5780
+ event("legalStatuses.REGISTERED.createdAtLocation").exact(),
5781
+ event("legalStatuses.REGISTERED.acceptedAt").range(),
5782
+ event("status").exact(),
5783
+ event("updatedAt").range()
5567
5784
  ]
5568
5785
  },
5569
5786
  {
@@ -5680,197 +5897,202 @@ var footballClubMembershipEvent = defineConfig({
5680
5897
  description: "This is shown as the action name anywhere the user can trigger the action from",
5681
5898
  id: "event.football-club-membership.action.correction.request.label"
5682
5899
  },
5683
- onboardingForm: [
5684
- {
5685
- id: "correction-requester",
5686
- type: PageTypes.enum.FORM,
5687
- title: {
5688
- id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
5689
- defaultMessage: "Correction requester",
5690
- description: "This is the title of the section"
5691
- },
5692
- fields: [
5693
- {
5694
- id: "correction.requester.relationshop.intro",
5695
- type: "PAGE_HEADER",
5696
- label: {
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
- }
5900
+ correctionForm: {
5901
+ label: {
5902
+ id: "event.football-club-membership.action.correction.request.label",
5903
+ defaultMessage: "Request correction",
5904
+ description: "This is shown as the action name anywhere the user can trigger the action from"
5905
+ },
5906
+ pages: [
5907
+ {
5908
+ id: "correction-requester",
5909
+ type: PageTypes.enum.FORM,
5910
+ title: {
5911
+ id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
5912
+ defaultMessage: "Correction requester",
5913
+ description: "This is the title of the section"
5701
5914
  },
5702
- {
5703
- id: "correction.requester.relationship",
5704
- type: "RADIO_GROUP",
5705
- label: {
5706
- id: "v2.correction.corrector.title",
5707
- defaultMessage: "Who is requesting a change to this record?",
5708
- description: "The title for the corrector form"
5915
+ fields: [
5916
+ {
5917
+ id: "correction.requester.relationshop.intro",
5918
+ type: "PAGE_HEADER",
5919
+ label: {
5920
+ id: "correction.requester.relationshop.intro.label",
5921
+ 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.",
5922
+ description: "The title for the corrector form"
5923
+ }
5709
5924
  },
5710
- defaultValue: "",
5711
- options: [
5712
- {
5713
- value: "INFORMANT",
5714
- label: {
5715
- id: "v2.correction.corrector.informant",
5716
- defaultMessage: "Informant",
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
- }
5925
+ {
5926
+ id: "correction.requester.relationship",
5927
+ type: "RADIO_GROUP",
5928
+ label: {
5929
+ id: "v2.correction.corrector.title",
5930
+ defaultMessage: "Who is requesting a change to this record?",
5931
+ description: "The title for the corrector form"
5735
5932
  },
5736
- {
5737
- value: "OTHER",
5738
- label: {
5739
- id: "v2.correction.corrector.others",
5740
- defaultMessage: "Someone else",
5741
- description: "Label for someone else option in certificate correction form"
5933
+ defaultValue: "",
5934
+ options: [
5935
+ {
5936
+ value: "INFORMANT",
5937
+ label: {
5938
+ id: "v2.correction.corrector.informant",
5939
+ defaultMessage: "Informant",
5940
+ description: "Label for informant option in certificate correction form"
5941
+ }
5942
+ },
5943
+ {
5944
+ value: "ANOTHER_AGENT",
5945
+ label: {
5946
+ id: "v2.correction.corrector.anotherAgent",
5947
+ defaultMessage: "Another registration agent or field agent",
5948
+ description: "Label for another registration or field agent option in certificate correction form"
5949
+ }
5950
+ },
5951
+ {
5952
+ value: "REGISTRAR",
5953
+ label: {
5954
+ id: "v2.correction.corrector.me",
5955
+ defaultMessage: "Me (Registrar)",
5956
+ description: "Label for registrar option in certificate correction form"
5957
+ }
5958
+ },
5959
+ {
5960
+ value: "OTHER",
5961
+ label: {
5962
+ id: "v2.correction.corrector.others",
5963
+ defaultMessage: "Someone else",
5964
+ description: "Label for someone else option in certificate correction form"
5965
+ }
5742
5966
  }
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"
5967
+ ]
5764
5968
  }
5969
+ ]
5970
+ },
5971
+ {
5972
+ id: "identity-check",
5973
+ type: PageTypes.enum.FORM,
5974
+ title: {
5975
+ id: "event.football-club-membership.action.requestCorrection.form.section.verify",
5976
+ defaultMessage: "Verify their identity",
5977
+ description: "This is the title of the section"
5765
5978
  },
5766
- {
5767
- id: "correction.identity-check.verified",
5768
- type: "RADIO_GROUP",
5769
- label: {
5770
- id: "correction.corrector.identity.verified.label",
5771
- defaultMessage: "Identity verified",
5772
- description: "The title for the corrector form"
5979
+ fields: [
5980
+ {
5981
+ id: "correction.identity-check.instructions",
5982
+ type: "PAGE_HEADER",
5983
+ label: {
5984
+ id: "correction.corrector.identity.instruction",
5985
+ defaultMessage: "Please verify the identity of the person making this request",
5986
+ description: "The title for the corrector form"
5987
+ }
5773
5988
  },
5774
- defaultValue: "",
5775
- required: true,
5776
- options: [
5777
- {
5778
- value: "VERIFIED",
5779
- label: {
5780
- id: "correction.corrector.identity.verified",
5781
- defaultMessage: "I have verified their identity",
5782
- description: "Label for verified option in corrector identity check page"
5989
+ {
5990
+ id: "correction.identity-check.verified",
5991
+ type: "RADIO_GROUP",
5992
+ label: {
5993
+ id: "correction.corrector.identity.verified.label",
5994
+ defaultMessage: "Identity verified",
5995
+ description: "The title for the corrector form"
5996
+ },
5997
+ defaultValue: "",
5998
+ required: true,
5999
+ options: [
6000
+ {
6001
+ value: "VERIFIED",
6002
+ label: {
6003
+ id: "correction.corrector.identity.verified",
6004
+ defaultMessage: "I have verified their identity",
6005
+ description: "Label for verified option in corrector identity check page"
6006
+ }
5783
6007
  }
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"
6008
+ ]
5816
6009
  }
6010
+ ]
6011
+ },
6012
+ {
6013
+ id: "correction-request.supporting-documents",
6014
+ type: PageTypes.enum.FORM,
6015
+ title: {
6016
+ id: "event.football-club-membership.action.requestCorrection.form.section.verify",
6017
+ defaultMessage: "Upload supporting documents",
6018
+ description: "This is the title of the section"
5817
6019
  },
5818
- {
5819
- id: "correction.request.supportingDocuments",
5820
- type: "RADIO_GROUP",
5821
- label: {
5822
- id: "correction.corrector.title",
5823
- defaultMessage: "Who is requesting a change to this record?",
5824
- description: "The title for the corrector form"
6020
+ fields: [
6021
+ {
6022
+ id: "correction.supportingDocs.introduction",
6023
+ type: "PAGE_HEADER",
6024
+ label: {
6025
+ id: "correction.corrector.paragraph.title",
6026
+ 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.",
6027
+ description: "The title for the corrector form"
6028
+ }
5825
6029
  },
5826
- defaultValue: "",
5827
- configuration: {
5828
- styles: {
5829
- size: "NORMAL"
6030
+ {
6031
+ id: "correction.supportingDocs",
6032
+ type: FieldType.FILE,
6033
+ label: {
6034
+ id: "correction.corrector.title",
6035
+ defaultMessage: "Upload supporting documents",
6036
+ description: "The title for the corrector form"
5830
6037
  }
5831
6038
  },
5832
- options: [
5833
- {
5834
- value: "ATTEST",
5835
- label: {
5836
- id: "correction.supportingDocuments.attest.label",
5837
- defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
5838
- description: ""
6039
+ {
6040
+ id: "correction.request.supportingDocuments",
6041
+ type: "RADIO_GROUP",
6042
+ label: {
6043
+ id: "correction.corrector.title",
6044
+ defaultMessage: "Who is requesting a change to this record?",
6045
+ description: "The title for the corrector form"
6046
+ },
6047
+ defaultValue: "",
6048
+ configuration: {
6049
+ styles: {
6050
+ size: "NORMAL"
5839
6051
  }
5840
6052
  },
5841
- {
5842
- value: "NOT_NEEDED",
5843
- label: {
5844
- id: "correction.supportingDocuments.notNeeded.label",
5845
- defaultMessage: "No supporting documents required",
5846
- description: ""
6053
+ options: [
6054
+ {
6055
+ value: "ATTEST",
6056
+ label: {
6057
+ id: "correction.supportingDocuments.attest.label",
6058
+ defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
6059
+ description: ""
6060
+ }
6061
+ },
6062
+ {
6063
+ value: "NOT_NEEDED",
6064
+ label: {
6065
+ id: "correction.supportingDocuments.notNeeded.label",
6066
+ defaultMessage: "No supporting documents required",
6067
+ description: ""
6068
+ }
5847
6069
  }
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"
6070
+ ]
6071
+ }
6072
+ ]
5860
6073
  },
5861
- fields: [
5862
- {
5863
- id: "correction.request.reason",
5864
- type: FieldType.TEXT,
5865
- label: {
5866
- id: "correction.reason.title",
5867
- defaultMessage: "Reason for correction?",
5868
- description: "The title for the corrector form"
6074
+ {
6075
+ id: "correction-request.additional-details",
6076
+ type: PageTypes.enum.FORM,
6077
+ title: {
6078
+ id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
6079
+ defaultMessage: "Reason for correction",
6080
+ description: "This is the title of the section"
6081
+ },
6082
+ fields: [
6083
+ {
6084
+ id: "correction.request.reason",
6085
+ type: FieldType.TEXT,
6086
+ label: {
6087
+ id: "correction.reason.title",
6088
+ defaultMessage: "Reason for correction?",
6089
+ description: "The title for the corrector form"
6090
+ }
5869
6091
  }
5870
- }
5871
- ]
5872
- }
5873
- ]
6092
+ ]
6093
+ }
6094
+ ]
6095
+ }
5874
6096
  },
5875
6097
  {
5876
6098
  type: ActionType.APPROVE_CORRECTION,
@@ -5953,10 +6175,10 @@ var footballClubMembershipEvent = defineConfig({
5953
6175
  id: "v2.advancedSearch.form.registrationDetails"
5954
6176
  },
5955
6177
  fields: [
5956
- event("legalStatus.REGISTERED.createdAtLocation").exact(),
5957
- event("legalStatus.REGISTERED.createdAt").range(),
5958
- event("status", statusOptions).exact(),
5959
- event("updatedAt", timePeriodOptions).range()
6178
+ event("legalStatuses.REGISTERED.createdAtLocation").exact(),
6179
+ event("legalStatuses.REGISTERED.acceptedAt").range(),
6180
+ event("status").exact(),
6181
+ event("updatedAt").range()
5960
6182
  ]
5961
6183
  },
5962
6184
  {
@@ -6169,8 +6391,9 @@ var v2BirthEvent = defineConfig({
6169
6391
  });
6170
6392
 
6171
6393
  // ../commons/src/events/test.utils.ts
6172
- var import_zod33 = require("zod");
6173
- var TestUserRole = import_zod33.z.enum([
6394
+ var import_zod34 = require("zod");
6395
+ var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
6396
+ var TestUserRole = import_zod34.z.enum([
6174
6397
  "FIELD_AGENT",
6175
6398
  "LOCAL_REGISTRAR",
6176
6399
  "LOCAL_SYSTEM_ADMIN",
@@ -6225,6 +6448,7 @@ function mapFieldTypeToMockValue(field2, i, rng) {
6225
6448
  case FieldType.PAGE_HEADER:
6226
6449
  case FieldType.LOCATION:
6227
6450
  case FieldType.SELECT:
6451
+ case FieldType.SELECT_DATE_RANGE:
6228
6452
  case FieldType.COUNTRY:
6229
6453
  case FieldType.RADIO_GROUP:
6230
6454
  case FieldType.PARAGRAPH:
@@ -6255,14 +6479,19 @@ function mapFieldTypeToMockValue(field2, i, rng) {
6255
6479
  };
6256
6480
  case FieldType.DATE:
6257
6481
  return "2021-01-01";
6482
+ case FieldType.TIME:
6483
+ return "09:33";
6258
6484
  case FieldType.DATE_RANGE:
6259
- return ["2021-01-01", "2021-01-02"];
6485
+ return {
6486
+ start: "2021-01-01",
6487
+ end: "2021-01-31"
6488
+ };
6260
6489
  case FieldType.CHECKBOX:
6261
6490
  return true;
6262
6491
  case FieldType.SIGNATURE:
6263
6492
  case FieldType.FILE:
6264
6493
  return {
6265
- filename: "4f095fc4-4312-4de2-aa38-86dcc0f71044.png",
6494
+ path: "/ocrvs/4f095fc4-4312-4de2-aa38-86dcc0f71044.png",
6266
6495
  originalFilename: "abcd.png",
6267
6496
  type: "image/png"
6268
6497
  };
@@ -6325,7 +6554,11 @@ function eventPayloadGenerator(rng) {
6325
6554
  type: input.type ?? TENNIS_CLUB_MEMBERSHIP,
6326
6555
  id
6327
6556
  }),
6328
- draft: ({ eventId, actionType }, input = {}) => (0, import_lodash2.merge)(
6557
+ draft: ({
6558
+ eventId,
6559
+ actionType,
6560
+ annotation
6561
+ }, input = {}) => (0, import_lodash3.merge)(
6329
6562
  {
6330
6563
  id: getUUID(),
6331
6564
  eventId,
@@ -6341,11 +6574,16 @@ function eventPayloadGenerator(rng) {
6341
6574
  surname: "McLaren"
6342
6575
  },
6343
6576
  "applicant.dob": "2020-01-02",
6344
- "recommender.none": true
6577
+ "applicant.image": {
6578
+ path: "/ocrvs/e56d1dd3-2cd4-452a-b54e-bf3e2d830605.png",
6579
+ originalFilename: "Screenshot.png",
6580
+ type: "image/png"
6581
+ }
6345
6582
  },
6346
6583
  annotation: {
6347
6584
  "correction.requester.relationship": "ANOTHER_AGENT",
6348
- "correction.request.reason": "Child's name was incorrect"
6585
+ "correction.request.reason": "Child's name was incorrect",
6586
+ ...annotation
6349
6587
  },
6350
6588
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
6351
6589
  createdBy: "@todo",
@@ -6379,13 +6617,13 @@ function eventPayloadGenerator(rng) {
6379
6617
  notify: (eventId, input = {}) => {
6380
6618
  let declaration = input.declaration;
6381
6619
  if (!declaration) {
6382
- const partialDeclaration = (0, import_lodash2.omitBy)(
6620
+ const partialDeclaration = (0, import_lodash3.omitBy)(
6383
6621
  generateActionDeclarationInput(
6384
6622
  tennisClubMembershipEvent,
6385
6623
  ActionType.DECLARE,
6386
6624
  rng
6387
6625
  ),
6388
- import_lodash2.isString
6626
+ import_lodash3.isString
6389
6627
  );
6390
6628
  declaration = partialDeclaration;
6391
6629
  }
@@ -6488,10 +6726,13 @@ function eventPayloadGenerator(rng) {
6488
6726
  request: (eventId, input = {}) => ({
6489
6727
  type: ActionType.REQUEST_CORRECTION,
6490
6728
  transactionId: input.transactionId ?? getUUID(),
6491
- declaration: input.declaration ?? generateActionDeclarationInput(
6492
- tennisClubMembershipEvent,
6493
- ActionType.REQUEST_CORRECTION,
6494
- rng
6729
+ declaration: input.declaration ?? (0, import_lodash3.omit)(
6730
+ generateActionDeclarationInput(
6731
+ tennisClubMembershipEvent,
6732
+ ActionType.REQUEST_CORRECTION,
6733
+ rng
6734
+ ),
6735
+ ["applicant.email"]
6495
6736
  ),
6496
6737
  annotation: input.annotation ?? generateActionAnnotationInput(
6497
6738
  tennisClubMembershipEvent,
@@ -6712,7 +6953,7 @@ var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
6712
6953
  createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
6713
6954
  updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
6714
6955
  createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
6715
- updatedAt: overrides.updatedAt ?? (0, import_addDays.default)(new Date(createdAt), 1).toISOString(),
6956
+ updatedAt: overrides.updatedAt ?? (0, import_date_fns4.addDays)(new Date(createdAt), 1).toISOString(),
6716
6957
  assignedTo: overrides.assignedTo ?? null,
6717
6958
  updatedBy: overrides.updatedBy ?? generateUuid(rng),
6718
6959
  updatedByUserRole: overrides.updatedByUserRole ?? "FIELD_AGENT",
@@ -6784,7 +7025,7 @@ function isFieldConfigDefaultValue(value) {
6784
7025
  }
6785
7026
 
6786
7027
  // ../commons/src/events/scopes.ts
6787
- var import_lodash3 = require("lodash");
7028
+ var import_lodash4 = require("lodash");
6788
7029
  var CONFIG_GET_ALLOWED_SCOPES = [
6789
7030
  SCOPES.RECORD_DECLARE,
6790
7031
  SCOPES.RECORD_READ,
@@ -6831,7 +7072,11 @@ var ACTION_ALLOWED_SCOPES = {
6831
7072
  [ActionType.REGISTER]: [SCOPES.RECORD_REGISTER],
6832
7073
  [ActionType.PRINT_CERTIFICATE]: [SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES],
6833
7074
  [ActionType.REQUEST_CORRECTION]: [
6834
- SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION
7075
+ SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION,
7076
+ SCOPES.RECORD_REGISTRATION_CORRECT
7077
+ ],
7078
+ [ExclusiveActions.REVIEW_CORRECTION_REQUEST]: [
7079
+ SCOPES.RECORD_REGISTRATION_CORRECT
6835
7080
  ],
6836
7081
  [ActionType.REJECT_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
6837
7082
  [ActionType.APPROVE_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
@@ -6868,19 +7113,19 @@ var WRITE_ACTION_SCOPES = [
6868
7113
  ...ACTION_ALLOWED_SCOPES[ActionType.PRINT_CERTIFICATE]
6869
7114
  ];
6870
7115
  function hasAnyOfScopes(a, b) {
6871
- return (0, import_lodash3.intersection)(a, b).length > 0;
7116
+ return (0, import_lodash4.intersection)(a, b).length > 0;
6872
7117
  }
6873
7118
 
6874
7119
  // ../commons/src/events/serializers/user/deserializer.ts
6875
- var import_zod34 = require("zod");
7120
+ var import_zod35 = require("zod");
6876
7121
  var UserWithPrimaryOffice = User.extend({
6877
- primaryOfficeId: import_zod34.z.string()
7122
+ primaryOfficeId: import_zod35.z.string()
6878
7123
  });
6879
7124
  function userDeserializer(serializedUserField, user2) {
6880
7125
  if (typeof serializedUserField === "string") {
6881
7126
  return serializedUserField;
6882
7127
  }
6883
- if (serializedUserField.$userField === "name" || serializedUserField.$userField === "signatureFilename") {
7128
+ if (serializedUserField.$userField === "name" || serializedUserField.$userField === "signature" || serializedUserField.$userField === "avatar") {
6884
7129
  throw new Error(
6885
7130
  `Deserializer for ${serializedUserField.$userField} is not implemented yet`
6886
7131
  );
@@ -6962,20 +7207,21 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
6962
7207
  ActionType.ARCHIVE,
6963
7208
  ActionType.REJECT
6964
7209
  ],
6965
- [EventStatus.enum.REJECTED]: [
6966
- ActionType.READ,
6967
- ActionType.DECLARE,
6968
- ActionType.VALIDATE
6969
- ],
6970
7210
  [EventStatus.enum.REGISTERED]: [
6971
7211
  ActionType.READ,
6972
7212
  ActionType.PRINT_CERTIFICATE,
6973
- ActionType.REQUEST_CORRECTION
7213
+ ActionType.REQUEST_CORRECTION,
7214
+ ActionType.APPROVE_CORRECTION,
7215
+ ActionType.REJECT_CORRECTION,
7216
+ ExclusiveActions.REVIEW_CORRECTION_REQUEST
6974
7217
  ],
6975
7218
  [EventStatus.enum.CERTIFIED]: [
6976
7219
  ActionType.READ,
6977
7220
  ActionType.PRINT_CERTIFICATE,
6978
- ActionType.REQUEST_CORRECTION
7221
+ ActionType.REQUEST_CORRECTION,
7222
+ ActionType.APPROVE_CORRECTION,
7223
+ ActionType.REJECT_CORRECTION,
7224
+ ExclusiveActions.REVIEW_CORRECTION_REQUEST
6979
7225
  ],
6980
7226
  [EventStatus.enum.ARCHIVED]: [
6981
7227
  ActionType.READ,
@@ -6983,3 +7229,10 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
6983
7229
  ActionType.UNASSIGN
6984
7230
  ]
6985
7231
  };
7232
+ var getAvailableActionsForEvent = (event2) => {
7233
+ return event2.flags.includes(InherentFlags.REJECTED) ? [
7234
+ ActionType.READ,
7235
+ event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
7236
+ ActionType.ARCHIVE
7237
+ ] : AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
7238
+ };