@opencrvs/toolkit 1.9.6-rc.3c3bfa8 → 1.9.6-rc.3fe98ad
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/dist/commons/events/FieldConfig.d.ts +12 -30
- package/dist/commons/events/FieldTypeMapping.d.ts +18 -0
- package/dist/commons/events/FieldValue.d.ts +1 -0
- package/dist/commons/events/TemplateConfig.d.ts +0 -2
- package/dist/conditionals/index.js +2 -6
- package/dist/events/index.js +22 -30
- package/dist/notification/index.js +25 -28
- package/package.json +1 -1
|
@@ -1768,20 +1768,12 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1768
1768
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1769
1769
|
}, {
|
|
1770
1770
|
type: z.ZodLiteral<"DATE">;
|
|
1771
|
-
defaultValue: z.ZodOptional<z.ZodUnion<[z.
|
|
1772
|
-
$$
|
|
1773
|
-
$$time: z.ZodLiteral<"now">;
|
|
1771
|
+
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1772
|
+
$$now: z.ZodLiteral<true>;
|
|
1774
1773
|
}, "strip", z.ZodTypeAny, {
|
|
1775
|
-
$$
|
|
1776
|
-
$$time: "now";
|
|
1777
|
-
}, {
|
|
1778
|
-
$$date: "now";
|
|
1779
|
-
$$time: "now";
|
|
1780
|
-
}>, {
|
|
1781
|
-
$$date: "now";
|
|
1774
|
+
$$now: true;
|
|
1782
1775
|
}, {
|
|
1783
|
-
$$
|
|
1784
|
-
$$time: "now";
|
|
1776
|
+
$$now: true;
|
|
1785
1777
|
}>, z.ZodString]>>;
|
|
1786
1778
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
1787
1779
|
notice: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, {
|
|
@@ -1840,7 +1832,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1840
1832
|
uncorrectable?: boolean | undefined;
|
|
1841
1833
|
analytics?: boolean | undefined;
|
|
1842
1834
|
defaultValue?: string | {
|
|
1843
|
-
$$
|
|
1835
|
+
$$now: true;
|
|
1844
1836
|
} | undefined;
|
|
1845
1837
|
configuration?: {
|
|
1846
1838
|
notice?: TranslationConfig | undefined;
|
|
@@ -1907,8 +1899,7 @@ declare const DateField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1907
1899
|
uncorrectable?: boolean | undefined;
|
|
1908
1900
|
analytics?: boolean | undefined;
|
|
1909
1901
|
defaultValue?: string | {
|
|
1910
|
-
$$
|
|
1911
|
-
$$time: "now";
|
|
1902
|
+
$$now: true;
|
|
1912
1903
|
} | undefined;
|
|
1913
1904
|
configuration?: {
|
|
1914
1905
|
notice?: {
|
|
@@ -2284,20 +2275,12 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2284
2275
|
analytics: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2285
2276
|
}, {
|
|
2286
2277
|
type: z.ZodLiteral<"TIME">;
|
|
2287
|
-
defaultValue: z.ZodOptional<z.ZodUnion<[z.
|
|
2288
|
-
$$
|
|
2289
|
-
$$time: z.ZodLiteral<"now">;
|
|
2278
|
+
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
2279
|
+
$$now: z.ZodLiteral<true>;
|
|
2290
2280
|
}, "strip", z.ZodTypeAny, {
|
|
2291
|
-
$$
|
|
2292
|
-
$$time: "now";
|
|
2293
|
-
}, {
|
|
2294
|
-
$$date: "now";
|
|
2295
|
-
$$time: "now";
|
|
2296
|
-
}>, {
|
|
2297
|
-
$$time: "now";
|
|
2281
|
+
$$now: true;
|
|
2298
2282
|
}, {
|
|
2299
|
-
$$
|
|
2300
|
-
$$time: "now";
|
|
2283
|
+
$$now: true;
|
|
2301
2284
|
}>, z.ZodString]>>;
|
|
2302
2285
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
2303
2286
|
use12HourFormat: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2359,7 +2342,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2359
2342
|
uncorrectable?: boolean | undefined;
|
|
2360
2343
|
analytics?: boolean | undefined;
|
|
2361
2344
|
defaultValue?: string | {
|
|
2362
|
-
$$
|
|
2345
|
+
$$now: true;
|
|
2363
2346
|
} | undefined;
|
|
2364
2347
|
configuration?: {
|
|
2365
2348
|
notice?: TranslationConfig | undefined;
|
|
@@ -2427,8 +2410,7 @@ declare const TimeField: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
2427
2410
|
uncorrectable?: boolean | undefined;
|
|
2428
2411
|
analytics?: boolean | undefined;
|
|
2429
2412
|
defaultValue?: string | {
|
|
2430
|
-
$$
|
|
2431
|
-
$$time: "now";
|
|
2413
|
+
$$now: true;
|
|
2432
2414
|
} | undefined;
|
|
2433
2415
|
configuration?: {
|
|
2434
2416
|
notice?: {
|
|
@@ -230,6 +230,15 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
230
230
|
}, {
|
|
231
231
|
data?: any;
|
|
232
232
|
}>>> | z.ZodObject<{
|
|
233
|
+
numericValue: z.ZodNumber;
|
|
234
|
+
unit: z.ZodString;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
numericValue: number;
|
|
237
|
+
unit: string;
|
|
238
|
+
}, {
|
|
239
|
+
numericValue: number;
|
|
240
|
+
unit: string;
|
|
241
|
+
}> | z.ZodObject<{
|
|
233
242
|
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
234
243
|
unit: z.ZodOptional<z.ZodString>;
|
|
235
244
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -239,6 +248,15 @@ export declare function mapFieldTypeToZod(field: FieldConfig, actionType?: Actio
|
|
|
239
248
|
numericValue?: number | undefined;
|
|
240
249
|
unit?: string | undefined;
|
|
241
250
|
}> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
251
|
+
numericValue: z.ZodNumber;
|
|
252
|
+
unit: z.ZodString;
|
|
253
|
+
}, "strip", z.ZodTypeAny, {
|
|
254
|
+
numericValue: number;
|
|
255
|
+
unit: string;
|
|
256
|
+
}, {
|
|
257
|
+
numericValue: number;
|
|
258
|
+
unit: string;
|
|
259
|
+
}>>> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
242
260
|
numericValue: z.ZodOptional<z.ZodNumber>;
|
|
243
261
|
unit: z.ZodOptional<z.ZodString>;
|
|
244
262
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -38,6 +38,7 @@ export declare const AgeUpdateValue: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
|
38
38
|
asOfDateRef: string;
|
|
39
39
|
}>>>;
|
|
40
40
|
export declare const TimeValue: z.ZodString;
|
|
41
|
+
export type TimeValue = z.infer<typeof TimeValue>;
|
|
41
42
|
export declare const DatetimeValue: z.ZodString;
|
|
42
43
|
export declare const SelectDateRangeValue: z.ZodEnum<["last7Days", "last30Days", "last90Days", "last365Days"]>;
|
|
43
44
|
export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodObject<{
|
|
@@ -110,14 +110,10 @@ function omitKeyDeep(obj, keyToRemove) {
|
|
|
110
110
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
111
111
|
var import_zod2 = require("zod");
|
|
112
112
|
var SerializedNowDateTime = import_zod2.z.object({
|
|
113
|
-
$$
|
|
114
|
-
$$time: import_zod2.z.literal("now")
|
|
113
|
+
$$now: import_zod2.z.literal(true)
|
|
115
114
|
});
|
|
116
115
|
function todayDateTimeValueSerializer() {
|
|
117
|
-
return {
|
|
118
|
-
$$date: "now",
|
|
119
|
-
$$time: "now"
|
|
120
|
-
};
|
|
116
|
+
return { $$now: true };
|
|
121
117
|
}
|
|
122
118
|
|
|
123
119
|
// ../commons/src/conditionals/conditionals.ts
|
package/dist/events/index.js
CHANGED
|
@@ -1909,14 +1909,10 @@ var SearchScopeAccessLevels = {
|
|
|
1909
1909
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
1910
1910
|
var import_zod15 = require("zod");
|
|
1911
1911
|
var SerializedNowDateTime = import_zod15.z.object({
|
|
1912
|
-
$$
|
|
1913
|
-
$$time: import_zod15.z.literal("now")
|
|
1912
|
+
$$now: import_zod15.z.literal(true)
|
|
1914
1913
|
});
|
|
1915
1914
|
function todayDateTimeValueSerializer() {
|
|
1916
|
-
return {
|
|
1917
|
-
$$date: "now",
|
|
1918
|
-
$$time: "now"
|
|
1919
|
-
};
|
|
1915
|
+
return { $$now: true };
|
|
1920
1916
|
}
|
|
1921
1917
|
|
|
1922
1918
|
// ../commons/src/events/FieldConfig.ts
|
|
@@ -2052,9 +2048,7 @@ var EmailField = BaseField.extend({
|
|
|
2052
2048
|
});
|
|
2053
2049
|
var DateField = BaseField.extend({
|
|
2054
2050
|
type: import_zod16.z.literal(FieldType.DATE),
|
|
2055
|
-
defaultValue: SerializedNowDateTime.
|
|
2056
|
-
$$date: "now"
|
|
2057
|
-
})).or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("A single time input (HH-mm)"),
|
|
2051
|
+
defaultValue: SerializedNowDateTime.or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("Default date value(yyyy-MM-dd)"),
|
|
2058
2052
|
configuration: import_zod16.z.object({
|
|
2059
2053
|
notice: TranslationConfig.describe(
|
|
2060
2054
|
"Text to display above the date input"
|
|
@@ -2072,9 +2066,7 @@ var AgeField = BaseField.extend({
|
|
|
2072
2066
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
2073
2067
|
var TimeField = BaseField.extend({
|
|
2074
2068
|
type: import_zod16.z.literal(FieldType.TIME),
|
|
2075
|
-
defaultValue: SerializedNowDateTime.
|
|
2076
|
-
$$time: "now"
|
|
2077
|
-
})).or(TimeValue).optional().openapi({ effectType: "input", type: "string" }).describe("A single time input (HH-mm)"),
|
|
2069
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
|
|
2078
2070
|
configuration: import_zod16.z.object({
|
|
2079
2071
|
use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
2080
2072
|
notice: TranslationConfig.describe(
|
|
@@ -3017,7 +3009,7 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
3017
3009
|
schema = NumberFieldValue;
|
|
3018
3010
|
break;
|
|
3019
3011
|
case FieldType.NUMBER_WITH_UNIT:
|
|
3020
|
-
schema = NumberWithUnitFieldUpdateValue;
|
|
3012
|
+
schema = field3.required ? NumberWithUnitFieldValue : NumberWithUnitFieldUpdateValue;
|
|
3021
3013
|
break;
|
|
3022
3014
|
case FieldType.CHECKBOX:
|
|
3023
3015
|
schema = CheckboxFieldValue;
|
|
@@ -3408,7 +3400,7 @@ function isFieldVisible(field3, form, context) {
|
|
|
3408
3400
|
}
|
|
3409
3401
|
function isFieldEmptyAndNotRequired(field3, form) {
|
|
3410
3402
|
const fieldValue = form[field3.id];
|
|
3411
|
-
return !field3.required && (fieldValue === void 0 || fieldValue === "");
|
|
3403
|
+
return !field3.required && (fieldValue === void 0 || fieldValue === "" || fieldValue && typeof fieldValue === "object" && Object.values(fieldValue).every((v) => v === void 0 || v === ""));
|
|
3412
3404
|
}
|
|
3413
3405
|
function isFieldEnabled(field3, form, context) {
|
|
3414
3406
|
return isFieldConditionMet(field3, form, ConditionalType.ENABLE, context);
|
|
@@ -5714,7 +5706,7 @@ function field(fieldId, options = {}) {
|
|
|
5714
5706
|
|
|
5715
5707
|
// ../commons/src/fixtures/forms.ts
|
|
5716
5708
|
var import_date_fns3 = require("date-fns");
|
|
5717
|
-
var PRINT_CERTIFICATE_FORM = {
|
|
5709
|
+
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
5718
5710
|
label: {
|
|
5719
5711
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
5720
5712
|
defaultMessage: "Tennis club membership certificate collector",
|
|
@@ -6370,7 +6362,7 @@ var PRINT_CERTIFICATE_FORM = {
|
|
|
6370
6362
|
}
|
|
6371
6363
|
}
|
|
6372
6364
|
]
|
|
6373
|
-
};
|
|
6365
|
+
});
|
|
6374
6366
|
var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
6375
6367
|
title: {
|
|
6376
6368
|
id: "event.tennis-club-membership.action.declare.form.review.title",
|
|
@@ -6415,7 +6407,7 @@ function isDomesticAddress() {
|
|
|
6415
6407
|
field("addressType").isEqualTo(AddressType.DOMESTIC)
|
|
6416
6408
|
);
|
|
6417
6409
|
}
|
|
6418
|
-
var TENNIS_CLUB_DECLARATION_FORM = {
|
|
6410
|
+
var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
6419
6411
|
label: {
|
|
6420
6412
|
id: "event.tennis-club-membership.action.declare.form.label",
|
|
6421
6413
|
defaultMessage: "Tennis club membership application",
|
|
@@ -6900,7 +6892,7 @@ var TENNIS_CLUB_DECLARATION_FORM = {
|
|
|
6900
6892
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
6901
6893
|
}
|
|
6902
6894
|
]
|
|
6903
|
-
};
|
|
6895
|
+
});
|
|
6904
6896
|
var statusOptions = [
|
|
6905
6897
|
{
|
|
6906
6898
|
value: "ALL",
|
|
@@ -7709,7 +7701,7 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
7709
7701
|
});
|
|
7710
7702
|
|
|
7711
7703
|
// ../commons/src/fixtures/library-membership-event.ts
|
|
7712
|
-
var libraryMembershipForm = {
|
|
7704
|
+
var libraryMembershipForm = defineDeclarationForm({
|
|
7713
7705
|
label: {
|
|
7714
7706
|
id: "event.library-membership.action.declare.form.label",
|
|
7715
7707
|
defaultMessage: "Library membership application",
|
|
@@ -7749,7 +7741,7 @@ var libraryMembershipForm = {
|
|
|
7749
7741
|
]
|
|
7750
7742
|
}
|
|
7751
7743
|
]
|
|
7752
|
-
};
|
|
7744
|
+
});
|
|
7753
7745
|
var libraryMembershipEvent = defineConfig({
|
|
7754
7746
|
id: "library-membership",
|
|
7755
7747
|
label: {
|
|
@@ -7775,7 +7767,7 @@ function generateTranslationConfig(message) {
|
|
|
7775
7767
|
id: message
|
|
7776
7768
|
};
|
|
7777
7769
|
}
|
|
7778
|
-
var child = {
|
|
7770
|
+
var child = defineFormPage({
|
|
7779
7771
|
id: "child",
|
|
7780
7772
|
type: PageTypes.enum.FORM,
|
|
7781
7773
|
title: generateTranslationConfig("Child's details"),
|
|
@@ -7798,8 +7790,8 @@ var child = {
|
|
|
7798
7790
|
label: generateTranslationConfig("Date of birth")
|
|
7799
7791
|
}
|
|
7800
7792
|
]
|
|
7801
|
-
};
|
|
7802
|
-
var mother = {
|
|
7793
|
+
});
|
|
7794
|
+
var mother = defineFormPage({
|
|
7803
7795
|
id: "mother",
|
|
7804
7796
|
type: PageTypes.enum.FORM,
|
|
7805
7797
|
title: generateTranslationConfig("Mother's details"),
|
|
@@ -7871,7 +7863,7 @@ var mother = {
|
|
|
7871
7863
|
validation: []
|
|
7872
7864
|
}
|
|
7873
7865
|
]
|
|
7874
|
-
};
|
|
7866
|
+
});
|
|
7875
7867
|
var BIRTH_DECLARATION_REVIEW = {
|
|
7876
7868
|
title: generateTranslationConfig(
|
|
7877
7869
|
"{child.name.firstname, select, __EMPTY__ {Birth declaration} other {{child.name.surname, select, __EMPTY__ {Birth declaration for {child.name.firstname}} other {Birth declaration for {child.name.firstname} {child.name.surname}}}}}"
|
|
@@ -7892,10 +7884,10 @@ var BIRTH_DECLARATION_REVIEW = {
|
|
|
7892
7884
|
}
|
|
7893
7885
|
]
|
|
7894
7886
|
};
|
|
7895
|
-
var BIRTH_DECLARATION_FORM = {
|
|
7887
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
7896
7888
|
label: generateTranslationConfig("Birth decalration form"),
|
|
7897
7889
|
pages: [child, mother]
|
|
7898
|
-
};
|
|
7890
|
+
});
|
|
7899
7891
|
var v2BirthEvent = defineConfig({
|
|
7900
7892
|
id: BIRTH_EVENT,
|
|
7901
7893
|
title: generateTranslationConfig(
|
|
@@ -7932,7 +7924,7 @@ var v2BirthEvent = defineConfig({
|
|
|
7932
7924
|
});
|
|
7933
7925
|
|
|
7934
7926
|
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
7935
|
-
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
7927
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
7936
7928
|
label: {
|
|
7937
7929
|
id: "event.digital-identity.action.certificate.form.label",
|
|
7938
7930
|
defaultMessage: "Digital identity certificate printer",
|
|
@@ -8076,8 +8068,8 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
|
8076
8068
|
]
|
|
8077
8069
|
}
|
|
8078
8070
|
]
|
|
8079
|
-
};
|
|
8080
|
-
var digitalIdentityForm = {
|
|
8071
|
+
});
|
|
8072
|
+
var digitalIdentityForm = defineDeclarationForm({
|
|
8081
8073
|
label: {
|
|
8082
8074
|
id: "event.digital-identity.action.declare.form.label",
|
|
8083
8075
|
defaultMessage: "Digital identity issuance",
|
|
@@ -8117,7 +8109,7 @@ var digitalIdentityForm = {
|
|
|
8117
8109
|
]
|
|
8118
8110
|
}
|
|
8119
8111
|
]
|
|
8120
|
-
};
|
|
8112
|
+
});
|
|
8121
8113
|
var digitalIdentityEvent = defineConfig({
|
|
8122
8114
|
id: "digital-identity",
|
|
8123
8115
|
label: {
|
|
@@ -1431,14 +1431,10 @@ var SearchQuery = import_zod14.z.object({
|
|
|
1431
1431
|
// ../commons/src/events/serializers/date/serializer.ts
|
|
1432
1432
|
var import_zod15 = require("zod");
|
|
1433
1433
|
var SerializedNowDateTime = import_zod15.z.object({
|
|
1434
|
-
$$
|
|
1435
|
-
$$time: import_zod15.z.literal("now")
|
|
1434
|
+
$$now: import_zod15.z.literal(true)
|
|
1436
1435
|
});
|
|
1437
1436
|
function todayDateTimeValueSerializer() {
|
|
1438
|
-
return {
|
|
1439
|
-
$$date: "now",
|
|
1440
|
-
$$time: "now"
|
|
1441
|
-
};
|
|
1437
|
+
return { $$now: true };
|
|
1442
1438
|
}
|
|
1443
1439
|
|
|
1444
1440
|
// ../commons/src/events/FieldConfig.ts
|
|
@@ -1574,9 +1570,7 @@ var EmailField = BaseField.extend({
|
|
|
1574
1570
|
});
|
|
1575
1571
|
var DateField = BaseField.extend({
|
|
1576
1572
|
type: import_zod16.z.literal(FieldType.DATE),
|
|
1577
|
-
defaultValue: SerializedNowDateTime.
|
|
1578
|
-
$$date: "now"
|
|
1579
|
-
})).or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("A single time input (HH-mm)"),
|
|
1573
|
+
defaultValue: SerializedNowDateTime.or(DateValue).optional().openapi({ effectType: "input", type: "string" }).describe("Default date value(yyyy-MM-dd)"),
|
|
1580
1574
|
configuration: import_zod16.z.object({
|
|
1581
1575
|
notice: TranslationConfig.describe(
|
|
1582
1576
|
"Text to display above the date input"
|
|
@@ -1594,9 +1588,7 @@ var AgeField = BaseField.extend({
|
|
|
1594
1588
|
}).describe("An age input field which uses the current date as the asOfDate");
|
|
1595
1589
|
var TimeField = BaseField.extend({
|
|
1596
1590
|
type: import_zod16.z.literal(FieldType.TIME),
|
|
1597
|
-
defaultValue: SerializedNowDateTime.
|
|
1598
|
-
$$time: "now"
|
|
1599
|
-
})).or(TimeValue).optional().openapi({ effectType: "input", type: "string" }).describe("A single time input (HH-mm)"),
|
|
1591
|
+
defaultValue: SerializedNowDateTime.or(TimeValue).optional().openapi({ effectType: "input", type: "object" }).describe("Default time value (HH-mm)"),
|
|
1600
1592
|
configuration: import_zod16.z.object({
|
|
1601
1593
|
use12HourFormat: import_zod16.z.boolean().optional().describe("Whether to use 12-hour format"),
|
|
1602
1594
|
notice: TranslationConfig.describe(
|
|
@@ -2699,6 +2691,11 @@ var EventConfig = import_zod27.z.object({
|
|
|
2699
2691
|
ref: "EventConfig"
|
|
2700
2692
|
}).describe("Configuration defining an event type.");
|
|
2701
2693
|
|
|
2694
|
+
// ../commons/src/events/EventConfigInput.ts
|
|
2695
|
+
var defineDeclarationForm = (form) => DeclarationFormConfig.parse(form);
|
|
2696
|
+
var defineActionForm = (actionForm) => ActionFormConfig.parse(actionForm);
|
|
2697
|
+
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
|
2698
|
+
|
|
2702
2699
|
// ../commons/src/events/WorkqueueConfig.ts
|
|
2703
2700
|
var import_zod31 = require("zod");
|
|
2704
2701
|
|
|
@@ -3962,7 +3959,7 @@ function field(fieldId, options = {}) {
|
|
|
3962
3959
|
|
|
3963
3960
|
// ../commons/src/fixtures/forms.ts
|
|
3964
3961
|
var import_date_fns3 = require("date-fns");
|
|
3965
|
-
var PRINT_CERTIFICATE_FORM = {
|
|
3962
|
+
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
3966
3963
|
label: {
|
|
3967
3964
|
id: "event.tennis-club-membership.action.certificate.form.label",
|
|
3968
3965
|
defaultMessage: "Tennis club membership certificate collector",
|
|
@@ -4618,7 +4615,7 @@ var PRINT_CERTIFICATE_FORM = {
|
|
|
4618
4615
|
}
|
|
4619
4616
|
}
|
|
4620
4617
|
]
|
|
4621
|
-
};
|
|
4618
|
+
});
|
|
4622
4619
|
var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
4623
4620
|
title: {
|
|
4624
4621
|
id: "event.tennis-club-membership.action.declare.form.review.title",
|
|
@@ -4663,7 +4660,7 @@ function isDomesticAddress() {
|
|
|
4663
4660
|
field("addressType").isEqualTo(AddressType.DOMESTIC)
|
|
4664
4661
|
);
|
|
4665
4662
|
}
|
|
4666
|
-
var TENNIS_CLUB_DECLARATION_FORM = {
|
|
4663
|
+
var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
4667
4664
|
label: {
|
|
4668
4665
|
id: "event.tennis-club-membership.action.declare.form.label",
|
|
4669
4666
|
defaultMessage: "Tennis club membership application",
|
|
@@ -5148,7 +5145,7 @@ var TENNIS_CLUB_DECLARATION_FORM = {
|
|
|
5148
5145
|
// Intentional always-true page conditional to exercise interactions between page-level and field-level conditionals in tests
|
|
5149
5146
|
}
|
|
5150
5147
|
]
|
|
5151
|
-
};
|
|
5148
|
+
});
|
|
5152
5149
|
var statusOptions = [
|
|
5153
5150
|
{
|
|
5154
5151
|
value: "ALL",
|
|
@@ -5957,7 +5954,7 @@ var footballClubMembershipEvent = defineConfig({
|
|
|
5957
5954
|
});
|
|
5958
5955
|
|
|
5959
5956
|
// ../commons/src/fixtures/library-membership-event.ts
|
|
5960
|
-
var libraryMembershipForm = {
|
|
5957
|
+
var libraryMembershipForm = defineDeclarationForm({
|
|
5961
5958
|
label: {
|
|
5962
5959
|
id: "event.library-membership.action.declare.form.label",
|
|
5963
5960
|
defaultMessage: "Library membership application",
|
|
@@ -5997,7 +5994,7 @@ var libraryMembershipForm = {
|
|
|
5997
5994
|
]
|
|
5998
5995
|
}
|
|
5999
5996
|
]
|
|
6000
|
-
};
|
|
5997
|
+
});
|
|
6001
5998
|
var libraryMembershipEvent = defineConfig({
|
|
6002
5999
|
id: "library-membership",
|
|
6003
6000
|
label: {
|
|
@@ -6023,7 +6020,7 @@ function generateTranslationConfig(message) {
|
|
|
6023
6020
|
id: message
|
|
6024
6021
|
};
|
|
6025
6022
|
}
|
|
6026
|
-
var child = {
|
|
6023
|
+
var child = defineFormPage({
|
|
6027
6024
|
id: "child",
|
|
6028
6025
|
type: PageTypes.enum.FORM,
|
|
6029
6026
|
title: generateTranslationConfig("Child's details"),
|
|
@@ -6046,8 +6043,8 @@ var child = {
|
|
|
6046
6043
|
label: generateTranslationConfig("Date of birth")
|
|
6047
6044
|
}
|
|
6048
6045
|
]
|
|
6049
|
-
};
|
|
6050
|
-
var mother = {
|
|
6046
|
+
});
|
|
6047
|
+
var mother = defineFormPage({
|
|
6051
6048
|
id: "mother",
|
|
6052
6049
|
type: PageTypes.enum.FORM,
|
|
6053
6050
|
title: generateTranslationConfig("Mother's details"),
|
|
@@ -6119,7 +6116,7 @@ var mother = {
|
|
|
6119
6116
|
validation: []
|
|
6120
6117
|
}
|
|
6121
6118
|
]
|
|
6122
|
-
};
|
|
6119
|
+
});
|
|
6123
6120
|
var BIRTH_DECLARATION_REVIEW = {
|
|
6124
6121
|
title: generateTranslationConfig(
|
|
6125
6122
|
"{child.name.firstname, select, __EMPTY__ {Birth declaration} other {{child.name.surname, select, __EMPTY__ {Birth declaration for {child.name.firstname}} other {Birth declaration for {child.name.firstname} {child.name.surname}}}}}"
|
|
@@ -6140,10 +6137,10 @@ var BIRTH_DECLARATION_REVIEW = {
|
|
|
6140
6137
|
}
|
|
6141
6138
|
]
|
|
6142
6139
|
};
|
|
6143
|
-
var BIRTH_DECLARATION_FORM = {
|
|
6140
|
+
var BIRTH_DECLARATION_FORM = defineDeclarationForm({
|
|
6144
6141
|
label: generateTranslationConfig("Birth decalration form"),
|
|
6145
6142
|
pages: [child, mother]
|
|
6146
|
-
};
|
|
6143
|
+
});
|
|
6147
6144
|
var v2BirthEvent = defineConfig({
|
|
6148
6145
|
id: BIRTH_EVENT,
|
|
6149
6146
|
title: generateTranslationConfig(
|
|
@@ -6180,7 +6177,7 @@ var v2BirthEvent = defineConfig({
|
|
|
6180
6177
|
});
|
|
6181
6178
|
|
|
6182
6179
|
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
6183
|
-
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
6180
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
6184
6181
|
label: {
|
|
6185
6182
|
id: "event.digital-identity.action.certificate.form.label",
|
|
6186
6183
|
defaultMessage: "Digital identity certificate printer",
|
|
@@ -6324,8 +6321,8 @@ var PRINT_DIGITAL_ID_CERTIFICATE_FORM = {
|
|
|
6324
6321
|
]
|
|
6325
6322
|
}
|
|
6326
6323
|
]
|
|
6327
|
-
};
|
|
6328
|
-
var digitalIdentityForm = {
|
|
6324
|
+
});
|
|
6325
|
+
var digitalIdentityForm = defineDeclarationForm({
|
|
6329
6326
|
label: {
|
|
6330
6327
|
id: "event.digital-identity.action.declare.form.label",
|
|
6331
6328
|
defaultMessage: "Digital identity issuance",
|
|
@@ -6365,7 +6362,7 @@ var digitalIdentityForm = {
|
|
|
6365
6362
|
]
|
|
6366
6363
|
}
|
|
6367
6364
|
]
|
|
6368
|
-
};
|
|
6365
|
+
});
|
|
6369
6366
|
var digitalIdentityEvent = defineConfig({
|
|
6370
6367
|
id: "digital-identity",
|
|
6371
6368
|
label: {
|