@opencrvs/toolkit 2.0.0-rc.a6e6000 → 2.0.0-rc.a71d5d8
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/dist/application-config/index.js +53 -34
- package/dist/cli.js +9 -3
- package/dist/commons/api/router.d.ts +92 -17
- 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 +6 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +378 -50
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- 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 +52 -1
- package/dist/events/index.js +695 -123
- package/dist/migrations/v2.0/index.js +9 -3
- package/dist/notification/index.js +551 -40
- package/dist/scopes/index.d.ts +4 -6
- package/dist/scopes/index.js +9 -3
- package/opencrvs-toolkit-2.0.0-rc.a71d5d8.tgz +0 -0
- package/package.json +2 -2
- package/opencrvs-toolkit-2.0.0-rc.a6e6000.tgz +0 -0
|
@@ -770,6 +770,11 @@ var FieldTypesToHideInReview = [
|
|
|
770
770
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
771
771
|
FieldType.ALPHA_HIDDEN
|
|
772
772
|
];
|
|
773
|
+
var HiddenFieldTypes = [
|
|
774
|
+
FieldType.HTTP,
|
|
775
|
+
FieldType.QUERY_PARAM_READER,
|
|
776
|
+
FieldType.ALPHA_HIDDEN
|
|
777
|
+
];
|
|
773
778
|
|
|
774
779
|
// ../commons/src/events/FieldValue.ts
|
|
775
780
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -888,7 +893,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
888
893
|
// ../commons/src/events/FieldValue.ts
|
|
889
894
|
var TextValue = z12.string();
|
|
890
895
|
var HiddenFieldValue = z12.string();
|
|
891
|
-
var NonEmptyTextValue =
|
|
896
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
892
897
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
893
898
|
var AgeValue = z12.object({
|
|
894
899
|
age: z12.number(),
|
|
@@ -917,6 +922,7 @@ var DateRangeFieldValue = z12.object({
|
|
|
917
922
|
var EmailValue = z12.email();
|
|
918
923
|
var CheckboxFieldValue = z12.boolean();
|
|
919
924
|
var NumberFieldValue = z12.number();
|
|
925
|
+
var SignatureFieldValue = FileFieldValue;
|
|
920
926
|
var ButtonFieldValue = z12.number();
|
|
921
927
|
var VerificationStatusValue = z12.enum([
|
|
922
928
|
"verified",
|
|
@@ -1215,8 +1221,9 @@ var RequestedCorrectionAction = ActionBase.extend(
|
|
|
1215
1221
|
var ApprovedCorrectionAction = ActionBase.extend(
|
|
1216
1222
|
z14.object({
|
|
1217
1223
|
type: z14.literal(ActionType.APPROVE_CORRECTION),
|
|
1218
|
-
requestId: z14.string()
|
|
1224
|
+
requestId: z14.string(),
|
|
1219
1225
|
// TODO move into 'content' property
|
|
1226
|
+
content: z14.object({ immediateCorrection: z14.boolean().optional() }).optional()
|
|
1220
1227
|
}).shape
|
|
1221
1228
|
);
|
|
1222
1229
|
var RejectedCorrectionAction = ActionBase.extend(
|
|
@@ -1665,8 +1672,18 @@ var FieldReference = import_v43.default.object({
|
|
|
1665
1672
|
$$field: FieldId.describe("Id of the field to reference"),
|
|
1666
1673
|
$$subfield: import_v43.default.array(import_v43.default.string()).optional().default([]).describe(
|
|
1667
1674
|
'If the FieldValue is an object, subfield can be used to refer to e.g. `["foo", "bar"]` in `{ foo: { bar: 3 } }`'
|
|
1675
|
+
),
|
|
1676
|
+
$$code: import_v43.default.string().optional().describe(
|
|
1677
|
+
"Serialised client-side function body. When present the expression is evaluated rather than dereferenced."
|
|
1668
1678
|
)
|
|
1669
|
-
}).describe(
|
|
1679
|
+
}).describe(
|
|
1680
|
+
"Reference to a field value, with an optional client-side computation applied."
|
|
1681
|
+
);
|
|
1682
|
+
var ComputedDefaultValue = import_v43.default.object({
|
|
1683
|
+
$$code: import_v43.default.string().describe(
|
|
1684
|
+
"Serialised client-side function body. Receives (undefined, context) where context includes $now, $online, and system variables."
|
|
1685
|
+
)
|
|
1686
|
+
}).describe("A context-only computation used as a field default value.");
|
|
1670
1687
|
var ValidationConfig = import_v43.default.object({
|
|
1671
1688
|
validator: Conditional.describe(
|
|
1672
1689
|
"Conditional expression that must hold for the field value to be considered valid."
|
|
@@ -1707,7 +1724,7 @@ var BaseField = import_v43.default.object({
|
|
|
1707
1724
|
"Indicates whether the field can be modified during record correction."
|
|
1708
1725
|
),
|
|
1709
1726
|
value: FieldReference.or(import_v43.default.array(FieldReference)).optional().describe(
|
|
1710
|
-
"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."
|
|
1727
|
+
"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."
|
|
1711
1728
|
),
|
|
1712
1729
|
analytics: import_v43.default.boolean().default(false).optional().describe(
|
|
1713
1730
|
"Indicates whether the field is included in analytics. When enabled, its value becomes available in the analytics dashboard."
|
|
@@ -1721,7 +1738,7 @@ var Divider = BaseField.extend({
|
|
|
1721
1738
|
});
|
|
1722
1739
|
var TextField = BaseField.extend({
|
|
1723
1740
|
type: import_v43.default.literal(FieldType.TEXT),
|
|
1724
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
1741
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
1725
1742
|
configuration: import_v43.default.object({
|
|
1726
1743
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1727
1744
|
type: import_v43.default.enum(["text", "password"]).optional(),
|
|
@@ -1734,10 +1751,11 @@ var TextField = BaseField.extend({
|
|
|
1734
1751
|
});
|
|
1735
1752
|
var NumberField = BaseField.extend({
|
|
1736
1753
|
type: import_v43.default.literal(FieldType.NUMBER),
|
|
1737
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1754
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1738
1755
|
configuration: import_v43.default.object({
|
|
1739
1756
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1740
1757
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1758
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1741
1759
|
prefix: TranslationConfig.optional(),
|
|
1742
1760
|
postfix: TranslationConfig.optional()
|
|
1743
1761
|
}).optional()
|
|
@@ -1747,7 +1765,7 @@ var NumberField = BaseField.extend({
|
|
|
1747
1765
|
});
|
|
1748
1766
|
var TextAreaField = BaseField.extend({
|
|
1749
1767
|
type: import_v43.default.literal(FieldType.TEXTAREA),
|
|
1750
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
1768
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
1751
1769
|
configuration: import_v43.default.object({
|
|
1752
1770
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text"),
|
|
1753
1771
|
rows: import_v43.default.number().optional().describe("Number of visible text lines"),
|
|
@@ -1781,7 +1799,7 @@ var SignatureField = BaseField.extend({
|
|
|
1781
1799
|
signaturePromptLabel: TranslationConfig.describe(
|
|
1782
1800
|
"Title of the signature modal"
|
|
1783
1801
|
),
|
|
1784
|
-
defaultValue:
|
|
1802
|
+
defaultValue: SignatureFieldValue.or(ComputedDefaultValue).optional(),
|
|
1785
1803
|
configuration: import_v43.default.object({
|
|
1786
1804
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1787
1805
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
|
@@ -1797,14 +1815,14 @@ var EmailField = BaseField.extend({
|
|
|
1797
1815
|
configuration: import_v43.default.object({
|
|
1798
1816
|
maxLength: import_v43.default.number().optional().describe("Maximum length of the text")
|
|
1799
1817
|
}).default({ maxLength: 255 }).optional(),
|
|
1800
|
-
defaultValue: NonEmptyTextValue.optional()
|
|
1818
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional()
|
|
1801
1819
|
}).meta({
|
|
1802
1820
|
description: "An email input field",
|
|
1803
1821
|
id: "EmailField"
|
|
1804
1822
|
});
|
|
1805
1823
|
var DateField = BaseField.extend({
|
|
1806
1824
|
type: import_v43.default.literal(FieldType.DATE),
|
|
1807
|
-
defaultValue: SerializedNowDateTime.or(PlainDate).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1825
|
+
defaultValue: SerializedNowDateTime.or(PlainDate).or(ComputedDefaultValue).optional().describe("Default date value(yyyy-MM-dd)"),
|
|
1808
1826
|
configuration: import_v43.default.object({
|
|
1809
1827
|
notice: TranslationConfig.describe(
|
|
1810
1828
|
"Text to display above the date input"
|
|
@@ -1816,7 +1834,7 @@ var DateField = BaseField.extend({
|
|
|
1816
1834
|
});
|
|
1817
1835
|
var AgeField = BaseField.extend({
|
|
1818
1836
|
type: import_v43.default.literal(FieldType.AGE),
|
|
1819
|
-
defaultValue: NumberFieldValue.optional(),
|
|
1837
|
+
defaultValue: NumberFieldValue.or(ComputedDefaultValue).optional(),
|
|
1820
1838
|
configuration: import_v43.default.object({
|
|
1821
1839
|
asOfDate: FieldReference,
|
|
1822
1840
|
prefix: TranslationConfig.optional(),
|
|
@@ -1828,7 +1846,7 @@ var AgeField = BaseField.extend({
|
|
|
1828
1846
|
});
|
|
1829
1847
|
var TimeField = BaseField.extend({
|
|
1830
1848
|
type: import_v43.default.literal(FieldType.TIME),
|
|
1831
|
-
defaultValue: SerializedNowDateTime.or(TimeValue).optional().describe("Default time value (HH-mm)"),
|
|
1849
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).or(ComputedDefaultValue).optional().describe("Default time value (HH-mm)"),
|
|
1832
1850
|
configuration: import_v43.default.object({
|
|
1833
1851
|
use12HourFormat: import_v43.default.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1834
1852
|
notice: TranslationConfig.describe(
|
|
@@ -1841,7 +1859,7 @@ var TimeField = BaseField.extend({
|
|
|
1841
1859
|
});
|
|
1842
1860
|
var DateRangeField = BaseField.extend({
|
|
1843
1861
|
type: import_v43.default.literal(FieldType.DATE_RANGE),
|
|
1844
|
-
defaultValue: DateRangeFieldValue.optional(),
|
|
1862
|
+
defaultValue: DateRangeFieldValue.or(ComputedDefaultValue).optional(),
|
|
1845
1863
|
configuration: import_v43.default.object({
|
|
1846
1864
|
notice: TranslationConfig.describe(
|
|
1847
1865
|
"Text to display above the date input"
|
|
@@ -1920,7 +1938,7 @@ var PageHeader = BaseField.extend({
|
|
|
1920
1938
|
});
|
|
1921
1939
|
var File = BaseField.extend({
|
|
1922
1940
|
type: import_v43.default.literal(FieldType.FILE),
|
|
1923
|
-
defaultValue: FileFieldValue.optional(),
|
|
1941
|
+
defaultValue: FileFieldValue.or(ComputedDefaultValue).optional(),
|
|
1924
1942
|
configuration: import_v43.default.object({
|
|
1925
1943
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
1926
1944
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
|
@@ -1947,7 +1965,7 @@ var SelectOption = import_v43.default.object({
|
|
|
1947
1965
|
});
|
|
1948
1966
|
var NumberWithUnitField = BaseField.extend({
|
|
1949
1967
|
type: import_v43.default.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1950
|
-
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1968
|
+
defaultValue: NumberWithUnitFieldValue.or(ComputedDefaultValue).optional(),
|
|
1951
1969
|
options: import_v43.default.array(SelectOption).describe("A list of options for the unit select"),
|
|
1952
1970
|
configuration: import_v43.default.object({
|
|
1953
1971
|
min: import_v43.default.number().optional().describe("Minimum value of the number field"),
|
|
@@ -1962,7 +1980,7 @@ var NumberWithUnitField = BaseField.extend({
|
|
|
1962
1980
|
});
|
|
1963
1981
|
var RadioGroup = BaseField.extend({
|
|
1964
1982
|
type: import_v43.default.literal(FieldType.RADIO_GROUP),
|
|
1965
|
-
defaultValue: TextValue.optional(),
|
|
1983
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1966
1984
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1967
1985
|
configuration: import_v43.default.object({
|
|
1968
1986
|
styles: import_v43.default.object({
|
|
@@ -1987,7 +2005,7 @@ var BulletList = BaseField.extend({
|
|
|
1987
2005
|
});
|
|
1988
2006
|
var Select = BaseField.extend({
|
|
1989
2007
|
type: import_v43.default.literal(FieldType.SELECT),
|
|
1990
|
-
defaultValue: TextValue.optional(),
|
|
2008
|
+
defaultValue: TextValue.or(ComputedDefaultValue).optional(),
|
|
1991
2009
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
1992
2010
|
noOptionsMessage: TranslationConfig.optional().describe(
|
|
1993
2011
|
`
|
|
@@ -2009,7 +2027,7 @@ var SelectDateRangeOption = import_v43.default.object({
|
|
|
2009
2027
|
});
|
|
2010
2028
|
var SelectDateRangeField = BaseField.extend({
|
|
2011
2029
|
type: import_v43.default.literal(FieldType.SELECT_DATE_RANGE),
|
|
2012
|
-
defaultValue: SelectDateRangeValue.optional(),
|
|
2030
|
+
defaultValue: SelectDateRangeValue.or(ComputedDefaultValue).optional(),
|
|
2013
2031
|
options: import_v43.default.array(SelectDateRangeOption).describe("A list of options")
|
|
2014
2032
|
}).meta({
|
|
2015
2033
|
description: "A date range selection field",
|
|
@@ -2026,7 +2044,7 @@ var NameField = BaseField.extend({
|
|
|
2026
2044
|
firstname: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2027
2045
|
middlename: SerializedUserField.or(NonEmptyTextValue).optional(),
|
|
2028
2046
|
surname: SerializedUserField.or(NonEmptyTextValue).optional()
|
|
2029
|
-
}).optional(),
|
|
2047
|
+
}).or(ComputedDefaultValue).optional(),
|
|
2030
2048
|
configuration: import_v43.default.object({
|
|
2031
2049
|
name: NameConfig.default({
|
|
2032
2050
|
firstname: { required: true },
|
|
@@ -2050,14 +2068,14 @@ var NameField = BaseField.extend({
|
|
|
2050
2068
|
id: "NameField"
|
|
2051
2069
|
});
|
|
2052
2070
|
var PhoneField = BaseField.extend({
|
|
2053
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2071
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2054
2072
|
type: import_v43.default.literal(FieldType.PHONE)
|
|
2055
2073
|
}).meta({
|
|
2056
2074
|
description: "A field for entering a phone number",
|
|
2057
2075
|
id: "PhoneField"
|
|
2058
2076
|
});
|
|
2059
2077
|
var IdField = BaseField.extend({
|
|
2060
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2078
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2061
2079
|
type: import_v43.default.literal(FieldType.ID)
|
|
2062
2080
|
}).meta({
|
|
2063
2081
|
description: "A field for entering an ID",
|
|
@@ -2065,14 +2083,14 @@ var IdField = BaseField.extend({
|
|
|
2065
2083
|
});
|
|
2066
2084
|
var Checkbox = BaseField.extend({
|
|
2067
2085
|
type: import_v43.default.literal(FieldType.CHECKBOX),
|
|
2068
|
-
defaultValue: CheckboxFieldValue.default(false)
|
|
2086
|
+
defaultValue: CheckboxFieldValue.or(ComputedDefaultValue).default(false)
|
|
2069
2087
|
}).meta({
|
|
2070
2088
|
description: "A boolean checkbox field",
|
|
2071
2089
|
id: "Checkbox"
|
|
2072
2090
|
});
|
|
2073
2091
|
var Country = BaseField.extend({
|
|
2074
2092
|
type: import_v43.default.literal(FieldType.COUNTRY),
|
|
2075
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2093
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2076
2094
|
optionOverrides: import_v43.default.array(SelectOption.omit({ label: true })).optional().describe(
|
|
2077
2095
|
"Conditionals for specific countries. Countries not listed are always shown and enabled."
|
|
2078
2096
|
)
|
|
@@ -2090,7 +2108,7 @@ var AdministrativeAreas = import_v43.default.enum([
|
|
|
2090
2108
|
]);
|
|
2091
2109
|
var AdministrativeAreaField = BaseField.extend({
|
|
2092
2110
|
type: import_v43.default.literal(FieldType.ADMINISTRATIVE_AREA),
|
|
2093
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2111
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2094
2112
|
configuration: import_v43.default.object({
|
|
2095
2113
|
partOf: FieldReference.optional().describe("Parent location"),
|
|
2096
2114
|
type: AdministrativeAreas,
|
|
@@ -2102,7 +2120,7 @@ var AdministrativeAreaField = BaseField.extend({
|
|
|
2102
2120
|
});
|
|
2103
2121
|
var LocationInput = BaseField.extend({
|
|
2104
2122
|
type: import_v43.default.literal(FieldType.LOCATION),
|
|
2105
|
-
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField]).optional(),
|
|
2123
|
+
defaultValue: import_v43.default.union([NonEmptyTextValue, SerializedUserField, ComputedDefaultValue]).optional(),
|
|
2106
2124
|
configuration: import_v43.default.object({
|
|
2107
2125
|
locationTypes: import_v43.default.array(import_v43.default.string()).optional().describe("Types of the locations that are available for selection."),
|
|
2108
2126
|
allowedLocations: AllowedLocations
|
|
@@ -2114,7 +2132,7 @@ var LocationInput = BaseField.extend({
|
|
|
2114
2132
|
var FileUploadWithOptions = BaseField.extend({
|
|
2115
2133
|
type: import_v43.default.literal(FieldType.FILE_WITH_OPTIONS),
|
|
2116
2134
|
options: import_v43.default.array(SelectOption).describe("A list of options"),
|
|
2117
|
-
defaultValue: FileFieldWithOptionValue.optional(),
|
|
2135
|
+
defaultValue: FileFieldWithOptionValue.or(ComputedDefaultValue).optional(),
|
|
2118
2136
|
configuration: import_v43.default.object({
|
|
2119
2137
|
maxFileSize: import_v43.default.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
|
2120
2138
|
maxImageSize: import_v43.default.object({
|
|
@@ -2130,12 +2148,12 @@ var FileUploadWithOptions = BaseField.extend({
|
|
|
2130
2148
|
});
|
|
2131
2149
|
var Facility = BaseField.extend({
|
|
2132
2150
|
type: import_v43.default.literal(FieldType.FACILITY),
|
|
2133
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2151
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2134
2152
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2135
2153
|
}).describe("Input field for a facility");
|
|
2136
2154
|
var Office = BaseField.extend({
|
|
2137
2155
|
type: import_v43.default.literal(FieldType.OFFICE),
|
|
2138
|
-
defaultValue: NonEmptyTextValue.optional(),
|
|
2156
|
+
defaultValue: NonEmptyTextValue.or(ComputedDefaultValue).optional(),
|
|
2139
2157
|
configuration: import_v43.default.object({ allowedLocations: AllowedLocations }).optional()
|
|
2140
2158
|
}).describe("Input field for an office");
|
|
2141
2159
|
var DefaultAddressFieldValue = DomesticAddressFieldValue.extend({
|
|
@@ -2171,7 +2189,7 @@ var Address = BaseField.extend({
|
|
|
2171
2189
|
).optional(),
|
|
2172
2190
|
allowedLocations: AllowedLocations
|
|
2173
2191
|
}).optional(),
|
|
2174
|
-
defaultValue: DefaultAddressFieldValue.optional()
|
|
2192
|
+
defaultValue: DefaultAddressFieldValue.or(ComputedDefaultValue).optional()
|
|
2175
2193
|
}).meta({
|
|
2176
2194
|
description: "Address input field \u2013 a combination of location and text fields",
|
|
2177
2195
|
id: "Address"
|
|
@@ -2218,7 +2236,7 @@ var ButtonConfiguration = import_v43.default.object({
|
|
|
2218
2236
|
});
|
|
2219
2237
|
var ButtonField = BaseField.extend({
|
|
2220
2238
|
type: import_v43.default.literal(FieldType.BUTTON),
|
|
2221
|
-
defaultValue: ButtonFieldValue.optional(),
|
|
2239
|
+
defaultValue: ButtonFieldValue.or(ComputedDefaultValue).optional(),
|
|
2222
2240
|
configuration: ButtonConfiguration
|
|
2223
2241
|
}).meta({
|
|
2224
2242
|
description: "A generic button that can be used to trigger an action",
|
|
@@ -2246,7 +2264,7 @@ var AlphaPrintButton = BaseField.extend({
|
|
|
2246
2264
|
});
|
|
2247
2265
|
var HttpField = BaseField.extend({
|
|
2248
2266
|
type: import_v43.default.literal(FieldType.HTTP),
|
|
2249
|
-
defaultValue: HttpFieldValue.optional(),
|
|
2267
|
+
defaultValue: HttpFieldValue.or(ComputedDefaultValue).optional(),
|
|
2250
2268
|
configuration: import_v43.default.object({
|
|
2251
2269
|
trigger: FieldReference.optional().describe(
|
|
2252
2270
|
"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."
|
|
@@ -2332,7 +2350,7 @@ var LinkButtonField = BaseField.extend({
|
|
|
2332
2350
|
});
|
|
2333
2351
|
var VerificationStatus = BaseField.extend({
|
|
2334
2352
|
type: import_v43.default.literal(FieldType.VERIFICATION_STATUS),
|
|
2335
|
-
defaultValue: VerificationStatusValue.optional(),
|
|
2353
|
+
defaultValue: VerificationStatusValue.or(ComputedDefaultValue).optional(),
|
|
2336
2354
|
configuration: import_v43.default.object({
|
|
2337
2355
|
status: TranslationConfig.describe("Text to display on the status pill."),
|
|
2338
2356
|
description: TranslationConfig.describe(
|
|
@@ -2354,7 +2372,7 @@ var QueryParamReaderField = BaseField.extend({
|
|
|
2354
2372
|
});
|
|
2355
2373
|
var QrReaderField = BaseField.extend({
|
|
2356
2374
|
type: import_v43.default.literal(FieldType.QR_READER),
|
|
2357
|
-
defaultValue: QrReaderFieldValue.optional(),
|
|
2375
|
+
defaultValue: QrReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2358
2376
|
configuration: import_v43.default.object({
|
|
2359
2377
|
validator: import_v43.default.any().meta({
|
|
2360
2378
|
description: "JSON Schema to validate the scanned QR code data against before populating the form fields.",
|
|
@@ -2367,7 +2385,7 @@ var QrReaderField = BaseField.extend({
|
|
|
2367
2385
|
});
|
|
2368
2386
|
var IdReaderField = BaseField.extend({
|
|
2369
2387
|
type: import_v43.default.literal(FieldType.ID_READER),
|
|
2370
|
-
defaultValue: IdReaderFieldValue.optional(),
|
|
2388
|
+
defaultValue: IdReaderFieldValue.or(ComputedDefaultValue).optional(),
|
|
2371
2389
|
methods: import_v43.default.array(
|
|
2372
2390
|
import_v43.default.union([QrReaderField, LinkButtonField]).describe("Methods for reading an ID")
|
|
2373
2391
|
)
|
|
@@ -2621,6 +2639,9 @@ var DeduplicationConfig = z23.object({
|
|
|
2621
2639
|
id: z23.string(),
|
|
2622
2640
|
label: TranslationConfig,
|
|
2623
2641
|
query: Clause
|
|
2642
|
+
}).meta({
|
|
2643
|
+
id: "DeduplicationConfig",
|
|
2644
|
+
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."
|
|
2624
2645
|
});
|
|
2625
2646
|
|
|
2626
2647
|
// ../commons/src/events/ActionConfig.ts
|
|
@@ -2849,7 +2870,10 @@ var Field = BaseField2.extend({
|
|
|
2849
2870
|
}).describe("Custom field defined for the summary view.");
|
|
2850
2871
|
var SummaryConfig = z27.object({
|
|
2851
2872
|
fields: z27.array(z27.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
|
|
2852
|
-
}).
|
|
2873
|
+
}).meta({
|
|
2874
|
+
id: "SummaryConfig",
|
|
2875
|
+
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."
|
|
2876
|
+
});
|
|
2853
2877
|
|
|
2854
2878
|
// ../commons/src/events/AdvancedSearchConfig.ts
|
|
2855
2879
|
var z28 = __toESM(require("zod/v4"));
|
|
@@ -2920,6 +2944,9 @@ var BaseField3 = z28.object({
|
|
|
2920
2944
|
),
|
|
2921
2945
|
validations: z28.array(ValidationConfig).optional().describe(
|
|
2922
2946
|
`Option for overriding the field validations specifically for advanced search form.`
|
|
2947
|
+
),
|
|
2948
|
+
allowedLocations: JurisdictionReference.optional().describe(
|
|
2949
|
+
`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.`
|
|
2923
2950
|
)
|
|
2924
2951
|
});
|
|
2925
2952
|
var SearchQueryParams = z28.object({
|
|
@@ -2973,6 +3000,9 @@ var AdvancedSearchField = z28.discriminatedUnion("fieldType", [FieldConfigSchema
|
|
|
2973
3000
|
var AdvancedSearchConfig = z28.object({
|
|
2974
3001
|
title: TranslationConfig.describe("Advanced search tab title"),
|
|
2975
3002
|
fields: z28.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
|
|
3003
|
+
}).meta({
|
|
3004
|
+
id: "AdvancedSearchConfig",
|
|
3005
|
+
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()`)."
|
|
2976
3006
|
});
|
|
2977
3007
|
|
|
2978
3008
|
// ../commons/src/events/utils.ts
|
|
@@ -3023,7 +3053,37 @@ function resolveDataPath(rootData, dataPath, instancePath) {
|
|
|
3023
3053
|
}
|
|
3024
3054
|
return current;
|
|
3025
3055
|
}
|
|
3056
|
+
function todayISO() {
|
|
3057
|
+
return (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" });
|
|
3058
|
+
}
|
|
3059
|
+
var compiledFunctionCache = /* @__PURE__ */ new Map();
|
|
3060
|
+
function compileClientFunction(code) {
|
|
3061
|
+
let fn = compiledFunctionCache.get(code);
|
|
3062
|
+
if (!fn) {
|
|
3063
|
+
fn = new Function(`return (${code})`)();
|
|
3064
|
+
compiledFunctionCache.set(code, fn);
|
|
3065
|
+
}
|
|
3066
|
+
return fn;
|
|
3067
|
+
}
|
|
3026
3068
|
(0, import_ajv_formats.default)(ajv);
|
|
3069
|
+
function buildClientFunctionContext(input) {
|
|
3070
|
+
return {
|
|
3071
|
+
$form: input.form,
|
|
3072
|
+
$now: todayISO(),
|
|
3073
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
3074
|
+
$online: isOnline(),
|
|
3075
|
+
$user: input.validatorContext?.user,
|
|
3076
|
+
$event: input.validatorContext?.event,
|
|
3077
|
+
$leafAdminStructureLocationIds: input.validatorContext?.leafAdminStructureLocationIds ?? [],
|
|
3078
|
+
user: input.systemVariables?.user,
|
|
3079
|
+
$window: input.systemVariables?.$window,
|
|
3080
|
+
locations: input.locations,
|
|
3081
|
+
adminLevelIds: input.adminLevelIds
|
|
3082
|
+
};
|
|
3083
|
+
}
|
|
3084
|
+
function runClientFunction(code, data, context) {
|
|
3085
|
+
return compileClientFunction(code)(data, context);
|
|
3086
|
+
}
|
|
3027
3087
|
ajv.addKeyword({
|
|
3028
3088
|
keyword: "daysFromDate",
|
|
3029
3089
|
type: "string",
|
|
@@ -3068,12 +3128,35 @@ ajv.addKeyword({
|
|
|
3068
3128
|
$data: true,
|
|
3069
3129
|
errors: true,
|
|
3070
3130
|
// @ts-ignore -- Force type. We will move this away from AJV next. Parsing the array will take seconds and is only called by core.
|
|
3071
|
-
validate(
|
|
3131
|
+
validate(_schema, data, _2, dataContext) {
|
|
3072
3132
|
const locationIdInput = data;
|
|
3073
3133
|
const locations = dataContext?.rootData.$leafAdminStructureLocationIds ?? [];
|
|
3074
3134
|
return locations.some((location) => location.id === locationIdInput);
|
|
3075
3135
|
}
|
|
3076
3136
|
});
|
|
3137
|
+
ajv.addKeyword({
|
|
3138
|
+
keyword: "customClientValidator",
|
|
3139
|
+
schemaType: "object",
|
|
3140
|
+
errors: true,
|
|
3141
|
+
// @ts-expect-error -- AJV's public types don't expose `rootData`. All
|
|
3142
|
+
// `validate()` callers build root data via `buildClientFunctionContext`,
|
|
3143
|
+
// so the cast holds.
|
|
3144
|
+
validate(schema, data, _2, dataContext) {
|
|
3145
|
+
return Boolean(
|
|
3146
|
+
runClientFunction(
|
|
3147
|
+
schema.code,
|
|
3148
|
+
data,
|
|
3149
|
+
dataContext?.rootData ?? buildClientFunctionContext({ form: {} })
|
|
3150
|
+
)
|
|
3151
|
+
);
|
|
3152
|
+
}
|
|
3153
|
+
});
|
|
3154
|
+
function isOnline() {
|
|
3155
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
3156
|
+
return navigator.onLine;
|
|
3157
|
+
}
|
|
3158
|
+
return true;
|
|
3159
|
+
}
|
|
3077
3160
|
|
|
3078
3161
|
// ../commons/src/utils.ts
|
|
3079
3162
|
var z32 = __toESM(require("zod/v4"));
|
|
@@ -3692,7 +3775,54 @@ function createFieldConditionals(fieldId) {
|
|
|
3692
3775
|
}
|
|
3693
3776
|
},
|
|
3694
3777
|
required: [fieldId]
|
|
3695
|
-
})
|
|
3778
|
+
}),
|
|
3779
|
+
/**
|
|
3780
|
+
* Custom client-side validator. The provided function is serialised and executed
|
|
3781
|
+
* just-in-time on the client only. External references (e.g. lodash) are not
|
|
3782
|
+
* available inside the function body — all logic must be self-contained.
|
|
3783
|
+
*
|
|
3784
|
+
* @example
|
|
3785
|
+
* field('nid').customClientValidator((value) => {
|
|
3786
|
+
* // LUHN check — all logic must be inline
|
|
3787
|
+
* const digits = String(value).split('').map(Number)
|
|
3788
|
+
* // ...
|
|
3789
|
+
* return isValid
|
|
3790
|
+
* })
|
|
3791
|
+
*/
|
|
3792
|
+
customClientValidator(validationFn) {
|
|
3793
|
+
const code = validationFn.toString();
|
|
3794
|
+
return defineFormConditional({
|
|
3795
|
+
type: "object",
|
|
3796
|
+
properties: wrapToPath(
|
|
3797
|
+
{ [fieldId]: { customClientValidator: { code } } },
|
|
3798
|
+
this.$$subfield
|
|
3799
|
+
),
|
|
3800
|
+
required: [fieldId]
|
|
3801
|
+
});
|
|
3802
|
+
},
|
|
3803
|
+
/**
|
|
3804
|
+
* Custom client-side evaluation. Returns a {@link FieldReference} descriptor
|
|
3805
|
+
* that can be used as the `value` property or a DATA component entry.
|
|
3806
|
+
* The function receives the referenced field's value as the first argument and
|
|
3807
|
+
* the full form context as the second; its return value replaces the field reference.
|
|
3808
|
+
* The function is serialised and executed just-in-time on the client only.
|
|
3809
|
+
* External references (e.g. lodash) are not available inside the function body.
|
|
3810
|
+
*
|
|
3811
|
+
* For computing a default value without referencing a specific field, use
|
|
3812
|
+
* `evaluate(fn)` in the `defaultValue` property instead.
|
|
3813
|
+
*
|
|
3814
|
+
* @example
|
|
3815
|
+
* field('a').customClientEvaluation((aValue, ctx) =>
|
|
3816
|
+
* Number(aValue) + Number(ctx.$form.b)
|
|
3817
|
+
* )
|
|
3818
|
+
*/
|
|
3819
|
+
customClientEvaluation(computationFn) {
|
|
3820
|
+
return {
|
|
3821
|
+
$$code: computationFn.toString(),
|
|
3822
|
+
$$field: fieldId,
|
|
3823
|
+
$$subfield: this.$$subfield
|
|
3824
|
+
};
|
|
3825
|
+
}
|
|
3696
3826
|
};
|
|
3697
3827
|
}
|
|
3698
3828
|
|
|
@@ -4089,6 +4219,9 @@ var WorkqueueColumnValue = z34.object({
|
|
|
4089
4219
|
var WorkqueueColumn = z34.object({
|
|
4090
4220
|
label: TranslationConfig,
|
|
4091
4221
|
value: WorkqueueColumnValue
|
|
4222
|
+
}).meta({
|
|
4223
|
+
id: "WorkqueueColumn",
|
|
4224
|
+
description: "Configuration for a single workqueue column. The value references an event metadata key (e.g. `dateOfEvent`, `status`, `trackingId`)."
|
|
4092
4225
|
});
|
|
4093
4226
|
function defineWorkqueuesColumns(workqueueColumns) {
|
|
4094
4227
|
return workqueueColumns.map(
|
|
@@ -4294,8 +4427,8 @@ var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
|
|
4294
4427
|
var WorkqueueConfigInput = WorkqueueConfig.extend({
|
|
4295
4428
|
query: CountryConfigQueryInputType
|
|
4296
4429
|
}).meta({
|
|
4297
|
-
|
|
4298
|
-
|
|
4430
|
+
id: "WorkqueueConfig",
|
|
4431
|
+
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."
|
|
4299
4432
|
});
|
|
4300
4433
|
var WorkqueueCountInput = z37.array(
|
|
4301
4434
|
z37.object({ slug: z37.string(), query: QueryType })
|
|
@@ -4457,7 +4590,8 @@ var RejectCorrectionActionInput = BaseActionInput.extend(
|
|
|
4457
4590
|
var ApproveCorrectionActionInput = BaseActionInput.extend(
|
|
4458
4591
|
z38.object({
|
|
4459
4592
|
requestId: z38.string(),
|
|
4460
|
-
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
|
4593
|
+
type: z38.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION),
|
|
4594
|
+
content: z38.object({ immediateCorrection: z38.boolean().optional() }).optional()
|
|
4461
4595
|
}).shape
|
|
4462
4596
|
);
|
|
4463
4597
|
var ReadActionInput = BaseActionInput.extend(
|
|
@@ -4569,6 +4703,8 @@ var updateActions = ActionTypes.extract([
|
|
|
4569
4703
|
ActionType.ARCHIVE,
|
|
4570
4704
|
ActionType.PRINT_CERTIFICATE,
|
|
4571
4705
|
ActionType.REQUEST_CORRECTION,
|
|
4706
|
+
ActionType.APPROVE_CORRECTION,
|
|
4707
|
+
ActionType.REJECT_CORRECTION,
|
|
4572
4708
|
ActionType.CUSTOM
|
|
4573
4709
|
]);
|
|
4574
4710
|
|
|
@@ -5320,6 +5456,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
5320
5456
|
id: "signature.upload.modal.title",
|
|
5321
5457
|
defaultMessage: "Draw signature",
|
|
5322
5458
|
description: "Title for the modal to draw signature"
|
|
5459
|
+
},
|
|
5460
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
5461
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
5462
|
+
configuration: {
|
|
5463
|
+
maxFileSize: 5 * 1024 * 1024
|
|
5323
5464
|
}
|
|
5324
5465
|
}
|
|
5325
5466
|
]
|
|
@@ -7113,10 +7254,380 @@ var ACTION_FILTERS = {
|
|
|
7113
7254
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7114
7255
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
7115
7256
|
};
|
|
7257
|
+
var REJECTED_ACTIONS = [
|
|
7258
|
+
ActionType.READ,
|
|
7259
|
+
ActionType.NOTIFY,
|
|
7260
|
+
ActionType.CUSTOM,
|
|
7261
|
+
ActionType.EDIT,
|
|
7262
|
+
ActionType.ARCHIVE
|
|
7263
|
+
];
|
|
7116
7264
|
|
|
7117
7265
|
// ../commons/src/events/FileUtils.ts
|
|
7118
7266
|
var import_lodash7 = require("lodash");
|
|
7119
7267
|
|
|
7268
|
+
// ../commons/src/events/mocks.test.utils.ts
|
|
7269
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
|
|
7270
|
+
{
|
|
7271
|
+
id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7272
|
+
name: "Central",
|
|
7273
|
+
parentId: null,
|
|
7274
|
+
validUntil: null,
|
|
7275
|
+
externalId: "ydyJb1RAy4U1"
|
|
7276
|
+
},
|
|
7277
|
+
{
|
|
7278
|
+
id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7279
|
+
name: "Sulaka",
|
|
7280
|
+
parentId: null,
|
|
7281
|
+
validUntil: null,
|
|
7282
|
+
externalId: "pQ8nGxWmZ2Q3"
|
|
7283
|
+
},
|
|
7284
|
+
{
|
|
7285
|
+
id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
|
|
7286
|
+
name: "Pualula",
|
|
7287
|
+
parentId: null,
|
|
7288
|
+
validUntil: null,
|
|
7289
|
+
externalId: "Aq91DweLmT8k"
|
|
7290
|
+
},
|
|
7291
|
+
{
|
|
7292
|
+
id: "6d1a59df-988c-4021-a846-ccbc021931a7",
|
|
7293
|
+
name: "Chuminga",
|
|
7294
|
+
parentId: null,
|
|
7295
|
+
validUntil: null,
|
|
7296
|
+
externalId: "Rw0fYNh2Xk9a"
|
|
7297
|
+
},
|
|
7298
|
+
{
|
|
7299
|
+
id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7300
|
+
name: "Ibombo",
|
|
7301
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7302
|
+
validUntil: null,
|
|
7303
|
+
externalId: "k7DsP4vbN1Qe"
|
|
7304
|
+
},
|
|
7305
|
+
{
|
|
7306
|
+
id: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7307
|
+
name: "Isango",
|
|
7308
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7309
|
+
validUntil: null,
|
|
7310
|
+
externalId: "Gm3Z9eQpHw4L"
|
|
7311
|
+
},
|
|
7312
|
+
{
|
|
7313
|
+
id: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7314
|
+
name: "Isamba",
|
|
7315
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7316
|
+
validUntil: null,
|
|
7317
|
+
externalId: "sT0xVu1KqJ7r"
|
|
7318
|
+
},
|
|
7319
|
+
{
|
|
7320
|
+
id: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7321
|
+
name: "Itambo",
|
|
7322
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7323
|
+
validUntil: null,
|
|
7324
|
+
externalId: "Nq6Bv2HpL9Te"
|
|
7325
|
+
},
|
|
7326
|
+
{
|
|
7327
|
+
id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
|
|
7328
|
+
name: "Ezhi",
|
|
7329
|
+
parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7330
|
+
validUntil: null,
|
|
7331
|
+
externalId: "xK8cQ0ZRy5Wd"
|
|
7332
|
+
},
|
|
7333
|
+
{
|
|
7334
|
+
id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7335
|
+
name: "Ilanga",
|
|
7336
|
+
parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7337
|
+
validUntil: null,
|
|
7338
|
+
externalId: "Cq4Jm1XvN8Ls"
|
|
7339
|
+
},
|
|
7340
|
+
// Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
|
|
7341
|
+
{
|
|
7342
|
+
id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7343
|
+
name: "Klow",
|
|
7344
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7345
|
+
validUntil: null,
|
|
7346
|
+
externalId: "IkYcYBUcyY2"
|
|
7347
|
+
},
|
|
7348
|
+
{
|
|
7349
|
+
id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
|
|
7350
|
+
name: "Mbondo",
|
|
7351
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7352
|
+
validUntil: null,
|
|
7353
|
+
externalId: "Qhvv5hvo3mY"
|
|
7354
|
+
},
|
|
7355
|
+
{
|
|
7356
|
+
id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
|
|
7357
|
+
name: "Ndara",
|
|
7358
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7359
|
+
validUntil: null,
|
|
7360
|
+
externalId: "crXh068O9TR"
|
|
7361
|
+
},
|
|
7362
|
+
{
|
|
7363
|
+
id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
|
|
7364
|
+
name: "Olani",
|
|
7365
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7366
|
+
validUntil: null,
|
|
7367
|
+
externalId: "r00It8Tvvp7"
|
|
7368
|
+
},
|
|
7369
|
+
{
|
|
7370
|
+
id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
|
|
7371
|
+
name: "Pemba",
|
|
7372
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7373
|
+
validUntil: null,
|
|
7374
|
+
externalId: "ZnUWsbONIaH"
|
|
7375
|
+
},
|
|
7376
|
+
{
|
|
7377
|
+
id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
|
|
7378
|
+
name: "Quanza",
|
|
7379
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7380
|
+
validUntil: null,
|
|
7381
|
+
externalId: "fDZycvQTa7l"
|
|
7382
|
+
},
|
|
7383
|
+
{
|
|
7384
|
+
id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
|
|
7385
|
+
name: "Rivka",
|
|
7386
|
+
parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7387
|
+
validUntil: null,
|
|
7388
|
+
externalId: "KqswxCGTELa"
|
|
7389
|
+
},
|
|
7390
|
+
// Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
|
|
7391
|
+
{
|
|
7392
|
+
id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
|
|
7393
|
+
name: "Mbula",
|
|
7394
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7395
|
+
validUntil: null,
|
|
7396
|
+
externalId: "osEbKjRc9Kg"
|
|
7397
|
+
},
|
|
7398
|
+
{
|
|
7399
|
+
id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
|
|
7400
|
+
name: "Ndoki",
|
|
7401
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7402
|
+
validUntil: null,
|
|
7403
|
+
externalId: "aq4daBUAGr3"
|
|
7404
|
+
},
|
|
7405
|
+
{
|
|
7406
|
+
id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
|
|
7407
|
+
name: "Tsanga",
|
|
7408
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7409
|
+
validUntil: null,
|
|
7410
|
+
externalId: "cqis6Y8trbJ"
|
|
7411
|
+
},
|
|
7412
|
+
{
|
|
7413
|
+
id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
|
|
7414
|
+
name: "Waziri",
|
|
7415
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7416
|
+
validUntil: null,
|
|
7417
|
+
externalId: "LMijHPyyx6d"
|
|
7418
|
+
},
|
|
7419
|
+
{
|
|
7420
|
+
id: "2c5d6e7f-8a9b-4423-8def-456789012345",
|
|
7421
|
+
name: "Zimbi",
|
|
7422
|
+
parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7423
|
+
validUntil: null,
|
|
7424
|
+
externalId: "pcQYbPuKGZ7"
|
|
7425
|
+
},
|
|
7426
|
+
// Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
|
|
7427
|
+
{
|
|
7428
|
+
id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
|
|
7429
|
+
name: "Felani",
|
|
7430
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7431
|
+
validUntil: null,
|
|
7432
|
+
externalId: "gSqpoCGdMXp"
|
|
7433
|
+
},
|
|
7434
|
+
{
|
|
7435
|
+
id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
|
|
7436
|
+
name: "Goroma",
|
|
7437
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7438
|
+
validUntil: null,
|
|
7439
|
+
externalId: "KvAAIaNqVrp"
|
|
7440
|
+
},
|
|
7441
|
+
{
|
|
7442
|
+
id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
|
|
7443
|
+
name: "Halifu",
|
|
7444
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7445
|
+
validUntil: null,
|
|
7446
|
+
externalId: "qe4UnEVt1hv"
|
|
7447
|
+
},
|
|
7448
|
+
{
|
|
7449
|
+
id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
|
|
7450
|
+
name: "Jabari",
|
|
7451
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7452
|
+
validUntil: null,
|
|
7453
|
+
externalId: "yHH9Nz4rLOt"
|
|
7454
|
+
},
|
|
7455
|
+
{
|
|
7456
|
+
id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
|
|
7457
|
+
name: "Kifani",
|
|
7458
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7459
|
+
validUntil: null,
|
|
7460
|
+
externalId: "eSWmXIGeu1I"
|
|
7461
|
+
},
|
|
7462
|
+
{
|
|
7463
|
+
id: "8c1d2e3f-4a5b-4089-8def-012345678901",
|
|
7464
|
+
name: "Lumela",
|
|
7465
|
+
parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
|
|
7466
|
+
validUntil: null,
|
|
7467
|
+
externalId: "bh0b3aI1uP3"
|
|
7468
|
+
}
|
|
7469
|
+
];
|
|
7470
|
+
var V2_DEFAULT_MOCK_LOCATIONS = [
|
|
7471
|
+
{
|
|
7472
|
+
id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
|
|
7473
|
+
name: "Central Provincial Office",
|
|
7474
|
+
locationType: "CRVS_OFFICE",
|
|
7475
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7476
|
+
validUntil: null,
|
|
7477
|
+
externalId: "Xr3Df8WpK6Ys"
|
|
7478
|
+
},
|
|
7479
|
+
{
|
|
7480
|
+
id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
|
|
7481
|
+
name: "Central Health Post",
|
|
7482
|
+
locationType: "HEALTH_FACILITY",
|
|
7483
|
+
administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
|
|
7484
|
+
validUntil: null
|
|
7485
|
+
},
|
|
7486
|
+
{
|
|
7487
|
+
id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
|
|
7488
|
+
name: "Ibombo District Office",
|
|
7489
|
+
locationType: "CRVS_OFFICE",
|
|
7490
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7491
|
+
validUntil: null,
|
|
7492
|
+
externalId: "Sm4Nw7GrD2Vy"
|
|
7493
|
+
},
|
|
7494
|
+
{
|
|
7495
|
+
id: "62a0ccb4-4f30-4f30-8882-f256007dff9f",
|
|
7496
|
+
name: "Isamba District Office",
|
|
7497
|
+
locationType: "CRVS_OFFICE",
|
|
7498
|
+
administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
|
|
7499
|
+
validUntil: null,
|
|
7500
|
+
externalId: "Vg1Bq5XeH9Lt"
|
|
7501
|
+
},
|
|
7502
|
+
{
|
|
7503
|
+
id: "954c93e1-13f7-4435-bb82-35e0e215e07d",
|
|
7504
|
+
name: "Isango District Office",
|
|
7505
|
+
locationType: "CRVS_OFFICE",
|
|
7506
|
+
administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
|
|
7507
|
+
validUntil: null,
|
|
7508
|
+
externalId: "Je7Lm2XqN9Vz"
|
|
7509
|
+
},
|
|
7510
|
+
{
|
|
7511
|
+
id: "2884f5b9-17b4-49ce-bf4d-f538228935df",
|
|
7512
|
+
name: "Sulaka Provincial Office",
|
|
7513
|
+
locationType: "CRVS_OFFICE",
|
|
7514
|
+
administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
|
|
7515
|
+
validUntil: null,
|
|
7516
|
+
externalId: "Ht2Wp9KcX5Qv"
|
|
7517
|
+
},
|
|
7518
|
+
{
|
|
7519
|
+
id: "030358c6-54af-44be-821b-8e4af963a49c",
|
|
7520
|
+
name: "Ilanga District Office",
|
|
7521
|
+
locationType: "CRVS_OFFICE",
|
|
7522
|
+
administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
|
|
7523
|
+
validUntil: null,
|
|
7524
|
+
externalId: "Yp6Ds1WqN3Xz"
|
|
7525
|
+
},
|
|
7526
|
+
{
|
|
7527
|
+
id: "423d000f-101b-47c0-8b86-21a908067cee",
|
|
7528
|
+
name: "Chamakubi Health Post",
|
|
7529
|
+
locationType: "HEALTH_FACILITY",
|
|
7530
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7531
|
+
validUntil: null,
|
|
7532
|
+
externalId: "M1nFr8LbC2Qy"
|
|
7533
|
+
},
|
|
7534
|
+
{
|
|
7535
|
+
id: "4d3279be-d026-420c-88f7-f0a4ae986973",
|
|
7536
|
+
name: "Ibombo Rural Health Centre",
|
|
7537
|
+
locationType: "HEALTH_FACILITY",
|
|
7538
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7539
|
+
validUntil: null,
|
|
7540
|
+
externalId: "bT7pV6YrW0Xc"
|
|
7541
|
+
},
|
|
7542
|
+
{
|
|
7543
|
+
id: "190902f4-1d77-476a-8947-41145af1db7d",
|
|
7544
|
+
name: "Chikobo Rural Health Centre",
|
|
7545
|
+
locationType: "HEALTH_FACILITY",
|
|
7546
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7547
|
+
validUntil: null,
|
|
7548
|
+
externalId: "zE4qPn2SgJ5d"
|
|
7549
|
+
},
|
|
7550
|
+
{
|
|
7551
|
+
id: "f5ecbd9b-a01e-4a65-910e-70e86ab41b71",
|
|
7552
|
+
name: "Chilochabalenje Health Post",
|
|
7553
|
+
locationType: "HEALTH_FACILITY",
|
|
7554
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7555
|
+
validUntil: null,
|
|
7556
|
+
externalId: "H8vDs1MqR4Uf"
|
|
7557
|
+
},
|
|
7558
|
+
{
|
|
7559
|
+
id: "dbfc178f-7295-4b90-b28d-111c95b03127",
|
|
7560
|
+
name: "Chipeso Rural Health Centre",
|
|
7561
|
+
locationType: "HEALTH_FACILITY",
|
|
7562
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7563
|
+
validUntil: null,
|
|
7564
|
+
externalId: "Qw3uZ9KfX6Lm"
|
|
7565
|
+
},
|
|
7566
|
+
{
|
|
7567
|
+
id: "09862bfe-c7ac-46cd-987b-668681533c80",
|
|
7568
|
+
name: "Chisamba Rural Health Centre",
|
|
7569
|
+
locationType: "HEALTH_FACILITY",
|
|
7570
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7571
|
+
validUntil: null,
|
|
7572
|
+
externalId: "Yr0pCg8LdM2s"
|
|
7573
|
+
},
|
|
7574
|
+
{
|
|
7575
|
+
id: "834ce389-e95b-4fb0-96a0-33e9ab323059",
|
|
7576
|
+
name: "Chitanda Rural Health Centre",
|
|
7577
|
+
locationType: "HEALTH_FACILITY",
|
|
7578
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7579
|
+
validUntil: null,
|
|
7580
|
+
externalId: "tS9gJ4PwB1Qx"
|
|
7581
|
+
},
|
|
7582
|
+
{
|
|
7583
|
+
id: "0431c433-6062-4a4c-aee9-25271aec61ee",
|
|
7584
|
+
name: "Golden Valley Rural Health Centre",
|
|
7585
|
+
locationType: "HEALTH_FACILITY",
|
|
7586
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7587
|
+
validUntil: null,
|
|
7588
|
+
externalId: "Ld7Qm3XsA8Vr"
|
|
7589
|
+
},
|
|
7590
|
+
{
|
|
7591
|
+
id: "bc84d0b6-7ba7-480d-a339-5d9920d90eb2",
|
|
7592
|
+
name: "Ipongo Rural Health Centre",
|
|
7593
|
+
locationType: "HEALTH_FACILITY",
|
|
7594
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7595
|
+
validUntil: null,
|
|
7596
|
+
externalId: "kF2sW9DmH0Bt"
|
|
7597
|
+
},
|
|
7598
|
+
{
|
|
7599
|
+
id: "4cf1f53b-b730-41d2-8649-dff7eeed970d",
|
|
7600
|
+
name: "Itumbwe Health Post",
|
|
7601
|
+
locationType: "HEALTH_FACILITY",
|
|
7602
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7603
|
+
validUntil: null,
|
|
7604
|
+
externalId: "Ue5Xb3VaC7Pq"
|
|
7605
|
+
},
|
|
7606
|
+
{
|
|
7607
|
+
id: "4b3676cb-9355-4942-9eb9-2ce46acaf0e0",
|
|
7608
|
+
name: "Kabangalala Rural Health Centre",
|
|
7609
|
+
locationType: "HEALTH_FACILITY",
|
|
7610
|
+
administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
|
|
7611
|
+
validUntil: null,
|
|
7612
|
+
externalId: "Pz8Kc1TqH6Jn"
|
|
7613
|
+
},
|
|
7614
|
+
// Village offices
|
|
7615
|
+
{
|
|
7616
|
+
id: "1f4a5b6c-7d8e-4312-8abc-345678901234",
|
|
7617
|
+
name: "Klow Village Office",
|
|
7618
|
+
locationType: "CRVS_OFFICE",
|
|
7619
|
+
administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
|
|
7620
|
+
validUntil: null,
|
|
7621
|
+
externalId: "PmAyxAJkxiJ"
|
|
7622
|
+
}
|
|
7623
|
+
];
|
|
7624
|
+
var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
|
|
7625
|
+
V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
|
|
7626
|
+
);
|
|
7627
|
+
var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
|
|
7628
|
+
V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
|
|
7629
|
+
);
|
|
7630
|
+
|
|
7120
7631
|
// ../commons/src/notification/UserNotifications.ts
|
|
7121
7632
|
var z44 = __toESM(require("zod/v4"));
|
|
7122
7633
|
var TriggerEvent = {
|