@opencrvs/toolkit 2.0.0-rc.5f678db → 2.0.0-rc.602d523
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +70 -46
- package/dist/cli.js +12 -4
- package/dist/commons/api/router.d.ts +101 -20
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +354 -4
- package/dist/commons/conditionals/validate.d.ts +51 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +42 -36
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +377 -50
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/utils.d.ts +12 -287
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +55 -2
- package/dist/events/index.js +750 -150
- package/dist/migrations/v2.0/index.js +12 -4
- package/dist/notification/index.js +608 -68
- package/dist/scopes/index.d.ts +4 -6
- package/dist/scopes/index.js +12 -4
- package/opencrvs-toolkit-2.0.0-rc.602d523.tgz +0 -0
- package/package.json +6 -2
- package/opencrvs-toolkit-2.0.0-rc.5f678db.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
|
-
|
|
657
|
-
|
|
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
|
-
|
|
674
|
-
|
|
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
|
|
@@ -886,7 +888,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
886
888
|
// ../commons/src/events/FieldValue.ts
|
|
887
889
|
var TextValue = z12.string();
|
|
888
890
|
var HiddenFieldValue = z12.string();
|
|
889
|
-
var NonEmptyTextValue =
|
|
891
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
890
892
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
891
893
|
var AgeValue = z12.object({
|
|
892
894
|
age: z12.number(),
|
|
@@ -915,6 +917,7 @@ var DateRangeFieldValue = z12.object({
|
|
|
915
917
|
var EmailValue = z12.email();
|
|
916
918
|
var CheckboxFieldValue = z12.boolean();
|
|
917
919
|
var NumberFieldValue = z12.number();
|
|
920
|
+
var SignatureFieldValue = FileFieldValue;
|
|
918
921
|
var ButtonFieldValue = z12.number();
|
|
919
922
|
var VerificationStatusValue = z12.enum([
|
|
920
923
|
"verified",
|
|
@@ -1213,8 +1216,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1213
1216
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1214
1217
|
z14.object({
|
|
1215
1218
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1216
|
-
requestId: z14.string()
|
|
1219
|
+
requestId: z14.string(),
|
|
1217
1220
|
// TODO move into 'content' property
|
|
1221
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1218
1222
|
}).shape
|
|
1219
1223
|
);
|
|
1220
1224
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1307,8 +1311,8 @@ var FlagConfig = z15.object({
|
|
|
1307
1311
|
),
|
|
1308
1312
|
label: TranslationConfig.describe("Human readable label of the flag.")
|
|
1309
1313
|
}).meta({
|
|
1310
|
-
|
|
1311
|
-
|
|
1314
|
+
id: "FlagConfig",
|
|
1315
|
+
description: "Configuration for a custom flag that can be added to or removed from records by event actions."
|
|
1312
1316
|
});
|
|
1313
1317
|
var ActionFlagConfig = z15.object({
|
|
1314
1318
|
id: Flag,
|
|
@@ -1317,8 +1321,8 @@ var ActionFlagConfig = z15.object({
|
|
|
1317
1321
|
"When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
|
|
1318
1322
|
)
|
|
1319
1323
|
}).meta({
|
|
1320
|
-
|
|
1321
|
-
|
|
1324
|
+
id: "ActionFlagConfig",
|
|
1325
|
+
description: "Add or remove operation applied to a flag when the parent action is accepted. Optionally gated by a conditional."
|
|
1322
1326
|
});
|
|
1323
1327
|
|
|
1324
1328
|
// ../commons/src/events/EventMetadata.ts
|
|
@@ -1663,11 +1667,28 @@ var FieldReference = import_v43.default.object({
|
|
|
1663
1667
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1664
1668
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1665
1669
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1670
|
+
),
|
|
1671
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1672
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1673
|
+
)
|
|
1674
|
+
}).describe(
|
|
1675
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1676
|
+
);
|
|
1677
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1678
|
+
$$code: import_v43.default.string().describe(
|
|
1679
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1666
1680
|
)
|
|
1667
|
-
}).describe("
|
|
1681
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1668
1682
|
var ValidationConfig = import_v43.default.object({
|
|
1669
|
-
validator: Conditional
|
|
1670
|
-
|
|
1683
|
+
validator: Conditional.describe(
|
|
1684
|
+
"Conditional expression that must hold for the field value to be considered valid."
|
|
1685
|
+
),
|
|
1686
|
+
message: TranslationConfig.describe(
|
|
1687
|
+
"Error message displayed when the validator does not hold."
|
|
1688
|
+
)
|
|
1689
|
+
}).meta({
|
|
1690
|
+
id: "ValidationConfig",
|
|
1691
|
+
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
1692
|
});
|
|
1672
1693
|
var requiredSchema = import_v43.default.union([
|
|
1673
1694
|
import_v43.default.boolean(),
|
|
@@ -1698,7 +1719,7 @@ var BaseField = import_v43.default.object({
|
|
|
1698
1719
|
"Indicates whether the field can be modified during record correction."
|
|
1699
1720
|
),
|
|
1700
1721
|
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."
|
|
1722
|
+
"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
1723
|
),
|
|
1703
1724
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1704
1725
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1712,7 +1733,7 @@ var Divider = BaseField.extend({
|
|
|
1712
1733
|
});
|
|
1713
1734
|
var TextField = BaseField.extend({
|
|
1714
1735
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1715
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1736
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1716
1737
|
configuration: import_v43.default.object({
|
|
1717
1738
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1718
1739
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
@@ -1725,7 +1746,7 @@ var TextField = BaseField.extend({
|
|
|
1725
1746
|
});
|
|
1726
1747
|
var NumberField = BaseField.extend({
|
|
1727
1748
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1728
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1749
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1729
1750
|
configuration: import_v43.default.object({
|
|
1730
1751
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1731
1752
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
@@ -1738,7 +1759,7 @@ var NumberField = BaseField.extend({
|
|
|
1738
1759
|
});
|
|
1739
1760
|
var TextAreaField = BaseField.extend({
|
|
1740
1761
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1741
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1762
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1742
1763
|
configuration: import_v43.default.object({
|
|
1743
1764
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1744
1765
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1772,7 +1793,7 @@ var SignatureField = BaseField.extend({
|
|
|
1772
1793
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1773
1794
|
"Title of the signature modal"
|
|
1774
1795
|
),
|
|
1775
|
-
defaultValue:
|
|
1796
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1776
1797
|
configuration: import_v43.default.object({
|
|
1777
1798
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1778
1799
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
@@ -1788,14 +1809,14 @@ var EmailField = BaseField.extend({
|
|
|
1788
1809
|
configuration: import_v43.default.object({
|
|
1789
1810
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1790
1811
|
}).default({ maxLength: 255 }).optional(),
|
|
1791
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1812
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1792
1813
|
}).meta({
|
|
1793
1814
|
description: "An email input field",
|
|
1794
1815
|
id: "EmailField"
|
|
1795
1816
|
});
|
|
1796
1817
|
var DateField = BaseField.extend({
|
|
1797
1818
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1798
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1819
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1799
1820
|
configuration: import_v43.default.object({
|
|
1800
1821
|
notice: TranslationConfig.describe(
|
|
1801
1822
|
"Text to display above the date input"
|
|
@@ -1807,7 +1828,7 @@ var DateField = BaseField.extend({
|
|
|
1807
1828
|
});
|
|
1808
1829
|
var AgeField = BaseField.extend({
|
|
1809
1830
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1810
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1831
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1811
1832
|
configuration: import_v43.default.object({
|
|
1812
1833
|
asOfDate: FieldReference,
|
|
1813
1834
|
prefix: TranslationConfig.optional(),
|
|
@@ -1819,7 +1840,7 @@ var AgeField = BaseField.extend({
|
|
|
1819
1840
|
});
|
|
1820
1841
|
var TimeField = BaseField.extend({
|
|
1821
1842
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1822
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1843
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1823
1844
|
configuration: import_v43.default.object({
|
|
1824
1845
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1825
1846
|
notice: TranslationConfig.describe(
|
|
@@ -1832,7 +1853,7 @@ var TimeField = BaseField.extend({
|
|
|
1832
1853
|
});
|
|
1833
1854
|
var DateRangeField = BaseField.extend({
|
|
1834
1855
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1835
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1856
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1836
1857
|
configuration: import_v43.default.object({
|
|
1837
1858
|
notice: TranslationConfig.describe(
|
|
1838
1859
|
"Text to display above the date input"
|
|
@@ -1911,7 +1932,7 @@ var PageHeader = BaseField.extend({
|
|
|
1911
1932
|
});
|
|
1912
1933
|
var File = BaseField.extend({
|
|
1913
1934
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1914
|
-
defaultValue: FileFieldValue.optional(),
|
|
1935
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1915
1936
|
configuration: import_v43.default.object({
|
|
1916
1937
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1917
1938
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1938,7 +1959,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1938
1959
|
});
|
|
1939
1960
|
var NumberWithUnitField = BaseField.extend({
|
|
1940
1961
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1941
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1962
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1942
1963
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1943
1964
|
configuration: import_v43.default.object({
|
|
1944
1965
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1953,7 +1974,7 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1953
1974
|
});
|
|
1954
1975
|
var RadioGroup = BaseField.extend({
|
|
1955
1976
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1956
|
-
defaultValue: TextValue.optional(),
|
|
1977
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1957
1978
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1958
1979
|
configuration: import_v43.default.object({
|
|
1959
1980
|
styles: import_v43.default.object({
|
|
@@ -1978,7 +1999,7 @@ var BulletList = BaseField.extend({
|
|
|
1978
1999
|
});
|
|
1979
2000
|
var Select = BaseField.extend({
|
|
1980
2001
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1981
|
-
defaultValue: TextValue.optional(),
|
|
2002
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1982
2003
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1983
2004
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1984
2005
|
`
|
|
@@ -2000,7 +2021,7 @@ var SelectDateRangeOption = import_v43.default.object({
|
|
|
2000
2021
|
});
|
|
2001
2022
|
var SelectDateRangeField = BaseField.extend({
|
|
2002
2023
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
2003
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
2024
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
2004
2025
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
2005
2026
|
}).meta({
|
|
2006
2027
|
description: "A date range selection field",
|
|
@@ -2017,7 +2038,7 @@ var NameField = BaseField.extend({
|
|
|
2017
2038
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2018
2039
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2019
2040
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
2020
|
-
}).optional(),
|
|
2041
|
+
}).or(ComputedDefaultValue).optional(),
|
|
2021
2042
|
configuration: import_v43.default.object({
|
|
2022
2043
|
name: NameConfig.default({
|
|
2023
2044
|
firstname: { required: true },
|
|
@@ -2041,14 +2062,14 @@ var NameField = BaseField.extend({
|
|
|
2041
2062
|
id: "NameField"
|
|
2042
2063
|
});
|
|
2043
2064
|
var PhoneField = BaseField.extend({
|
|
2044
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2065
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2045
2066
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
2046
2067
|
}).meta({
|
|
2047
2068
|
description: "A field for entering a phone number",
|
|
2048
2069
|
id: "PhoneField"
|
|
2049
2070
|
});
|
|
2050
2071
|
var IdField = BaseField.extend({
|
|
2051
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2072
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2052
2073
|
type: import_v43.default.literal(FieldType.ID)
|
|
2053
2074
|
}).meta({
|
|
2054
2075
|
description: "A field for entering an ID",
|
|
@@ -2056,14 +2077,14 @@ var IdField = BaseField.extend({
|
|
|
2056
2077
|
});
|
|
2057
2078
|
var Checkbox = BaseField.extend({
|
|
2058
2079
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
2059
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
2080
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
2060
2081
|
}).meta({
|
|
2061
2082
|
description: "A boolean checkbox field",
|
|
2062
2083
|
id: "Checkbox"
|
|
2063
2084
|
});
|
|
2064
2085
|
var Country = BaseField.extend({
|
|
2065
2086
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
2066
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2087
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2067
2088
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
2068
2089
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2069
2090
|
)
|
|
@@ -2081,7 +2102,7 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2081
2102
|
]);
|
|
2082
2103
|
var AdministrativeAreaField = BaseField.extend({
|
|
2083
2104
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2084
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2105
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2085
2106
|
configuration: import_v43.default.object({
|
|
2086
2107
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
2087
2108
|
type: AdministrativeAreas,
|
|
@@ -2093,7 +2114,7 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
2093
2114
|
});
|
|
2094
2115
|
var LocationInput = BaseField.extend({
|
|
2095
2116
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2096
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2117
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2097
2118
|
configuration: import_v43.default.object({
|
|
2098
2119
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2099
2120
|
allowedLocations: AllowedLocations
|
|
@@ -2105,7 +2126,7 @@ var LocationInput = BaseField.extend({
|
|
|
2105
2126
|
var FileUploadWithOptions = BaseField.extend({
|
|
2106
2127
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2107
2128
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
2108
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2129
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
2109
2130
|
configuration: import_v43.default.object({
|
|
2110
2131
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2111
2132
|
maxImageSize: import_v43.default.object({
|
|
@@ -2121,12 +2142,12 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2121
2142
|
});
|
|
2122
2143
|
var Facility = BaseField.extend({
|
|
2123
2144
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2124
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2145
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2125
2146
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2126
2147
|
}).describe("Input field for a facility");
|
|
2127
2148
|
var Office = BaseField.extend({
|
|
2128
2149
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2129
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2150
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2130
2151
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2131
2152
|
}).describe("Input field for an office");
|
|
2132
2153
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -2162,7 +2183,7 @@ var Address = BaseField.extend({
|
|
|
2162
2183
|
).optional(),
|
|
2163
2184
|
allowedLocations: AllowedLocations
|
|
2164
2185
|
}).optional(),
|
|
2165
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
2186
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
2166
2187
|
}).meta({
|
|
2167
2188
|
description: "Address input field \u2013 a combination of location and text fields",
|
|
2168
2189
|
id: "Address"
|
|
@@ -2209,7 +2230,7 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
2209
2230
|
});
|
|
2210
2231
|
var ButtonField = BaseField.extend({
|
|
2211
2232
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2212
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
2233
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
2213
2234
|
configuration: ButtonConfiguration
|
|
2214
2235
|
}).meta({
|
|
2215
2236
|
description: "A generic button that can be used to trigger an action",
|
|
@@ -2237,7 +2258,7 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2237
2258
|
});
|
|
2238
2259
|
var HttpField = BaseField.extend({
|
|
2239
2260
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2240
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2261
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
2241
2262
|
configuration: import_v43.default.object({
|
|
2242
2263
|
trigger: FieldReference.optional().describe(
|
|
2243
2264
|
"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,7 +2278,9 @@ var HttpField = BaseField.extend({
|
|
|
2257
2278
|
var AutocompleteField = BaseField.extend({
|
|
2258
2279
|
type: import_v43.default.literal(FieldType.AUTOCOMPLETE),
|
|
2259
2280
|
configuration: import_v43.default.object({
|
|
2260
|
-
url: import_v43.default.string().describe(
|
|
2281
|
+
url: import_v43.default.string().describe(
|
|
2282
|
+
"URL to fetch autocomplete suggestions from. This should be a country config server endpoint."
|
|
2283
|
+
).optional(),
|
|
2261
2284
|
method: import_v43.default.enum(["GET", "POST"]).default("GET").optional(),
|
|
2262
2285
|
defaultOptions: import_v43.default.array(
|
|
2263
2286
|
import_v43.default.object({
|
|
@@ -2321,7 +2344,7 @@ var LinkButtonField = BaseField.extend({
|
|
|
2321
2344
|
});
|
|
2322
2345
|
var VerificationStatus = BaseField.extend({
|
|
2323
2346
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2324
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2347
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2325
2348
|
configuration: import_v43.default.object({
|
|
2326
2349
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2327
2350
|
description: TranslationConfig.describe(
|
|
@@ -2343,7 +2366,7 @@ var QueryParamReaderField = BaseField.extend({
|
|
|
2343
2366
|
});
|
|
2344
2367
|
var QrReaderField = BaseField.extend({
|
|
2345
2368
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2346
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2369
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2347
2370
|
configuration: import_v43.default.object({
|
|
2348
2371
|
validator: import_v43.default.any().meta({
|
|
2349
2372
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2356,7 +2379,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2356
2379
|
});
|
|
2357
2380
|
var IdReaderField = BaseField.extend({
|
|
2358
2381
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2359
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2382
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2360
2383
|
methods: import_v43.default.array(
|
|
2361
2384
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2362
2385
|
)
|
|
@@ -2499,15 +2522,18 @@ var VerificationPageConfig = FormPageConfig.extend({
|
|
|
2499
2522
|
actions: VerificationActionConfig
|
|
2500
2523
|
});
|
|
2501
2524
|
var PageConfig = z21.discriminatedUnion("type", [FormPageConfig, VerificationPageConfig]).meta({
|
|
2502
|
-
|
|
2503
|
-
|
|
2525
|
+
id: "PageConfig",
|
|
2526
|
+
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."
|
|
2504
2527
|
});
|
|
2505
2528
|
|
|
2506
2529
|
// ../commons/src/events/FormConfig.ts
|
|
2507
2530
|
var DeclarationFormConfig = z22.object({
|
|
2508
2531
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2509
2532
|
pages: z22.array(FormPageConfig)
|
|
2510
|
-
}).
|
|
2533
|
+
}).meta({
|
|
2534
|
+
id: "DeclarationFormConfig",
|
|
2535
|
+
description: "Configuration of the declaration form."
|
|
2536
|
+
});
|
|
2511
2537
|
var ActionFormConfig = z22.object({
|
|
2512
2538
|
label: TranslationConfig.describe("Human readable description of the form"),
|
|
2513
2539
|
pages: z22.array(PageConfig)
|
|
@@ -2607,6 +2633,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2607
2633
|
id: z23.string(),
|
|
2608
2634
|
label: TranslationConfig,
|
|
2609
2635
|
query: Clause
|
|
2636
|
+
}).meta({
|
|
2637
|
+
id: "DeduplicationConfig",
|
|
2638
|
+
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."
|
|
2610
2639
|
});
|
|
2611
2640
|
|
|
2612
2641
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2724,17 +2753,42 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
2724
2753
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
|
2725
2754
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
|
2726
2755
|
*/
|
|
2727
|
-
ReadActionConfig.meta({
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2756
|
+
ReadActionConfig.meta({
|
|
2757
|
+
id: "ReadActionConfig",
|
|
2758
|
+
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
2759
|
+
}),
|
|
2760
|
+
DeclareConfig.meta({
|
|
2761
|
+
id: "DeclareActionConfig",
|
|
2762
|
+
description: "Configuration for the declare action. Includes review-page fields. Shared with the notify action (ActionType.NOTIFY)."
|
|
2763
|
+
}),
|
|
2764
|
+
RejectConfig.meta({
|
|
2765
|
+
id: "RejectActionConfig",
|
|
2766
|
+
description: "Configuration for rejecting a record before registration."
|
|
2767
|
+
}),
|
|
2768
|
+
RegisterConfig.meta({
|
|
2769
|
+
id: "RegisterActionConfig",
|
|
2770
|
+
description: "Configuration for registering a record."
|
|
2771
|
+
}),
|
|
2731
2772
|
PrintCertificateActionConfig.meta({
|
|
2732
|
-
id: "PrintCertificateActionConfig"
|
|
2773
|
+
id: "PrintCertificateActionConfig",
|
|
2774
|
+
description: "Configuration for printing a certificate of a registered record."
|
|
2775
|
+
}),
|
|
2776
|
+
RequestCorrectionConfig.meta({
|
|
2777
|
+
id: "RequestCorrectionActionConfig",
|
|
2778
|
+
description: "Configuration for requesting a correction on a registered record."
|
|
2779
|
+
}),
|
|
2780
|
+
EditActionConfig.meta({
|
|
2781
|
+
id: "EditActionConfig",
|
|
2782
|
+
description: "Configuration for editing a record before registration."
|
|
2733
2783
|
}),
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2784
|
+
ArchiveConfig.meta({
|
|
2785
|
+
id: "ArchiveActionConfig",
|
|
2786
|
+
description: "Configuration for archiving a record."
|
|
2787
|
+
}),
|
|
2788
|
+
CustomActionConfig.meta({
|
|
2789
|
+
id: "CustomActionConfig",
|
|
2790
|
+
description: "Configuration for a country-defined custom action. An event may include any number of these."
|
|
2791
|
+
})
|
|
2738
2792
|
]).describe(
|
|
2739
2793
|
"Configuration of an action available for an event. Data collected depends on the action type and is accessible through the annotation property in ActionDocument."
|
|
2740
2794
|
).meta({ id: "ActionConfig" });
|
|
@@ -2810,7 +2864,10 @@ var Field = BaseField2.extend({
|
|
|
2810
2864
|
}).describe("Custom field defined for the summary view.");
|
|
2811
2865
|
var SummaryConfig = z27.object({
|
|
2812
2866
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2813
|
-
}).
|
|
2867
|
+
}).meta({
|
|
2868
|
+
id: "SummaryConfig",
|
|
2869
|
+
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."
|
|
2870
|
+
});
|
|
2814
2871
|
|
|
2815
2872
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2816
2873
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2881,6 +2938,9 @@ var BaseField3 = z28.object({
|
|
|
2881
2938
|
),
|
|
2882
2939
|
validations: z28.array(ValidationConfig).optional().describe(
|
|
2883
2940
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2941
|
+
),
|
|
2942
|
+
allowedLocations: JurisdictionReference.optional().describe(
|
|
2943
|
+
`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.`
|
|
2884
2944
|
)
|
|
2885
2945
|
});
|
|
2886
2946
|
var SearchQueryParams = z28.object({
|
|
@@ -2934,6 +2994,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2934
2994
|
var AdvancedSearchConfig = z28.object({
|
|
2935
2995
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2936
2996
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
2997
|
+
}).meta({
|
|
2998
|
+
id: "AdvancedSearchConfig",
|
|
2999
|
+
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()`)."
|
|
2937
3000
|
});
|
|
2938
3001
|
|
|
2939
3002
|
// ../commons/src/events/utils.ts
|
|
@@ -2984,7 +3047,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
|
|
|
2984
3047
|
}
|
|
2985
3048
|
return current;
|
|
2986
3049
|
}
|
|
3050
|
+
function todayISO() {
|
|
3051
|
+
return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
|
|
3052
|
+
}
|
|
3053
|
+
var compiledFunctionCache = /* @__PURE__ */ new Map();
|
|
3054
|
+
function compileClientFunction(code) {
|
|
3055
|
+
let fn = compiledFunctionCache.get(code);
|
|
3056
|
+
if (!fn) {
|
|
3057
|
+
fn = new Function(`return (${code})`)();
|
|
3058
|
+
compiledFunctionCache.set(code, fn);
|
|
3059
|
+
}
|
|
3060
|
+
return fn;
|
|
3061
|
+
}
|
|
2987
3062
|
(0, import_ajv_formats.default)(ajv);
|
|
3063
|
+
function buildClientFunctionContext(input) {
|
|
3064
|
+
return {
|
|
3065
|
+
$form: input.form,
|
|
3066
|
+
$now: todayISO(),
|
|
3067
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3068
|
+
$online: isOnline(),
|
|
3069
|
+
$user: input.validatorContext?.user,
|
|
3070
|
+
$event: input.validatorContext?.event,
|
|
3071
|
+
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
3072
|
+
user: input.systemVariables?.user,
|
|
3073
|
+
$window: input.systemVariables?.$window,
|
|
3074
|
+
locations: input.locations,
|
|
3075
|
+
adminLevelIds: input.adminLevelIds
|
|
3076
|
+
};
|
|
3077
|
+
}
|
|
3078
|
+
function runClientFunction(code, data, context) {
|
|
3079
|
+
return compileClientFunction(code)(data, context);
|
|
3080
|
+
}
|
|
2988
3081
|
ajv.addKeyword({
|
|
2989
3082
|
keyword: "daysFromDate",
|
|
2990
3083
|
type: "string",
|
|
@@ -3029,12 +3122,35 @@ ajv.addKeyword({
|
|
|
3029
3122
|
$data: true,
|
|
3030
3123
|
errors: true,
|
|
3031
3124
|
// @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
|
|
3032
|
-
validate(
|
|
3125
|
+
validate(_schema, data, _2, dataContext) {
|
|
3033
3126
|
const locationIdInput = data;
|
|
3034
3127
|
const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
|
|
3035
3128
|
return locations.some((location) => location.id === locationIdInput);
|
|
3036
3129
|
}
|
|
3037
3130
|
});
|
|
3131
|
+
ajv.addKeyword({
|
|
3132
|
+
keyword: "customClientValidator",
|
|
3133
|
+
schemaType: "object",
|
|
3134
|
+
errors: true,
|
|
3135
|
+
// @ts-expect-error -- AJV's public types don't expose `rootData`. All
|
|
3136
|
+
// `validate()` callers build root data via `buildClientFunctionContext`,
|
|
3137
|
+
// so the cast holds.
|
|
3138
|
+
validate(schema, data, _2, dataContext) {
|
|
3139
|
+
return Boolean(
|
|
3140
|
+
runClientFunction(
|
|
3141
|
+
schema.code,
|
|
3142
|
+
data,
|
|
3143
|
+
dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
|
|
3144
|
+
)
|
|
3145
|
+
);
|
|
3146
|
+
}
|
|
3147
|
+
});
|
|
3148
|
+
function isOnline() {
|
|
3149
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
3150
|
+
return navigator.onLine;
|
|
3151
|
+
}
|
|
3152
|
+
return true;
|
|
3153
|
+
}
|
|
3038
3154
|
|
|
3039
3155
|
// ../commons/src/utils.ts
|
|
3040
3156
|
var z32 = __toESM(require("zod/v4"));
|
|
@@ -3653,7 +3769,54 @@ function createFieldConditionals(fieldId) {
|
|
|
3653
3769
|
}
|
|
3654
3770
|
},
|
|
3655
3771
|
required: [fieldId]
|
|
3656
|
-
})
|
|
3772
|
+
}),
|
|
3773
|
+
/**
|
|
3774
|
+
* Custom client-side validator. The provided function is serialised and executed
|
|
3775
|
+
* just-in-time on the client only. External references (e.g. lodash) are not
|
|
3776
|
+
* available inside the function body — all logic must be self-contained.
|
|
3777
|
+
*
|
|
3778
|
+
* @example
|
|
3779
|
+
* field('nid').customClientValidator((value) => {
|
|
3780
|
+
* // LUHN check — all logic must be inline
|
|
3781
|
+
* const digits = String(value).split('').map(Number)
|
|
3782
|
+
* // ...
|
|
3783
|
+
* return isValid
|
|
3784
|
+
* })
|
|
3785
|
+
*/
|
|
3786
|
+
customClientValidator(validationFn) {
|
|
3787
|
+
const code = validationFn.toString();
|
|
3788
|
+
return defineFormConditional({
|
|
3789
|
+
type: "object",
|
|
3790
|
+
properties: wrapToPath(
|
|
3791
|
+
{ [fieldId]: { customClientValidator: { code } } },
|
|
3792
|
+
this.$$subfield
|
|
3793
|
+
),
|
|
3794
|
+
required: [fieldId]
|
|
3795
|
+
});
|
|
3796
|
+
},
|
|
3797
|
+
/**
|
|
3798
|
+
* Custom client-side evaluation. Returns a {@link FieldReference} descriptor
|
|
3799
|
+
* that can be used as the `value` property or a DATA component entry.
|
|
3800
|
+
* The function receives the referenced field's value as the first argument and
|
|
3801
|
+
* the full form context as the second; its return value replaces the field reference.
|
|
3802
|
+
* The function is serialised and executed just-in-time on the client only.
|
|
3803
|
+
* External references (e.g. lodash) are not available inside the function body.
|
|
3804
|
+
*
|
|
3805
|
+
* For computing a default value without referencing a specific field, use
|
|
3806
|
+
* `evaluate(fn)` in the `defaultValue` property instead.
|
|
3807
|
+
*
|
|
3808
|
+
* @example
|
|
3809
|
+
* field('a').customClientEvaluation((aValue, ctx) =>
|
|
3810
|
+
* Number(aValue) + Number(ctx.$form.b)
|
|
3811
|
+
* )
|
|
3812
|
+
*/
|
|
3813
|
+
customClientEvaluation(computationFn) {
|
|
3814
|
+
return {
|
|
3815
|
+
$$code: computationFn.toString(),
|
|
3816
|
+
$$field: fieldId,
|
|
3817
|
+
$$subfield: this.$$subfield
|
|
3818
|
+
};
|
|
3819
|
+
}
|
|
3657
3820
|
};
|
|
3658
3821
|
}
|
|
3659
3822
|
|
|
@@ -3826,8 +3989,9 @@ var EventConfig = _EventConfigBase.superRefine((event2, ctx) => {
|
|
|
3826
3989
|
validateActionFlags(event2, ctx);
|
|
3827
3990
|
validateActionOrder(event2, ctx);
|
|
3828
3991
|
}).meta({
|
|
3829
|
-
id: "EventConfig"
|
|
3830
|
-
|
|
3992
|
+
id: "EventConfig",
|
|
3993
|
+
description: "Configuration defining an event type registered in OpenCRVS (for example birth or death)."
|
|
3994
|
+
});
|
|
3831
3995
|
|
|
3832
3996
|
// ../commons/src/events/EventConfigInput.ts
|
|
3833
3997
|
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
@@ -4049,6 +4213,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
4049
4213
|
var WorkqueueColumn = z34.object({
|
|
4050
4214
|
label: TranslationConfig,
|
|
4051
4215
|
value: WorkqueueColumnValue
|
|
4216
|
+
}).meta({
|
|
4217
|
+
id: "WorkqueueColumn",
|
|
4218
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
4052
4219
|
});
|
|
4053
4220
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
4054
4221
|
return workqueueColumns.map(
|
|
@@ -4254,8 +4421,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4254
4421
|
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4255
4422
|
query: CountryConfigQueryInputType
|
|
4256
4423
|
}).meta({
|
|
4257
|
-
|
|
4258
|
-
|
|
4424
|
+
id: "WorkqueueConfig",
|
|
4425
|
+
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."
|
|
4259
4426
|
});
|
|
4260
4427
|
var WorkqueueCountInput = z37.array(
|
|
4261
4428
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4297,7 +4464,9 @@ var BaseActionInput = z38.object({
|
|
|
4297
4464
|
keepAssignment: z38.boolean().optional(),
|
|
4298
4465
|
keepAssignmentIfAccepted: z38.boolean().optional(),
|
|
4299
4466
|
keepAssignmentIfRejected: z38.boolean().optional(),
|
|
4300
|
-
waitFor: z38.boolean().
|
|
4467
|
+
waitFor: z38.boolean().default(true).describe(
|
|
4468
|
+
"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."
|
|
4469
|
+
),
|
|
4301
4470
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
4302
4471
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
4303
4472
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -4415,7 +4584,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
4415
4584
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4416
4585
|
z38.object({
|
|
4417
4586
|
requestId: z38.string(),
|
|
4418
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4587
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
4588
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
4419
4589
|
}).shape
|
|
4420
4590
|
);
|
|
4421
4591
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -4477,7 +4647,7 @@ var Draft = z39.object({
|
|
|
4477
4647
|
}).describe(
|
|
4478
4648
|
"A temporary storage for an action. Stored with details of the event, creator and creation time."
|
|
4479
4649
|
);
|
|
4480
|
-
var DraftInput = BaseActionInput.extend({
|
|
4650
|
+
var DraftInput = BaseActionInput.omit({ waitFor: true }).extend({
|
|
4481
4651
|
type: ActionTypes.exclude([ActionTypes.enum.DELETE]),
|
|
4482
4652
|
status: z39.enum([
|
|
4483
4653
|
ActionStatus.Requested,
|
|
@@ -7071,10 +7241,380 @@ var ACTION_FILTERS = {
|
|
|
7071
7241
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7072
7242
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
7073
7243
|
};
|
|
7244
|
+
var REJECTED_ACTIONS = [
|
|
7245
|
+
ActionType.READ,
|
|
7246
|
+
ActionType.NOTIFY,
|
|
7247
|
+
ActionType.CUSTOM,
|
|
7248
|
+
ActionType.EDIT,
|
|
7249
|
+
ActionType.ARCHIVE
|
|
7250
|
+
];
|
|
7074
7251
|
|
|
7075
7252
|
// ../commons/src/events/FileUtils.ts
|
|
7076
7253
|
var import_lodash7 = require("lodash");
|
|
7077
7254
|
|
|
7255
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
7256
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
7257
|
+
{
|
|
7258
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7259
|
+
name: "Central",
|
|
7260
|
+
parentId: null,
|
|
7261
|
+
validUntil: null,
|
|
7262
|
+
externalId: "ydyJb1RAy4U1"
|
|
7263
|
+
},
|
|
7264
|
+
{
|
|
7265
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7266
|
+
name: "Sulaka",
|
|
7267
|
+
parentId: null,
|
|
7268
|
+
validUntil: null,
|
|
7269
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
7270
|
+
},
|
|
7271
|
+
{
|
|
7272
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7273
|
+
name: "Pualula",
|
|
7274
|
+
parentId: null,
|
|
7275
|
+
validUntil: null,
|
|
7276
|
+
externalId: "Aq91DweLmT8k"
|
|
7277
|
+
},
|
|
7278
|
+
{
|
|
7279
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7280
|
+
name: "Chuminga",
|
|
7281
|
+
parentId: null,
|
|
7282
|
+
validUntil: null,
|
|
7283
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
7284
|
+
},
|
|
7285
|
+
{
|
|
7286
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7287
|
+
name: "Ibombo",
|
|
7288
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7289
|
+
validUntil: null,
|
|
7290
|
+
externalId: "k7DsP4vbN1Qe"
|
|
7291
|
+
},
|
|
7292
|
+
{
|
|
7293
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7294
|
+
name: "Isango",
|
|
7295
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7296
|
+
validUntil: null,
|
|
7297
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
7298
|
+
},
|
|
7299
|
+
{
|
|
7300
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7301
|
+
name: "Isamba",
|
|
7302
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7303
|
+
validUntil: null,
|
|
7304
|
+
externalId: "sT0xVu1KqJ7r"
|
|
7305
|
+
},
|
|
7306
|
+
{
|
|
7307
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7308
|
+
name: "Itambo",
|
|
7309
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7310
|
+
validUntil: null,
|
|
7311
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
7312
|
+
},
|
|
7313
|
+
{
|
|
7314
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7315
|
+
name: "Ezhi",
|
|
7316
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7317
|
+
validUntil: null,
|
|
7318
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
7319
|
+
},
|
|
7320
|
+
{
|
|
7321
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7322
|
+
name: "Ilanga",
|
|
7323
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7324
|
+
validUntil: null,
|
|
7325
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
7326
|
+
},
|
|
7327
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
7328
|
+
{
|
|
7329
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7330
|
+
name: "Klow",
|
|
7331
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7332
|
+
validUntil: null,
|
|
7333
|
+
externalId: "IkYcYBUcyY2"
|
|
7334
|
+
},
|
|
7335
|
+
{
|
|
7336
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7337
|
+
name: "Mbondo",
|
|
7338
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7339
|
+
validUntil: null,
|
|
7340
|
+
externalId: "Qhvv5hvo3mY"
|
|
7341
|
+
},
|
|
7342
|
+
{
|
|
7343
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7344
|
+
name: "Ndara",
|
|
7345
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7346
|
+
validUntil: null,
|
|
7347
|
+
externalId: "crXh068O9TR"
|
|
7348
|
+
},
|
|
7349
|
+
{
|
|
7350
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7351
|
+
name: "Olani",
|
|
7352
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7353
|
+
validUntil: null,
|
|
7354
|
+
externalId: "r00It8Tvvp7"
|
|
7355
|
+
},
|
|
7356
|
+
{
|
|
7357
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7358
|
+
name: "Pemba",
|
|
7359
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7360
|
+
validUntil: null,
|
|
7361
|
+
externalId: "ZnUWsbONIaH"
|
|
7362
|
+
},
|
|
7363
|
+
{
|
|
7364
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7365
|
+
name: "Quanza",
|
|
7366
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7367
|
+
validUntil: null,
|
|
7368
|
+
externalId: "fDZycvQTa7l"
|
|
7369
|
+
},
|
|
7370
|
+
{
|
|
7371
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7372
|
+
name: "Rivka",
|
|
7373
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7374
|
+
validUntil: null,
|
|
7375
|
+
externalId: "KqswxCGTELa"
|
|
7376
|
+
},
|
|
7377
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
7378
|
+
{
|
|
7379
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7380
|
+
name: "Mbula",
|
|
7381
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7382
|
+
validUntil: null,
|
|
7383
|
+
externalId: "osEbKjRc9Kg"
|
|
7384
|
+
},
|
|
7385
|
+
{
|
|
7386
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7387
|
+
name: "Ndoki",
|
|
7388
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7389
|
+
validUntil: null,
|
|
7390
|
+
externalId: "aq4daBUAGr3"
|
|
7391
|
+
},
|
|
7392
|
+
{
|
|
7393
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7394
|
+
name: "Tsanga",
|
|
7395
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7396
|
+
validUntil: null,
|
|
7397
|
+
externalId: "cqis6Y8trbJ"
|
|
7398
|
+
},
|
|
7399
|
+
{
|
|
7400
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7401
|
+
name: "Waziri",
|
|
7402
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7403
|
+
validUntil: null,
|
|
7404
|
+
externalId: "LMijHPyyx6d"
|
|
7405
|
+
},
|
|
7406
|
+
{
|
|
7407
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7408
|
+
name: "Zimbi",
|
|
7409
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7410
|
+
validUntil: null,
|
|
7411
|
+
externalId: "pcQYbPuKGZ7"
|
|
7412
|
+
},
|
|
7413
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
7414
|
+
{
|
|
7415
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7416
|
+
name: "Felani",
|
|
7417
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7418
|
+
validUntil: null,
|
|
7419
|
+
externalId: "gSqpoCGdMXp"
|
|
7420
|
+
},
|
|
7421
|
+
{
|
|
7422
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7423
|
+
name: "Goroma",
|
|
7424
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7425
|
+
validUntil: null,
|
|
7426
|
+
externalId: "KvAAIaNqVrp"
|
|
7427
|
+
},
|
|
7428
|
+
{
|
|
7429
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7430
|
+
name: "Halifu",
|
|
7431
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7432
|
+
validUntil: null,
|
|
7433
|
+
externalId: "qe4UnEVt1hv"
|
|
7434
|
+
},
|
|
7435
|
+
{
|
|
7436
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7437
|
+
name: "Jabari",
|
|
7438
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7439
|
+
validUntil: null,
|
|
7440
|
+
externalId: "yHH9Nz4rLOt"
|
|
7441
|
+
},
|
|
7442
|
+
{
|
|
7443
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7444
|
+
name: "Kifani",
|
|
7445
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7446
|
+
validUntil: null,
|
|
7447
|
+
externalId: "eSWmXIGeu1I"
|
|
7448
|
+
},
|
|
7449
|
+
{
|
|
7450
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7451
|
+
name: "Lumela",
|
|
7452
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7453
|
+
validUntil: null,
|
|
7454
|
+
externalId: "bh0b3aI1uP3"
|
|
7455
|
+
}
|
|
7456
|
+
];
|
|
7457
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
7458
|
+
{
|
|
7459
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7460
|
+
name: "Central Provincial Office",
|
|
7461
|
+
locationType: "CRVS_OFFICE",
|
|
7462
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7463
|
+
validUntil: null,
|
|
7464
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
7465
|
+
},
|
|
7466
|
+
{
|
|
7467
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7468
|
+
name: "Central Health Post",
|
|
7469
|
+
locationType: "HEALTH_FACILITY",
|
|
7470
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7471
|
+
validUntil: null
|
|
7472
|
+
},
|
|
7473
|
+
{
|
|
7474
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7475
|
+
name: "Ibombo District Office",
|
|
7476
|
+
locationType: "CRVS_OFFICE",
|
|
7477
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7478
|
+
validUntil: null,
|
|
7479
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
7480
|
+
},
|
|
7481
|
+
{
|
|
7482
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
7483
|
+
name: "Isamba District Office",
|
|
7484
|
+
locationType: "CRVS_OFFICE",
|
|
7485
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7486
|
+
validUntil: null,
|
|
7487
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
7488
|
+
},
|
|
7489
|
+
{
|
|
7490
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
7491
|
+
name: "Isango District Office",
|
|
7492
|
+
locationType: "CRVS_OFFICE",
|
|
7493
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7494
|
+
validUntil: null,
|
|
7495
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
7496
|
+
},
|
|
7497
|
+
{
|
|
7498
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
7499
|
+
name: "Sulaka Provincial Office",
|
|
7500
|
+
locationType: "CRVS_OFFICE",
|
|
7501
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7502
|
+
validUntil: null,
|
|
7503
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
7504
|
+
},
|
|
7505
|
+
{
|
|
7506
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
7507
|
+
name: "Ilanga District Office",
|
|
7508
|
+
locationType: "CRVS_OFFICE",
|
|
7509
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7510
|
+
validUntil: null,
|
|
7511
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
7512
|
+
},
|
|
7513
|
+
{
|
|
7514
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
7515
|
+
name: "Chamakubi Health Post",
|
|
7516
|
+
locationType: "HEALTH_FACILITY",
|
|
7517
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7518
|
+
validUntil: null,
|
|
7519
|
+
externalId: "M1nFr8LbC2Qy"
|
|
7520
|
+
},
|
|
7521
|
+
{
|
|
7522
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
7523
|
+
name: "Ibombo Rural Health Centre",
|
|
7524
|
+
locationType: "HEALTH_FACILITY",
|
|
7525
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7526
|
+
validUntil: null,
|
|
7527
|
+
externalId: "bT7pV6YrW0Xc"
|
|
7528
|
+
},
|
|
7529
|
+
{
|
|
7530
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
7531
|
+
name: "Chikobo Rural Health Centre",
|
|
7532
|
+
locationType: "HEALTH_FACILITY",
|
|
7533
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7534
|
+
validUntil: null,
|
|
7535
|
+
externalId: "zE4qPn2SgJ5d"
|
|
7536
|
+
},
|
|
7537
|
+
{
|
|
7538
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
7539
|
+
name: "Chilochabalenje Health Post",
|
|
7540
|
+
locationType: "HEALTH_FACILITY",
|
|
7541
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7542
|
+
validUntil: null,
|
|
7543
|
+
externalId: "H8vDs1MqR4Uf"
|
|
7544
|
+
},
|
|
7545
|
+
{
|
|
7546
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
7547
|
+
name: "Chipeso Rural Health Centre",
|
|
7548
|
+
locationType: "HEALTH_FACILITY",
|
|
7549
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7550
|
+
validUntil: null,
|
|
7551
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
7552
|
+
},
|
|
7553
|
+
{
|
|
7554
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
7555
|
+
name: "Chisamba Rural Health Centre",
|
|
7556
|
+
locationType: "HEALTH_FACILITY",
|
|
7557
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7558
|
+
validUntil: null,
|
|
7559
|
+
externalId: "Yr0pCg8LdM2s"
|
|
7560
|
+
},
|
|
7561
|
+
{
|
|
7562
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
7563
|
+
name: "Chitanda Rural Health Centre",
|
|
7564
|
+
locationType: "HEALTH_FACILITY",
|
|
7565
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7566
|
+
validUntil: null,
|
|
7567
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
7568
|
+
},
|
|
7569
|
+
{
|
|
7570
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
7571
|
+
name: "Golden Valley Rural Health Centre",
|
|
7572
|
+
locationType: "HEALTH_FACILITY",
|
|
7573
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7574
|
+
validUntil: null,
|
|
7575
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
7576
|
+
},
|
|
7577
|
+
{
|
|
7578
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
7579
|
+
name: "Ipongo Rural Health Centre",
|
|
7580
|
+
locationType: "HEALTH_FACILITY",
|
|
7581
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7582
|
+
validUntil: null,
|
|
7583
|
+
externalId: "kF2sW9DmH0Bt"
|
|
7584
|
+
},
|
|
7585
|
+
{
|
|
7586
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
7587
|
+
name: "Itumbwe Health Post",
|
|
7588
|
+
locationType: "HEALTH_FACILITY",
|
|
7589
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7590
|
+
validUntil: null,
|
|
7591
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
7592
|
+
},
|
|
7593
|
+
{
|
|
7594
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
7595
|
+
name: "Kabangalala Rural Health Centre",
|
|
7596
|
+
locationType: "HEALTH_FACILITY",
|
|
7597
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7598
|
+
validUntil: null,
|
|
7599
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
7600
|
+
},
|
|
7601
|
+
// Village offices
|
|
7602
|
+
{
|
|
7603
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
7604
|
+
name: "Klow Village Office",
|
|
7605
|
+
locationType: "CRVS_OFFICE",
|
|
7606
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7607
|
+
validUntil: null,
|
|
7608
|
+
externalId: "PmAyxAJkxiJ"
|
|
7609
|
+
}
|
|
7610
|
+
];
|
|
7611
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7612
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7613
|
+
);
|
|
7614
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
7615
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7616
|
+
);
|
|
7617
|
+
|
|
7078
7618
|
// ../commons/src/notification/UserNotifications.ts
|
|
7079
7619
|
var z44 = __toESM(require("zod/v4"));
|
|
7080
7620
|
var TriggerEvent = {
|