@opencrvs/toolkit 2.0.0-rc.a928ed6 → 2.0.0-rc.a95fd2a

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 (101) hide show
  1. package/README.md +15 -0
  2. package/build.sh +3 -2
  3. package/create-countryconfig/index.js +50 -20
  4. package/create-countryconfig/package.json +12 -2
  5. package/dist/application-config/index.js +82 -49
  6. package/dist/cli.js +3254 -46
  7. package/dist/commons/api/router.d.ts +108 -20
  8. package/dist/commons/application-config/index.d.ts +1 -0
  9. package/dist/commons/conditionals/conditionals.d.ts +354 -4
  10. package/dist/commons/conditionals/validate.d.ts +51 -2
  11. package/dist/commons/events/ActionConfig.d.ts +28 -2
  12. package/dist/commons/events/ActionDocument.d.ts +6 -0
  13. package/dist/commons/events/ActionInput.d.ts +42 -36
  14. package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
  16. package/dist/commons/events/Draft.d.ts +2 -3
  17. package/dist/commons/events/EventDocument.d.ts +3 -0
  18. package/dist/commons/events/EventIndex.d.ts +14 -0
  19. package/dist/commons/events/FieldConfig.d.ts +378 -50
  20. package/dist/commons/events/FieldType.d.ts +1 -0
  21. package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
  22. package/dist/commons/events/FieldValue.d.ts +6 -0
  23. package/dist/commons/events/WorkqueueConfig.d.ts +39 -0
  24. package/dist/commons/events/field.d.ts +53 -1
  25. package/dist/commons/events/index.d.ts +2 -0
  26. package/dist/commons/events/state/flags.d.ts +16 -0
  27. package/dist/commons/events/state/utils.d.ts +12 -287
  28. package/dist/commons/events/utils.d.ts +12 -1
  29. package/dist/conditionals/index.js +55 -2
  30. package/dist/environment/custom-types.d.ts +33 -0
  31. package/dist/environment/custom-types.d.ts.map +1 -0
  32. package/dist/environment/custom-types.js +12 -0
  33. package/dist/environment/derived-variables.d.ts +134 -0
  34. package/dist/environment/derived-variables.d.ts.map +1 -0
  35. package/dist/environment/derived-variables.js +169 -0
  36. package/dist/environment/editor-questions.d.ts +4 -0
  37. package/dist/environment/editor-questions.d.ts.map +1 -0
  38. package/dist/environment/editor-questions.js +67 -0
  39. package/dist/environment/git.d.ts +5 -0
  40. package/dist/environment/git.d.ts.map +1 -0
  41. package/dist/environment/git.js +38 -0
  42. package/dist/environment/github.d.ts +26 -0
  43. package/dist/environment/github.d.ts.map +1 -0
  44. package/dist/environment/github.js +247 -0
  45. package/dist/environment/index.d.ts +5 -0
  46. package/dist/environment/index.d.ts.map +1 -0
  47. package/dist/environment/index.js +71 -0
  48. package/dist/environment/logger.d.ts +15 -0
  49. package/dist/environment/logger.d.ts.map +1 -0
  50. package/dist/environment/logger.js +25 -0
  51. package/dist/environment/manage-users.d.ts +11 -0
  52. package/dist/environment/manage-users.d.ts.map +1 -0
  53. package/dist/environment/manage-users.js +497 -0
  54. package/dist/environment/questions-helper.d.ts +15 -0
  55. package/dist/environment/questions-helper.d.ts.map +1 -0
  56. package/dist/environment/questions-helper.js +70 -0
  57. package/dist/environment/questions.d.ts +199 -0
  58. package/dist/environment/questions.d.ts.map +1 -0
  59. package/dist/environment/questions.js +412 -0
  60. package/dist/environment/setup-environment.d.ts +2 -0
  61. package/dist/environment/setup-environment.d.ts.map +1 -0
  62. package/dist/environment/setup-environment.js +794 -0
  63. package/dist/environment/ssh-keygen.d.ts +5 -0
  64. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  65. package/dist/environment/ssh-keygen.js +21 -0
  66. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  67. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  68. package/dist/environment/swarm-to-k8s.js +173 -0
  69. package/dist/environment/templates.d.ts +27 -0
  70. package/dist/environment/templates.d.ts.map +1 -0
  71. package/dist/environment/templates.js +162 -0
  72. package/dist/environment/update-workflows.d.ts +2 -0
  73. package/dist/environment/update-workflows.d.ts.map +1 -0
  74. package/dist/environment/update-workflows.js +169 -0
  75. package/dist/environment/users.d.ts +2 -0
  76. package/dist/environment/users.d.ts.map +1 -0
  77. package/dist/environment/users.js +112 -0
  78. package/dist/environment/utils.d.ts +18 -0
  79. package/dist/environment/utils.d.ts.map +1 -0
  80. package/dist/environment/utils.js +100 -0
  81. package/dist/events/index.js +867 -174
  82. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  83. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  84. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  85. package/dist/migrations/v2.0/index.js +13 -5
  86. package/dist/notification/index.js +701 -72
  87. package/dist/scopes/index.d.ts +4 -6
  88. package/dist/scopes/index.js +12 -4
  89. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  90. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  91. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  92. package/dist/templates/charts-values/opencrvs-services/values.yaml +80 -0
  93. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  94. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  95. package/dist/templates/inventory/inventory.template.yml +100 -0
  96. package/dist/templates/inventory/production.example.yml +77 -0
  97. package/dist/templates/inventory/qa.example.yml +48 -0
  98. package/opencrvs-toolkit-2.0.0-rc.a95fd2a.tgz +0 -0
  99. package/package.json +20 -2
  100. package/tsconfig.tsbuildinfo +1 -1
  101. package/opencrvs-toolkit-2.0.0-rc.a928ed6.tgz +0 -0
@@ -293,7 +293,9 @@ var ScopeType = z2.enum([
293
293
  var EncodedScope = z2.string().brand("EncodedScope");
294
294
  var DEFAULT_SCOPE_OPTIONS = {
295
295
  placeOfEvent: JurisdictionFilter.enum.all,
296
- accessLevel: JurisdictionFilter.enum.all
296
+ accessLevel: JurisdictionFilter.enum.all,
297
+ registeredIn: JurisdictionFilter.enum.all,
298
+ declaredIn: JurisdictionFilter.enum.all
297
299
  };
298
300
 
299
301
  // ../commons/src/authentication.ts
@@ -653,8 +655,8 @@ var ActionConditional = z7.discriminatedUnion("type", [
653
655
  // Action can be shown to the user in the list but as disabled
654
656
  EnableConditional
655
657
  ]).meta({
656
- description: "Action conditional configuration",
657
- id: "ActionConditional"
658
+ id: "ActionConditional",
659
+ description: "Conditional gating whether an action is shown (SHOW) or enabled (ENABLE). When omitted from an action, the action is shown and enabled for everyone."
658
660
  });
659
661
  var DisplayOnReviewConditional = z7.object({
660
662
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
@@ -670,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
670
672
  // Field output can be shown / hidden on the review page
671
673
  DisplayOnReviewConditional
672
674
  ]).meta({
673
- description: "Field conditional configuration",
674
- id: "FieldConditional"
675
+ id: "FieldConditional",
676
+ description: "Conditional gating whether a form field is shown (SHOW), enabled (ENABLE), or displayed on the review page (DISPLAY_ON_REVIEW). When omitted, the field is shown and enabled for everyone, and is displayed on review whenever it has a value."
675
677
  });
676
678
 
677
679
  // ../commons/src/events/FieldType.ts
@@ -768,6 +770,11 @@ var FieldTypesToHideInReview = [
768
770
  FieldType.ALPHA_PRINT_BUTTON,
769
771
  FieldType.ALPHA_HIDDEN
770
772
  ];
773
+ var HiddenFieldTypes = [
774
+ FieldType.HTTP,
775
+ FieldType.QUERY_PARAM_READER,
776
+ FieldType.ALPHA_HIDDEN
777
+ ];
771
778
 
772
779
  // ../commons/src/events/FieldValue.ts
773
780
  var z12 = __toESM(require("zod/v4"));
@@ -886,7 +893,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
886
893
  // ../commons/src/events/FieldValue.ts
887
894
  var TextValue = z12.string();
888
895
  var HiddenFieldValue = z12.string();
889
- var NonEmptyTextValue = TextValue.min(1);
896
+ var NonEmptyTextValue = z12.string().trim().min(1);
890
897
  var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
891
898
  var AgeValue = z12.object({
892
899
  age: z12.number(),
@@ -915,6 +922,7 @@ var DateRangeFieldValue = z12.object({
915
922
  var EmailValue = z12.email();
916
923
  var CheckboxFieldValue = z12.boolean();
917
924
  var NumberFieldValue = z12.number();
925
+ var SignatureFieldValue = FileFieldValue;
918
926
  var ButtonFieldValue = z12.number();
919
927
  var VerificationStatusValue = z12.enum([
920
928
  "verified",
@@ -1213,8 +1221,9 @@ var RequestedCorrectionAction = ActionBase.extend(
1213
1221
  var ApprovedCorrectionAction = ActionBase.extend(
1214
1222
  z14.object({
1215
1223
  type: z14.literal(ActionType.APPROVE_CORRECTION),
1216
- requestId: z14.string()
1224
+ requestId: z14.string(),
1217
1225
  // TODO move into 'content' property
1226
+ content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
1218
1227
  }).shape
1219
1228
  );
1220
1229
  var RejectedCorrectionAction = ActionBase.extend(
@@ -1307,8 +1316,8 @@ var FlagConfig = z15.object({
1307
1316
  ),
1308
1317
  label: TranslationConfig.describe("Human readable label of the flag.")
1309
1318
  }).meta({
1310
- description: "Flag configuration",
1311
- id: "FlagConfig"
1319
+ id: "FlagConfig",
1320
+ description: "Configuration for a custom flag that can be added to or removed from records by event actions."
1312
1321
  });
1313
1322
  var ActionFlagConfig = z15.object({
1314
1323
  id: Flag,
@@ -1317,8 +1326,8 @@ var ActionFlagConfig = z15.object({
1317
1326
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1318
1327
  )
1319
1328
  }).meta({
1320
- description: "Action flag configuration",
1321
- id: "ActionFlagConfig"
1329
+ id: "ActionFlagConfig",
1330
+ description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
1322
1331
  });
1323
1332
 
1324
1333
  // ../commons/src/events/EventMetadata.ts
@@ -1474,7 +1483,8 @@ var Range = import_v4.z.object({
1474
1483
  });
1475
1484
  var ContainsFlags = import_v4.z.object({
1476
1485
  anyOf: import_v4.z.array(Flag).optional(),
1477
- noneOf: import_v4.z.array(Flag).optional()
1486
+ noneOf: import_v4.z.array(Flag).optional(),
1487
+ allOf: import_v4.z.array(Flag).optional()
1478
1488
  }).meta({
1479
1489
  id: "ContainsFlags"
1480
1490
  });
@@ -1663,11 +1673,28 @@ var FieldReference = import_v43.default.object({
1663
1673
  $$field: FieldId.describe("Id of the field to reference"),
1664
1674
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1665
1675
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1676
+ ),
1677
+ $$code: import_v43.default.string().optional().describe(
1678
+ "Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
1679
+ )
1680
+ }).describe(
1681
+ "Reference to a field value, with an optional client-side computation applied."
1682
+ );
1683
+ var ComputedDefaultValue = import_v43.default.object({
1684
+ $$code: import_v43.default.string().describe(
1685
+ "Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
1666
1686
  )
1667
- }).describe("Reference to a field by its ID");
1687
+ }).describe("A context-only computation used as a field default value.");
1668
1688
  var ValidationConfig = import_v43.default.object({
1669
- validator: Conditional,
1670
- message: TranslationConfig
1689
+ validator: Conditional.describe(
1690
+ "Conditional expression that must hold for the field value to be considered valid."
1691
+ ),
1692
+ message: TranslationConfig.describe(
1693
+ "Error message displayed when the validator does not hold."
1694
+ )
1695
+ }).meta({
1696
+ id: "ValidationConfig",
1697
+ description: "Validation rule applied to a form field. The validator is a conditional expression that must hold for the field value to be considered valid."
1671
1698
  });
1672
1699
  var requiredSchema = import_v43.default.union([
1673
1700
  import_v43.default.boolean(),
@@ -1698,7 +1725,7 @@ var BaseField = import_v43.default.object({
1698
1725
  "Indicates whether the field can be modified during record correction."
1699
1726
  ),
1700
1727
  value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
1701
- "Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used."
1728
+ "Reference to the source field or fields. When a value is defined, it is copied from the parent field when changed. If multiple references are provided, the first truthy value is used. A FieldReference with $$code computes the value via a custom client-side function."
1702
1729
  ),
1703
1730
  analytics: import_v43.default.boolean().default(false).optional().describe(
1704
1731
  "Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
@@ -1712,7 +1739,7 @@ var Divider = BaseField.extend({
1712
1739
  });
1713
1740
  var TextField = BaseField.extend({
1714
1741
  type: import_v43.default.literal(FieldType.TEXT),
1715
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1742
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1716
1743
  configuration: import_v43.default.object({
1717
1744
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1718
1745
  type: import_v43.default.enum(["text", "password"]).optional(),
@@ -1725,10 +1752,11 @@ var TextField = BaseField.extend({
1725
1752
  });
1726
1753
  var NumberField = BaseField.extend({
1727
1754
  type: import_v43.default.literal(FieldType.NUMBER),
1728
- defaultValue: NumberFieldValue.optional(),
1755
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1729
1756
  configuration: import_v43.default.object({
1730
1757
  min: import_v43.default.number().optional().describe("Minimum value"),
1731
1758
  max: import_v43.default.number().optional().describe("Maximum value"),
1759
+ integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
1732
1760
  prefix: TranslationConfig.optional(),
1733
1761
  postfix: TranslationConfig.optional()
1734
1762
  }).optional()
@@ -1738,7 +1766,7 @@ var NumberField = BaseField.extend({
1738
1766
  });
1739
1767
  var TextAreaField = BaseField.extend({
1740
1768
  type: import_v43.default.literal(FieldType.TEXTAREA),
1741
- defaultValue: NonEmptyTextValue.optional(),
1769
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1742
1770
  configuration: import_v43.default.object({
1743
1771
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1744
1772
  rows: import_v43.default.number().optional().describe("Number of visible text lines"),
@@ -1772,7 +1800,7 @@ var SignatureField = BaseField.extend({
1772
1800
  signaturePromptLabel: TranslationConfig.describe(
1773
1801
  "Title of the signature modal"
1774
1802
  ),
1775
- defaultValue: FieldValue.optional(),
1803
+ defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
1776
1804
  configuration: import_v43.default.object({
1777
1805
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1778
1806
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
@@ -1788,14 +1816,14 @@ var EmailField = BaseField.extend({
1788
1816
  configuration: import_v43.default.object({
1789
1817
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1790
1818
  }).default({ maxLength: 255 }).optional(),
1791
- defaultValue: NonEmptyTextValue.optional()
1819
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
1792
1820
  }).meta({
1793
1821
  description: "An email input field",
1794
1822
  id: "EmailField"
1795
1823
  });
1796
1824
  var DateField = BaseField.extend({
1797
1825
  type: import_v43.default.literal(FieldType.DATE),
1798
- defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
1826
+ defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
1799
1827
  configuration: import_v43.default.object({
1800
1828
  notice: TranslationConfig.describe(
1801
1829
  "Text to display above the date input"
@@ -1807,7 +1835,7 @@ var DateField = BaseField.extend({
1807
1835
  });
1808
1836
  var AgeField = BaseField.extend({
1809
1837
  type: import_v43.default.literal(FieldType.AGE),
1810
- defaultValue: NumberFieldValue.optional(),
1838
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1811
1839
  configuration: import_v43.default.object({
1812
1840
  asOfDate: FieldReference,
1813
1841
  prefix: TranslationConfig.optional(),
@@ -1819,7 +1847,7 @@ var AgeField = BaseField.extend({
1819
1847
  });
1820
1848
  var TimeField = BaseField.extend({
1821
1849
  type: import_v43.default.literal(FieldType.TIME),
1822
- defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
1850
+ defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
1823
1851
  configuration: import_v43.default.object({
1824
1852
  use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
1825
1853
  notice: TranslationConfig.describe(
@@ -1832,7 +1860,7 @@ var TimeField = BaseField.extend({
1832
1860
  });
1833
1861
  var DateRangeField = BaseField.extend({
1834
1862
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1835
- defaultValue: DateRangeFieldValue.optional(),
1863
+ defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
1836
1864
  configuration: import_v43.default.object({
1837
1865
  notice: TranslationConfig.describe(
1838
1866
  "Text to display above the date input"
@@ -1911,7 +1939,7 @@ var PageHeader = BaseField.extend({
1911
1939
  });
1912
1940
  var File = BaseField.extend({
1913
1941
  type: import_v43.default.literal(FieldType.FILE),
1914
- defaultValue: FileFieldValue.optional(),
1942
+ defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
1915
1943
  configuration: import_v43.default.object({
1916
1944
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1917
1945
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
@@ -1938,7 +1966,7 @@ var SelectOption = import_v43.default.object({
1938
1966
  });
1939
1967
  var NumberWithUnitField = BaseField.extend({
1940
1968
  type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
1941
- defaultValue: NumberWithUnitFieldValue.optional(),
1969
+ defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
1942
1970
  options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
1943
1971
  configuration: import_v43.default.object({
1944
1972
  min: import_v43.default.number().optional().describe("Minimum value of the number field"),
@@ -1953,7 +1981,7 @@ var NumberWithUnitField = BaseField.extend({
1953
1981
  });
1954
1982
  var RadioGroup = BaseField.extend({
1955
1983
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1956
- defaultValue: TextValue.optional(),
1984
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1957
1985
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1958
1986
  configuration: import_v43.default.object({
1959
1987
  styles: import_v43.default.object({
@@ -1978,7 +2006,7 @@ var BulletList = BaseField.extend({
1978
2006
  });
1979
2007
  var Select = BaseField.extend({
1980
2008
  type: import_v43.default.literal(FieldType.SELECT),
1981
- defaultValue: TextValue.optional(),
2009
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1982
2010
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1983
2011
  noOptionsMessage: TranslationConfig.optional().describe(
1984
2012
  `
@@ -2000,7 +2028,7 @@ var SelectDateRangeOption = import_v43.default.object({
2000
2028
  });
2001
2029
  var SelectDateRangeField = BaseField.extend({
2002
2030
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
2003
- defaultValue: SelectDateRangeValue.optional(),
2031
+ defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
2004
2032
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
2005
2033
  }).meta({
2006
2034
  description: "A date range selection field",
@@ -2017,7 +2045,7 @@ var NameField = BaseField.extend({
2017
2045
  firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
2018
2046
  middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
2019
2047
  surname: SerializedUserField.or(NonEmptyTextValue).optional()
2020
- }).optional(),
2048
+ }).or(ComputedDefaultValue).optional(),
2021
2049
  configuration: import_v43.default.object({
2022
2050
  name: NameConfig.default({
2023
2051
  firstname: { required: true },
@@ -2041,14 +2069,14 @@ var NameField = BaseField.extend({
2041
2069
  id: "NameField"
2042
2070
  });
2043
2071
  var PhoneField = BaseField.extend({
2044
- defaultValue: NonEmptyTextValue.optional(),
2072
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2045
2073
  type: import_v43.default.literal(FieldType.PHONE)
2046
2074
  }).meta({
2047
2075
  description: "A field for entering a phone number",
2048
2076
  id: "PhoneField"
2049
2077
  });
2050
2078
  var IdField = BaseField.extend({
2051
- defaultValue: NonEmptyTextValue.optional(),
2079
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2052
2080
  type: import_v43.default.literal(FieldType.ID)
2053
2081
  }).meta({
2054
2082
  description: "A field for entering an ID",
@@ -2056,14 +2084,14 @@ var IdField = BaseField.extend({
2056
2084
  });
2057
2085
  var Checkbox = BaseField.extend({
2058
2086
  type: import_v43.default.literal(FieldType.CHECKBOX),
2059
- defaultValue: CheckboxFieldValue.default(false)
2087
+ defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
2060
2088
  }).meta({
2061
2089
  description: "A boolean checkbox field",
2062
2090
  id: "Checkbox"
2063
2091
  });
2064
2092
  var Country = BaseField.extend({
2065
2093
  type: import_v43.default.literal(FieldType.COUNTRY),
2066
- defaultValue: NonEmptyTextValue.optional(),
2094
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2067
2095
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
2068
2096
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
2069
2097
  )
@@ -2081,7 +2109,7 @@ var AdministrativeAreas = import_v43.default.enum([
2081
2109
  ]);
2082
2110
  var AdministrativeAreaField = BaseField.extend({
2083
2111
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
2084
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2112
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
2085
2113
  configuration: import_v43.default.object({
2086
2114
  partOf: FieldReference.optional().describe("Parent location"),
2087
2115
  type: AdministrativeAreas,
@@ -2093,7 +2121,7 @@ var AdministrativeAreaField = BaseField.extend({
2093
2121
  });
2094
2122
  var LocationInput = BaseField.extend({
2095
2123
  type: import_v43.default.literal(FieldType.LOCATION),
2096
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2124
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
2097
2125
  configuration: import_v43.default.object({
2098
2126
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2099
2127
  allowedLocations: AllowedLocations
@@ -2105,7 +2133,7 @@ var LocationInput = BaseField.extend({
2105
2133
  var FileUploadWithOptions = BaseField.extend({
2106
2134
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
2107
2135
  options: import_v43.default.array(SelectOption).describe("A list of options"),
2108
- defaultValue: FileFieldWithOptionValue.optional(),
2136
+ defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
2109
2137
  configuration: import_v43.default.object({
2110
2138
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
2111
2139
  maxImageSize: import_v43.default.object({
@@ -2121,12 +2149,12 @@ var FileUploadWithOptions = BaseField.extend({
2121
2149
  });
2122
2150
  var Facility = BaseField.extend({
2123
2151
  type: import_v43.default.literal(FieldType.FACILITY),
2124
- defaultValue: NonEmptyTextValue.optional(),
2152
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2125
2153
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
2126
2154
  }).describe("Input field for a facility");
2127
2155
  var Office = BaseField.extend({
2128
2156
  type: import_v43.default.literal(FieldType.OFFICE),
2129
- defaultValue: NonEmptyTextValue.optional(),
2157
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2130
2158
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
2131
2159
  }).describe("Input field for an office");
2132
2160
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
@@ -2162,7 +2190,7 @@ var Address = BaseField.extend({
2162
2190
  ).optional(),
2163
2191
  allowedLocations: AllowedLocations
2164
2192
  }).optional(),
2165
- defaultValue: DefaultAddressFieldValue.optional()
2193
+ defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
2166
2194
  }).meta({
2167
2195
  description: "Address input field \u2013 a combination of location and text fields",
2168
2196
  id: "Address"
@@ -2209,7 +2237,7 @@ var ButtonConfiguration = import_v43.default.object({
2209
2237
  });
2210
2238
  var ButtonField = BaseField.extend({
2211
2239
  type: import_v43.default.literal(FieldType.BUTTON),
2212
- defaultValue: ButtonFieldValue.optional(),
2240
+ defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
2213
2241
  configuration: ButtonConfiguration
2214
2242
  }).meta({
2215
2243
  description: "A generic button that can be used to trigger an action",
@@ -2237,7 +2265,7 @@ var AlphaPrintButton = BaseField.extend({
2237
2265
  });
2238
2266
  var HttpField = BaseField.extend({
2239
2267
  type: import_v43.default.literal(FieldType.HTTP),
2240
- defaultValue: HttpFieldValue.optional(),
2268
+ defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
2241
2269
  configuration: import_v43.default.object({
2242
2270
  trigger: FieldReference.optional().describe(
2243
2271
  "Reference to the field that triggers the HTTP request when its value changes. If not provided, the HTTP request is triggered once on component mount."
@@ -2257,17 +2285,21 @@ var HttpField = BaseField.extend({
2257
2285
  var AutocompleteField = BaseField.extend({
2258
2286
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2259
2287
  configuration: import_v43.default.object({
2260
- url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2288
+ url: import_v43.default.string().describe(
2289
+ "URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
2290
+ ).optional(),
2261
2291
  method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2262
2292
  defaultOptions: import_v43.default.array(
2263
2293
  import_v43.default.object({
2264
2294
  label: import_v43.default.string(),
2265
2295
  value: import_v43.default.string()
2266
2296
  })
2267
- ).optional()
2297
+ ).optional().describe(
2298
+ "Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
2299
+ )
2268
2300
  })
2269
2301
  }).meta({
2270
- description: "Autocomplete input field",
2302
+ description: "Generic autocomplete component designed for use with large dictionary-based datasets. The component supports dynamic retrieval of options from configurable data sources and is intended for datasets that may contain tens or hundreds of thousands of records.",
2271
2303
  id: "AutocompleteField"
2272
2304
  });
2273
2305
  var SearchField = HttpField.extend({
@@ -2319,7 +2351,7 @@ var LinkButtonField = BaseField.extend({
2319
2351
  });
2320
2352
  var VerificationStatus = BaseField.extend({
2321
2353
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2322
- defaultValue: VerificationStatusValue.optional(),
2354
+ defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
2323
2355
  configuration: import_v43.default.object({
2324
2356
  status: TranslationConfig.describe("Text to display on the status pill."),
2325
2357
  description: TranslationConfig.describe(
@@ -2341,7 +2373,7 @@ var QueryParamReaderField = BaseField.extend({
2341
2373
  });
2342
2374
  var QrReaderField = BaseField.extend({
2343
2375
  type: import_v43.default.literal(FieldType.QR_READER),
2344
- defaultValue: QrReaderFieldValue.optional(),
2376
+ defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
2345
2377
  configuration: import_v43.default.object({
2346
2378
  validator: import_v43.default.any().meta({
2347
2379
  description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
@@ -2354,7 +2386,7 @@ var QrReaderField = BaseField.extend({
2354
2386
  });
2355
2387
  var IdReaderField = BaseField.extend({
2356
2388
  type: import_v43.default.literal(FieldType.ID_READER),
2357
- defaultValue: IdReaderFieldValue.optional(),
2389
+ defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
2358
2390
  methods: import_v43.default.array(
2359
2391
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2360
2392
  )
@@ -2497,15 +2529,18 @@ var VerificationPageConfig = FormPageConfig.extend({
2497
2529
  actions: VerificationActionConfig
2498
2530
  });
2499
2531
  var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
2500
- description: "Page configuration",
2501
- id: "PageConfig"
2532
+ id: "PageConfig",
2533
+ description: "Configuration for a single page in a form. Either a form page with fields and a continue button, or a verification page with verify/cancel options."
2502
2534
  });
2503
2535
 
2504
2536
  // ../commons/src/events/FormConfig.ts
2505
2537
  var DeclarationFormConfig = z22.object({
2506
2538
  label: TranslationConfig.describe("Human readable description of the form"),
2507
2539
  pages: z22.array(FormPageConfig)
2508
- }).describe("Configuration of the declaration form.");
2540
+ }).meta({
2541
+ id: "DeclarationFormConfig",
2542
+ description: "Configuration of the declaration form."
2543
+ });
2509
2544
  var ActionFormConfig = z22.object({
2510
2545
  label: TranslationConfig.describe("Human readable description of the form"),
2511
2546
  pages: z22.array(PageConfig)
@@ -2605,6 +2640,9 @@ var DeduplicationConfig = z23.object({
2605
2640
  id: z23.string(),
2606
2641
  label: TranslationConfig,
2607
2642
  query: Clause
2643
+ }).meta({
2644
+ id: "DeduplicationConfig",
2645
+ description: "Configuration for duplicate detection on a declare or register action. The query is built from fuzzy / strict / date-range matchers combined with and/or/not."
2608
2646
  });
2609
2647
 
2610
2648
  // ../commons/src/events/ActionConfig.ts
@@ -2642,6 +2680,11 @@ var ReadActionConfig = ActionConfigBase.extend(
2642
2680
  conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
2643
2681
  }).shape
2644
2682
  );
2683
+ var NotifyConfig = ActionConfigBase.extend(
2684
+ z24.object({
2685
+ type: z24.literal(ActionType.NOTIFY)
2686
+ }).shape
2687
+ );
2645
2688
  var DeclareConfig = DeclarationActionBase.extend(
2646
2689
  z24.object({
2647
2690
  type: z24.literal(ActionType.DECLARE),
@@ -2722,17 +2765,46 @@ var ActionConfig = z24.discriminatedUnion("type", [
2722
2765
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
2723
2766
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
2724
2767
  */
2725
- ReadActionConfig.meta({ id: "ReadActionConfig" }),
2726
- DeclareConfig.meta({ id: "DeclareActionConfig" }),
2727
- RejectConfig.meta({ id: "RejectActionConfig" }),
2728
- RegisterConfig.meta({ id: "RegisterActionConfig" }),
2768
+ ReadActionConfig.meta({
2769
+ id: "ReadActionConfig",
2770
+ description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
2771
+ }),
2772
+ NotifyConfig.meta({
2773
+ id: "NotifyActionConfig",
2774
+ description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
2775
+ }),
2776
+ DeclareConfig.meta({
2777
+ id: "DeclareActionConfig",
2778
+ description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
2779
+ }),
2780
+ RejectConfig.meta({
2781
+ id: "RejectActionConfig",
2782
+ description: "Configuration for rejecting a record before registration."
2783
+ }),
2784
+ RegisterConfig.meta({
2785
+ id: "RegisterActionConfig",
2786
+ description: "Configuration for registering a record."
2787
+ }),
2729
2788
  PrintCertificateActionConfig.meta({
2730
- id: "PrintCertificateActionConfig"
2789
+ id: "PrintCertificateActionConfig",
2790
+ description: "Configuration for printing a certificate of a registered record."
2791
+ }),
2792
+ RequestCorrectionConfig.meta({
2793
+ id: "RequestCorrectionActionConfig",
2794
+ description: "Configuration for requesting a correction on a registered record."
2731
2795
  }),
2732
- RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
2733
- EditActionConfig.meta({ id: "EditActionConfig" }),
2734
- ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
2735
- CustomActionConfig.meta({ id: "CustomActionConfig" })
2796
+ EditActionConfig.meta({
2797
+ id: "EditActionConfig",
2798
+ description: "Configuration for editing a record before registration."
2799
+ }),
2800
+ ArchiveConfig.meta({
2801
+ id: "ArchiveActionConfig",
2802
+ description: "Configuration for archiving a record."
2803
+ }),
2804
+ CustomActionConfig.meta({
2805
+ id: "CustomActionConfig",
2806
+ description: "Configuration for a country-defined custom action. An event may include any number of these."
2807
+ })
2736
2808
  ]).describe(
2737
2809
  "Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
2738
2810
  ).meta({ id: "ActionConfig" });
@@ -2808,7 +2880,10 @@ var Field = BaseField2.extend({
2808
2880
  }).describe("Custom field defined for the summary view.");
2809
2881
  var SummaryConfig = z27.object({
2810
2882
  fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2811
- }).describe("Configuration of the event summary section.");
2883
+ }).meta({
2884
+ id: "SummaryConfig",
2885
+ description: "Configuration of the event overview page. Defines which declaration fields appear in the record summary, optionally with custom labels, empty-value messages, and templated values."
2886
+ });
2812
2887
 
2813
2888
  // ../commons/src/events/AdvancedSearchConfig.ts
2814
2889
  var z28 = __toESM(require("zod/v4"));
@@ -2879,6 +2954,9 @@ var BaseField3 = z28.object({
2879
2954
  ),
2880
2955
  validations: z28.array(ValidationConfig).optional().describe(
2881
2956
  `Option for overriding the field validations specifically for advanced search form.`
2957
+ ),
2958
+ allowedLocations: JurisdictionReference.optional().describe(
2959
+ `Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
2882
2960
  )
2883
2961
  });
2884
2962
  var SearchQueryParams = z28.object({
@@ -2932,6 +3010,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
2932
3010
  var AdvancedSearchConfig = z28.object({
2933
3011
  title: TranslationConfig.describe("Advanced search tab title"),
2934
3012
  fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
3013
+ }).meta({
3014
+ id: "AdvancedSearchConfig",
3015
+ description: "Configuration of one advanced search tab. Each tab has a title and a list of searchable fields \u2014 either declaration fields (via `field()`) or event metadata (via `event()`)."
2935
3016
  });
2936
3017
 
2937
3018
  // ../commons/src/events/utils.ts
@@ -2982,7 +3063,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
2982
3063
  }
2983
3064
  return current;
2984
3065
  }
3066
+ function todayISO() {
3067
+ return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
3068
+ }
3069
+ var compiledFunctionCache = /* @__PURE__ */ new Map();
3070
+ function compileClientFunction(code) {
3071
+ let fn = compiledFunctionCache.get(code);
3072
+ if (!fn) {
3073
+ fn = new Function(`return (${code})`)();
3074
+ compiledFunctionCache.set(code, fn);
3075
+ }
3076
+ return fn;
3077
+ }
2985
3078
  (0, import_ajv_formats.default)(ajv);
3079
+ function buildClientFunctionContext(input) {
3080
+ return {
3081
+ $form: input.form,
3082
+ $now: todayISO(),
3083
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
3084
+ $online: isOnline(),
3085
+ $user: input.validatorContext?.user,
3086
+ $event: input.validatorContext?.event,
3087
+ $leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
3088
+ user: input.systemVariables?.user,
3089
+ $window: input.systemVariables?.$window,
3090
+ locations: input.locations,
3091
+ adminLevelIds: input.adminLevelIds
3092
+ };
3093
+ }
3094
+ function runClientFunction(code, data, context) {
3095
+ return compileClientFunction(code)(data, context);
3096
+ }
2986
3097
  ajv.addKeyword({
2987
3098
  keyword: "daysFromDate",
2988
3099
  type: "string",
@@ -3027,12 +3138,35 @@ ajv.addKeyword({
3027
3138
  $data: true,
3028
3139
  errors: true,
3029
3140
  // @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
3030
- validate(schema, data, _2, dataContext) {
3141
+ validate(_schema, data, _2, dataContext) {
3031
3142
  const locationIdInput = data;
3032
3143
  const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
3033
3144
  return locations.some((location) => location.id === locationIdInput);
3034
3145
  }
3035
3146
  });
3147
+ ajv.addKeyword({
3148
+ keyword: "customClientValidator",
3149
+ schemaType: "object",
3150
+ errors: true,
3151
+ // @ts-expect-error -- AJV's public types don't expose `rootData`. All
3152
+ // `validate()` callers build root data via `buildClientFunctionContext`,
3153
+ // so the cast holds.
3154
+ validate(schema, data, _2, dataContext) {
3155
+ return Boolean(
3156
+ runClientFunction(
3157
+ schema.code,
3158
+ data,
3159
+ dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
3160
+ )
3161
+ );
3162
+ }
3163
+ });
3164
+ function isOnline() {
3165
+ if (typeof window !== "undefined" && typeof navigator !== "undefined") {
3166
+ return navigator.onLine;
3167
+ }
3168
+ return true;
3169
+ }
3036
3170
 
3037
3171
  // ../commons/src/utils.ts
3038
3172
  var z32 = __toESM(require("zod/v4"));
@@ -3075,7 +3209,7 @@ var getActionAnnotationFields = (actionConfig) => {
3075
3209
  if (actionConfig.type === ActionType.CUSTOM) {
3076
3210
  return actionConfig.form;
3077
3211
  }
3078
- if ("review" in actionConfig) {
3212
+ if ("review" in actionConfig && actionConfig.review != null) {
3079
3213
  return actionConfig.review.fields;
3080
3214
  }
3081
3215
  return [];
@@ -3651,7 +3785,54 @@ function createFieldConditionals(fieldId) {
3651
3785
  }
3652
3786
  },
3653
3787
  required: [fieldId]
3654
- })
3788
+ }),
3789
+ /**
3790
+ * Custom client-side validator. The provided function is serialised and executed
3791
+ * just-in-time on the client only. External references (e.g. lodash) are not
3792
+ * available inside the function body — all logic must be self-contained.
3793
+ *
3794
+ * @example
3795
+ * field('nid').customClientValidator((value) => {
3796
+ * // LUHN check — all logic must be inline
3797
+ * const digits = String(value).split('').map(Number)
3798
+ * // ...
3799
+ * return isValid
3800
+ * })
3801
+ */
3802
+ customClientValidator(validationFn) {
3803
+ const code = validationFn.toString();
3804
+ return defineFormConditional({
3805
+ type: "object",
3806
+ properties: wrapToPath(
3807
+ { [fieldId]: { customClientValidator: { code } } },
3808
+ this.$$subfield
3809
+ ),
3810
+ required: [fieldId]
3811
+ });
3812
+ },
3813
+ /**
3814
+ * Custom client-side evaluation. Returns a {@link FieldReference} descriptor
3815
+ * that can be used as the `value` property or a DATA component entry.
3816
+ * The function receives the referenced field's value as the first argument and
3817
+ * the full form context as the second; its return value replaces the field reference.
3818
+ * The function is serialised and executed just-in-time on the client only.
3819
+ * External references (e.g. lodash) are not available inside the function body.
3820
+ *
3821
+ * For computing a default value without referencing a specific field, use
3822
+ * `evaluate(fn)` in the `defaultValue` property instead.
3823
+ *
3824
+ * @example
3825
+ * field('a').customClientEvaluation((aValue, ctx) =>
3826
+ * Number(aValue) + Number(ctx.$form.b)
3827
+ * )
3828
+ */
3829
+ customClientEvaluation(computationFn) {
3830
+ return {
3831
+ $$code: computationFn.toString(),
3832
+ $$field: fieldId,
3833
+ $$subfield: this.$$subfield
3834
+ };
3835
+ }
3655
3836
  };
3656
3837
  }
3657
3838
 
@@ -3824,8 +4005,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
3824
4005
  validateActionFlags(event2, ctx);
3825
4006
  validateActionOrder(event2, ctx);
3826
4007
  }).meta({
3827
- id: "EventConfig"
3828
- }).describe("Configuration defining an event type.");
4008
+ id: "EventConfig",
4009
+ description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
4010
+ });
3829
4011
 
3830
4012
  // ../commons/src/events/EventConfigInput.ts
3831
4013
  var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
@@ -4047,6 +4229,9 @@ var WorkqueueColumnValue = z34.object({
4047
4229
  var WorkqueueColumn = z34.object({
4048
4230
  label: TranslationConfig,
4049
4231
  value: WorkqueueColumnValue
4232
+ }).meta({
4233
+ id: "WorkqueueColumn",
4234
+ description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
4050
4235
  });
4051
4236
  function defineWorkqueuesColumns(workqueueColumns) {
4052
4237
  return workqueueColumns.map(
@@ -4252,8 +4437,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
4252
4437
  var WorkqueueConfigInput = WorkqueueConfig.extend({
4253
4438
  query: CountryConfigQueryInputType
4254
4439
  }).meta({
4255
- description: "Workqueue configuration",
4256
- id: "WorkqueueConfig"
4440
+ id: "WorkqueueConfig",
4441
+ description: "Configuration for a single workqueue. Defines the filter applied to the event index, the quick-action button, the columns shown on each row, and the message rendered when the queue is empty."
4257
4442
  });
4258
4443
  var WorkqueueCountInput = z37.array(
4259
4444
  z37.object({ slug: z37.string(), query: QueryType })
@@ -4295,7 +4480,9 @@ var BaseActionInput = z38.object({
4295
4480
  keepAssignment: z38.boolean().optional(),
4296
4481
  keepAssignmentIfAccepted: z38.boolean().optional(),
4297
4482
  keepAssignmentIfRejected: z38.boolean().optional(),
4298
- waitFor: z38.boolean().optional(),
4483
+ waitFor: z38.boolean().default(true).describe(
4484
+ "Whether action waits for the indexing before returning. Defaults to true. Setting this to to false completes faster but might lead to stale data in the client if the client tries to read the event immediately after performing the action. Use with care."
4485
+ ),
4299
4486
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4300
4487
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
4301
4488
  createdAtLocation: UUID.nullish().describe(
@@ -4413,7 +4600,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
4413
4600
  var ApproveCorrectionActionInput = BaseActionInput.extend(
4414
4601
  z38.object({
4415
4602
  requestId: z38.string(),
4416
- type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
4603
+ type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
4604
+ content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
4417
4605
  }).shape
4418
4606
  );
4419
4607
  var ReadActionInput = BaseActionInput.extend(
@@ -4475,7 +4663,7 @@ var Draft = z39.object({
4475
4663
  }).describe(
4476
4664
  "A temporary storage for an action. Stored with details of the event, creator and creation time."
4477
4665
  );
4478
- var DraftInput = BaseActionInput.extend({
4666
+ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
4479
4667
  type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
4480
4668
  status: z39.enum([
4481
4669
  ActionStatus.Requested,
@@ -4525,12 +4713,53 @@ var updateActions = ActionTypes.extract([
4525
4713
  ActionType.ARCHIVE,
4526
4714
  ActionType.PRINT_CERTIFICATE,
4527
4715
  ActionType.REQUEST_CORRECTION,
4716
+ ActionType.APPROVE_CORRECTION,
4717
+ ActionType.REJECT_CORRECTION,
4528
4718
  ActionType.CUSTOM
4529
4719
  ]);
4530
4720
 
4531
4721
  // ../commons/src/events/state/flags.ts
4532
4722
  var import_lodash3 = require("lodash");
4533
4723
  var import_date_fns3 = require("date-fns");
4724
+ var INHERENT_FLAG_RULES = [
4725
+ {
4726
+ flag: InherentFlags.CORRECTION_REQUESTED,
4727
+ setOn: [ActionType.REQUEST_CORRECTION],
4728
+ resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
4729
+ },
4730
+ {
4731
+ // INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
4732
+ // other status-changing action (see getStatusFromActions).
4733
+ flag: InherentFlags.INCOMPLETE,
4734
+ setOn: [ActionType.NOTIFY],
4735
+ resetOn: [
4736
+ ActionType.CREATE,
4737
+ ActionType.DECLARE,
4738
+ ActionType.REGISTER,
4739
+ ActionType.ARCHIVE
4740
+ ]
4741
+ },
4742
+ {
4743
+ flag: InherentFlags.REJECTED,
4744
+ setOn: [ActionType.REJECT],
4745
+ resetOn: [
4746
+ ActionType.NOTIFY,
4747
+ ActionType.DECLARE,
4748
+ ActionType.EDIT,
4749
+ ActionType.REGISTER
4750
+ ]
4751
+ },
4752
+ {
4753
+ flag: InherentFlags.POTENTIAL_DUPLICATE,
4754
+ setOn: [ActionType.DUPLICATE_DETECTED],
4755
+ resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
4756
+ },
4757
+ {
4758
+ flag: InherentFlags.EDIT_IN_PROGRESS,
4759
+ setOn: [ActionType.EDIT],
4760
+ resetOnAnyOtherAction: true
4761
+ }
4762
+ ];
4534
4763
 
4535
4764
  // ../commons/src/events/defineConfig.ts
4536
4765
  var IGNORED_EVENT_TYPES = [
@@ -5276,6 +5505,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
5276
5505
  id: "signature.upload.modal.title",
5277
5506
  defaultMessage: "Draw signature",
5278
5507
  description: "Title for the modal to draw signature"
5508
+ },
5509
+ // Zod applies the schema default at parse time, but this fixture bypasses
5510
+ // parsing — GeneratedInputField accesses configuration.maxFileSize directly.
5511
+ configuration: {
5512
+ maxFileSize: 5 * 1024 * 1024
5279
5513
  }
5280
5514
  }
5281
5515
  ]
@@ -5832,6 +6066,20 @@ var tennisClubMembershipEvent = defineConfig({
5832
6066
  },
5833
6067
  review: TENNIS_CLUB_DECLARATION_REVIEW
5834
6068
  },
6069
+ {
6070
+ type: ActionType.NOTIFY,
6071
+ label: {
6072
+ defaultMessage: "Notify health worker",
6073
+ description: "This is shown as the action name anywhere the user can trigger the action from",
6074
+ id: "event.tennis-club-membership.action.notify.label"
6075
+ },
6076
+ flags: [
6077
+ {
6078
+ id: "health-worker-notified",
6079
+ operation: "add"
6080
+ }
6081
+ ]
6082
+ },
5835
6083
  {
5836
6084
  type: ActionType.REJECT,
5837
6085
  label: {
@@ -6074,6 +6322,17 @@ var tennisClubMembershipEvent = defineConfig({
6074
6322
  }
6075
6323
  }
6076
6324
  ],
6325
+ flags: [
6326
+ {
6327
+ id: "health-worker-notified",
6328
+ requiresAction: false,
6329
+ label: {
6330
+ id: "event.tennis-club-membership.flag.health-worker-notified.label",
6331
+ defaultMessage: "Health worker notified",
6332
+ description: "Label for the health-worker-notified flag"
6333
+ }
6334
+ }
6335
+ ],
6077
6336
  advancedSearch: [
6078
6337
  {
6079
6338
  title: {
@@ -7069,10 +7328,380 @@ var ACTION_FILTERS = {
7069
7328
  [ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
7070
7329
  [ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
7071
7330
  };
7331
+ var REJECTED_ACTIONS = [
7332
+ ActionType.READ,
7333
+ ActionType.NOTIFY,
7334
+ ActionType.CUSTOM,
7335
+ ActionType.EDIT,
7336
+ ActionType.ARCHIVE
7337
+ ];
7072
7338
 
7073
7339
  // ../commons/src/events/FileUtils.ts
7074
7340
  var import_lodash7 = require("lodash");
7075
7341
 
7342
+ // ../commons/src/events/mocks.test.utils.ts
7343
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7344
+ {
7345
+ id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7346
+ name: "Central",
7347
+ parentId: null,
7348
+ validUntil: null,
7349
+ externalId: "ydyJb1RAy4U1"
7350
+ },
7351
+ {
7352
+ id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7353
+ name: "Sulaka",
7354
+ parentId: null,
7355
+ validUntil: null,
7356
+ externalId: "pQ8nGxWmZ2Q3"
7357
+ },
7358
+ {
7359
+ id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
7360
+ name: "Pualula",
7361
+ parentId: null,
7362
+ validUntil: null,
7363
+ externalId: "Aq91DweLmT8k"
7364
+ },
7365
+ {
7366
+ id: "6d1a59df-988c-4021-a846-ccbc021931a7",
7367
+ name: "Chuminga",
7368
+ parentId: null,
7369
+ validUntil: null,
7370
+ externalId: "Rw0fYNh2Xk9a"
7371
+ },
7372
+ {
7373
+ id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7374
+ name: "Ibombo",
7375
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7376
+ validUntil: null,
7377
+ externalId: "k7DsP4vbN1Qe"
7378
+ },
7379
+ {
7380
+ id: "27160bbd-32d1-4625-812f-860226bfb92a",
7381
+ name: "Isango",
7382
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7383
+ validUntil: null,
7384
+ externalId: "Gm3Z9eQpHw4L"
7385
+ },
7386
+ {
7387
+ id: "967032fd-3f81-478a-826c-30cb8fe121bd",
7388
+ name: "Isamba",
7389
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7390
+ validUntil: null,
7391
+ externalId: "sT0xVu1KqJ7r"
7392
+ },
7393
+ {
7394
+ id: "89a33893-b17d-481d-a26d-6461e7ac1651",
7395
+ name: "Itambo",
7396
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7397
+ validUntil: null,
7398
+ externalId: "Nq6Bv2HpL9Te"
7399
+ },
7400
+ {
7401
+ id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
7402
+ name: "Ezhi",
7403
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7404
+ validUntil: null,
7405
+ externalId: "xK8cQ0ZRy5Wd"
7406
+ },
7407
+ {
7408
+ id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7409
+ name: "Ilanga",
7410
+ parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7411
+ validUntil: null,
7412
+ externalId: "Cq4Jm1XvN8Ls"
7413
+ },
7414
+ // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
7415
+ {
7416
+ id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7417
+ name: "Klow",
7418
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7419
+ validUntil: null,
7420
+ externalId: "IkYcYBUcyY2"
7421
+ },
7422
+ {
7423
+ id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
7424
+ name: "Mbondo",
7425
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7426
+ validUntil: null,
7427
+ externalId: "Qhvv5hvo3mY"
7428
+ },
7429
+ {
7430
+ id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
7431
+ name: "Ndara",
7432
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7433
+ validUntil: null,
7434
+ externalId: "crXh068O9TR"
7435
+ },
7436
+ {
7437
+ id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
7438
+ name: "Olani",
7439
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7440
+ validUntil: null,
7441
+ externalId: "r00It8Tvvp7"
7442
+ },
7443
+ {
7444
+ id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
7445
+ name: "Pemba",
7446
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7447
+ validUntil: null,
7448
+ externalId: "ZnUWsbONIaH"
7449
+ },
7450
+ {
7451
+ id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
7452
+ name: "Quanza",
7453
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7454
+ validUntil: null,
7455
+ externalId: "fDZycvQTa7l"
7456
+ },
7457
+ {
7458
+ id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
7459
+ name: "Rivka",
7460
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7461
+ validUntil: null,
7462
+ externalId: "KqswxCGTELa"
7463
+ },
7464
+ // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
7465
+ {
7466
+ id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
7467
+ name: "Mbula",
7468
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7469
+ validUntil: null,
7470
+ externalId: "osEbKjRc9Kg"
7471
+ },
7472
+ {
7473
+ id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
7474
+ name: "Ndoki",
7475
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7476
+ validUntil: null,
7477
+ externalId: "aq4daBUAGr3"
7478
+ },
7479
+ {
7480
+ id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
7481
+ name: "Tsanga",
7482
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7483
+ validUntil: null,
7484
+ externalId: "cqis6Y8trbJ"
7485
+ },
7486
+ {
7487
+ id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
7488
+ name: "Waziri",
7489
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7490
+ validUntil: null,
7491
+ externalId: "LMijHPyyx6d"
7492
+ },
7493
+ {
7494
+ id: "2c5d6e7f-8a9b-4423-8def-456789012345",
7495
+ name: "Zimbi",
7496
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7497
+ validUntil: null,
7498
+ externalId: "pcQYbPuKGZ7"
7499
+ },
7500
+ // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
7501
+ {
7502
+ id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
7503
+ name: "Felani",
7504
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7505
+ validUntil: null,
7506
+ externalId: "gSqpoCGdMXp"
7507
+ },
7508
+ {
7509
+ id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
7510
+ name: "Goroma",
7511
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7512
+ validUntil: null,
7513
+ externalId: "KvAAIaNqVrp"
7514
+ },
7515
+ {
7516
+ id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
7517
+ name: "Halifu",
7518
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7519
+ validUntil: null,
7520
+ externalId: "qe4UnEVt1hv"
7521
+ },
7522
+ {
7523
+ id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
7524
+ name: "Jabari",
7525
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7526
+ validUntil: null,
7527
+ externalId: "yHH9Nz4rLOt"
7528
+ },
7529
+ {
7530
+ id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
7531
+ name: "Kifani",
7532
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7533
+ validUntil: null,
7534
+ externalId: "eSWmXIGeu1I"
7535
+ },
7536
+ {
7537
+ id: "8c1d2e3f-4a5b-4089-8def-012345678901",
7538
+ name: "Lumela",
7539
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7540
+ validUntil: null,
7541
+ externalId: "bh0b3aI1uP3"
7542
+ }
7543
+ ];
7544
+ var V2_DEFAULT_MOCK_LOCATIONS = [
7545
+ {
7546
+ id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
7547
+ name: "Central Provincial Office",
7548
+ locationType: "CRVS_OFFICE",
7549
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7550
+ validUntil: null,
7551
+ externalId: "Xr3Df8WpK6Ys"
7552
+ },
7553
+ {
7554
+ id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
7555
+ name: "Central Health Post",
7556
+ locationType: "HEALTH_FACILITY",
7557
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7558
+ validUntil: null
7559
+ },
7560
+ {
7561
+ id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
7562
+ name: "Ibombo District Office",
7563
+ locationType: "CRVS_OFFICE",
7564
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7565
+ validUntil: null,
7566
+ externalId: "Sm4Nw7GrD2Vy"
7567
+ },
7568
+ {
7569
+ id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
7570
+ name: "Isamba District Office",
7571
+ locationType: "CRVS_OFFICE",
7572
+ administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7573
+ validUntil: null,
7574
+ externalId: "Vg1Bq5XeH9Lt"
7575
+ },
7576
+ {
7577
+ id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
7578
+ name: "Isango District Office",
7579
+ locationType: "CRVS_OFFICE",
7580
+ administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
7581
+ validUntil: null,
7582
+ externalId: "Je7Lm2XqN9Vz"
7583
+ },
7584
+ {
7585
+ id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
7586
+ name: "Sulaka Provincial Office",
7587
+ locationType: "CRVS_OFFICE",
7588
+ administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7589
+ validUntil: null,
7590
+ externalId: "Ht2Wp9KcX5Qv"
7591
+ },
7592
+ {
7593
+ id: "030358c6-54af-44be-821b-8e4af963a49c",
7594
+ name: "Ilanga District Office",
7595
+ locationType: "CRVS_OFFICE",
7596
+ administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7597
+ validUntil: null,
7598
+ externalId: "Yp6Ds1WqN3Xz"
7599
+ },
7600
+ {
7601
+ id: "423d000f-101b-47c0-8b86-21a908067cee",
7602
+ name: "Chamakubi Health Post",
7603
+ locationType: "HEALTH_FACILITY",
7604
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7605
+ validUntil: null,
7606
+ externalId: "M1nFr8LbC2Qy"
7607
+ },
7608
+ {
7609
+ id: "4d3279be-d026-420c-88f7-f0a4ae986973",
7610
+ name: "Ibombo Rural Health Centre",
7611
+ locationType: "HEALTH_FACILITY",
7612
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7613
+ validUntil: null,
7614
+ externalId: "bT7pV6YrW0Xc"
7615
+ },
7616
+ {
7617
+ id: "190902f4-1d77-476a-8947-41145af1db7d",
7618
+ name: "Chikobo Rural Health Centre",
7619
+ locationType: "HEALTH_FACILITY",
7620
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7621
+ validUntil: null,
7622
+ externalId: "zE4qPn2SgJ5d"
7623
+ },
7624
+ {
7625
+ id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
7626
+ name: "Chilochabalenje Health Post",
7627
+ locationType: "HEALTH_FACILITY",
7628
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7629
+ validUntil: null,
7630
+ externalId: "H8vDs1MqR4Uf"
7631
+ },
7632
+ {
7633
+ id: "dbfc178f-7295-4b90-b28d-111c95b03127",
7634
+ name: "Chipeso Rural Health Centre",
7635
+ locationType: "HEALTH_FACILITY",
7636
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7637
+ validUntil: null,
7638
+ externalId: "Qw3uZ9KfX6Lm"
7639
+ },
7640
+ {
7641
+ id: "09862bfe-c7ac-46cd-987b-668681533c80",
7642
+ name: "Chisamba Rural Health Centre",
7643
+ locationType: "HEALTH_FACILITY",
7644
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7645
+ validUntil: null,
7646
+ externalId: "Yr0pCg8LdM2s"
7647
+ },
7648
+ {
7649
+ id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
7650
+ name: "Chitanda Rural Health Centre",
7651
+ locationType: "HEALTH_FACILITY",
7652
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7653
+ validUntil: null,
7654
+ externalId: "tS9gJ4PwB1Qx"
7655
+ },
7656
+ {
7657
+ id: "0431c433-6062-4a4c-aee9-25271aec61ee",
7658
+ name: "Golden Valley Rural Health Centre",
7659
+ locationType: "HEALTH_FACILITY",
7660
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7661
+ validUntil: null,
7662
+ externalId: "Ld7Qm3XsA8Vr"
7663
+ },
7664
+ {
7665
+ id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
7666
+ name: "Ipongo Rural Health Centre",
7667
+ locationType: "HEALTH_FACILITY",
7668
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7669
+ validUntil: null,
7670
+ externalId: "kF2sW9DmH0Bt"
7671
+ },
7672
+ {
7673
+ id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
7674
+ name: "Itumbwe Health Post",
7675
+ locationType: "HEALTH_FACILITY",
7676
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7677
+ validUntil: null,
7678
+ externalId: "Ue5Xb3VaC7Pq"
7679
+ },
7680
+ {
7681
+ id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
7682
+ name: "Kabangalala Rural Health Centre",
7683
+ locationType: "HEALTH_FACILITY",
7684
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7685
+ validUntil: null,
7686
+ externalId: "Pz8Kc1TqH6Jn"
7687
+ },
7688
+ // Village offices
7689
+ {
7690
+ id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
7691
+ name: "Klow Village Office",
7692
+ locationType: "CRVS_OFFICE",
7693
+ administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7694
+ validUntil: null,
7695
+ externalId: "PmAyxAJkxiJ"
7696
+ }
7697
+ ];
7698
+ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
7699
+ V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
7700
+ );
7701
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
7702
+ V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
7703
+ );
7704
+
7076
7705
  // ../commons/src/notification/UserNotifications.ts
7077
7706
  var z44 = __toESM(require("zod/v4"));
7078
7707
  var TriggerEvent = {