@opencrvs/toolkit 1.9.3-rc.e574091 → 1.9.3-rc.f03a611
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/api/router.d.ts +3 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +30 -24
- package/dist/commons/events/CompositeFieldValue.d.ts +22 -0
- package/dist/commons/events/EventConfig.d.ts +22 -20
- package/dist/commons/events/FieldConfig.d.ts +284 -2
- package/dist/commons/events/FieldType.d.ts +2 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +88 -3
- package/dist/commons/events/FieldValue.d.ts +52 -4
- package/dist/commons/events/WorkqueueConfig.d.ts +8 -8
- package/dist/commons/events/defineConfig.d.ts +2 -2
- package/dist/commons/events/utils.d.ts +14 -2
- package/dist/events/index.js +257 -0
- package/dist/notification/index.js +242 -0
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
|
@@ -153,6 +153,8 @@ __export(events_exports, {
|
|
|
153
153
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
|
154
154
|
NotifyActionInput: () => NotifyActionInput,
|
|
155
155
|
NumberFieldValue: () => NumberFieldValue,
|
|
156
|
+
NumberWithUnitFieldUpdateValue: () => NumberWithUnitFieldUpdateValue,
|
|
157
|
+
NumberWithUnitFieldValue: () => NumberWithUnitFieldValue,
|
|
156
158
|
PageConfig: () => PageConfig,
|
|
157
159
|
PageTypes: () => PageTypes,
|
|
158
160
|
PotentialDuplicate: () => PotentialDuplicate,
|
|
@@ -330,6 +332,7 @@ __export(events_exports, {
|
|
|
330
332
|
isNameFieldType: () => isNameFieldType,
|
|
331
333
|
isNonInteractiveFieldType: () => isNonInteractiveFieldType,
|
|
332
334
|
isNumberFieldType: () => isNumberFieldType,
|
|
335
|
+
isNumberWithUnitFieldType: () => isNumberWithUnitFieldType,
|
|
333
336
|
isOfficeFieldType: () => isOfficeFieldType,
|
|
334
337
|
isOnline: () => isOnline,
|
|
335
338
|
isPageHeaderFieldType: () => isPageHeaderFieldType,
|
|
@@ -565,6 +568,7 @@ var FieldType = {
|
|
|
565
568
|
ADDRESS: "ADDRESS",
|
|
566
569
|
TEXT: "TEXT",
|
|
567
570
|
NUMBER: "NUMBER",
|
|
571
|
+
NUMBER_WITH_UNIT: "NUMBER_WITH_UNIT",
|
|
568
572
|
TEXTAREA: "TEXTAREA",
|
|
569
573
|
EMAIL: "EMAIL",
|
|
570
574
|
DATE: "DATE",
|
|
@@ -732,6 +736,14 @@ var ReadDataValue = import_zod6.z.object({
|
|
|
732
736
|
});
|
|
733
737
|
var QrReaderFieldValue = ReadDataValue;
|
|
734
738
|
var IdReaderFieldValue = ReadDataValue;
|
|
739
|
+
var NumberWithUnitFieldValue = import_zod6.z.object({
|
|
740
|
+
numericValue: import_zod6.z.number(),
|
|
741
|
+
unit: import_zod6.z.string()
|
|
742
|
+
});
|
|
743
|
+
var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
744
|
+
numericValue: import_zod6.z.number().optional(),
|
|
745
|
+
unit: import_zod6.z.string().optional()
|
|
746
|
+
});
|
|
735
747
|
|
|
736
748
|
// ../commons/src/events/FieldValue.ts
|
|
737
749
|
var TextValue = import_zod7.z.string();
|
|
@@ -777,6 +789,8 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
|
777
789
|
SelectDateRangeValue,
|
|
778
790
|
CheckboxFieldValue,
|
|
779
791
|
NumberFieldValue,
|
|
792
|
+
NumberWithUnitFieldValue,
|
|
793
|
+
NumberWithUnitFieldUpdateValue,
|
|
780
794
|
FileFieldValue,
|
|
781
795
|
FileFieldWithOptionValue,
|
|
782
796
|
NameFieldValue,
|
|
@@ -806,6 +820,7 @@ var PRIORITY_ORDER = [
|
|
|
806
820
|
"SelectDateRangeValue",
|
|
807
821
|
"CheckboxFieldValue",
|
|
808
822
|
"NumberFieldValue",
|
|
823
|
+
"NumberWithUnitFieldUpdateValue",
|
|
809
824
|
"FileFieldValue",
|
|
810
825
|
"FileFieldWithOptionValue",
|
|
811
826
|
"DataFieldValue"
|
|
@@ -839,6 +854,7 @@ var FieldUpdateValue = safeUnion([
|
|
|
839
854
|
SelectDateRangeValue.describe("SelectDateRangeValue"),
|
|
840
855
|
CheckboxFieldValue.describe("CheckboxFieldValue"),
|
|
841
856
|
NumberFieldValue.describe("NumberFieldValue"),
|
|
857
|
+
NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
|
|
842
858
|
FileFieldValue.describe("FileFieldValue"),
|
|
843
859
|
FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
|
|
844
860
|
DataFieldValue.describe("DataFieldValue"),
|
|
@@ -2098,6 +2114,18 @@ var SelectOption = import_zod15.z.object({
|
|
|
2098
2114
|
value: import_zod15.z.string().describe("The value of the option"),
|
|
2099
2115
|
label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
|
|
2100
2116
|
});
|
|
2117
|
+
var NumberWithUnitField = BaseField.extend({
|
|
2118
|
+
type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
2119
|
+
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
2120
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
2121
|
+
configuration: import_zod15.z.object({
|
|
2122
|
+
min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
|
|
2123
|
+
max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
|
|
2124
|
+
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
2125
|
+
"Placeholder for the number field"
|
|
2126
|
+
)
|
|
2127
|
+
}).optional()
|
|
2128
|
+
}).describe("Number with unit input");
|
|
2101
2129
|
var RadioGroup = BaseField.extend({
|
|
2102
2130
|
type: import_zod15.z.literal(FieldType.RADIO_GROUP),
|
|
2103
2131
|
defaultValue: TextValue.optional(),
|
|
@@ -2386,6 +2414,7 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
|
2386
2414
|
Address,
|
|
2387
2415
|
TextField,
|
|
2388
2416
|
NumberField,
|
|
2417
|
+
NumberWithUnitField,
|
|
2389
2418
|
TextAreaField,
|
|
2390
2419
|
AgeField,
|
|
2391
2420
|
DateField,
|
|
@@ -2955,6 +2984,9 @@ function mapFieldTypeToZod(field3, actionType) {
|
|
|
2955
2984
|
case FieldType.NUMBER:
|
|
2956
2985
|
schema = NumberFieldValue;
|
|
2957
2986
|
break;
|
|
2987
|
+
case FieldType.NUMBER_WITH_UNIT:
|
|
2988
|
+
schema = NumberWithUnitFieldUpdateValue;
|
|
2989
|
+
break;
|
|
2958
2990
|
case FieldType.CHECKBOX:
|
|
2959
2991
|
schema = CheckboxFieldValue;
|
|
2960
2992
|
break;
|
|
@@ -3012,6 +3044,7 @@ function mapFieldTypeToEmptyValue(field3) {
|
|
|
3012
3044
|
case FieldType.FACILITY:
|
|
3013
3045
|
case FieldType.OFFICE:
|
|
3014
3046
|
case FieldType.NUMBER:
|
|
3047
|
+
case FieldType.NUMBER_WITH_UNIT:
|
|
3015
3048
|
case FieldType.EMAIL:
|
|
3016
3049
|
case FieldType.DATE:
|
|
3017
3050
|
case FieldType.AGE:
|
|
@@ -3079,6 +3112,9 @@ var isTextFieldType = (field3) => {
|
|
|
3079
3112
|
var isNumberFieldType = (field3) => {
|
|
3080
3113
|
return field3.config.type === FieldType.NUMBER;
|
|
3081
3114
|
};
|
|
3115
|
+
var isNumberWithUnitFieldType = (field3) => {
|
|
3116
|
+
return field3.config.type === FieldType.NUMBER_WITH_UNIT;
|
|
3117
|
+
};
|
|
3082
3118
|
var isNameFieldType = (field3) => {
|
|
3083
3119
|
return field3.config.type === FieldType.NAME;
|
|
3084
3120
|
};
|
|
@@ -5655,6 +5691,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
5655
5691
|
{
|
|
5656
5692
|
id: "collector",
|
|
5657
5693
|
type: PageTypes.enum.FORM,
|
|
5694
|
+
requireCompletionToContinue: true,
|
|
5658
5695
|
title: {
|
|
5659
5696
|
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
5660
5697
|
defaultMessage: "Print certified copy",
|
|
@@ -6262,6 +6299,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
6262
6299
|
{
|
|
6263
6300
|
id: "collector.identity.verify",
|
|
6264
6301
|
type: PageTypes.enum.VERIFICATION,
|
|
6302
|
+
requireCompletionToContinue: true,
|
|
6265
6303
|
conditional: field("collector.requesterId").isEqualTo("INFORMANT"),
|
|
6266
6304
|
title: {
|
|
6267
6305
|
id: "event.tennis-club-membership.action.print.verifyIdentity",
|
|
@@ -7860,6 +7898,220 @@ var v2BirthEvent = defineConfig({
|
|
|
7860
7898
|
advancedSearch: []
|
|
7861
7899
|
});
|
|
7862
7900
|
|
|
7901
|
+
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
7902
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
7903
|
+
label: {
|
|
7904
|
+
id: "event.digital-identity.action.certificate.form.label",
|
|
7905
|
+
defaultMessage: "Digital identity certificate printer",
|
|
7906
|
+
description: "This is what this form is referred as in the system"
|
|
7907
|
+
},
|
|
7908
|
+
pages: [
|
|
7909
|
+
{
|
|
7910
|
+
id: "collector",
|
|
7911
|
+
type: PageTypes.enum.FORM,
|
|
7912
|
+
title: {
|
|
7913
|
+
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
7914
|
+
defaultMessage: "Print certified copy",
|
|
7915
|
+
description: "This is the title of the section"
|
|
7916
|
+
},
|
|
7917
|
+
fields: [
|
|
7918
|
+
{
|
|
7919
|
+
id: "identity.http-fetch",
|
|
7920
|
+
type: FieldType.HTTP,
|
|
7921
|
+
label: {
|
|
7922
|
+
defaultMessage: "Digital identity certificate",
|
|
7923
|
+
description: "Fetch printable digital identity certificate",
|
|
7924
|
+
id: "event.digital-identity.certificate.fetch.label"
|
|
7925
|
+
},
|
|
7926
|
+
configuration: {
|
|
7927
|
+
trigger: field("identity.http-button"),
|
|
7928
|
+
url: "/api/digital-identity/certificate",
|
|
7929
|
+
timeout: 5e3,
|
|
7930
|
+
method: "POST",
|
|
7931
|
+
headers: {
|
|
7932
|
+
"Content-Type": "application/json"
|
|
7933
|
+
},
|
|
7934
|
+
body: {
|
|
7935
|
+
subjectId: "$event.subject.id"
|
|
7936
|
+
}
|
|
7937
|
+
}
|
|
7938
|
+
},
|
|
7939
|
+
{
|
|
7940
|
+
id: "identity.http-button",
|
|
7941
|
+
type: FieldType.BUTTON,
|
|
7942
|
+
label: {
|
|
7943
|
+
defaultMessage: "Certificate",
|
|
7944
|
+
description: "Certificate",
|
|
7945
|
+
id: "event.digital-identity.certificate.button.label"
|
|
7946
|
+
},
|
|
7947
|
+
conditionals: [
|
|
7948
|
+
{
|
|
7949
|
+
type: ConditionalType.ENABLE,
|
|
7950
|
+
conditional: and(
|
|
7951
|
+
field("identity.http-fetch").isUndefined(),
|
|
7952
|
+
user.isOnline()
|
|
7953
|
+
)
|
|
7954
|
+
},
|
|
7955
|
+
{
|
|
7956
|
+
type: ConditionalType.SHOW,
|
|
7957
|
+
conditional: and(
|
|
7958
|
+
field("identity.http-fetch").get("loading").isFalsy(),
|
|
7959
|
+
field("identity.http-fetch").get("data").isFalsy()
|
|
7960
|
+
)
|
|
7961
|
+
}
|
|
7962
|
+
],
|
|
7963
|
+
configuration: {
|
|
7964
|
+
icon: "IdentificationCard",
|
|
7965
|
+
text: {
|
|
7966
|
+
defaultMessage: "Fetch certificate",
|
|
7967
|
+
description: "Fetch certificate",
|
|
7968
|
+
id: "event.digital-identity.certificate.fetch.text"
|
|
7969
|
+
}
|
|
7970
|
+
}
|
|
7971
|
+
},
|
|
7972
|
+
{
|
|
7973
|
+
id: "identity.http-button",
|
|
7974
|
+
type: FieldType.BUTTON,
|
|
7975
|
+
label: {
|
|
7976
|
+
defaultMessage: "Certificate",
|
|
7977
|
+
description: "Certificate",
|
|
7978
|
+
id: "event.digital-identity.certificate.button.label"
|
|
7979
|
+
},
|
|
7980
|
+
conditionals: [
|
|
7981
|
+
{
|
|
7982
|
+
type: ConditionalType.ENABLE,
|
|
7983
|
+
conditional: never()
|
|
7984
|
+
},
|
|
7985
|
+
{
|
|
7986
|
+
type: ConditionalType.SHOW,
|
|
7987
|
+
conditional: field("identity.http-fetch").get("loading").isEqualTo(true)
|
|
7988
|
+
}
|
|
7989
|
+
],
|
|
7990
|
+
configuration: {
|
|
7991
|
+
loading: true,
|
|
7992
|
+
text: {
|
|
7993
|
+
defaultMessage: "Fetching certificate\u2026",
|
|
7994
|
+
description: "Fetching certificate\u2026",
|
|
7995
|
+
id: "event.digital-identity.certificate.fetching.text"
|
|
7996
|
+
}
|
|
7997
|
+
}
|
|
7998
|
+
},
|
|
7999
|
+
{
|
|
8000
|
+
id: "identity.http-button",
|
|
8001
|
+
type: FieldType.BUTTON,
|
|
8002
|
+
label: {
|
|
8003
|
+
defaultMessage: "Certificate",
|
|
8004
|
+
description: "Certificate",
|
|
8005
|
+
id: "event.digital-identity.certificate.button.label"
|
|
8006
|
+
},
|
|
8007
|
+
conditionals: [
|
|
8008
|
+
{
|
|
8009
|
+
type: ConditionalType.ENABLE,
|
|
8010
|
+
conditional: never()
|
|
8011
|
+
},
|
|
8012
|
+
{
|
|
8013
|
+
type: ConditionalType.SHOW,
|
|
8014
|
+
conditional: not(field("identity.certificateId").isFalsy())
|
|
8015
|
+
}
|
|
8016
|
+
],
|
|
8017
|
+
configuration: {
|
|
8018
|
+
icon: "Check",
|
|
8019
|
+
text: {
|
|
8020
|
+
defaultMessage: "Certificate ready",
|
|
8021
|
+
description: "Certificate ready",
|
|
8022
|
+
id: "event.digital-identity.certificate.ready.text"
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
},
|
|
8026
|
+
{
|
|
8027
|
+
id: "identity.certificateId",
|
|
8028
|
+
type: FieldType.TEXT,
|
|
8029
|
+
parent: field("identity.http-fetch"),
|
|
8030
|
+
label: {
|
|
8031
|
+
defaultMessage: "Certificate ID",
|
|
8032
|
+
description: "Issued digital identity certificate identifier",
|
|
8033
|
+
id: "event.digital-identity.certificate.id.label"
|
|
8034
|
+
},
|
|
8035
|
+
conditionals: [
|
|
8036
|
+
{
|
|
8037
|
+
type: ConditionalType.ENABLE,
|
|
8038
|
+
conditional: never()
|
|
8039
|
+
}
|
|
8040
|
+
],
|
|
8041
|
+
value: field("identity.http-fetch").get("data.certificateId")
|
|
8042
|
+
}
|
|
8043
|
+
]
|
|
8044
|
+
}
|
|
8045
|
+
]
|
|
8046
|
+
});
|
|
8047
|
+
var digitalIdentityForm = defineDeclarationForm({
|
|
8048
|
+
label: {
|
|
8049
|
+
id: "event.digital-identity.action.declare.form.label",
|
|
8050
|
+
defaultMessage: "Digital identity issuance",
|
|
8051
|
+
description: "This is what this form is referred as in the system"
|
|
8052
|
+
},
|
|
8053
|
+
pages: [
|
|
8054
|
+
{
|
|
8055
|
+
id: "subject",
|
|
8056
|
+
title: {
|
|
8057
|
+
id: "event.digital-identity.action.declare.form.section.who.title",
|
|
8058
|
+
defaultMessage: "Who is the digital identity issued to?",
|
|
8059
|
+
description: "This is the title of the section"
|
|
8060
|
+
},
|
|
8061
|
+
fields: [
|
|
8062
|
+
{
|
|
8063
|
+
id: "subject.firstname",
|
|
8064
|
+
type: FieldType.TEXT,
|
|
8065
|
+
required: true,
|
|
8066
|
+
conditionals: [],
|
|
8067
|
+
label: {
|
|
8068
|
+
defaultMessage: "Subject's first name",
|
|
8069
|
+
description: "This is the label for the field",
|
|
8070
|
+
id: "event.digital-identity.action.declare.form.section.who.field.firstname.label"
|
|
8071
|
+
}
|
|
8072
|
+
},
|
|
8073
|
+
{
|
|
8074
|
+
id: "subject.surname",
|
|
8075
|
+
type: FieldType.TEXT,
|
|
8076
|
+
required: true,
|
|
8077
|
+
conditionals: [],
|
|
8078
|
+
label: {
|
|
8079
|
+
defaultMessage: "Subject's surname",
|
|
8080
|
+
description: "This is the label for the field",
|
|
8081
|
+
id: "event.digital-identity.action.declare.form.section.who.field.surname.label"
|
|
8082
|
+
}
|
|
8083
|
+
}
|
|
8084
|
+
]
|
|
8085
|
+
}
|
|
8086
|
+
]
|
|
8087
|
+
});
|
|
8088
|
+
var digitalIdentityEvent = defineConfig({
|
|
8089
|
+
id: "digital-identity",
|
|
8090
|
+
label: {
|
|
8091
|
+
defaultMessage: "Digital identity issuance",
|
|
8092
|
+
description: "This is what this event is referred as in the system",
|
|
8093
|
+
id: "event.digital-identity.label"
|
|
8094
|
+
},
|
|
8095
|
+
title: {
|
|
8096
|
+
defaultMessage: "{subject.firstname} {subject.surname}",
|
|
8097
|
+
description: "This is the title of the summary",
|
|
8098
|
+
id: "event.digital-identity.title"
|
|
8099
|
+
},
|
|
8100
|
+
summary: { fields: [] },
|
|
8101
|
+
actions: [
|
|
8102
|
+
{
|
|
8103
|
+
type: ActionType.PRINT_CERTIFICATE,
|
|
8104
|
+
label: {
|
|
8105
|
+
id: "event.football-club-membership.action.collect-certificate.label",
|
|
8106
|
+
defaultMessage: "Print certificate",
|
|
8107
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
8108
|
+
},
|
|
8109
|
+
printForm: PRINT_DIGITAL_ID_CERTIFICATE_FORM
|
|
8110
|
+
}
|
|
8111
|
+
],
|
|
8112
|
+
declaration: digitalIdentityForm
|
|
8113
|
+
});
|
|
8114
|
+
|
|
7863
8115
|
// ../commons/src/events/test.utils.ts
|
|
7864
8116
|
var import_zod35 = require("zod");
|
|
7865
8117
|
var TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
|
|
@@ -7959,6 +8211,11 @@ function mapFieldTypeToMockValue(field3, i, rng) {
|
|
|
7959
8211
|
return generateRandomName(rng);
|
|
7960
8212
|
case FieldType.NUMBER:
|
|
7961
8213
|
return 19;
|
|
8214
|
+
case FieldType.NUMBER_WITH_UNIT:
|
|
8215
|
+
return {
|
|
8216
|
+
numericValue: 42,
|
|
8217
|
+
unit: "Hours"
|
|
8218
|
+
};
|
|
7962
8219
|
case FieldType.BUTTON:
|
|
7963
8220
|
return 1;
|
|
7964
8221
|
case FieldType.EMAIL:
|
|
@@ -230,6 +230,7 @@ var FieldType = {
|
|
|
230
230
|
ADDRESS: "ADDRESS",
|
|
231
231
|
TEXT: "TEXT",
|
|
232
232
|
NUMBER: "NUMBER",
|
|
233
|
+
NUMBER_WITH_UNIT: "NUMBER_WITH_UNIT",
|
|
233
234
|
TEXTAREA: "TEXTAREA",
|
|
234
235
|
EMAIL: "EMAIL",
|
|
235
236
|
DATE: "DATE",
|
|
@@ -393,6 +394,14 @@ var ReadDataValue = import_zod6.z.object({
|
|
|
393
394
|
});
|
|
394
395
|
var QrReaderFieldValue = ReadDataValue;
|
|
395
396
|
var IdReaderFieldValue = ReadDataValue;
|
|
397
|
+
var NumberWithUnitFieldValue = import_zod6.z.object({
|
|
398
|
+
numericValue: import_zod6.z.number(),
|
|
399
|
+
unit: import_zod6.z.string()
|
|
400
|
+
});
|
|
401
|
+
var NumberWithUnitFieldUpdateValue = import_zod6.z.object({
|
|
402
|
+
numericValue: import_zod6.z.number().optional(),
|
|
403
|
+
unit: import_zod6.z.string().optional()
|
|
404
|
+
});
|
|
396
405
|
|
|
397
406
|
// ../commons/src/events/FieldValue.ts
|
|
398
407
|
var TextValue = import_zod7.z.string();
|
|
@@ -438,6 +447,8 @@ var FieldValuesWithoutDataField = import_zod7.z.union([
|
|
|
438
447
|
SelectDateRangeValue,
|
|
439
448
|
CheckboxFieldValue,
|
|
440
449
|
NumberFieldValue,
|
|
450
|
+
NumberWithUnitFieldValue,
|
|
451
|
+
NumberWithUnitFieldUpdateValue,
|
|
441
452
|
FileFieldValue,
|
|
442
453
|
FileFieldWithOptionValue,
|
|
443
454
|
NameFieldValue,
|
|
@@ -467,6 +478,7 @@ var PRIORITY_ORDER = [
|
|
|
467
478
|
"SelectDateRangeValue",
|
|
468
479
|
"CheckboxFieldValue",
|
|
469
480
|
"NumberFieldValue",
|
|
481
|
+
"NumberWithUnitFieldUpdateValue",
|
|
470
482
|
"FileFieldValue",
|
|
471
483
|
"FileFieldWithOptionValue",
|
|
472
484
|
"DataFieldValue"
|
|
@@ -500,6 +512,7 @@ var FieldUpdateValue = safeUnion([
|
|
|
500
512
|
SelectDateRangeValue.describe("SelectDateRangeValue"),
|
|
501
513
|
CheckboxFieldValue.describe("CheckboxFieldValue"),
|
|
502
514
|
NumberFieldValue.describe("NumberFieldValue"),
|
|
515
|
+
NumberWithUnitFieldUpdateValue.describe("NumberWithUnitFieldUpdateValue"),
|
|
503
516
|
FileFieldValue.describe("FileFieldValue"),
|
|
504
517
|
FileFieldWithOptionValue.describe("FileFieldWithOptionValue"),
|
|
505
518
|
DataFieldValue.describe("DataFieldValue"),
|
|
@@ -1624,6 +1637,18 @@ var SelectOption = import_zod15.z.object({
|
|
|
1624
1637
|
value: import_zod15.z.string().describe("The value of the option"),
|
|
1625
1638
|
label: import_zod15.z.union([import_zod15.z.string(), TranslationConfig]).describe("The label of the option")
|
|
1626
1639
|
});
|
|
1640
|
+
var NumberWithUnitField = BaseField.extend({
|
|
1641
|
+
type: import_zod15.z.literal(FieldType.NUMBER_WITH_UNIT),
|
|
1642
|
+
defaultValue: NumberWithUnitFieldValue.optional(),
|
|
1643
|
+
options: import_zod15.z.array(SelectOption).describe("A list of options for the unit select"),
|
|
1644
|
+
configuration: import_zod15.z.object({
|
|
1645
|
+
min: import_zod15.z.number().optional().describe("Minimum value of the number field"),
|
|
1646
|
+
max: import_zod15.z.number().optional().describe("Maximum value of the number field"),
|
|
1647
|
+
numberFieldPlaceholder: TranslationConfig.optional().describe(
|
|
1648
|
+
"Placeholder for the number field"
|
|
1649
|
+
)
|
|
1650
|
+
}).optional()
|
|
1651
|
+
}).describe("Number with unit input");
|
|
1627
1652
|
var RadioGroup = BaseField.extend({
|
|
1628
1653
|
type: import_zod15.z.literal(FieldType.RADIO_GROUP),
|
|
1629
1654
|
defaultValue: TextValue.optional(),
|
|
@@ -1912,6 +1937,7 @@ var FieldConfig = import_zod15.z.discriminatedUnion("type", [
|
|
|
1912
1937
|
Address,
|
|
1913
1938
|
TextField,
|
|
1914
1939
|
NumberField,
|
|
1940
|
+
NumberWithUnitField,
|
|
1915
1941
|
TextAreaField,
|
|
1916
1942
|
AgeField,
|
|
1917
1943
|
DateField,
|
|
@@ -3919,6 +3945,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
3919
3945
|
{
|
|
3920
3946
|
id: "collector",
|
|
3921
3947
|
type: PageTypes.enum.FORM,
|
|
3948
|
+
requireCompletionToContinue: true,
|
|
3922
3949
|
title: {
|
|
3923
3950
|
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
3924
3951
|
defaultMessage: "Print certified copy",
|
|
@@ -4526,6 +4553,7 @@ var PRINT_CERTIFICATE_FORM = defineActionForm({
|
|
|
4526
4553
|
{
|
|
4527
4554
|
id: "collector.identity.verify",
|
|
4528
4555
|
type: PageTypes.enum.VERIFICATION,
|
|
4556
|
+
requireCompletionToContinue: true,
|
|
4529
4557
|
conditional: field("collector.requesterId").isEqualTo("INFORMANT"),
|
|
4530
4558
|
title: {
|
|
4531
4559
|
id: "event.tennis-club-membership.action.print.verifyIdentity",
|
|
@@ -6124,6 +6152,220 @@ var v2BirthEvent = defineConfig({
|
|
|
6124
6152
|
advancedSearch: []
|
|
6125
6153
|
});
|
|
6126
6154
|
|
|
6155
|
+
// ../commons/src/fixtures/digital-identity-issuance-event.ts
|
|
6156
|
+
var PRINT_DIGITAL_ID_CERTIFICATE_FORM = defineActionForm({
|
|
6157
|
+
label: {
|
|
6158
|
+
id: "event.digital-identity.action.certificate.form.label",
|
|
6159
|
+
defaultMessage: "Digital identity certificate printer",
|
|
6160
|
+
description: "This is what this form is referred as in the system"
|
|
6161
|
+
},
|
|
6162
|
+
pages: [
|
|
6163
|
+
{
|
|
6164
|
+
id: "collector",
|
|
6165
|
+
type: PageTypes.enum.FORM,
|
|
6166
|
+
title: {
|
|
6167
|
+
id: "event.tennis-club-membership.action.certificate.form.section.who.title",
|
|
6168
|
+
defaultMessage: "Print certified copy",
|
|
6169
|
+
description: "This is the title of the section"
|
|
6170
|
+
},
|
|
6171
|
+
fields: [
|
|
6172
|
+
{
|
|
6173
|
+
id: "identity.http-fetch",
|
|
6174
|
+
type: FieldType.HTTP,
|
|
6175
|
+
label: {
|
|
6176
|
+
defaultMessage: "Digital identity certificate",
|
|
6177
|
+
description: "Fetch printable digital identity certificate",
|
|
6178
|
+
id: "event.digital-identity.certificate.fetch.label"
|
|
6179
|
+
},
|
|
6180
|
+
configuration: {
|
|
6181
|
+
trigger: field("identity.http-button"),
|
|
6182
|
+
url: "/api/digital-identity/certificate",
|
|
6183
|
+
timeout: 5e3,
|
|
6184
|
+
method: "POST",
|
|
6185
|
+
headers: {
|
|
6186
|
+
"Content-Type": "application/json"
|
|
6187
|
+
},
|
|
6188
|
+
body: {
|
|
6189
|
+
subjectId: "$event.subject.id"
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
},
|
|
6193
|
+
{
|
|
6194
|
+
id: "identity.http-button",
|
|
6195
|
+
type: FieldType.BUTTON,
|
|
6196
|
+
label: {
|
|
6197
|
+
defaultMessage: "Certificate",
|
|
6198
|
+
description: "Certificate",
|
|
6199
|
+
id: "event.digital-identity.certificate.button.label"
|
|
6200
|
+
},
|
|
6201
|
+
conditionals: [
|
|
6202
|
+
{
|
|
6203
|
+
type: ConditionalType.ENABLE,
|
|
6204
|
+
conditional: and(
|
|
6205
|
+
field("identity.http-fetch").isUndefined(),
|
|
6206
|
+
user.isOnline()
|
|
6207
|
+
)
|
|
6208
|
+
},
|
|
6209
|
+
{
|
|
6210
|
+
type: ConditionalType.SHOW,
|
|
6211
|
+
conditional: and(
|
|
6212
|
+
field("identity.http-fetch").get("loading").isFalsy(),
|
|
6213
|
+
field("identity.http-fetch").get("data").isFalsy()
|
|
6214
|
+
)
|
|
6215
|
+
}
|
|
6216
|
+
],
|
|
6217
|
+
configuration: {
|
|
6218
|
+
icon: "IdentificationCard",
|
|
6219
|
+
text: {
|
|
6220
|
+
defaultMessage: "Fetch certificate",
|
|
6221
|
+
description: "Fetch certificate",
|
|
6222
|
+
id: "event.digital-identity.certificate.fetch.text"
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
},
|
|
6226
|
+
{
|
|
6227
|
+
id: "identity.http-button",
|
|
6228
|
+
type: FieldType.BUTTON,
|
|
6229
|
+
label: {
|
|
6230
|
+
defaultMessage: "Certificate",
|
|
6231
|
+
description: "Certificate",
|
|
6232
|
+
id: "event.digital-identity.certificate.button.label"
|
|
6233
|
+
},
|
|
6234
|
+
conditionals: [
|
|
6235
|
+
{
|
|
6236
|
+
type: ConditionalType.ENABLE,
|
|
6237
|
+
conditional: never()
|
|
6238
|
+
},
|
|
6239
|
+
{
|
|
6240
|
+
type: ConditionalType.SHOW,
|
|
6241
|
+
conditional: field("identity.http-fetch").get("loading").isEqualTo(true)
|
|
6242
|
+
}
|
|
6243
|
+
],
|
|
6244
|
+
configuration: {
|
|
6245
|
+
loading: true,
|
|
6246
|
+
text: {
|
|
6247
|
+
defaultMessage: "Fetching certificate\u2026",
|
|
6248
|
+
description: "Fetching certificate\u2026",
|
|
6249
|
+
id: "event.digital-identity.certificate.fetching.text"
|
|
6250
|
+
}
|
|
6251
|
+
}
|
|
6252
|
+
},
|
|
6253
|
+
{
|
|
6254
|
+
id: "identity.http-button",
|
|
6255
|
+
type: FieldType.BUTTON,
|
|
6256
|
+
label: {
|
|
6257
|
+
defaultMessage: "Certificate",
|
|
6258
|
+
description: "Certificate",
|
|
6259
|
+
id: "event.digital-identity.certificate.button.label"
|
|
6260
|
+
},
|
|
6261
|
+
conditionals: [
|
|
6262
|
+
{
|
|
6263
|
+
type: ConditionalType.ENABLE,
|
|
6264
|
+
conditional: never()
|
|
6265
|
+
},
|
|
6266
|
+
{
|
|
6267
|
+
type: ConditionalType.SHOW,
|
|
6268
|
+
conditional: not(field("identity.certificateId").isFalsy())
|
|
6269
|
+
}
|
|
6270
|
+
],
|
|
6271
|
+
configuration: {
|
|
6272
|
+
icon: "Check",
|
|
6273
|
+
text: {
|
|
6274
|
+
defaultMessage: "Certificate ready",
|
|
6275
|
+
description: "Certificate ready",
|
|
6276
|
+
id: "event.digital-identity.certificate.ready.text"
|
|
6277
|
+
}
|
|
6278
|
+
}
|
|
6279
|
+
},
|
|
6280
|
+
{
|
|
6281
|
+
id: "identity.certificateId",
|
|
6282
|
+
type: FieldType.TEXT,
|
|
6283
|
+
parent: field("identity.http-fetch"),
|
|
6284
|
+
label: {
|
|
6285
|
+
defaultMessage: "Certificate ID",
|
|
6286
|
+
description: "Issued digital identity certificate identifier",
|
|
6287
|
+
id: "event.digital-identity.certificate.id.label"
|
|
6288
|
+
},
|
|
6289
|
+
conditionals: [
|
|
6290
|
+
{
|
|
6291
|
+
type: ConditionalType.ENABLE,
|
|
6292
|
+
conditional: never()
|
|
6293
|
+
}
|
|
6294
|
+
],
|
|
6295
|
+
value: field("identity.http-fetch").get("data.certificateId")
|
|
6296
|
+
}
|
|
6297
|
+
]
|
|
6298
|
+
}
|
|
6299
|
+
]
|
|
6300
|
+
});
|
|
6301
|
+
var digitalIdentityForm = defineDeclarationForm({
|
|
6302
|
+
label: {
|
|
6303
|
+
id: "event.digital-identity.action.declare.form.label",
|
|
6304
|
+
defaultMessage: "Digital identity issuance",
|
|
6305
|
+
description: "This is what this form is referred as in the system"
|
|
6306
|
+
},
|
|
6307
|
+
pages: [
|
|
6308
|
+
{
|
|
6309
|
+
id: "subject",
|
|
6310
|
+
title: {
|
|
6311
|
+
id: "event.digital-identity.action.declare.form.section.who.title",
|
|
6312
|
+
defaultMessage: "Who is the digital identity issued to?",
|
|
6313
|
+
description: "This is the title of the section"
|
|
6314
|
+
},
|
|
6315
|
+
fields: [
|
|
6316
|
+
{
|
|
6317
|
+
id: "subject.firstname",
|
|
6318
|
+
type: FieldType.TEXT,
|
|
6319
|
+
required: true,
|
|
6320
|
+
conditionals: [],
|
|
6321
|
+
label: {
|
|
6322
|
+
defaultMessage: "Subject's first name",
|
|
6323
|
+
description: "This is the label for the field",
|
|
6324
|
+
id: "event.digital-identity.action.declare.form.section.who.field.firstname.label"
|
|
6325
|
+
}
|
|
6326
|
+
},
|
|
6327
|
+
{
|
|
6328
|
+
id: "subject.surname",
|
|
6329
|
+
type: FieldType.TEXT,
|
|
6330
|
+
required: true,
|
|
6331
|
+
conditionals: [],
|
|
6332
|
+
label: {
|
|
6333
|
+
defaultMessage: "Subject's surname",
|
|
6334
|
+
description: "This is the label for the field",
|
|
6335
|
+
id: "event.digital-identity.action.declare.form.section.who.field.surname.label"
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
]
|
|
6339
|
+
}
|
|
6340
|
+
]
|
|
6341
|
+
});
|
|
6342
|
+
var digitalIdentityEvent = defineConfig({
|
|
6343
|
+
id: "digital-identity",
|
|
6344
|
+
label: {
|
|
6345
|
+
defaultMessage: "Digital identity issuance",
|
|
6346
|
+
description: "This is what this event is referred as in the system",
|
|
6347
|
+
id: "event.digital-identity.label"
|
|
6348
|
+
},
|
|
6349
|
+
title: {
|
|
6350
|
+
defaultMessage: "{subject.firstname} {subject.surname}",
|
|
6351
|
+
description: "This is the title of the summary",
|
|
6352
|
+
id: "event.digital-identity.title"
|
|
6353
|
+
},
|
|
6354
|
+
summary: { fields: [] },
|
|
6355
|
+
actions: [
|
|
6356
|
+
{
|
|
6357
|
+
type: ActionType.PRINT_CERTIFICATE,
|
|
6358
|
+
label: {
|
|
6359
|
+
id: "event.football-club-membership.action.collect-certificate.label",
|
|
6360
|
+
defaultMessage: "Print certificate",
|
|
6361
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
|
6362
|
+
},
|
|
6363
|
+
printForm: PRINT_DIGITAL_ID_CERTIFICATE_FORM
|
|
6364
|
+
}
|
|
6365
|
+
],
|
|
6366
|
+
declaration: digitalIdentityForm
|
|
6367
|
+
});
|
|
6368
|
+
|
|
6127
6369
|
// ../commons/src/events/test.utils.ts
|
|
6128
6370
|
var import_zod35 = require("zod");
|
|
6129
6371
|
var TestUserRole = import_zod35.z.enum([
|