@opencrvs/toolkit 2.0.0-rc.c0924af → 2.0.0-rc.c0adb49

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 (36) hide show
  1. package/create-countryconfig/index.js +50 -20
  2. package/create-countryconfig/package.json +12 -2
  3. package/dist/application-config/index.js +251 -97
  4. package/dist/cli.js +206 -36
  5. package/dist/commons/api/router.d.ts +3287 -229
  6. package/dist/commons/application-config/index.d.ts +2 -0
  7. package/dist/commons/conditionals/conditionals.d.ts +354 -4
  8. package/dist/commons/conditionals/validate.d.ts +52 -2
  9. package/dist/commons/events/ActionInput.d.ts +108 -36
  10. package/dist/commons/events/Draft.d.ts +4 -3
  11. package/dist/commons/events/EventIndex.d.ts +0 -3
  12. package/dist/commons/events/EventMetadata.d.ts +0 -7
  13. package/dist/commons/events/FieldConfig.d.ts +377 -50
  14. package/dist/commons/events/FieldValue.d.ts +6 -0
  15. package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
  16. package/dist/commons/events/field.d.ts +47 -1
  17. package/dist/commons/events/index.d.ts +2 -0
  18. package/dist/commons/events/state/flags.d.ts +16 -0
  19. package/dist/commons/events/state/index.d.ts +0 -4
  20. package/dist/commons/events/state/utils.d.ts +0 -2
  21. package/dist/commons/events/utils.d.ts +2 -2
  22. package/dist/conditionals/index.js +55 -2
  23. package/dist/events/index.js +904 -227
  24. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
  25. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
  26. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
  27. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  28. package/dist/migrations/v2.0/index.js +204 -34
  29. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  30. package/dist/migrations/v2.0/migrate-scopes.js +54 -30
  31. package/dist/notification/index.js +785 -132
  32. package/dist/scopes/index.js +3 -1
  33. package/opencrvs-toolkit-2.0.0-rc.c0adb49.tgz +0 -0
  34. package/package.json +6 -2
  35. package/tsconfig.tsbuildinfo +1 -1
  36. package/opencrvs-toolkit-2.0.0-rc.c0924af.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
@@ -652,7 +654,10 @@ var ActionConditional = z7.discriminatedUnion("type", [
652
654
  ShowConditional,
653
655
  // Action can be shown to the user in the list but as disabled
654
656
  EnableConditional
655
- ]);
657
+ ]).meta({
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."
660
+ });
656
661
  var DisplayOnReviewConditional = z7.object({
657
662
  type: z7.literal(ConditionalType.DISPLAY_ON_REVIEW),
658
663
  conditional: Conditional
@@ -667,8 +672,8 @@ var FieldConditional = z7.discriminatedUnion("type", [
667
672
  // Field output can be shown / hidden on the review page
668
673
  DisplayOnReviewConditional
669
674
  ]).meta({
670
- description: "Field conditional configuration",
671
- 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."
672
677
  });
673
678
 
674
679
  // ../commons/src/events/FieldType.ts
@@ -912,6 +917,7 @@ var DateRangeFieldValue = z12.object({
912
917
  var EmailValue = z12.email();
913
918
  var CheckboxFieldValue = z12.boolean();
914
919
  var NumberFieldValue = z12.number();
920
+ var SignatureFieldValue = FileFieldValue;
915
921
  var ButtonFieldValue = z12.number();
916
922
  var VerificationStatusValue = z12.enum([
917
923
  "verified",
@@ -1303,6 +1309,9 @@ var FlagConfig = z15.object({
1303
1309
  "Indicates if this flag expects an action to be performed to be cleared."
1304
1310
  ),
1305
1311
  label: TranslationConfig.describe("Human readable label of the flag.")
1312
+ }).meta({
1313
+ id: "FlagConfig",
1314
+ description: "Configuration for a custom flag that can be added to or removed from records by event actions."
1306
1315
  });
1307
1316
  var ActionFlagConfig = z15.object({
1308
1317
  id: Flag,
@@ -1310,6 +1319,9 @@ var ActionFlagConfig = z15.object({
1310
1319
  conditional: Conditional.optional().describe(
1311
1320
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
1312
1321
  )
1322
+ }).meta({
1323
+ id: "ActionFlagConfig",
1324
+ description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
1313
1325
  });
1314
1326
 
1315
1327
  // ../commons/src/events/EventMetadata.ts
@@ -1331,8 +1343,7 @@ var ActionCreationMetadata = z16.object({
1331
1343
  ),
1332
1344
  createdByUserType: z16.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1333
1345
  acceptedAt: z16.iso.datetime().describe("Timestamp when the action request was accepted."),
1334
- createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation."),
1335
- createdBySignature: z16.string().nullish().describe("Signature of the user who created the action request.")
1346
+ createdByRole: z16.string().optional().describe("Role of the user at the time of action request creation.")
1336
1347
  });
1337
1348
  var RegistrationCreationMetadata = ActionCreationMetadata.extend({
1338
1349
  registrationNumber: z16.string().describe(
@@ -1360,9 +1371,6 @@ var EventMetadata = z16.object({
1360
1371
  createdAtLocation: UUID.nullish().describe(
1361
1372
  "Location of the user who created the event."
1362
1373
  ),
1363
- createdBySignature: DocumentPath.nullish().describe(
1364
- "Signature of the user who created the event."
1365
- ),
1366
1374
  updatedAtLocation: UUID.nullish().describe(
1367
1375
  "Location of the user who last changed the status."
1368
1376
  ),
@@ -1655,14 +1663,31 @@ var FieldId = import_v43.default.string().superRefine((val, ctx) => {
1655
1663
  }
1656
1664
  }).describe("Unique identifier for the field");
1657
1665
  var FieldReference = import_v43.default.object({
1658
- $$field: FieldId,
1666
+ $$field: FieldId.describe("Id of the field to reference"),
1659
1667
  $$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
1660
1668
  'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
1669
+ ),
1670
+ $$code: import_v43.default.string().optional().describe(
1671
+ "Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
1672
+ )
1673
+ }).describe(
1674
+ "Reference to a field value, with an optional client-side computation applied."
1675
+ );
1676
+ var ComputedDefaultValue = import_v43.default.object({
1677
+ $$code: import_v43.default.string().describe(
1678
+ "Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
1661
1679
  )
1662
- }).describe("Reference to a field by its ID");
1680
+ }).describe("A context-only computation used as a field default value.");
1663
1681
  var ValidationConfig = import_v43.default.object({
1664
- validator: Conditional,
1665
- message: TranslationConfig
1682
+ validator: Conditional.describe(
1683
+ "Conditional expression that must hold for the field value to be considered valid."
1684
+ ),
1685
+ message: TranslationConfig.describe(
1686
+ "Error message displayed when the validator does not hold."
1687
+ )
1688
+ }).meta({
1689
+ id: "ValidationConfig",
1690
+ 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."
1666
1691
  });
1667
1692
  var requiredSchema = import_v43.default.union([
1668
1693
  import_v43.default.boolean(),
@@ -1693,7 +1718,7 @@ var BaseField = import_v43.default.object({
1693
1718
  "Indicates whether the field can be modified during record correction."
1694
1719
  ),
1695
1720
  value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
1696
- "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."
1721
+ "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."
1697
1722
  ),
1698
1723
  analytics: import_v43.default.boolean().default(false).optional().describe(
1699
1724
  "Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
@@ -1701,30 +1726,39 @@ var BaseField = import_v43.default.object({
1701
1726
  }).describe("Common properties shared across all field types.");
1702
1727
  var Divider = BaseField.extend({
1703
1728
  type: import_v43.default.literal(FieldType.DIVIDER)
1729
+ }).meta({
1730
+ description: "A horizontal line divider",
1731
+ id: "Divider"
1704
1732
  });
1705
1733
  var TextField = BaseField.extend({
1706
1734
  type: import_v43.default.literal(FieldType.TEXT),
1707
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
1735
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
1708
1736
  configuration: import_v43.default.object({
1709
1737
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1710
1738
  type: import_v43.default.enum(["text", "password"]).optional(),
1711
1739
  prefix: TranslationConfig.optional(),
1712
1740
  postfix: TranslationConfig.optional()
1713
1741
  }).default({ type: "text" }).optional()
1714
- }).describe("Text input");
1742
+ }).meta({
1743
+ description: "A text input field",
1744
+ id: "TextField"
1745
+ });
1715
1746
  var NumberField = BaseField.extend({
1716
1747
  type: import_v43.default.literal(FieldType.NUMBER),
1717
- defaultValue: NumberFieldValue.optional(),
1748
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1718
1749
  configuration: import_v43.default.object({
1719
1750
  min: import_v43.default.number().optional().describe("Minimum value"),
1720
1751
  max: import_v43.default.number().optional().describe("Maximum value"),
1721
1752
  prefix: TranslationConfig.optional(),
1722
1753
  postfix: TranslationConfig.optional()
1723
1754
  }).optional()
1724
- }).describe("Number input");
1755
+ }).meta({
1756
+ description: "A number input field",
1757
+ id: "NumberField"
1758
+ });
1725
1759
  var TextAreaField = BaseField.extend({
1726
1760
  type: import_v43.default.literal(FieldType.TEXTAREA),
1727
- defaultValue: NonEmptyTextValue.optional(),
1761
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1728
1762
  configuration: import_v43.default.object({
1729
1763
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
1730
1764
  rows: import_v43.default.number().optional().describe("Number of visible text lines"),
@@ -1732,7 +1766,10 @@ var TextAreaField = BaseField.extend({
1732
1766
  prefix: TranslationConfig.optional(),
1733
1767
  postfix: TranslationConfig.optional()
1734
1768
  }).default({ rows: 4 }).optional()
1735
- }).describe("Multiline text input");
1769
+ }).meta({
1770
+ description: "A multiline text input",
1771
+ id: "TextAreaField"
1772
+ });
1736
1773
  var ImageMimeType = import_v43.default.enum([
1737
1774
  "image/png",
1738
1775
  "image/jpg",
@@ -1755,58 +1792,76 @@ var SignatureField = BaseField.extend({
1755
1792
  signaturePromptLabel: TranslationConfig.describe(
1756
1793
  "Title of the signature modal"
1757
1794
  ),
1758
- defaultValue: FieldValue.optional(),
1795
+ defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
1759
1796
  configuration: import_v43.default.object({
1760
1797
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1761
1798
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
1762
1799
  }).default({
1763
1800
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1764
1801
  })
1765
- }).describe("Signature input field");
1802
+ }).meta({
1803
+ description: "A signature input field",
1804
+ id: "SignatureField"
1805
+ });
1766
1806
  var EmailField = BaseField.extend({
1767
1807
  type: import_v43.default.literal(FieldType.EMAIL),
1768
1808
  configuration: import_v43.default.object({
1769
1809
  maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
1770
1810
  }).default({ maxLength: 255 }).optional(),
1771
- defaultValue: NonEmptyTextValue.optional()
1811
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
1812
+ }).meta({
1813
+ description: "An email input field",
1814
+ id: "EmailField"
1772
1815
  });
1773
1816
  var DateField = BaseField.extend({
1774
1817
  type: import_v43.default.literal(FieldType.DATE),
1775
- defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
1818
+ defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
1776
1819
  configuration: import_v43.default.object({
1777
1820
  notice: TranslationConfig.describe(
1778
1821
  "Text to display above the date input"
1779
1822
  ).optional()
1780
1823
  }).optional()
1781
- }).describe("A single date input (yyyy-MM-dd)");
1824
+ }).meta({
1825
+ description: "A date input (yyyy-MM-dd)",
1826
+ id: "DateField"
1827
+ });
1782
1828
  var AgeField = BaseField.extend({
1783
1829
  type: import_v43.default.literal(FieldType.AGE),
1784
- defaultValue: NumberFieldValue.optional(),
1830
+ defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
1785
1831
  configuration: import_v43.default.object({
1786
1832
  asOfDate: FieldReference,
1787
1833
  prefix: TranslationConfig.optional(),
1788
1834
  postfix: TranslationConfig.optional()
1789
1835
  })
1790
- }).describe("An age input field which uses the current date as the asOfDate");
1836
+ }).meta({
1837
+ description: "An age input field which uses the current date as the asOfDate",
1838
+ id: "AgeField"
1839
+ });
1791
1840
  var TimeField = BaseField.extend({
1792
1841
  type: import_v43.default.literal(FieldType.TIME),
1793
- defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
1842
+ defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
1794
1843
  configuration: import_v43.default.object({
1795
1844
  use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
1796
1845
  notice: TranslationConfig.describe(
1797
1846
  "Text to display above the time input"
1798
1847
  ).optional()
1799
1848
  }).optional()
1800
- }).describe("A single date input (HH-mm)");
1849
+ }).meta({
1850
+ description: "A single time input (HH-mm)",
1851
+ id: "TimeField"
1852
+ });
1801
1853
  var DateRangeField = BaseField.extend({
1802
1854
  type: import_v43.default.literal(FieldType.DATE_RANGE),
1803
- defaultValue: DateRangeFieldValue.optional(),
1855
+ defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
1804
1856
  configuration: import_v43.default.object({
1805
1857
  notice: TranslationConfig.describe(
1806
1858
  "Text to display above the date input"
1807
1859
  ).optional()
1808
1860
  }).optional()
1809
- }).describe("A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })");
1861
+ }).meta({
1862
+ description: "A date range input ({ start: yyyy-MM-dd, end: yyyy-MM-dd })",
1863
+ id: "DateRangeField"
1864
+ });
1810
1865
  var HtmlFontVariant = import_v43.default.enum([
1811
1866
  "reg12",
1812
1867
  "reg14",
@@ -1850,21 +1905,33 @@ var ImageViewField = BaseField.extend({
1850
1905
  type: import_v43.default.literal(FieldType.IMAGE_VIEW),
1851
1906
  defaultValue: NonEmptyTextValue.optional(),
1852
1907
  configuration: ImageConfiguration
1853
- }).describe("A read-only image component for form pages");
1908
+ }).meta({
1909
+ description: "A read-only image component for form pages",
1910
+ id: "ImageViewField"
1911
+ });
1854
1912
  var Paragraph = BaseField.extend({
1855
1913
  type: import_v43.default.literal(FieldType.PARAGRAPH),
1856
1914
  configuration: ParagraphConfiguration
1857
- }).describe("A read-only HTML <p> paragraph");
1915
+ }).meta({
1916
+ description: "A read-only HTML <p> paragraph",
1917
+ id: "Paragraph"
1918
+ });
1858
1919
  var Heading = BaseField.extend({
1859
1920
  type: import_v43.default.literal(FieldType.HEADING),
1860
1921
  configuration: HeadingConfiguration
1861
- }).describe("A read-only heading component for form pages");
1922
+ }).meta({
1923
+ description: "A read-only heading component for form pages",
1924
+ id: "Heading"
1925
+ });
1862
1926
  var PageHeader = BaseField.extend({
1863
1927
  type: import_v43.default.literal(FieldType.PAGE_HEADER)
1864
- }).describe("A read-only header component for form pages");
1928
+ }).meta({
1929
+ description: "A read-only header component for form pages",
1930
+ id: "PageHeader"
1931
+ });
1865
1932
  var File = BaseField.extend({
1866
1933
  type: import_v43.default.literal(FieldType.FILE),
1867
- defaultValue: FileFieldValue.optional(),
1934
+ defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
1868
1935
  configuration: import_v43.default.object({
1869
1936
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
1870
1937
  acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
@@ -1880,7 +1947,10 @@ var File = BaseField.extend({
1880
1947
  }).default({
1881
1948
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
1882
1949
  })
1883
- }).describe("File upload");
1950
+ }).meta({
1951
+ description: "A file upload field",
1952
+ id: "File"
1953
+ });
1884
1954
  var SelectOption = import_v43.default.object({
1885
1955
  value: import_v43.default.string().describe("The value of the option"),
1886
1956
  label: import_v43.default.union([import_v43.default.string(), TranslationConfig]).describe("The label of the option"),
@@ -1888,7 +1958,7 @@ var SelectOption = import_v43.default.object({
1888
1958
  });
1889
1959
  var NumberWithUnitField = BaseField.extend({
1890
1960
  type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
1891
- defaultValue: NumberWithUnitFieldValue.optional(),
1961
+ defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
1892
1962
  options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
1893
1963
  configuration: import_v43.default.object({
1894
1964
  min: import_v43.default.number().optional().describe("Minimum value of the number field"),
@@ -1897,17 +1967,23 @@ var NumberWithUnitField = BaseField.extend({
1897
1967
  "Placeholder for the number field"
1898
1968
  )
1899
1969
  }).optional()
1900
- }).describe("Number with unit input");
1970
+ }).meta({
1971
+ description: "A number with unit input field",
1972
+ id: "NumberWithUnitField"
1973
+ });
1901
1974
  var RadioGroup = BaseField.extend({
1902
1975
  type: import_v43.default.literal(FieldType.RADIO_GROUP),
1903
- defaultValue: TextValue.optional(),
1976
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1904
1977
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1905
1978
  configuration: import_v43.default.object({
1906
1979
  styles: import_v43.default.object({
1907
1980
  size: import_v43.default.enum(["NORMAL", "LARGE"]).optional()
1908
1981
  }).optional()
1909
1982
  }).optional()
1910
- }).describe("Grouped radio options");
1983
+ }).meta({
1984
+ description: "A grouped radio button field",
1985
+ id: "RadioGroup"
1986
+ });
1911
1987
  var BulletList = BaseField.extend({
1912
1988
  type: import_v43.default.literal(FieldType.BULLET_LIST),
1913
1989
  items: import_v43.default.array(TranslationConfig).describe("A list of items"),
@@ -1916,10 +1992,13 @@ var BulletList = BaseField.extend({
1916
1992
  fontVariant: HtmlFontVariant.optional()
1917
1993
  }).optional()
1918
1994
  }).default({})
1919
- }).describe("A list of bullet points");
1995
+ }).meta({
1996
+ description: "A list of bullet points",
1997
+ id: "BulletList"
1998
+ });
1920
1999
  var Select = BaseField.extend({
1921
2000
  type: import_v43.default.literal(FieldType.SELECT),
1922
- defaultValue: TextValue.optional(),
2001
+ defaultValue: TextValue.or(ComputedDefaultValue).optional(),
1923
2002
  options: import_v43.default.array(SelectOption).describe("A list of options"),
1924
2003
  noOptionsMessage: TranslationConfig.optional().describe(
1925
2004
  `
@@ -1931,16 +2010,22 @@ var Select = BaseField.extend({
1931
2010
  { ..., defaultMessage: "'{input}' is not listed among the health facilities." }
1932
2011
  `
1933
2012
  )
1934
- }).describe("Select input");
2013
+ }).meta({
2014
+ description: "A select input field",
2015
+ id: "Select"
2016
+ });
1935
2017
  var SelectDateRangeOption = import_v43.default.object({
1936
2018
  value: SelectDateRangeValue.describe("The value of the option"),
1937
2019
  label: TranslationConfig.describe("The label of the option")
1938
2020
  });
1939
2021
  var SelectDateRangeField = BaseField.extend({
1940
2022
  type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
1941
- defaultValue: SelectDateRangeValue.optional(),
2023
+ defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
1942
2024
  options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
1943
- }).describe("Select input with date range options");
2025
+ }).meta({
2026
+ description: "A date range selection field",
2027
+ id: "SelectDateRangeField"
2028
+ });
1944
2029
  var NameConfig = import_v43.default.object({
1945
2030
  firstname: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
1946
2031
  middlename: import_v43.default.object({ required: requiredSchema, label: TranslationConfig.optional() }).optional(),
@@ -1952,7 +2037,7 @@ var NameField = BaseField.extend({
1952
2037
  firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
1953
2038
  middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
1954
2039
  surname: SerializedUserField.or(NonEmptyTextValue).optional()
1955
- }).optional(),
2040
+ }).or(ComputedDefaultValue).optional(),
1956
2041
  configuration: import_v43.default.object({
1957
2042
  name: NameConfig.default({
1958
2043
  firstname: { required: true },
@@ -1971,26 +2056,41 @@ var NameField = BaseField.extend({
1971
2056
  surname: { required: true }
1972
2057
  }
1973
2058
  }).optional()
1974
- }).describe("Name input field");
2059
+ }).meta({
2060
+ description: "A field for entering a persons name",
2061
+ id: "NameField"
2062
+ });
1975
2063
  var PhoneField = BaseField.extend({
1976
- defaultValue: NonEmptyTextValue.optional(),
2064
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1977
2065
  type: import_v43.default.literal(FieldType.PHONE)
1978
- }).describe("Phone input field");
2066
+ }).meta({
2067
+ description: "A field for entering a phone number",
2068
+ id: "PhoneField"
2069
+ });
1979
2070
  var IdField = BaseField.extend({
1980
- defaultValue: NonEmptyTextValue.optional(),
2071
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1981
2072
  type: import_v43.default.literal(FieldType.ID)
1982
- }).describe("ID input field");
2073
+ }).meta({
2074
+ description: "A field for entering an ID",
2075
+ id: "IdField"
2076
+ });
1983
2077
  var Checkbox = BaseField.extend({
1984
2078
  type: import_v43.default.literal(FieldType.CHECKBOX),
1985
- defaultValue: CheckboxFieldValue.default(false)
1986
- }).describe("Boolean checkbox field");
2079
+ defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
2080
+ }).meta({
2081
+ description: "A boolean checkbox field",
2082
+ id: "Checkbox"
2083
+ });
1987
2084
  var Country = BaseField.extend({
1988
2085
  type: import_v43.default.literal(FieldType.COUNTRY),
1989
- defaultValue: NonEmptyTextValue.optional(),
2086
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
1990
2087
  optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
1991
2088
  "Conditionals for specific countries. Countries not listed are always shown and enabled."
1992
2089
  )
1993
- }).describe("Country select field");
2090
+ }).meta({
2091
+ description: "A field for selecting a country",
2092
+ id: "Country"
2093
+ });
1994
2094
  var AllowedLocations = JurisdictionReference.optional().describe(
1995
2095
  "Limits which location options are selectable depending on user jurisdiction and location."
1996
2096
  );
@@ -1999,28 +2099,33 @@ var AdministrativeAreas = import_v43.default.enum([
1999
2099
  "HEALTH_FACILITY",
2000
2100
  "CRVS_OFFICE"
2001
2101
  ]);
2002
- var AdministrativeAreaConfiguration = import_v43.default.object({
2003
- partOf: FieldReference.optional().describe("Parent location"),
2004
- type: AdministrativeAreas,
2005
- allowedLocations: AllowedLocations
2006
- }).describe("Administrative area options");
2007
2102
  var AdministrativeAreaField = BaseField.extend({
2008
2103
  type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
2009
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2010
- configuration: AdministrativeAreaConfiguration
2011
- }).describe("Administrative area input field e.g. facility, office");
2104
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
2105
+ configuration: import_v43.default.object({
2106
+ partOf: FieldReference.optional().describe("Parent location"),
2107
+ type: AdministrativeAreas,
2108
+ allowedLocations: AllowedLocations
2109
+ }).describe("Administrative area options")
2110
+ }).meta({
2111
+ description: "Administrative area input field",
2112
+ id: "AdministrativeAreaField"
2113
+ });
2012
2114
  var LocationInput = BaseField.extend({
2013
2115
  type: import_v43.default.literal(FieldType.LOCATION),
2014
- defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
2116
+ defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
2015
2117
  configuration: import_v43.default.object({
2016
2118
  locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
2017
2119
  allowedLocations: AllowedLocations
2018
2120
  }).optional()
2019
- }).describe("Input field for a location");
2121
+ }).meta({
2122
+ description: "A field for selecting a location",
2123
+ id: "LocationInput"
2124
+ });
2020
2125
  var FileUploadWithOptions = BaseField.extend({
2021
2126
  type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
2022
2127
  options: import_v43.default.array(SelectOption).describe("A list of options"),
2023
- defaultValue: FileFieldWithOptionValue.optional(),
2128
+ defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
2024
2129
  configuration: import_v43.default.object({
2025
2130
  maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
2026
2131
  maxImageSize: import_v43.default.object({
@@ -2030,15 +2135,18 @@ var FileUploadWithOptions = BaseField.extend({
2030
2135
  }).default({
2031
2136
  maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
2032
2137
  })
2138
+ }).meta({
2139
+ description: "A field for uploading files with file type options",
2140
+ id: "FileUploadWithOptions"
2033
2141
  });
2034
2142
  var Facility = BaseField.extend({
2035
2143
  type: import_v43.default.literal(FieldType.FACILITY),
2036
- defaultValue: NonEmptyTextValue.optional(),
2144
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2037
2145
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
2038
2146
  }).describe("Input field for a facility");
2039
2147
  var Office = BaseField.extend({
2040
2148
  type: import_v43.default.literal(FieldType.OFFICE),
2041
- defaultValue: NonEmptyTextValue.optional(),
2149
+ defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
2042
2150
  configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
2043
2151
  }).describe("Input field for an office");
2044
2152
  var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
@@ -2074,8 +2182,11 @@ var Address = BaseField.extend({
2074
2182
  ).optional(),
2075
2183
  allowedLocations: AllowedLocations
2076
2184
  }).optional(),
2077
- defaultValue: DefaultAddressFieldValue.optional()
2078
- }).describe("Address input field \u2013 a combination of location and text fields");
2185
+ defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
2186
+ }).meta({
2187
+ description: "Address input field \u2013 a combination of location and text fields",
2188
+ id: "Address"
2189
+ });
2079
2190
  var StaticDataEntry = import_v43.default.object({
2080
2191
  id: import_v43.default.string().describe("ID for the data entry."),
2081
2192
  label: TranslationConfig,
@@ -2090,7 +2201,10 @@ var DataField = BaseField.extend({
2090
2201
  subtitle: TranslationConfig.optional(),
2091
2202
  data: import_v43.default.array(DataEntry)
2092
2203
  })
2093
- }).describe("Data field for displaying read-only data");
2204
+ }).meta({
2205
+ description: "A field for displaying a table of read-only data",
2206
+ id: "DataField"
2207
+ });
2094
2208
  var ButtonSize = import_v43.default.enum(["small", "medium", "large"]);
2095
2209
  var ButtonType = import_v43.default.enum([
2096
2210
  "primary",
@@ -2115,13 +2229,19 @@ var ButtonConfiguration = import_v43.default.object({
2115
2229
  });
2116
2230
  var ButtonField = BaseField.extend({
2117
2231
  type: import_v43.default.literal(FieldType.BUTTON),
2118
- defaultValue: ButtonFieldValue.optional(),
2232
+ defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
2119
2233
  configuration: ButtonConfiguration
2120
- }).describe("Generic button without any built-in functionality");
2234
+ }).meta({
2235
+ description: "A generic button that can be used to trigger an action",
2236
+ id: "ButtonField"
2237
+ });
2121
2238
  var FieldGroup = BaseField.extend({
2122
2239
  type: import_v43.default.literal(FieldType.FIELD_GROUP),
2123
2240
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
2124
2241
  fields: import_v43.default.lazy(() => import_v43.default.array(FieldConfig))
2242
+ }).meta({
2243
+ description: "A group of fields that are displayed together",
2244
+ id: "FieldGroup"
2125
2245
  });
2126
2246
  var AlphaPrintButton = BaseField.extend({
2127
2247
  type: import_v43.default.literal(FieldType.ALPHA_PRINT_BUTTON),
@@ -2131,10 +2251,13 @@ var AlphaPrintButton = BaseField.extend({
2131
2251
  "Label for the print button"
2132
2252
  )
2133
2253
  })
2134
- }).describe("Print button field for printing certificates");
2254
+ }).meta({
2255
+ description: "An experimental print button field for printing certificates during the declaration process",
2256
+ id: "AlphaPrintButton"
2257
+ });
2135
2258
  var HttpField = BaseField.extend({
2136
2259
  type: import_v43.default.literal(FieldType.HTTP),
2137
- defaultValue: HttpFieldValue.optional(),
2260
+ defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
2138
2261
  configuration: import_v43.default.object({
2139
2262
  trigger: FieldReference.optional().describe(
2140
2263
  "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."
@@ -2147,20 +2270,30 @@ var HttpField = BaseField.extend({
2147
2270
  params: import_v43.default.record(import_v43.default.string(), import_v43.default.union([import_v43.default.string(), FieldReference])).optional(),
2148
2271
  timeout: import_v43.default.number().default(15e3).describe("Request timeout in milliseconds")
2149
2272
  })
2150
- }).describe("HTTP request function triggered by a button click or other event");
2273
+ }).meta({
2274
+ description: "Makes a background HTTP request to an external service and stores the response so other fields can use it. Has no visible UI \u2014 pair with LOADER to show request status.",
2275
+ id: "HttpField"
2276
+ });
2151
2277
  var AutocompleteField = BaseField.extend({
2152
2278
  type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
2153
2279
  configuration: import_v43.default.object({
2154
- url: import_v43.default.string().describe("URL to fetch autocomplete suggestions from").optional(),
2280
+ url: import_v43.default.string().describe(
2281
+ "URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
2282
+ ).optional(),
2155
2283
  method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
2156
2284
  defaultOptions: import_v43.default.array(
2157
2285
  import_v43.default.object({
2158
2286
  label: import_v43.default.string(),
2159
2287
  value: import_v43.default.string()
2160
2288
  })
2161
- ).optional()
2289
+ ).optional().describe(
2290
+ "Manual entry is supported through configuration, allowing users to provide values not currently represented in the dataset."
2291
+ )
2162
2292
  })
2163
- }).describe("Autocomplete input field");
2293
+ }).meta({
2294
+ 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.",
2295
+ id: "AutocompleteField"
2296
+ });
2164
2297
  var SearchField = HttpField.extend({
2165
2298
  type: import_v43.default.literal(FieldType.SEARCH),
2166
2299
  configuration: SearchQuery.pick({
@@ -2193,6 +2326,9 @@ var SearchField = HttpField.extend({
2193
2326
  ok: TranslationConfig.optional()
2194
2327
  }).optional()
2195
2328
  })
2329
+ }).meta({
2330
+ description: "A search input field",
2331
+ id: "SearchField"
2196
2332
  });
2197
2333
  var LinkButtonField = BaseField.extend({
2198
2334
  type: import_v43.default.literal(FieldType.LINK_BUTTON),
@@ -2201,28 +2337,35 @@ var LinkButtonField = BaseField.extend({
2201
2337
  text: TranslationConfig.describe("Text to display on the button"),
2202
2338
  icon: import_v43.default.string().optional().describe("Icon for the button. You can find icons from OpenCRVS UI-Kit.")
2203
2339
  })
2204
- }).describe("Button that opens a link");
2340
+ }).meta({
2341
+ description: "A button that opens a URL link",
2342
+ id: "LinkButtonField"
2343
+ });
2205
2344
  var VerificationStatus = BaseField.extend({
2206
2345
  type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
2207
- defaultValue: VerificationStatusValue.optional(),
2346
+ defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
2208
2347
  configuration: import_v43.default.object({
2209
2348
  status: TranslationConfig.describe("Text to display on the status pill."),
2210
2349
  description: TranslationConfig.describe(
2211
2350
  "Explaining text on the banner in form."
2212
2351
  )
2213
2352
  })
2353
+ }).meta({
2354
+ description: "Displays a verification state (e.g. ID verified / pending). Often paired with ID_READER \u2014 it can read its value off an ID_READER rather than holding its own.",
2355
+ id: "VerificationStatus"
2214
2356
  });
2215
2357
  var QueryParamReaderField = BaseField.extend({
2216
2358
  type: import_v43.default.literal(FieldType.QUERY_PARAM_READER),
2217
2359
  configuration: import_v43.default.object({
2218
2360
  pickParams: import_v43.default.array(import_v43.default.string()).describe("List of query parameters to read from the URL")
2219
2361
  })
2220
- }).describe(
2221
- "A field that maps URL query params into form values and clears them afterward"
2222
- );
2362
+ }).meta({
2363
+ description: "A field that maps URL query params into form values and clears them afterward",
2364
+ id: "QueryParamReaderField"
2365
+ });
2223
2366
  var QrReaderField = BaseField.extend({
2224
2367
  type: import_v43.default.literal(FieldType.QR_READER),
2225
- defaultValue: QrReaderFieldValue.optional(),
2368
+ defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
2226
2369
  configuration: import_v43.default.object({
2227
2370
  validator: import_v43.default.any().meta({
2228
2371
  description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
@@ -2230,21 +2373,27 @@ var QrReaderField = BaseField.extend({
2230
2373
  })
2231
2374
  }).optional()
2232
2375
  }).meta({
2233
- description: "Configuration for QR code reader field, including optional JSON Schema validator.",
2376
+ description: "QR code reader field, including optional JSON Schema validator.",
2234
2377
  id: "QrReaderField"
2235
2378
  });
2236
2379
  var IdReaderField = BaseField.extend({
2237
2380
  type: import_v43.default.literal(FieldType.ID_READER),
2238
- defaultValue: IdReaderFieldValue.optional(),
2381
+ defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
2239
2382
  methods: import_v43.default.array(
2240
2383
  import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
2241
2384
  )
2385
+ }).meta({
2386
+ description: "A wrapper around nested form fields, specifically QR_READER and LINK_BUTTON. It can hold the QR_READERs value.",
2387
+ id: "IdReaderField"
2242
2388
  });
2243
2389
  var CustomField = BaseField.extend({
2244
2390
  type: import_v43.default.literal(FieldType._EXPERIMENTAL_CUSTOM),
2245
2391
  defaultValue: CustomFieldValue.optional(),
2246
2392
  src: import_v43.default.string().describe("Module source path for the custom field component"),
2247
2393
  configuration: import_v43.default.unknown().optional()
2394
+ }).meta({
2395
+ description: "An expiremental custom field that is defined by a module source path",
2396
+ id: "CustomField"
2248
2397
  });
2249
2398
  var FieldStyleVariant = import_v43.default.enum(["default", "highlighted"]);
2250
2399
  var LoaderField = BaseField.extend({
@@ -2254,22 +2403,25 @@ var LoaderField = BaseField.extend({
2254
2403
  configuration: import_v43.default.object({
2255
2404
  text: TranslationConfig.describe("Display text above the loading spinner")
2256
2405
  })
2257
- }).describe(
2258
- "A non-interactive field that indicates an in progress operation in form"
2259
- );
2406
+ }).meta({
2407
+ description: "A non-interactive field that indicates an in progress operation in form",
2408
+ id: "LoaderField"
2409
+ });
2260
2410
  var HiddenField = BaseField.extend({
2261
2411
  type: import_v43.default.literal(FieldType.ALPHA_HIDDEN),
2262
2412
  required: import_v43.default.boolean().default(false).optional(),
2263
2413
  defaultValue: TextValue.optional()
2264
- }).describe(
2265
- "A non-interactive, hidden field that only hold a value in the form"
2266
- );
2414
+ }).meta({
2415
+ description: "A non-interactive, hidden field that only hold a value in the form",
2416
+ id: "HiddenField"
2417
+ });
2267
2418
  var UserRoleField = BaseField.extend({
2268
2419
  type: import_v43.default.literal(FieldType.USER_ROLE),
2269
2420
  defaultValue: TextValue.optional()
2270
- }).describe(
2271
- "A select dropdown that is automatically populated with available user roles"
2272
- );
2421
+ }).meta({
2422
+ description: "A select dropdown that is automatically populated with available user roles",
2423
+ id: "UserRoleField"
2424
+ });
2273
2425
  var FieldConfig = import_v43.default.discriminatedUnion("type", [
2274
2426
  FieldGroup,
2275
2427
  Address,
@@ -2368,16 +2520,19 @@ var VerificationPageConfig = FormPageConfig.extend({
2368
2520
  type: z21.literal(PageTypes.enum.VERIFICATION),
2369
2521
  actions: VerificationActionConfig
2370
2522
  });
2371
- var PageConfig = z21.discriminatedUnion("type", [
2372
- FormPageConfig,
2373
- VerificationPageConfig
2374
- ]);
2523
+ var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
2524
+ id: "PageConfig",
2525
+ 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."
2526
+ });
2375
2527
 
2376
2528
  // ../commons/src/events/FormConfig.ts
2377
2529
  var DeclarationFormConfig = z22.object({
2378
2530
  label: TranslationConfig.describe("Human readable description of the form"),
2379
2531
  pages: z22.array(FormPageConfig)
2380
- }).describe("Configuration of the declaration form.");
2532
+ }).meta({
2533
+ id: "DeclarationFormConfig",
2534
+ description: "Configuration of the declaration form."
2535
+ });
2381
2536
  var ActionFormConfig = z22.object({
2382
2537
  label: TranslationConfig.describe("Human readable description of the form"),
2383
2538
  pages: z22.array(PageConfig)
@@ -2477,6 +2632,9 @@ var DeduplicationConfig = z23.object({
2477
2632
  id: z23.string(),
2478
2633
  label: TranslationConfig,
2479
2634
  query: Clause
2635
+ }).meta({
2636
+ id: "DeduplicationConfig",
2637
+ 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."
2480
2638
  });
2481
2639
 
2482
2640
  // ../commons/src/events/ActionConfig.ts
@@ -2594,17 +2752,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
2594
2752
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
2595
2753
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
2596
2754
  */
2597
- ReadActionConfig.meta({ id: "ReadActionConfig" }),
2598
- DeclareConfig.meta({ id: "DeclareActionConfig" }),
2599
- RejectConfig.meta({ id: "RejectActionConfig" }),
2600
- RegisterConfig.meta({ id: "RegisterActionConfig" }),
2755
+ ReadActionConfig.meta({
2756
+ id: "ReadActionConfig",
2757
+ description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
2758
+ }),
2759
+ DeclareConfig.meta({
2760
+ id: "DeclareActionConfig",
2761
+ description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
2762
+ }),
2763
+ RejectConfig.meta({
2764
+ id: "RejectActionConfig",
2765
+ description: "Configuration for rejecting a record before registration."
2766
+ }),
2767
+ RegisterConfig.meta({
2768
+ id: "RegisterActionConfig",
2769
+ description: "Configuration for registering a record."
2770
+ }),
2601
2771
  PrintCertificateActionConfig.meta({
2602
- id: "PrintCertificateActionConfig"
2772
+ id: "PrintCertificateActionConfig",
2773
+ description: "Configuration for printing a certificate of a registered record."
2774
+ }),
2775
+ RequestCorrectionConfig.meta({
2776
+ id: "RequestCorrectionActionConfig",
2777
+ description: "Configuration for requesting a correction on a registered record."
2603
2778
  }),
2604
- RequestCorrectionConfig.meta({ id: "RequestCorrectionActionConfig" }),
2605
- EditActionConfig.meta({ id: "EditActionConfig" }),
2606
- ArchiveConfig.meta({ id: "ArchiveActionConfig" }),
2607
- CustomActionConfig.meta({ id: "CustomActionConfig" })
2779
+ EditActionConfig.meta({
2780
+ id: "EditActionConfig",
2781
+ description: "Configuration for editing a record before registration."
2782
+ }),
2783
+ ArchiveConfig.meta({
2784
+ id: "ArchiveActionConfig",
2785
+ description: "Configuration for archiving a record."
2786
+ }),
2787
+ CustomActionConfig.meta({
2788
+ id: "CustomActionConfig",
2789
+ description: "Configuration for a country-defined custom action. An event may include any number of these."
2790
+ })
2608
2791
  ]).describe(
2609
2792
  "Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
2610
2793
  ).meta({ id: "ActionConfig" });
@@ -2680,7 +2863,10 @@ var Field = BaseField2.extend({
2680
2863
  }).describe("Custom field defined for the summary view.");
2681
2864
  var SummaryConfig = z27.object({
2682
2865
  fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2683
- }).describe("Configuration of the event summary section.");
2866
+ }).meta({
2867
+ id: "SummaryConfig",
2868
+ 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."
2869
+ });
2684
2870
 
2685
2871
  // ../commons/src/events/AdvancedSearchConfig.ts
2686
2872
  var z28 = __toESM(require("zod/v4"));
@@ -2804,6 +2990,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
2804
2990
  var AdvancedSearchConfig = z28.object({
2805
2991
  title: TranslationConfig.describe("Advanced search tab title"),
2806
2992
  fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2993
+ }).meta({
2994
+ id: "AdvancedSearchConfig",
2995
+ 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()`)."
2807
2996
  });
2808
2997
 
2809
2998
  // ../commons/src/events/utils.ts
@@ -2854,7 +3043,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
2854
3043
  }
2855
3044
  return current;
2856
3045
  }
3046
+ function todayISO() {
3047
+ return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
3048
+ }
3049
+ var compiledFunctionCache = /* @__PURE__ */ new Map();
3050
+ function compileClientFunction(code) {
3051
+ let fn = compiledFunctionCache.get(code);
3052
+ if (!fn) {
3053
+ fn = new Function(`return (${code})`)();
3054
+ compiledFunctionCache.set(code, fn);
3055
+ }
3056
+ return fn;
3057
+ }
2857
3058
  (0, import_ajv_formats.default)(ajv);
3059
+ function buildClientFunctionContext(input) {
3060
+ return {
3061
+ $form: input.form,
3062
+ $now: todayISO(),
3063
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
3064
+ $online: isOnline(),
3065
+ $user: input.validatorContext?.user,
3066
+ $event: input.validatorContext?.event,
3067
+ $leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
3068
+ user: input.systemVariables?.user,
3069
+ $window: input.systemVariables?.$window,
3070
+ locations: input.locations,
3071
+ adminLevelIds: input.adminLevelIds
3072
+ };
3073
+ }
3074
+ function runClientFunction(code, data, context) {
3075
+ return compileClientFunction(code)(data, context);
3076
+ }
2858
3077
  ajv.addKeyword({
2859
3078
  keyword: "daysFromDate",
2860
3079
  type: "string",
@@ -2899,12 +3118,35 @@ ajv.addKeyword({
2899
3118
  $data: true,
2900
3119
  errors: true,
2901
3120
  // @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
2902
- validate(schema, data, _2, dataContext) {
3121
+ validate(_schema, data, _2, dataContext) {
2903
3122
  const locationIdInput = data;
2904
3123
  const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
2905
3124
  return locations.some((location) => location.id === locationIdInput);
2906
3125
  }
2907
3126
  });
3127
+ ajv.addKeyword({
3128
+ keyword: "customClientValidator",
3129
+ schemaType: "object",
3130
+ errors: true,
3131
+ // @ts-expect-error -- AJV's public types don't expose `rootData`. All
3132
+ // `validate()` callers build root data via `buildClientFunctionContext`,
3133
+ // so the cast holds.
3134
+ validate(schema, data, _2, dataContext) {
3135
+ return Boolean(
3136
+ runClientFunction(
3137
+ schema.code,
3138
+ data,
3139
+ dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
3140
+ )
3141
+ );
3142
+ }
3143
+ });
3144
+ function isOnline() {
3145
+ if (typeof window !== "undefined" && typeof navigator !== "undefined") {
3146
+ return navigator.onLine;
3147
+ }
3148
+ return true;
3149
+ }
2908
3150
 
2909
3151
  // ../commons/src/utils.ts
2910
3152
  var z32 = __toESM(require("zod/v4"));
@@ -3523,7 +3765,54 @@ function createFieldConditionals(fieldId) {
3523
3765
  }
3524
3766
  },
3525
3767
  required: [fieldId]
3526
- })
3768
+ }),
3769
+ /**
3770
+ * Custom client-side validator. The provided function is serialised and executed
3771
+ * just-in-time on the client only. External references (e.g. lodash) are not
3772
+ * available inside the function body — all logic must be self-contained.
3773
+ *
3774
+ * @example
3775
+ * field('nid').customClientValidator((value) => {
3776
+ * // LUHN check — all logic must be inline
3777
+ * const digits = String(value).split('').map(Number)
3778
+ * // ...
3779
+ * return isValid
3780
+ * })
3781
+ */
3782
+ customClientValidator(validationFn) {
3783
+ const code = validationFn.toString();
3784
+ return defineFormConditional({
3785
+ type: "object",
3786
+ properties: wrapToPath(
3787
+ { [fieldId]: { customClientValidator: { code } } },
3788
+ this.$$subfield
3789
+ ),
3790
+ required: [fieldId]
3791
+ });
3792
+ },
3793
+ /**
3794
+ * Custom client-side evaluation. Returns a {@link FieldReference} descriptor
3795
+ * that can be used as the `value` property or a DATA component entry.
3796
+ * The function receives the referenced field's value as the first argument and
3797
+ * the full form context as the second; its return value replaces the field reference.
3798
+ * The function is serialised and executed just-in-time on the client only.
3799
+ * External references (e.g. lodash) are not available inside the function body.
3800
+ *
3801
+ * For computing a default value without referencing a specific field, use
3802
+ * `evaluate(fn)` in the `defaultValue` property instead.
3803
+ *
3804
+ * @example
3805
+ * field('a').customClientEvaluation((aValue, ctx) =>
3806
+ * Number(aValue) + Number(ctx.$form.b)
3807
+ * )
3808
+ */
3809
+ customClientEvaluation(computationFn) {
3810
+ return {
3811
+ $$code: computationFn.toString(),
3812
+ $$field: fieldId,
3813
+ $$subfield: this.$$subfield
3814
+ };
3815
+ }
3527
3816
  };
3528
3817
  }
3529
3818
 
@@ -3671,7 +3960,7 @@ var _EventConfigBase = z33.object({
3671
3960
  ),
3672
3961
  label: TranslationConfig.describe("Human-readable label for the event type."),
3673
3962
  actions: z33.array(ActionConfig).describe(
3674
- "Configuration of system-defined actions associated with the event."
3963
+ "Configuration of core and custom actions associated with the event."
3675
3964
  ),
3676
3965
  actionOrder: z33.array(z33.string()).optional().describe(
3677
3966
  "Order of actions in the action menu. Use either the action type for core actions or the customActionType for custom actions."
@@ -3683,7 +3972,7 @@ var _EventConfigBase = z33.object({
3683
3972
  "Configuration of fields available in the advanced search feature."
3684
3973
  ),
3685
3974
  flags: z33.array(FlagConfig).optional().default([]).describe(
3686
- "Configuration of flags associated with the actions of this event type."
3975
+ "Configuration of custom flags associated with the actions of this event type."
3687
3976
  ),
3688
3977
  analytics: z33.boolean().optional().default(true).describe(
3689
3978
  "Indicates whether the records of this event type are included in analytics"
@@ -3696,8 +3985,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
3696
3985
  validateActionFlags(event2, ctx);
3697
3986
  validateActionOrder(event2, ctx);
3698
3987
  }).meta({
3699
- id: "EventConfig"
3700
- }).describe("Configuration defining an event type.");
3988
+ id: "EventConfig",
3989
+ description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
3990
+ });
3701
3991
 
3702
3992
  // ../commons/src/events/EventConfigInput.ts
3703
3993
  var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
@@ -3919,6 +4209,9 @@ var WorkqueueColumnValue = z34.object({
3919
4209
  var WorkqueueColumn = z34.object({
3920
4210
  label: TranslationConfig,
3921
4211
  value: WorkqueueColumnValue
4212
+ }).meta({
4213
+ id: "WorkqueueColumn",
4214
+ description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
3922
4215
  });
3923
4216
  function defineWorkqueuesColumns(workqueueColumns) {
3924
4217
  return workqueueColumns.map(
@@ -4121,18 +4414,11 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
4121
4414
  query: true,
4122
4415
  columns: true
4123
4416
  });
4124
- var WorkqueueConfigInput = z37.object({
4125
- slug: z37.string().describe("Determines the url of the workqueue."),
4126
- name: TranslationConfig.describe(
4127
- "Title of the workflow (both in navigation and on the page)"
4128
- ),
4129
- query: CountryConfigQueryInputType,
4130
- action: z37.object({ type: WorkqueueActionType }).optional().describe(
4131
- "Workqueue call-to-action button configuration. This determines the quick action button shown on each event card and the action taken when the button is clicked."
4132
- ),
4133
- columns: z37.array(WorkqueueColumn).default(mandatoryColumns),
4134
- icon: AvailableIcons,
4135
- emptyMessage: TranslationConfig.optional()
4417
+ var WorkqueueConfigInput = WorkqueueConfig.extend({
4418
+ query: CountryConfigQueryInputType
4419
+ }).meta({
4420
+ id: "WorkqueueConfig",
4421
+ 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."
4136
4422
  });
4137
4423
  var WorkqueueCountInput = z37.array(
4138
4424
  z37.object({ slug: z37.string(), query: QueryType })
@@ -4172,7 +4458,11 @@ var BaseActionInput = z38.object({
4172
4458
  originalActionId: UUID.optional(),
4173
4459
  // should not be part of base action.
4174
4460
  keepAssignment: z38.boolean().optional(),
4175
- waitFor: z38.boolean().optional(),
4461
+ keepAssignmentIfAccepted: z38.boolean().optional(),
4462
+ keepAssignmentIfRejected: z38.boolean().optional(),
4463
+ waitFor: z38.boolean().default(true).describe(
4464
+ "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."
4465
+ ),
4176
4466
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
4177
4467
  // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
4178
4468
  createdAtLocation: UUID.nullish().describe(
@@ -4352,7 +4642,7 @@ var Draft = z39.object({
4352
4642
  }).describe(
4353
4643
  "A temporary storage for an action. Stored with details of the event, creator and creation time."
4354
4644
  );
4355
- var DraftInput = BaseActionInput.extend({
4645
+ var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
4356
4646
  type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
4357
4647
  status: z39.enum([
4358
4648
  ActionStatus.Requested,
@@ -6950,6 +7240,369 @@ var ACTION_FILTERS = {
6950
7240
  // ../commons/src/events/FileUtils.ts
6951
7241
  var import_lodash7 = require("lodash");
6952
7242
 
7243
+ // ../commons/src/events/mocks.test.utils.ts
7244
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7245
+ {
7246
+ id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7247
+ name: "Central",
7248
+ parentId: null,
7249
+ validUntil: null,
7250
+ externalId: "ydyJb1RAy4U1"
7251
+ },
7252
+ {
7253
+ id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7254
+ name: "Sulaka",
7255
+ parentId: null,
7256
+ validUntil: null,
7257
+ externalId: "pQ8nGxWmZ2Q3"
7258
+ },
7259
+ {
7260
+ id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
7261
+ name: "Pualula",
7262
+ parentId: null,
7263
+ validUntil: null,
7264
+ externalId: "Aq91DweLmT8k"
7265
+ },
7266
+ {
7267
+ id: "6d1a59df-988c-4021-a846-ccbc021931a7",
7268
+ name: "Chuminga",
7269
+ parentId: null,
7270
+ validUntil: null,
7271
+ externalId: "Rw0fYNh2Xk9a"
7272
+ },
7273
+ {
7274
+ id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7275
+ name: "Ibombo",
7276
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7277
+ validUntil: null,
7278
+ externalId: "k7DsP4vbN1Qe"
7279
+ },
7280
+ {
7281
+ id: "27160bbd-32d1-4625-812f-860226bfb92a",
7282
+ name: "Isango",
7283
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7284
+ validUntil: null,
7285
+ externalId: "Gm3Z9eQpHw4L"
7286
+ },
7287
+ {
7288
+ id: "967032fd-3f81-478a-826c-30cb8fe121bd",
7289
+ name: "Isamba",
7290
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7291
+ validUntil: null,
7292
+ externalId: "sT0xVu1KqJ7r"
7293
+ },
7294
+ {
7295
+ id: "89a33893-b17d-481d-a26d-6461e7ac1651",
7296
+ name: "Itambo",
7297
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7298
+ validUntil: null,
7299
+ externalId: "Nq6Bv2HpL9Te"
7300
+ },
7301
+ {
7302
+ id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
7303
+ name: "Ezhi",
7304
+ parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7305
+ validUntil: null,
7306
+ externalId: "xK8cQ0ZRy5Wd"
7307
+ },
7308
+ {
7309
+ id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7310
+ name: "Ilanga",
7311
+ parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7312
+ validUntil: null,
7313
+ externalId: "Cq4Jm1XvN8Ls"
7314
+ },
7315
+ // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
7316
+ {
7317
+ id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7318
+ name: "Klow",
7319
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7320
+ validUntil: null,
7321
+ externalId: "IkYcYBUcyY2"
7322
+ },
7323
+ {
7324
+ id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
7325
+ name: "Mbondo",
7326
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7327
+ validUntil: null,
7328
+ externalId: "Qhvv5hvo3mY"
7329
+ },
7330
+ {
7331
+ id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
7332
+ name: "Ndara",
7333
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7334
+ validUntil: null,
7335
+ externalId: "crXh068O9TR"
7336
+ },
7337
+ {
7338
+ id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
7339
+ name: "Olani",
7340
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7341
+ validUntil: null,
7342
+ externalId: "r00It8Tvvp7"
7343
+ },
7344
+ {
7345
+ id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
7346
+ name: "Pemba",
7347
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7348
+ validUntil: null,
7349
+ externalId: "ZnUWsbONIaH"
7350
+ },
7351
+ {
7352
+ id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
7353
+ name: "Quanza",
7354
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7355
+ validUntil: null,
7356
+ externalId: "fDZycvQTa7l"
7357
+ },
7358
+ {
7359
+ id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
7360
+ name: "Rivka",
7361
+ parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7362
+ validUntil: null,
7363
+ externalId: "KqswxCGTELa"
7364
+ },
7365
+ // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
7366
+ {
7367
+ id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
7368
+ name: "Mbula",
7369
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7370
+ validUntil: null,
7371
+ externalId: "osEbKjRc9Kg"
7372
+ },
7373
+ {
7374
+ id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
7375
+ name: "Ndoki",
7376
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7377
+ validUntil: null,
7378
+ externalId: "aq4daBUAGr3"
7379
+ },
7380
+ {
7381
+ id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
7382
+ name: "Tsanga",
7383
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7384
+ validUntil: null,
7385
+ externalId: "cqis6Y8trbJ"
7386
+ },
7387
+ {
7388
+ id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
7389
+ name: "Waziri",
7390
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7391
+ validUntil: null,
7392
+ externalId: "LMijHPyyx6d"
7393
+ },
7394
+ {
7395
+ id: "2c5d6e7f-8a9b-4423-8def-456789012345",
7396
+ name: "Zimbi",
7397
+ parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7398
+ validUntil: null,
7399
+ externalId: "pcQYbPuKGZ7"
7400
+ },
7401
+ // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
7402
+ {
7403
+ id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
7404
+ name: "Felani",
7405
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7406
+ validUntil: null,
7407
+ externalId: "gSqpoCGdMXp"
7408
+ },
7409
+ {
7410
+ id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
7411
+ name: "Goroma",
7412
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7413
+ validUntil: null,
7414
+ externalId: "KvAAIaNqVrp"
7415
+ },
7416
+ {
7417
+ id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
7418
+ name: "Halifu",
7419
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7420
+ validUntil: null,
7421
+ externalId: "qe4UnEVt1hv"
7422
+ },
7423
+ {
7424
+ id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
7425
+ name: "Jabari",
7426
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7427
+ validUntil: null,
7428
+ externalId: "yHH9Nz4rLOt"
7429
+ },
7430
+ {
7431
+ id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
7432
+ name: "Kifani",
7433
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7434
+ validUntil: null,
7435
+ externalId: "eSWmXIGeu1I"
7436
+ },
7437
+ {
7438
+ id: "8c1d2e3f-4a5b-4089-8def-012345678901",
7439
+ name: "Lumela",
7440
+ parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7441
+ validUntil: null,
7442
+ externalId: "bh0b3aI1uP3"
7443
+ }
7444
+ ];
7445
+ var V2_DEFAULT_MOCK_LOCATIONS = [
7446
+ {
7447
+ id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
7448
+ name: "Central Provincial Office",
7449
+ locationType: "CRVS_OFFICE",
7450
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7451
+ validUntil: null,
7452
+ externalId: "Xr3Df8WpK6Ys"
7453
+ },
7454
+ {
7455
+ id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
7456
+ name: "Central Health Post",
7457
+ locationType: "HEALTH_FACILITY",
7458
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7459
+ validUntil: null
7460
+ },
7461
+ {
7462
+ id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
7463
+ name: "Ibombo District Office",
7464
+ locationType: "CRVS_OFFICE",
7465
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7466
+ validUntil: null,
7467
+ externalId: "Sm4Nw7GrD2Vy"
7468
+ },
7469
+ {
7470
+ id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
7471
+ name: "Isamba District Office",
7472
+ locationType: "CRVS_OFFICE",
7473
+ administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7474
+ validUntil: null,
7475
+ externalId: "Vg1Bq5XeH9Lt"
7476
+ },
7477
+ {
7478
+ id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
7479
+ name: "Isango District Office",
7480
+ locationType: "CRVS_OFFICE",
7481
+ administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
7482
+ validUntil: null,
7483
+ externalId: "Je7Lm2XqN9Vz"
7484
+ },
7485
+ {
7486
+ id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
7487
+ name: "Sulaka Provincial Office",
7488
+ locationType: "CRVS_OFFICE",
7489
+ administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7490
+ validUntil: null,
7491
+ externalId: "Ht2Wp9KcX5Qv"
7492
+ },
7493
+ {
7494
+ id: "030358c6-54af-44be-821b-8e4af963a49c",
7495
+ name: "Ilanga District Office",
7496
+ locationType: "CRVS_OFFICE",
7497
+ administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7498
+ validUntil: null,
7499
+ externalId: "Yp6Ds1WqN3Xz"
7500
+ },
7501
+ {
7502
+ id: "423d000f-101b-47c0-8b86-21a908067cee",
7503
+ name: "Chamakubi Health Post",
7504
+ locationType: "HEALTH_FACILITY",
7505
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7506
+ validUntil: null,
7507
+ externalId: "M1nFr8LbC2Qy"
7508
+ },
7509
+ {
7510
+ id: "4d3279be-d026-420c-88f7-f0a4ae986973",
7511
+ name: "Ibombo Rural Health Centre",
7512
+ locationType: "HEALTH_FACILITY",
7513
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7514
+ validUntil: null,
7515
+ externalId: "bT7pV6YrW0Xc"
7516
+ },
7517
+ {
7518
+ id: "190902f4-1d77-476a-8947-41145af1db7d",
7519
+ name: "Chikobo Rural Health Centre",
7520
+ locationType: "HEALTH_FACILITY",
7521
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7522
+ validUntil: null,
7523
+ externalId: "zE4qPn2SgJ5d"
7524
+ },
7525
+ {
7526
+ id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
7527
+ name: "Chilochabalenje Health Post",
7528
+ locationType: "HEALTH_FACILITY",
7529
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7530
+ validUntil: null,
7531
+ externalId: "H8vDs1MqR4Uf"
7532
+ },
7533
+ {
7534
+ id: "dbfc178f-7295-4b90-b28d-111c95b03127",
7535
+ name: "Chipeso Rural Health Centre",
7536
+ locationType: "HEALTH_FACILITY",
7537
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7538
+ validUntil: null,
7539
+ externalId: "Qw3uZ9KfX6Lm"
7540
+ },
7541
+ {
7542
+ id: "09862bfe-c7ac-46cd-987b-668681533c80",
7543
+ name: "Chisamba Rural Health Centre",
7544
+ locationType: "HEALTH_FACILITY",
7545
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7546
+ validUntil: null,
7547
+ externalId: "Yr0pCg8LdM2s"
7548
+ },
7549
+ {
7550
+ id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
7551
+ name: "Chitanda Rural Health Centre",
7552
+ locationType: "HEALTH_FACILITY",
7553
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7554
+ validUntil: null,
7555
+ externalId: "tS9gJ4PwB1Qx"
7556
+ },
7557
+ {
7558
+ id: "0431c433-6062-4a4c-aee9-25271aec61ee",
7559
+ name: "Golden Valley Rural Health Centre",
7560
+ locationType: "HEALTH_FACILITY",
7561
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7562
+ validUntil: null,
7563
+ externalId: "Ld7Qm3XsA8Vr"
7564
+ },
7565
+ {
7566
+ id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
7567
+ name: "Ipongo Rural Health Centre",
7568
+ locationType: "HEALTH_FACILITY",
7569
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7570
+ validUntil: null,
7571
+ externalId: "kF2sW9DmH0Bt"
7572
+ },
7573
+ {
7574
+ id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
7575
+ name: "Itumbwe Health Post",
7576
+ locationType: "HEALTH_FACILITY",
7577
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7578
+ validUntil: null,
7579
+ externalId: "Ue5Xb3VaC7Pq"
7580
+ },
7581
+ {
7582
+ id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
7583
+ name: "Kabangalala Rural Health Centre",
7584
+ locationType: "HEALTH_FACILITY",
7585
+ administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7586
+ validUntil: null,
7587
+ externalId: "Pz8Kc1TqH6Jn"
7588
+ },
7589
+ // Village offices
7590
+ {
7591
+ id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
7592
+ name: "Klow Village Office",
7593
+ locationType: "CRVS_OFFICE",
7594
+ administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7595
+ validUntil: null,
7596
+ externalId: "PmAyxAJkxiJ"
7597
+ }
7598
+ ];
7599
+ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
7600
+ V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
7601
+ );
7602
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
7603
+ V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
7604
+ );
7605
+
6953
7606
  // ../commons/src/notification/UserNotifications.ts
6954
7607
  var z44 = __toESM(require("zod/v4"));
6955
7608
  var TriggerEvent = {