@opencrvs/toolkit 1.8.1-rc.4c1434e → 1.8.1-rc.4ed8a2e

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 (31) hide show
  1. package/dist/commons/api/router.d.ts +391 -394
  2. package/dist/commons/conditionals/validate.d.ts +8 -0
  3. package/dist/commons/events/ActionConfig.d.ts +2004 -366
  4. package/dist/commons/events/ActionDocument.d.ts +736 -736
  5. package/dist/commons/events/ActionInput.d.ts +600 -600
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +49 -31
  7. package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
  8. package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
  9. package/dist/commons/events/Draft.d.ts +48 -48
  10. package/dist/commons/events/EventConfig.d.ts +673 -146
  11. package/dist/commons/events/EventDocument.d.ts +432 -432
  12. package/dist/commons/events/EventIndex.d.ts +62 -65
  13. package/dist/commons/events/EventMetadata.d.ts +9 -12
  14. package/dist/commons/events/FieldConfig.d.ts +254 -43
  15. package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
  16. package/dist/commons/events/FieldValue.d.ts +12 -12
  17. package/dist/commons/events/FormConfig.d.ts +1032 -246
  18. package/dist/commons/events/PageConfig.d.ts +264 -46
  19. package/dist/commons/events/WorkqueueConfig.d.ts +199 -164
  20. package/dist/commons/events/defineConfig.d.ts +127 -28
  21. package/dist/commons/events/event.d.ts +6 -6
  22. package/dist/commons/events/test.utils.d.ts +12 -12
  23. package/dist/commons/events/utils.d.ts +234 -58
  24. package/dist/conditionals/index.js +3 -2
  25. package/dist/events/index.js +142 -94
  26. package/package.json +1 -1
  27. package/tsconfig.json +1 -1
  28. package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
  29. package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
  30. package/dist/commons/conditionals/validate.test.d.ts +0 -2
  31. package/dist/commons/events/utils.test.d.ts +0 -2
@@ -40,6 +40,7 @@ __export(events_exports, {
40
40
  ActionConfigBase: () => ActionConfigBase,
41
41
  ActionCreationMetadata: () => ActionCreationMetadata,
42
42
  ActionDocument: () => ActionDocument,
43
+ ActionFlag: () => ActionFlag,
43
44
  ActionFormConfig: () => ActionFormConfig,
44
45
  ActionInput: () => ActionInput,
45
46
  ActionStatus: () => ActionStatus,
@@ -95,6 +96,7 @@ __export(events_exports, {
95
96
  EventDocument: () => EventDocument,
96
97
  EventFieldConfigSchema: () => EventFieldConfigSchema,
97
98
  EventFieldId: () => EventFieldId,
99
+ EventFieldIdInput: () => EventFieldIdInput,
98
100
  EventIndex: () => EventIndex,
99
101
  EventInput: () => EventInput,
100
102
  EventMetadata: () => EventMetadata,
@@ -129,8 +131,10 @@ __export(events_exports, {
129
131
  InherentFlags: () => InherentFlags,
130
132
  LanguageConfig: () => LanguageConfig,
131
133
  LegalStatuses: () => LegalStatuses,
134
+ METADATA_FIELD_PREFIX: () => METADATA_FIELD_PREFIX,
132
135
  MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
133
136
  MimeType: () => MimeType,
137
+ NameConfig: () => NameConfig,
134
138
  NameFieldUpdateValue: () => NameFieldUpdateValue,
135
139
  NameFieldValue: () => NameFieldValue,
136
140
  NonEmptyTextValue: () => NonEmptyTextValue,
@@ -168,6 +172,7 @@ __export(events_exports, {
168
172
  TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
169
173
  TEST_SYSTEM_IANA_TIMEZONE: () => TEST_SYSTEM_IANA_TIMEZONE,
170
174
  TestUserRole: () => TestUserRole,
175
+ TextField: () => TextField,
171
176
  TextValue: () => TextValue,
172
177
  TimeValue: () => TimeValue,
173
178
  TranslationConfig: () => TranslationConfig,
@@ -179,7 +184,6 @@ __export(events_exports, {
179
184
  ValidationConfig: () => ValidationConfig,
180
185
  VerificationActionConfig: () => VerificationActionConfig,
181
186
  VerificationPageConfig: () => VerificationPageConfig,
182
- VisibleStatus: () => VisibleStatus,
183
187
  WRITE_ACTION_SCOPES: () => WRITE_ACTION_SCOPES,
184
188
  Within: () => Within,
185
189
  WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
@@ -322,6 +326,7 @@ __export(events_exports, {
322
326
  or: () => or,
323
327
  resolveDateOfEvent: () => resolveDateOfEvent,
324
328
  runFieldValidations: () => runFieldValidations,
329
+ runStructuralValidations: () => runStructuralValidations,
325
330
  timePeriodToDateRange: () => timePeriodToDateRange,
326
331
  user: () => user,
327
332
  validate: () => validate,
@@ -556,7 +561,7 @@ var import_zod6 = require("zod");
556
561
  var import_zod4 = require("zod");
557
562
  var import_zod_openapi3 = require("zod-openapi");
558
563
  (0, import_zod_openapi3.extendZodWithOpenApi)(import_zod4.z);
559
- var FullDocumentURL = import_zod4.z.string().brand("FullDocumentURL").describe(
564
+ var FullDocumentUrl = import_zod4.z.string().brand("FullDocumentUrl").describe(
560
565
  "A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio/bucket-name/document-id.jpg"
561
566
  );
562
567
  var FullDocumentPath = import_zod4.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
@@ -608,13 +613,13 @@ var UrbanAddressUpdateValue = AdminStructure.extend({
608
613
  zipCode: import_zod5.z.string().nullish()
609
614
  });
610
615
  var NameFieldValue = import_zod5.z.object({
611
- firstname: import_zod5.z.string().min(1),
612
- surname: import_zod5.z.string().min(1),
616
+ firstname: import_zod5.z.string(),
617
+ surname: import_zod5.z.string(),
613
618
  middlename: import_zod5.z.string().optional()
614
619
  });
615
620
  var NameFieldUpdateValue = import_zod5.z.object({
616
- firstname: import_zod5.z.string().nullish(),
617
- surname: import_zod5.z.string().nullish(),
621
+ firstname: import_zod5.z.string(),
622
+ surname: import_zod5.z.string(),
618
623
  middlename: import_zod5.z.string().nullish()
619
624
  }).or(import_zod5.z.null()).or(import_zod5.z.undefined());
620
625
  var RuralAddressUpdateValue = AdminStructure.extend({
@@ -911,18 +916,32 @@ var SelectDateRangeField = BaseField.extend({
911
916
  defaultValue: SelectDateRangeValue.optional(),
912
917
  options: import_zod7.z.array(SelectDateRangeOption).describe("A list of options")
913
918
  }).describe("Select input with date range options");
919
+ var NameConfig = import_zod7.z.object({
920
+ firstname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
921
+ middlename: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
922
+ surname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional()
923
+ });
914
924
  var NameField = BaseField.extend({
915
925
  type: import_zod7.z.literal(FieldType.NAME),
916
926
  defaultValue: import_zod7.z.object({
917
- firstname: NonEmptyTextValue,
918
- surname: NonEmptyTextValue
927
+ firstname: NonEmptyTextValue.optional(),
928
+ middlename: NonEmptyTextValue.optional(),
929
+ surname: NonEmptyTextValue.optional()
919
930
  }).optional(),
920
931
  configuration: import_zod7.z.object({
932
+ name: NameConfig.default({
933
+ firstname: { required: true },
934
+ surname: { required: true }
935
+ }).optional(),
921
936
  maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
922
937
  prefix: TranslationConfig.optional(),
923
938
  postfix: TranslationConfig.optional(),
924
- includeMiddlename: import_zod7.z.boolean().default(false).optional().describe("To make middle name visible in Name form field"),
925
939
  searchMode: import_zod7.z.boolean().optional()
940
+ }).default({
941
+ name: {
942
+ firstname: { required: true },
943
+ surname: { required: true }
944
+ }
926
945
  }).optional()
927
946
  }).describe("Name input field");
928
947
  var PhoneField = BaseField.extend({
@@ -1397,22 +1416,30 @@ var FieldConfigSchema = BaseField3.extend({
1397
1416
  fieldType: import_zod15.z.literal("field"),
1398
1417
  alternateFieldIds: import_zod15.z.array(import_zod15.z.string()).optional().describe(
1399
1418
  `Sometimes there might be need to search a value against multiple field of same FormField type. For example
1400
- search Country, Province, District against child.address.private and child.address.other. In such case, we
1419
+ search Country, Province, District against child.address.private and child.address.other. In such case, we
1401
1420
  add a one field as fieldId, and accomodate others in alternateFieldIds`
1402
1421
  ),
1403
- excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
1404
- conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
1422
+ excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
1423
+ conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
1405
1424
  is select field, which has 3 options, FACILITY, PRIVATE_HOME, OTHER. Upon selecting any of the option, pops up another field
1406
1425
  related to the selected option, whose value is required in the search query. But child.placeOfBirth itself is not needed in the query.
1407
1426
  In such case, populate this field (excludeInSearchQuery) with boolean true`)
1408
1427
  });
1409
- var EventFieldId = import_zod15.z.enum([
1428
+ var EventFieldIdInput = import_zod15.z.enum([
1410
1429
  "trackingId",
1411
1430
  "status",
1412
1431
  "legalStatuses.REGISTERED.acceptedAt",
1413
1432
  "legalStatuses.REGISTERED.createdAtLocation",
1414
1433
  "updatedAt"
1415
1434
  ]);
1435
+ var METADATA_FIELD_PREFIX = "event.";
1436
+ var EventFieldId = import_zod15.z.enum([
1437
+ `${METADATA_FIELD_PREFIX}trackingId`,
1438
+ `${METADATA_FIELD_PREFIX}status`,
1439
+ `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
1440
+ `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
1441
+ `${METADATA_FIELD_PREFIX}updatedAt`
1442
+ ]);
1416
1443
  var EventFieldConfigSchema = BaseField3.extend({
1417
1444
  fieldId: EventFieldId,
1418
1445
  fieldType: import_zod15.z.literal("event")
@@ -2264,6 +2291,10 @@ var isNonInteractiveFieldType = (field2) => {
2264
2291
  var ajv = new import__.default({
2265
2292
  $data: true,
2266
2293
  allowUnionTypes: true,
2294
+ // This must be here to prevent memory leaks
2295
+ // https://www.poberezkin.com/posts/2021-02-11-ajv-version-7-big-changes-and-improvements.html#caching-compiled-schemas
2296
+ // https://github.com/ajv-validator/ajv/issues/1413
2297
+ addUsedSchema: false,
2267
2298
  strict: false
2268
2299
  // Allow minContains and other newer features
2269
2300
  });
@@ -2438,6 +2469,23 @@ function validateFieldInput({
2438
2469
  const rawError = zodType.safeParse(value, { errorMap: zodToIntlErrorMap });
2439
2470
  return rawError.error?.issues.map((issue) => issue.message) ?? [];
2440
2471
  }
2472
+ function runStructuralValidations({
2473
+ field: field2,
2474
+ values
2475
+ }) {
2476
+ if (!isFieldVisible(field2, values) || isFieldEmptyAndNotRequired(field2, values)) {
2477
+ return {
2478
+ errors: []
2479
+ };
2480
+ }
2481
+ const fieldValidationResult = validateFieldInput({
2482
+ field: field2,
2483
+ value: values[field2.id]
2484
+ });
2485
+ return {
2486
+ errors: fieldValidationResult
2487
+ };
2488
+ }
2441
2489
  function runFieldValidations({
2442
2490
  field: field2,
2443
2491
  values
@@ -2728,16 +2776,16 @@ function timePeriodToDateRange(value) {
2728
2776
  let startDate;
2729
2777
  switch (value) {
2730
2778
  case "last7Days":
2731
- startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 6);
2779
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7);
2732
2780
  break;
2733
2781
  case "last30Days":
2734
- startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 29);
2782
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 30);
2735
2783
  break;
2736
2784
  case "last90Days":
2737
- startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 89);
2785
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 90);
2738
2786
  break;
2739
2787
  case "last365Days":
2740
- startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 364);
2788
+ startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 365);
2741
2789
  break;
2742
2790
  }
2743
2791
  return {
@@ -3104,8 +3152,9 @@ function createFieldConditionals(fieldId) {
3104
3152
  properties: {
3105
3153
  [fieldId]: {
3106
3154
  type: "string",
3107
- 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'._-]*)*$",
3108
- description: "Name must contain only letters, numbers, and allowed special characters ('._-). No double spaces."
3155
+ minLength: 1,
3156
+ 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'.-]*)*$",
3157
+ description: "Name must contain only letters, numbers, and allowed special characters ('.-). No double spaces."
3109
3158
  }
3110
3159
  }
3111
3160
  }),
@@ -3218,7 +3267,7 @@ function createSearchConfig(baseField) {
3218
3267
  // ../commons/src/event-config/event-configuration.ts
3219
3268
  function createEventFieldConfig(fieldId) {
3220
3269
  const baseField = {
3221
- fieldId,
3270
+ fieldId: `${METADATA_FIELD_PREFIX}${fieldId}`,
3222
3271
  fieldType: "event"
3223
3272
  };
3224
3273
  return createSearchConfig(baseField);
@@ -3350,24 +3399,23 @@ var EventStatus = import_zod23.z.enum([
3350
3399
  "DECLARED",
3351
3400
  "VALIDATED",
3352
3401
  "REGISTERED",
3353
- "CERTIFIED",
3354
3402
  "ARCHIVED"
3355
3403
  ]);
3356
- var VisibleStatus = import_zod23.z.enum([...EventStatus.options, "REJECTED"]);
3357
3404
  var InherentFlags = {
3358
- PRINTED: "printed",
3405
+ PENDING_CERTIFICATION: "pending-certification",
3359
3406
  INCOMPLETE: "incomplete",
3360
3407
  REJECTED: "rejected",
3361
3408
  CORRECTION_REQUESTED: "correction-requested"
3362
3409
  };
3363
- var Flag = import_zod23.z.string().regex(
3410
+ var ActionFlag = import_zod23.z.string().regex(
3364
3411
  new RegExp(
3365
3412
  `^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
3366
3413
  ActionStatus
3367
3414
  ).join("|").toLowerCase()})$`
3368
3415
  ),
3369
3416
  "Flag must be in the format ActionType:ActionStatus (lowerCase)"
3370
- ).or(import_zod23.z.nativeEnum(InherentFlags));
3417
+ );
3418
+ var Flag = ActionFlag.or(import_zod23.z.nativeEnum(InherentFlags));
3371
3419
  var ZodDate = import_zod23.z.string().date();
3372
3420
  var ActionCreationMetadata = import_zod23.z.object({
3373
3421
  createdAt: import_zod23.z.string().datetime().describe("The timestamp when the action request was created."),
@@ -3416,8 +3464,7 @@ var EventMetadata = import_zod23.z.object({
3416
3464
  trackingId: import_zod23.z.string().describe(
3417
3465
  "System-generated tracking ID used by informants or registrars to look up the event."
3418
3466
  ),
3419
- flags: import_zod23.z.array(Flag),
3420
- modifiedAt: import_zod23.z.string().optional()
3467
+ flags: import_zod23.z.array(Flag)
3421
3468
  });
3422
3469
  var EventMetadataKeysArray = [
3423
3470
  "id",
@@ -3884,7 +3931,8 @@ var WorkqueueConfig = import_zod28.z.object({
3884
3931
  })
3885
3932
  ),
3886
3933
  columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
3887
- icon: AvailableIcons
3934
+ icon: AvailableIcons,
3935
+ emptyMessage: TranslationConfig.optional()
3888
3936
  }).describe("Configuration for workqueue.");
3889
3937
  var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
3890
3938
  query: true,
@@ -3903,7 +3951,8 @@ var WorkqueueConfigInput = import_zod28.z.object({
3903
3951
  })
3904
3952
  ),
3905
3953
  columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
3906
- icon: AvailableIcons
3954
+ icon: AvailableIcons,
3955
+ emptyMessage: TranslationConfig.optional()
3907
3956
  });
3908
3957
  function defineWorkqueue(workqueueInput) {
3909
3958
  const queryInput = workqueueInput.query;
@@ -4205,16 +4254,19 @@ function getLegalStatuses(actions) {
4205
4254
  }
4206
4255
 
4207
4256
  // ../commons/src/events/state/flags.ts
4208
- function isCertificatePrinted(actions) {
4257
+ function isPendingCertification(actions) {
4258
+ if (getStatusFromActions(actions) !== EventStatus.enum.REGISTERED) {
4259
+ return false;
4260
+ }
4209
4261
  return actions.reduce((prev, { type }) => {
4210
4262
  if (type === ActionType.PRINT_CERTIFICATE) {
4211
- return true;
4263
+ return false;
4212
4264
  }
4213
4265
  if (type === ActionType.APPROVE_CORRECTION) {
4214
- return false;
4266
+ return true;
4215
4267
  }
4216
4268
  return prev;
4217
- }, false);
4269
+ }, true);
4218
4270
  }
4219
4271
  function isCorrectionRequested(actions) {
4220
4272
  return actions.reduce((prev, { type }) => {
@@ -4249,8 +4301,8 @@ function getFlagsFromActions(actions) {
4249
4301
  const flag = joinValues([type, status], ":").toLowerCase();
4250
4302
  return flag;
4251
4303
  });
4252
- if (isCertificatePrinted(sortedActions)) {
4253
- flags.push(InherentFlags.PRINTED);
4304
+ if (isPendingCertification(sortedActions)) {
4305
+ flags.push(InherentFlags.PENDING_CERTIFICATION);
4254
4306
  }
4255
4307
  if (isCorrectionRequested(sortedActions)) {
4256
4308
  flags.push(InherentFlags.CORRECTION_REQUESTED);
@@ -4281,7 +4333,6 @@ function getStatusFromActions(actions) {
4281
4333
  case ActionType.NOTIFY:
4282
4334
  return EventStatus.enum.NOTIFIED;
4283
4335
  case ActionType.PRINT_CERTIFICATE:
4284
- return EventStatus.enum.CERTIFIED;
4285
4336
  case ActionType.ASSIGN:
4286
4337
  case ActionType.UNASSIGN:
4287
4338
  case ActionType.REJECT:
@@ -5246,7 +5297,27 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
5246
5297
  defaultMessage: "Applicant's name",
5247
5298
  description: "This is the label for the field",
5248
5299
  id: "v2.event.tennis-club-membership.action.declare.form.section.who.field.firstname.label"
5249
- }
5300
+ },
5301
+ configuration: {
5302
+ name: {
5303
+ firstname: { required: true },
5304
+ middlename: { required: false },
5305
+ surname: { required: true }
5306
+ }
5307
+ },
5308
+ validation: [
5309
+ {
5310
+ validator: field("applicant.name").object({
5311
+ firstname: field("firstname").isValidEnglishName(),
5312
+ surname: field("surname").isValidEnglishName()
5313
+ }),
5314
+ message: {
5315
+ defaultMessage: "Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)",
5316
+ description: "This is the error message for invalid name",
5317
+ id: "v2.error.invalidName"
5318
+ }
5319
+ }
5320
+ ]
5250
5321
  },
5251
5322
  {
5252
5323
  id: "applicant.email",
@@ -5468,22 +5539,6 @@ var statusOptions = [
5468
5539
  id: "v2.advancedSearch.form.recordStatusRegistered"
5469
5540
  }
5470
5541
  },
5471
- {
5472
- value: EventStatus.enum.CERTIFIED,
5473
- label: {
5474
- defaultMessage: "Certified",
5475
- description: "Option for form field: status of record",
5476
- id: "v2.advancedSearch.form.recordStatusCertified"
5477
- }
5478
- },
5479
- {
5480
- value: VisibleStatus.enum.REJECTED,
5481
- label: {
5482
- defaultMessage: "Rejected",
5483
- description: "Option for form field: status of record",
5484
- id: "v2.advancedSearch.form.recordStatusRejected"
5485
- }
5486
- },
5487
5542
  {
5488
5543
  value: EventStatus.enum.ARCHIVED,
5489
5544
  label: {
@@ -5690,44 +5745,41 @@ var tennisClubMembershipEvent = defineConfig({
5690
5745
  },
5691
5746
  {
5692
5747
  id: "identity-check",
5693
- type: PageTypes.enum.FORM,
5748
+ type: PageTypes.enum.VERIFICATION,
5694
5749
  title: {
5695
- id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
5696
- defaultMessage: "Verify their identity",
5750
+ id: "v2.event.birth.action.correction.form.section.requester.identity.verify.title",
5751
+ defaultMessage: "Verify ID",
5697
5752
  description: "This is the title of the section"
5698
5753
  },
5699
- fields: [
5700
- {
5701
- id: "correction.identity-check.instructions",
5702
- type: "PAGE_HEADER",
5754
+ fields: [],
5755
+ actions: {
5756
+ verify: {
5703
5757
  label: {
5704
- id: "correction.corrector.identity.instruction",
5705
- defaultMessage: "Please verify the identity of the person making this request",
5706
- description: "The title for the corrector form"
5758
+ defaultMessage: "Verified",
5759
+ description: "This is the label for the verification button",
5760
+ id: "v2.event.birth.action.correction.form.verify"
5707
5761
  }
5708
5762
  },
5709
- {
5710
- id: "correction.identity-check.verified",
5711
- type: "RADIO_GROUP",
5763
+ cancel: {
5712
5764
  label: {
5713
- id: "correction.corrector.identity.verified.label",
5714
- defaultMessage: "Identity verified",
5715
- description: "The title for the corrector form"
5765
+ defaultMessage: "Identity does not match",
5766
+ description: "This is the label for the verification cancellation button",
5767
+ id: "v2.event.birth.action.correction.form.cancel"
5716
5768
  },
5717
- defaultValue: "",
5718
- required: true,
5719
- options: [
5720
- {
5721
- value: "VERIFIED",
5722
- label: {
5723
- id: "correction.corrector.identity.verified",
5724
- defaultMessage: "I have verified their identity",
5725
- description: "Label for verified option in corrector identity check page"
5726
- }
5769
+ confirmation: {
5770
+ title: {
5771
+ defaultMessage: "Correct without proof of ID?",
5772
+ description: "This is the title for the verification cancellation modal",
5773
+ id: "v2.event.birth.action.correction.form.cancel.confirmation.title"
5774
+ },
5775
+ body: {
5776
+ defaultMessage: "Please be aware that if you proceed, you will be responsible for making a change to this record without the necessary proof of identification",
5777
+ description: "This is the body for the verification cancellation modal",
5778
+ id: "v2.event.birth.action.correction.form.cancel.confirmation.body"
5727
5779
  }
5728
- ]
5780
+ }
5729
5781
  }
5730
- ]
5782
+ }
5731
5783
  },
5732
5784
  {
5733
5785
  id: "correction-request.supporting-documents",
@@ -6701,6 +6753,7 @@ function eventPayloadGenerator(rng) {
6701
6753
  annotation: {
6702
6754
  "correction.requester.relationship": "ANOTHER_AGENT",
6703
6755
  "correction.request.reason": "Child's name was incorrect",
6756
+ "identity-check": true,
6704
6757
  ...annotation
6705
6758
  },
6706
6759
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7339,14 +7392,6 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
7339
7392
  ActionType.REJECT_CORRECTION,
7340
7393
  ExclusiveActions.REVIEW_CORRECTION_REQUEST
7341
7394
  ],
7342
- [EventStatus.enum.CERTIFIED]: [
7343
- ActionType.READ,
7344
- ActionType.PRINT_CERTIFICATE,
7345
- ActionType.REQUEST_CORRECTION,
7346
- ActionType.APPROVE_CORRECTION,
7347
- ActionType.REJECT_CORRECTION,
7348
- ExclusiveActions.REVIEW_CORRECTION_REQUEST
7349
- ],
7350
7395
  [EventStatus.enum.ARCHIVED]: [
7351
7396
  ActionType.READ,
7352
7397
  ActionType.ASSIGN,
@@ -7354,9 +7399,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
7354
7399
  ]
7355
7400
  };
7356
7401
  var getAvailableActionsForEvent = (event2) => {
7357
- return event2.flags.includes(InherentFlags.REJECTED) ? [
7358
- ActionType.READ,
7359
- event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
7360
- ActionType.ARCHIVE
7361
- ] : AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
7402
+ if (event2.flags.includes(InherentFlags.REJECTED)) {
7403
+ return [
7404
+ ActionType.READ,
7405
+ event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
7406
+ ActionType.ARCHIVE
7407
+ ];
7408
+ }
7409
+ return AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
7362
7410
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.8.1-rc.4c1434e",
3
+ "version": "1.8.1-rc.4ed8a2e",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {
package/tsconfig.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "@opencrvs/commons/events": ["../commons/src/events/index.ts"]
20
20
  }
21
21
  },
22
- "references": [{ "path": "../commons" }],
22
+ "references": [{ "path": "../commons/tsconfig-commonjs.json" }],
23
23
  "include": ["src/**/*.ts"],
24
24
  "exclude": ["**/node_modules/**", "dist"]
25
25
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=conditionals.test.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=validate-address.test.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=validate.test.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.test.d.ts.map