@opencrvs/toolkit 1.8.1-rc.6c27961 → 1.8.1-rc.6eacccb
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 +391 -390
- package/dist/commons/conditionals/validate.d.ts +11 -2
- package/dist/commons/events/ActionConfig.d.ts +2730 -532
- package/dist/commons/events/ActionDocument.d.ts +736 -736
- package/dist/commons/events/ActionInput.d.ts +600 -600
- package/dist/commons/events/AdvancedSearchConfig.d.ts +49 -31
- package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
- package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
- package/dist/commons/events/DeduplicationConfig.d.ts +21 -48
- package/dist/commons/events/Draft.d.ts +48 -48
- package/dist/commons/events/EventConfig.d.ts +1009 -195
- package/dist/commons/events/EventDocument.d.ts +432 -432
- package/dist/commons/events/EventIndex.d.ts +62 -62
- package/dist/commons/events/EventMetadata.d.ts +9 -9
- package/dist/commons/events/FieldConfig.d.ts +254 -43
- package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/FormConfig.d.ts +1032 -246
- package/dist/commons/events/PageConfig.d.ts +264 -46
- package/dist/commons/events/WorkqueueConfig.d.ts +199 -164
- package/dist/commons/events/defineConfig.d.ts +187 -33
- package/dist/commons/events/event.d.ts +61 -7
- package/dist/commons/events/test.utils.d.ts +12 -12
- package/dist/commons/events/utils.d.ts +294 -63
- package/dist/conditionals/index.js +3 -2
- package/dist/events/index.js +383 -257
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
@@ -40,6 +40,7 @@ __export(events_exports, {
|
|
40
40
|
ActionConfigBase: () => ActionConfigBase,
|
41
41
|
ActionCreationMetadata: () => ActionCreationMetadata,
|
42
42
|
ActionDocument: () => ActionDocument,
|
43
|
+
ActionFlag: () => ActionFlag,
|
43
44
|
ActionFormConfig: () => ActionFormConfig,
|
44
45
|
ActionInput: () => ActionInput,
|
45
46
|
ActionStatus: () => ActionStatus,
|
@@ -95,6 +96,7 @@ __export(events_exports, {
|
|
95
96
|
EventDocument: () => EventDocument,
|
96
97
|
EventFieldConfigSchema: () => EventFieldConfigSchema,
|
97
98
|
EventFieldId: () => EventFieldId,
|
99
|
+
EventFieldIdInput: () => EventFieldIdInput,
|
98
100
|
EventIndex: () => EventIndex,
|
99
101
|
EventInput: () => EventInput,
|
100
102
|
EventMetadata: () => EventMetadata,
|
@@ -129,8 +131,10 @@ __export(events_exports, {
|
|
129
131
|
InherentFlags: () => InherentFlags,
|
130
132
|
LanguageConfig: () => LanguageConfig,
|
131
133
|
LegalStatuses: () => LegalStatuses,
|
134
|
+
METADATA_FIELD_PREFIX: () => METADATA_FIELD_PREFIX,
|
132
135
|
MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
|
133
136
|
MimeType: () => MimeType,
|
137
|
+
NameConfig: () => NameConfig,
|
134
138
|
NameFieldUpdateValue: () => NameFieldUpdateValue,
|
135
139
|
NameFieldValue: () => NameFieldValue,
|
136
140
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
@@ -168,6 +172,7 @@ __export(events_exports, {
|
|
168
172
|
TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
|
169
173
|
TEST_SYSTEM_IANA_TIMEZONE: () => TEST_SYSTEM_IANA_TIMEZONE,
|
170
174
|
TestUserRole: () => TestUserRole,
|
175
|
+
TextField: () => TextField,
|
171
176
|
TextValue: () => TextValue,
|
172
177
|
TimeValue: () => TimeValue,
|
173
178
|
TranslationConfig: () => TranslationConfig,
|
@@ -179,7 +184,6 @@ __export(events_exports, {
|
|
179
184
|
ValidationConfig: () => ValidationConfig,
|
180
185
|
VerificationActionConfig: () => VerificationActionConfig,
|
181
186
|
VerificationPageConfig: () => VerificationPageConfig,
|
182
|
-
VisibleStatus: () => VisibleStatus,
|
183
187
|
WRITE_ACTION_SCOPES: () => WRITE_ACTION_SCOPES,
|
184
188
|
Within: () => Within,
|
185
189
|
WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
|
@@ -198,6 +202,7 @@ __export(events_exports, {
|
|
198
202
|
annotationActions: () => annotationActions,
|
199
203
|
applyDeclarationToEventIndex: () => applyDeclarationToEventIndex,
|
200
204
|
applyDraftsToEventIndex: () => applyDraftsToEventIndex,
|
205
|
+
areCertificateConditionsMet: () => areCertificateConditionsMet,
|
201
206
|
areConditionsMet: () => areConditionsMet,
|
202
207
|
compositeFieldTypes: () => compositeFieldTypes,
|
203
208
|
createEmptyDraft: () => createEmptyDraft,
|
@@ -321,6 +326,7 @@ __export(events_exports, {
|
|
321
326
|
or: () => or,
|
322
327
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
323
328
|
runFieldValidations: () => runFieldValidations,
|
329
|
+
runStructuralValidations: () => runStructuralValidations,
|
324
330
|
timePeriodToDateRange: () => timePeriodToDateRange,
|
325
331
|
user: () => user,
|
326
332
|
validate: () => validate,
|
@@ -335,7 +341,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
|
335
341
|
var BIRTH_EVENT = "v2-birth";
|
336
342
|
|
337
343
|
// ../commons/src/events/ActionConfig.ts
|
338
|
-
var
|
344
|
+
var import_zod11 = require("zod");
|
339
345
|
|
340
346
|
// ../commons/src/events/Conditional.ts
|
341
347
|
var import_zod = require("zod");
|
@@ -555,7 +561,7 @@ var import_zod6 = require("zod");
|
|
555
561
|
var import_zod4 = require("zod");
|
556
562
|
var import_zod_openapi3 = require("zod-openapi");
|
557
563
|
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod4.z);
|
558
|
-
var
|
564
|
+
var FullDocumentUrl = import_zod4.z.string().brand("FullDocumentUrl").describe(
|
559
565
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio/bucket-name/document-id.jpg"
|
560
566
|
);
|
561
567
|
var FullDocumentPath = import_zod4.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
@@ -607,13 +613,13 @@ var UrbanAddressUpdateValue = AdminStructure.extend({
|
|
607
613
|
zipCode: import_zod5.z.string().nullish()
|
608
614
|
});
|
609
615
|
var NameFieldValue = import_zod5.z.object({
|
610
|
-
firstname: import_zod5.z.string()
|
611
|
-
surname: import_zod5.z.string()
|
616
|
+
firstname: import_zod5.z.string(),
|
617
|
+
surname: import_zod5.z.string(),
|
612
618
|
middlename: import_zod5.z.string().optional()
|
613
619
|
});
|
614
620
|
var NameFieldUpdateValue = import_zod5.z.object({
|
615
|
-
firstname: import_zod5.z.string()
|
616
|
-
surname: import_zod5.z.string()
|
621
|
+
firstname: import_zod5.z.string(),
|
622
|
+
surname: import_zod5.z.string(),
|
617
623
|
middlename: import_zod5.z.string().nullish()
|
618
624
|
}).or(import_zod5.z.null()).or(import_zod5.z.undefined());
|
619
625
|
var RuralAddressUpdateValue = AdminStructure.extend({
|
@@ -910,18 +916,32 @@ var SelectDateRangeField = BaseField.extend({
|
|
910
916
|
defaultValue: SelectDateRangeValue.optional(),
|
911
917
|
options: import_zod7.z.array(SelectDateRangeOption).describe("A list of options")
|
912
918
|
}).describe("Select input with date range options");
|
919
|
+
var NameConfig = import_zod7.z.object({
|
920
|
+
firstname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
|
921
|
+
middlename: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
|
922
|
+
surname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional()
|
923
|
+
});
|
913
924
|
var NameField = BaseField.extend({
|
914
925
|
type: import_zod7.z.literal(FieldType.NAME),
|
915
926
|
defaultValue: import_zod7.z.object({
|
916
|
-
firstname: NonEmptyTextValue,
|
917
|
-
|
927
|
+
firstname: NonEmptyTextValue.optional(),
|
928
|
+
middlename: NonEmptyTextValue.optional(),
|
929
|
+
surname: NonEmptyTextValue.optional()
|
918
930
|
}).optional(),
|
919
931
|
configuration: import_zod7.z.object({
|
932
|
+
name: NameConfig.default({
|
933
|
+
firstname: { required: true },
|
934
|
+
surname: { required: true }
|
935
|
+
}).optional(),
|
920
936
|
maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
|
921
937
|
prefix: TranslationConfig.optional(),
|
922
938
|
postfix: TranslationConfig.optional(),
|
923
|
-
includeMiddlename: import_zod7.z.boolean().default(false).optional().describe("To make middle name visible in Name form field"),
|
924
939
|
searchMode: import_zod7.z.boolean().optional()
|
940
|
+
}).default({
|
941
|
+
name: {
|
942
|
+
firstname: { required: true },
|
943
|
+
surname: { required: true }
|
944
|
+
}
|
925
945
|
}).optional()
|
926
946
|
}).describe("Name input field");
|
927
947
|
var PhoneField = BaseField.extend({
|
@@ -1094,91 +1114,168 @@ var ActionFormConfig = import_zod9.z.object({
|
|
1094
1114
|
});
|
1095
1115
|
var FormConfig = import_zod9.z.union([DeclarationFormConfig, ActionFormConfig]);
|
1096
1116
|
|
1097
|
-
// ../commons/src/events/
|
1117
|
+
// ../commons/src/events/DeduplicationConfig.ts
|
1118
|
+
var import_zod10 = require("zod");
|
1098
1119
|
var import_zod_openapi6 = require("zod-openapi");
|
1099
1120
|
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod10.z);
|
1100
|
-
var
|
1121
|
+
var FieldReference2 = import_zod10.z.string();
|
1122
|
+
var Matcher = import_zod10.z.object({
|
1123
|
+
/**
|
1124
|
+
* The reference to the field to match against.
|
1125
|
+
*
|
1126
|
+
* For `dateDistance` type matcher the value of this field will
|
1127
|
+
* be used as the origin date to calculate the distance from.
|
1128
|
+
*/
|
1129
|
+
fieldId: FieldReference2,
|
1130
|
+
options: import_zod10.z.object({
|
1131
|
+
boost: import_zod10.z.number().optional()
|
1132
|
+
}).optional().default({
|
1133
|
+
boost: 1
|
1134
|
+
})
|
1135
|
+
});
|
1136
|
+
var FuzzyMatcher = Matcher.extend({
|
1137
|
+
type: import_zod10.z.literal("fuzzy"),
|
1138
|
+
options: import_zod10.z.object({
|
1139
|
+
/**
|
1140
|
+
* Names of length 3 or less characters = 0 edits allowed
|
1141
|
+
* Names of length 4 - 6 characters = 1 edit allowed
|
1142
|
+
* Names of length >7 characters = 2 edits allowed
|
1143
|
+
*/
|
1144
|
+
fuzziness: import_zod10.z.union([import_zod10.z.string(), import_zod10.z.number()]).optional().default("AUTO:4,7"),
|
1145
|
+
boost: import_zod10.z.number().optional().default(1)
|
1146
|
+
}).optional().default({
|
1147
|
+
fuzziness: "AUTO:4,7",
|
1148
|
+
boost: 1
|
1149
|
+
})
|
1150
|
+
});
|
1151
|
+
var StrictMatcher = Matcher.extend({
|
1152
|
+
type: import_zod10.z.literal("strict"),
|
1153
|
+
options: import_zod10.z.object({
|
1154
|
+
boost: import_zod10.z.number().optional().default(1)
|
1155
|
+
}).optional().default({
|
1156
|
+
boost: 1
|
1157
|
+
})
|
1158
|
+
});
|
1159
|
+
var DateDistanceMatcher = Matcher.extend({
|
1160
|
+
type: import_zod10.z.literal("dateDistance"),
|
1161
|
+
options: import_zod10.z.object({
|
1162
|
+
days: import_zod10.z.number(),
|
1163
|
+
boost: import_zod10.z.number().optional().default(1)
|
1164
|
+
})
|
1165
|
+
});
|
1166
|
+
var And = import_zod10.z.object({
|
1167
|
+
type: import_zod10.z.literal("and"),
|
1168
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1169
|
+
clauses: import_zod10.z.lazy(() => Clause.array())
|
1170
|
+
});
|
1171
|
+
var Or = import_zod10.z.object({
|
1172
|
+
type: import_zod10.z.literal("or"),
|
1173
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1174
|
+
clauses: import_zod10.z.lazy(() => Clause.array())
|
1175
|
+
});
|
1176
|
+
var Clause = import_zod10.z.lazy(
|
1177
|
+
() => import_zod10.z.discriminatedUnion("type", [
|
1178
|
+
And,
|
1179
|
+
Or,
|
1180
|
+
FuzzyMatcher,
|
1181
|
+
StrictMatcher,
|
1182
|
+
DateDistanceMatcher
|
1183
|
+
])
|
1184
|
+
).openapi({
|
1185
|
+
ref: "Clause"
|
1186
|
+
});
|
1187
|
+
var DeduplicationConfig = import_zod10.z.object({
|
1188
|
+
id: import_zod10.z.string(),
|
1189
|
+
label: TranslationConfig,
|
1190
|
+
query: Clause
|
1191
|
+
});
|
1192
|
+
|
1193
|
+
// ../commons/src/events/ActionConfig.ts
|
1194
|
+
var import_zod_openapi7 = require("zod-openapi");
|
1195
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod11.z);
|
1196
|
+
var ActionConditional2 = import_zod11.z.discriminatedUnion("type", [
|
1101
1197
|
/** If conditional is defined, the action is shown to the user only if the condition is met */
|
1102
1198
|
ShowConditional,
|
1103
1199
|
/** If conditional is defined, the action is enabled only if the condition is met */
|
1104
1200
|
EnableConditional
|
1105
1201
|
]);
|
1106
|
-
var DeclarationReviewConfig =
|
1202
|
+
var DeclarationReviewConfig = import_zod11.z.object({
|
1107
1203
|
title: TranslationConfig.describe("Title of the review page"),
|
1108
|
-
fields:
|
1204
|
+
fields: import_zod11.z.array(FieldConfig).describe("Fields to be rendered on the review page for annotations.")
|
1109
1205
|
}).describe("Configuration for **declaration** review page.");
|
1110
|
-
var ActionConfigBase =
|
1206
|
+
var ActionConfigBase = import_zod11.z.object({
|
1111
1207
|
label: TranslationConfig,
|
1112
|
-
conditionals:
|
1113
|
-
|
1208
|
+
conditionals: import_zod11.z.array(ActionConditional2).optional().default([]),
|
1209
|
+
deduplication: DeduplicationConfig.optional(),
|
1210
|
+
draft: import_zod11.z.boolean().optional()
|
1114
1211
|
});
|
1115
1212
|
var ReadActionConfig = ActionConfigBase.merge(
|
1116
|
-
|
1117
|
-
type:
|
1213
|
+
import_zod11.z.object({
|
1214
|
+
type: import_zod11.z.literal(ActionType.READ),
|
1118
1215
|
review: DeclarationReviewConfig
|
1119
1216
|
})
|
1120
1217
|
);
|
1121
1218
|
var DeclareConfig = ActionConfigBase.merge(
|
1122
|
-
|
1123
|
-
type:
|
1219
|
+
import_zod11.z.object({
|
1220
|
+
type: import_zod11.z.literal(ActionType.DECLARE),
|
1124
1221
|
review: DeclarationReviewConfig
|
1125
1222
|
})
|
1126
1223
|
);
|
1127
1224
|
var ValidateConfig = ActionConfigBase.merge(
|
1128
|
-
|
1129
|
-
type:
|
1225
|
+
import_zod11.z.object({
|
1226
|
+
type: import_zod11.z.literal(ActionType.VALIDATE),
|
1130
1227
|
review: DeclarationReviewConfig
|
1131
1228
|
})
|
1132
1229
|
);
|
1133
1230
|
var RegisterConfig = ActionConfigBase.merge(
|
1134
|
-
|
1135
|
-
type:
|
1231
|
+
import_zod11.z.object({
|
1232
|
+
type: import_zod11.z.literal(ActionType.REGISTER),
|
1136
1233
|
review: DeclarationReviewConfig
|
1137
1234
|
})
|
1138
1235
|
);
|
1139
1236
|
var RejectDeclarationConfig = ActionConfigBase.merge(
|
1140
|
-
|
1141
|
-
type:
|
1237
|
+
import_zod11.z.object({
|
1238
|
+
type: import_zod11.z.literal(ActionType.REJECT)
|
1142
1239
|
})
|
1143
1240
|
);
|
1144
1241
|
var MarkedAsDuplicateConfig = ActionConfigBase.merge(
|
1145
|
-
|
1146
|
-
type:
|
1242
|
+
import_zod11.z.object({
|
1243
|
+
type: import_zod11.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1147
1244
|
})
|
1148
1245
|
);
|
1149
1246
|
var ArchiveConfig = ActionConfigBase.merge(
|
1150
|
-
|
1151
|
-
type:
|
1247
|
+
import_zod11.z.object({
|
1248
|
+
type: import_zod11.z.literal(ActionType.ARCHIVE)
|
1152
1249
|
})
|
1153
1250
|
);
|
1154
1251
|
var DeleteConfig = ActionConfigBase.merge(
|
1155
|
-
|
1156
|
-
type:
|
1252
|
+
import_zod11.z.object({
|
1253
|
+
type: import_zod11.z.literal(ActionType.DELETE)
|
1157
1254
|
})
|
1158
1255
|
);
|
1159
1256
|
var PrintCertificateActionConfig = ActionConfigBase.merge(
|
1160
|
-
|
1161
|
-
type:
|
1257
|
+
import_zod11.z.object({
|
1258
|
+
type: import_zod11.z.literal(ActionType.PRINT_CERTIFICATE),
|
1162
1259
|
printForm: ActionFormConfig
|
1163
1260
|
})
|
1164
1261
|
);
|
1165
1262
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
1166
|
-
|
1167
|
-
type:
|
1263
|
+
import_zod11.z.object({
|
1264
|
+
type: import_zod11.z.literal(ActionType.REQUEST_CORRECTION),
|
1168
1265
|
correctionForm: ActionFormConfig
|
1169
1266
|
})
|
1170
1267
|
);
|
1171
1268
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
1172
|
-
|
1173
|
-
type:
|
1269
|
+
import_zod11.z.object({
|
1270
|
+
type: import_zod11.z.literal(ActionType.REJECT_CORRECTION)
|
1174
1271
|
})
|
1175
1272
|
);
|
1176
1273
|
var ApproveCorrectionConfig = ActionConfigBase.merge(
|
1177
|
-
|
1178
|
-
type:
|
1274
|
+
import_zod11.z.object({
|
1275
|
+
type: import_zod11.z.literal(ActionType.APPROVE_CORRECTION)
|
1179
1276
|
})
|
1180
1277
|
);
|
1181
|
-
var ActionConfig =
|
1278
|
+
var ActionConfig = import_zod11.z.discriminatedUnion("type", [
|
1182
1279
|
/*
|
1183
1280
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
1184
1281
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
@@ -1198,124 +1295,52 @@ var ActionConfig = import_zod10.z.discriminatedUnion("type", [
|
|
1198
1295
|
RejectCorrectionConfig.openapi({ ref: "RejectCorrectionActionConfig" }),
|
1199
1296
|
ApproveCorrectionConfig.openapi({ ref: "ApproveCorrectionActionConfig" })
|
1200
1297
|
]).openapi({ ref: "ActionConfig" });
|
1201
|
-
var DeclarationActionConfig =
|
1298
|
+
var DeclarationActionConfig = import_zod11.z.discriminatedUnion("type", [
|
1202
1299
|
DeclareConfig,
|
1203
1300
|
ValidateConfig,
|
1204
1301
|
RegisterConfig
|
1205
1302
|
]);
|
1206
1303
|
|
1207
1304
|
// ../commons/src/events/offline/CertificateConfig.ts
|
1208
|
-
var
|
1209
|
-
var FontFamily =
|
1210
|
-
normal:
|
1211
|
-
bold:
|
1212
|
-
italics:
|
1213
|
-
bolditalics:
|
1305
|
+
var import_zod12 = require("zod");
|
1306
|
+
var FontFamily = import_zod12.z.object({
|
1307
|
+
normal: import_zod12.z.string(),
|
1308
|
+
bold: import_zod12.z.string(),
|
1309
|
+
italics: import_zod12.z.string(),
|
1310
|
+
bolditalics: import_zod12.z.string()
|
1214
1311
|
});
|
1215
|
-
var CertificateConfig =
|
1216
|
-
id:
|
1217
|
-
event:
|
1312
|
+
var CertificateConfig = import_zod12.z.object({
|
1313
|
+
id: import_zod12.z.string(),
|
1314
|
+
event: import_zod12.z.string(),
|
1218
1315
|
label: TranslationConfig,
|
1219
|
-
isDefault:
|
1220
|
-
fee:
|
1221
|
-
onTime:
|
1222
|
-
late:
|
1223
|
-
delayed:
|
1316
|
+
isDefault: import_zod12.z.boolean(),
|
1317
|
+
fee: import_zod12.z.object({
|
1318
|
+
onTime: import_zod12.z.number(),
|
1319
|
+
late: import_zod12.z.number(),
|
1320
|
+
delayed: import_zod12.z.number()
|
1224
1321
|
}),
|
1225
|
-
svgUrl:
|
1226
|
-
fonts:
|
1322
|
+
svgUrl: import_zod12.z.string(),
|
1323
|
+
fonts: import_zod12.z.record(FontFamily).optional(),
|
1324
|
+
conditionals: import_zod12.z.array(ShowConditional).optional()
|
1227
1325
|
});
|
1228
1326
|
var CertificateTemplateConfig = CertificateConfig.extend({
|
1229
|
-
hash:
|
1230
|
-
svg:
|
1327
|
+
hash: import_zod12.z.string().optional(),
|
1328
|
+
svg: import_zod12.z.string()
|
1231
1329
|
});
|
1232
1330
|
|
1233
1331
|
// ../commons/src/events/offline/LanguageConfig.ts
|
1234
|
-
var
|
1235
|
-
var LanguageConfig =
|
1236
|
-
lang:
|
1332
|
+
var import_zod13 = require("zod");
|
1333
|
+
var LanguageConfig = import_zod13.z.object({
|
1334
|
+
lang: import_zod13.z.string(),
|
1237
1335
|
/**
|
1238
1336
|
* client.csv contents
|
1239
1337
|
*/
|
1240
|
-
messages:
|
1338
|
+
messages: import_zod13.z.record(import_zod13.z.string())
|
1241
1339
|
});
|
1242
1340
|
|
1243
1341
|
// ../commons/src/events/EventConfig.ts
|
1244
1342
|
var import_zod21 = require("zod");
|
1245
1343
|
|
1246
|
-
// ../commons/src/events/DeduplicationConfig.ts
|
1247
|
-
var import_zod13 = require("zod");
|
1248
|
-
var import_zod_openapi7 = require("zod-openapi");
|
1249
|
-
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod13.z);
|
1250
|
-
var FieldReference2 = import_zod13.z.string();
|
1251
|
-
var Matcher = import_zod13.z.object({
|
1252
|
-
fieldId: import_zod13.z.string(),
|
1253
|
-
options: import_zod13.z.object({
|
1254
|
-
boost: import_zod13.z.number().optional()
|
1255
|
-
}).optional().default({})
|
1256
|
-
});
|
1257
|
-
var FuzzyMatcher = Matcher.extend({
|
1258
|
-
type: import_zod13.z.literal("fuzzy"),
|
1259
|
-
options: import_zod13.z.object({
|
1260
|
-
/**
|
1261
|
-
* Names of length 3 or less characters = 0 edits allowed
|
1262
|
-
* Names of length 4 - 6 characters = 1 edit allowed
|
1263
|
-
* Names of length >7 characters = 2 edits allowed
|
1264
|
-
*/
|
1265
|
-
fuzziness: import_zod13.z.union([import_zod13.z.string(), import_zod13.z.number()]).optional().default("AUTO:4,7"),
|
1266
|
-
boost: import_zod13.z.number().optional().default(1)
|
1267
|
-
}).optional().default({})
|
1268
|
-
});
|
1269
|
-
var StrictMatcher = Matcher.extend({
|
1270
|
-
type: import_zod13.z.literal("strict"),
|
1271
|
-
options: import_zod13.z.object({
|
1272
|
-
boost: import_zod13.z.number().optional().default(1)
|
1273
|
-
}).optional().default({})
|
1274
|
-
});
|
1275
|
-
var DateRangeMatcher = Matcher.extend({
|
1276
|
-
type: import_zod13.z.literal("dateRange"),
|
1277
|
-
options: import_zod13.z.object({
|
1278
|
-
days: import_zod13.z.number(),
|
1279
|
-
origin: FieldReference2,
|
1280
|
-
boost: import_zod13.z.number().optional().default(1)
|
1281
|
-
})
|
1282
|
-
});
|
1283
|
-
var DateDistanceMatcher = Matcher.extend({
|
1284
|
-
type: import_zod13.z.literal("dateDistance"),
|
1285
|
-
options: import_zod13.z.object({
|
1286
|
-
days: import_zod13.z.number(),
|
1287
|
-
origin: FieldReference2,
|
1288
|
-
boost: import_zod13.z.number().optional().default(1)
|
1289
|
-
})
|
1290
|
-
});
|
1291
|
-
var And = import_zod13.z.object({
|
1292
|
-
type: import_zod13.z.literal("and"),
|
1293
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1294
|
-
clauses: import_zod13.z.lazy(() => Clause.array())
|
1295
|
-
});
|
1296
|
-
var Or = import_zod13.z.object({
|
1297
|
-
type: import_zod13.z.literal("or"),
|
1298
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
1299
|
-
clauses: import_zod13.z.lazy(() => Clause.array())
|
1300
|
-
});
|
1301
|
-
var Clause = import_zod13.z.lazy(
|
1302
|
-
() => import_zod13.z.discriminatedUnion("type", [
|
1303
|
-
And,
|
1304
|
-
Or,
|
1305
|
-
FuzzyMatcher,
|
1306
|
-
StrictMatcher,
|
1307
|
-
DateRangeMatcher,
|
1308
|
-
DateDistanceMatcher
|
1309
|
-
])
|
1310
|
-
).openapi({
|
1311
|
-
ref: "Clause"
|
1312
|
-
});
|
1313
|
-
var DeduplicationConfig = import_zod13.z.object({
|
1314
|
-
id: import_zod13.z.string(),
|
1315
|
-
label: TranslationConfig,
|
1316
|
-
query: Clause
|
1317
|
-
});
|
1318
|
-
|
1319
1344
|
// ../commons/src/events/SummaryConfig.ts
|
1320
1345
|
var import_zod14 = require("zod");
|
1321
1346
|
var BaseField2 = import_zod14.z.object({
|
@@ -1395,22 +1420,30 @@ var FieldConfigSchema = BaseField3.extend({
|
|
1395
1420
|
fieldType: import_zod15.z.literal("field"),
|
1396
1421
|
alternateFieldIds: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
1397
1422
|
`Sometimes there might be need to search a value against multiple field of same FormField type. For example
|
1398
|
-
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1423
|
+
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1399
1424
|
add a one field as fieldId, and accomodate others in alternateFieldIds`
|
1400
1425
|
),
|
1401
|
-
excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
|
1402
|
-
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1426
|
+
excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
|
1427
|
+
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1403
1428
|
is select field, which has 3 options, FACILITY, PRIVATE_HOME, OTHER. Upon selecting any of the option, pops up another field
|
1404
1429
|
related to the selected option, whose value is required in the search query. But child.placeOfBirth itself is not needed in the query.
|
1405
1430
|
In such case, populate this field (excludeInSearchQuery) with boolean true`)
|
1406
1431
|
});
|
1407
|
-
var
|
1432
|
+
var EventFieldIdInput = import_zod15.z.enum([
|
1408
1433
|
"trackingId",
|
1409
1434
|
"status",
|
1410
1435
|
"legalStatuses.REGISTERED.acceptedAt",
|
1411
1436
|
"legalStatuses.REGISTERED.createdAtLocation",
|
1412
1437
|
"updatedAt"
|
1413
1438
|
]);
|
1439
|
+
var METADATA_FIELD_PREFIX = "event.";
|
1440
|
+
var EventFieldId = import_zod15.z.enum([
|
1441
|
+
`${METADATA_FIELD_PREFIX}trackingId`,
|
1442
|
+
`${METADATA_FIELD_PREFIX}status`,
|
1443
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
1444
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
1445
|
+
`${METADATA_FIELD_PREFIX}updatedAt`
|
1446
|
+
]);
|
1414
1447
|
var EventFieldConfigSchema = BaseField3.extend({
|
1415
1448
|
fieldId: EventFieldId,
|
1416
1449
|
fieldType: import_zod15.z.literal("event")
|
@@ -2045,7 +2078,7 @@ var ResolvedUser = import_zod19.z.object({
|
|
2045
2078
|
});
|
2046
2079
|
|
2047
2080
|
// ../commons/src/conditionals/validate.ts
|
2048
|
-
var
|
2081
|
+
var import__ = __toESM(require("ajv/dist/2019"));
|
2049
2082
|
var import_ajv_formats = __toESM(require("ajv-formats"));
|
2050
2083
|
var import_date_fns = require("date-fns");
|
2051
2084
|
|
@@ -2259,9 +2292,11 @@ var isNonInteractiveFieldType = (field2) => {
|
|
2259
2292
|
};
|
2260
2293
|
|
2261
2294
|
// ../commons/src/conditionals/validate.ts
|
2262
|
-
var ajv = new
|
2295
|
+
var ajv = new import__.default({
|
2263
2296
|
$data: true,
|
2264
|
-
allowUnionTypes: true
|
2297
|
+
allowUnionTypes: true,
|
2298
|
+
strict: false
|
2299
|
+
// Allow minContains and other newer features
|
2265
2300
|
});
|
2266
2301
|
(0, import_ajv_formats.default)(ajv);
|
2267
2302
|
ajv.addKeyword({
|
@@ -2434,6 +2469,23 @@ function validateFieldInput({
|
|
2434
2469
|
const rawError = zodType.safeParse(value, { errorMap: zodToIntlErrorMap });
|
2435
2470
|
return rawError.error?.issues.map((issue) => issue.message) ?? [];
|
2436
2471
|
}
|
2472
|
+
function runStructuralValidations({
|
2473
|
+
field: field2,
|
2474
|
+
values
|
2475
|
+
}) {
|
2476
|
+
if (!isFieldVisible(field2, values) || isFieldEmptyAndNotRequired(field2, values)) {
|
2477
|
+
return {
|
2478
|
+
errors: []
|
2479
|
+
};
|
2480
|
+
}
|
2481
|
+
const fieldValidationResult = validateFieldInput({
|
2482
|
+
field: field2,
|
2483
|
+
value: values[field2.id]
|
2484
|
+
});
|
2485
|
+
return {
|
2486
|
+
errors: fieldValidationResult
|
2487
|
+
};
|
2488
|
+
}
|
2437
2489
|
function runFieldValidations({
|
2438
2490
|
field: field2,
|
2439
2491
|
values
|
@@ -2499,6 +2551,11 @@ function getValidatorsForField(fieldId, validations) {
|
|
2499
2551
|
};
|
2500
2552
|
}).filter((x) => x !== null);
|
2501
2553
|
}
|
2554
|
+
function areCertificateConditionsMet(conditions, values) {
|
2555
|
+
return conditions.every((condition) => {
|
2556
|
+
return ajv.validate(condition.conditional, values);
|
2557
|
+
});
|
2558
|
+
}
|
2502
2559
|
|
2503
2560
|
// ../commons/src/utils.ts
|
2504
2561
|
function getOrThrow(x, message) {
|
@@ -2719,16 +2776,16 @@ function timePeriodToDateRange(value) {
|
|
2719
2776
|
let startDate;
|
2720
2777
|
switch (value) {
|
2721
2778
|
case "last7Days":
|
2722
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2779
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7);
|
2723
2780
|
break;
|
2724
2781
|
case "last30Days":
|
2725
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2782
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 30);
|
2726
2783
|
break;
|
2727
2784
|
case "last90Days":
|
2728
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2785
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 90);
|
2729
2786
|
break;
|
2730
2787
|
case "last365Days":
|
2731
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2788
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 365);
|
2732
2789
|
break;
|
2733
2790
|
}
|
2734
2791
|
return {
|
@@ -2753,7 +2810,6 @@ var EventConfig = import_zod21.z.object({
|
|
2753
2810
|
label: TranslationConfig,
|
2754
2811
|
actions: import_zod21.z.array(ActionConfig),
|
2755
2812
|
declaration: DeclarationFormConfig,
|
2756
|
-
deduplication: import_zod21.z.array(DeduplicationConfig).optional().default([]),
|
2757
2813
|
advancedSearch: import_zod21.z.array(AdvancedSearchConfig).optional().default([])
|
2758
2814
|
}).superRefine((event2, ctx) => {
|
2759
2815
|
const allFields = findAllFields(event2);
|
@@ -3095,8 +3151,9 @@ function createFieldConditionals(fieldId) {
|
|
3095
3151
|
properties: {
|
3096
3152
|
[fieldId]: {
|
3097
3153
|
type: "string",
|
3098
|
-
|
3099
|
-
|
3154
|
+
minLength: 1,
|
3155
|
+
pattern: "^[\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*( [\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*)*$",
|
3156
|
+
description: "Name must contain only letters, numbers, and allowed special characters ('.-). No double spaces."
|
3100
3157
|
}
|
3101
3158
|
}
|
3102
3159
|
}),
|
@@ -3209,7 +3266,7 @@ function createSearchConfig(baseField) {
|
|
3209
3266
|
// ../commons/src/event-config/event-configuration.ts
|
3210
3267
|
function createEventFieldConfig(fieldId) {
|
3211
3268
|
const baseField = {
|
3212
|
-
fieldId
|
3269
|
+
fieldId: `${METADATA_FIELD_PREFIX}${fieldId}`,
|
3213
3270
|
fieldType: "event"
|
3214
3271
|
};
|
3215
3272
|
return createSearchConfig(baseField);
|
@@ -3222,32 +3279,107 @@ function eventFn(fieldId) {
|
|
3222
3279
|
var event = Object.assign(eventFn, {
|
3223
3280
|
/**
|
3224
3281
|
* Checks if the event contains a specific action type.
|
3282
|
+
* Can be used directly as a conditional or chained with additional methods.
|
3225
3283
|
* @param action - The action type to check for.
|
3226
3284
|
*/
|
3227
|
-
hasAction: (action) =>
|
3228
|
-
|
3229
|
-
|
3230
|
-
|
3285
|
+
hasAction: (action) => {
|
3286
|
+
const basicConditional = defineConditional({
|
3287
|
+
type: "object",
|
3288
|
+
properties: {
|
3289
|
+
$event: {
|
3290
|
+
type: "object",
|
3291
|
+
properties: {
|
3292
|
+
actions: {
|
3293
|
+
type: "array",
|
3294
|
+
contains: {
|
3295
|
+
type: "object",
|
3296
|
+
properties: {
|
3297
|
+
type: {
|
3298
|
+
const: action
|
3299
|
+
}
|
3300
|
+
},
|
3301
|
+
required: ["type"]
|
3302
|
+
}
|
3303
|
+
}
|
3304
|
+
},
|
3305
|
+
required: ["actions"]
|
3306
|
+
}
|
3307
|
+
},
|
3308
|
+
required: ["$event"]
|
3309
|
+
});
|
3310
|
+
const buildActionConstraints = (additionalFields) => {
|
3311
|
+
const actionProperties = {
|
3312
|
+
type: { const: action }
|
3313
|
+
};
|
3314
|
+
const requiredFields = ["type"];
|
3315
|
+
if (additionalFields) {
|
3316
|
+
Object.entries(additionalFields).forEach(([key, value]) => {
|
3317
|
+
actionProperties[key] = { const: value };
|
3318
|
+
requiredFields.push(key);
|
3319
|
+
});
|
3320
|
+
}
|
3321
|
+
return { actionProperties, requiredFields };
|
3322
|
+
};
|
3323
|
+
const createCountConditional = (countType, count, additionalFields) => {
|
3324
|
+
const { actionProperties, requiredFields } = buildActionConstraints(additionalFields);
|
3325
|
+
return defineConditional({
|
3231
3326
|
type: "object",
|
3232
3327
|
properties: {
|
3233
|
-
|
3234
|
-
type: "
|
3235
|
-
|
3236
|
-
|
3237
|
-
|
3238
|
-
|
3239
|
-
|
3240
|
-
|
3241
|
-
|
3242
|
-
|
3243
|
-
|
3328
|
+
$event: {
|
3329
|
+
type: "object",
|
3330
|
+
properties: {
|
3331
|
+
actions: {
|
3332
|
+
type: "array",
|
3333
|
+
contains: {
|
3334
|
+
type: "object",
|
3335
|
+
properties: actionProperties,
|
3336
|
+
required: requiredFields
|
3337
|
+
},
|
3338
|
+
[countType]: count
|
3339
|
+
}
|
3340
|
+
},
|
3341
|
+
required: ["actions"]
|
3244
3342
|
}
|
3245
3343
|
},
|
3246
|
-
required: ["
|
3247
|
-
}
|
3248
|
-
}
|
3249
|
-
|
3250
|
-
|
3344
|
+
required: ["$event"]
|
3345
|
+
});
|
3346
|
+
};
|
3347
|
+
const withMinMax = (additionalFields) => {
|
3348
|
+
return {
|
3349
|
+
/**
|
3350
|
+
* Creates a conditional that checks if the event contains a specific action type
|
3351
|
+
* with a minimum count of occurrences.
|
3352
|
+
*
|
3353
|
+
* @param minCount - The minimum number of actions required.
|
3354
|
+
*/
|
3355
|
+
minCount: (minCount) => createCountConditional("minContains", minCount, additionalFields),
|
3356
|
+
/**
|
3357
|
+
* Builds a conditional that sets a maximum count for the number of actions.
|
3358
|
+
* This is useful for limiting the number of actions of a specific type in a single event.
|
3359
|
+
*/
|
3360
|
+
maxCount: (maxCount) => createCountConditional("maxContains", maxCount, additionalFields)
|
3361
|
+
};
|
3362
|
+
};
|
3363
|
+
const chainableMethods = {
|
3364
|
+
/**
|
3365
|
+
* Adds additional field constraints to the action matching.
|
3366
|
+
*
|
3367
|
+
* @param fields - Object containing additional fields to match on the action.
|
3368
|
+
*/
|
3369
|
+
withFields: (fields) => withMinMax(fields),
|
3370
|
+
/**
|
3371
|
+
* Adds template ID constraint to the action matching.
|
3372
|
+
* This is a convenience method that adds content.templateId to the fields.
|
3373
|
+
*
|
3374
|
+
* @param id - The template ID to match against.
|
3375
|
+
*/
|
3376
|
+
withTemplate: (id) => withMinMax({
|
3377
|
+
content: { templateId: id }
|
3378
|
+
}),
|
3379
|
+
...withMinMax()
|
3380
|
+
};
|
3381
|
+
return { ...basicConditional, ...chainableMethods };
|
3382
|
+
},
|
3251
3383
|
field(field2) {
|
3252
3384
|
return {
|
3253
3385
|
$event: field2
|
@@ -3266,24 +3398,23 @@ var EventStatus = import_zod23.z.enum([
|
|
3266
3398
|
"DECLARED",
|
3267
3399
|
"VALIDATED",
|
3268
3400
|
"REGISTERED",
|
3269
|
-
"CERTIFIED",
|
3270
3401
|
"ARCHIVED"
|
3271
3402
|
]);
|
3272
|
-
var VisibleStatus = import_zod23.z.enum([...EventStatus.options, "REJECTED"]);
|
3273
3403
|
var InherentFlags = {
|
3274
|
-
|
3404
|
+
PENDING_CERTIFICATION: "pending-certification",
|
3275
3405
|
INCOMPLETE: "incomplete",
|
3276
3406
|
REJECTED: "rejected",
|
3277
3407
|
CORRECTION_REQUESTED: "correction-requested"
|
3278
3408
|
};
|
3279
|
-
var
|
3409
|
+
var ActionFlag = import_zod23.z.string().regex(
|
3280
3410
|
new RegExp(
|
3281
3411
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
3282
3412
|
ActionStatus
|
3283
3413
|
).join("|").toLowerCase()})$`
|
3284
3414
|
),
|
3285
3415
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
3286
|
-
)
|
3416
|
+
);
|
3417
|
+
var Flag = ActionFlag.or(import_zod23.z.nativeEnum(InherentFlags));
|
3287
3418
|
var ZodDate = import_zod23.z.string().date();
|
3288
3419
|
var ActionCreationMetadata = import_zod23.z.object({
|
3289
3420
|
createdAt: import_zod23.z.string().datetime().describe("The timestamp when the action request was created."),
|
@@ -3799,7 +3930,8 @@ var WorkqueueConfig = import_zod28.z.object({
|
|
3799
3930
|
})
|
3800
3931
|
),
|
3801
3932
|
columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3802
|
-
icon: AvailableIcons
|
3933
|
+
icon: AvailableIcons,
|
3934
|
+
emptyMessage: TranslationConfig.optional()
|
3803
3935
|
}).describe("Configuration for workqueue.");
|
3804
3936
|
var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
3805
3937
|
query: true,
|
@@ -3818,7 +3950,8 @@ var WorkqueueConfigInput = import_zod28.z.object({
|
|
3818
3950
|
})
|
3819
3951
|
),
|
3820
3952
|
columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3821
|
-
icon: AvailableIcons
|
3953
|
+
icon: AvailableIcons,
|
3954
|
+
emptyMessage: TranslationConfig.optional()
|
3822
3955
|
});
|
3823
3956
|
function defineWorkqueue(workqueueInput) {
|
3824
3957
|
const queryInput = workqueueInput.query;
|
@@ -4120,16 +4253,19 @@ function getLegalStatuses(actions) {
|
|
4120
4253
|
}
|
4121
4254
|
|
4122
4255
|
// ../commons/src/events/state/flags.ts
|
4123
|
-
function
|
4256
|
+
function isPendingCertification(actions) {
|
4257
|
+
if (getStatusFromActions(actions) !== EventStatus.enum.REGISTERED) {
|
4258
|
+
return false;
|
4259
|
+
}
|
4124
4260
|
return actions.reduce((prev, { type }) => {
|
4125
4261
|
if (type === ActionType.PRINT_CERTIFICATE) {
|
4126
|
-
return
|
4262
|
+
return false;
|
4127
4263
|
}
|
4128
4264
|
if (type === ActionType.APPROVE_CORRECTION) {
|
4129
|
-
return
|
4265
|
+
return true;
|
4130
4266
|
}
|
4131
4267
|
return prev;
|
4132
|
-
},
|
4268
|
+
}, true);
|
4133
4269
|
}
|
4134
4270
|
function isCorrectionRequested(actions) {
|
4135
4271
|
return actions.reduce((prev, { type }) => {
|
@@ -4164,8 +4300,8 @@ function getFlagsFromActions(actions) {
|
|
4164
4300
|
const flag = joinValues([type, status], ":").toLowerCase();
|
4165
4301
|
return flag;
|
4166
4302
|
});
|
4167
|
-
if (
|
4168
|
-
flags.push(InherentFlags.
|
4303
|
+
if (isPendingCertification(sortedActions)) {
|
4304
|
+
flags.push(InherentFlags.PENDING_CERTIFICATION);
|
4169
4305
|
}
|
4170
4306
|
if (isCorrectionRequested(sortedActions)) {
|
4171
4307
|
flags.push(InherentFlags.CORRECTION_REQUESTED);
|
@@ -4196,7 +4332,6 @@ function getStatusFromActions(actions) {
|
|
4196
4332
|
case ActionType.NOTIFY:
|
4197
4333
|
return EventStatus.enum.NOTIFIED;
|
4198
4334
|
case ActionType.PRINT_CERTIFICATE:
|
4199
|
-
return EventStatus.enum.CERTIFIED;
|
4200
4335
|
case ActionType.ASSIGN:
|
4201
4336
|
case ActionType.UNASSIGN:
|
4202
4337
|
case ActionType.REJECT:
|
@@ -5161,7 +5296,27 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
5161
5296
|
defaultMessage: "Applicant's name",
|
5162
5297
|
description: "This is the label for the field",
|
5163
5298
|
id: "v2.event.tennis-club-membership.action.declare.form.section.who.field.firstname.label"
|
5164
|
-
}
|
5299
|
+
},
|
5300
|
+
configuration: {
|
5301
|
+
name: {
|
5302
|
+
firstname: { required: true },
|
5303
|
+
middlename: { required: false },
|
5304
|
+
surname: { required: true }
|
5305
|
+
}
|
5306
|
+
},
|
5307
|
+
validation: [
|
5308
|
+
{
|
5309
|
+
validator: field("applicant.name").object({
|
5310
|
+
firstname: field("firstname").isValidEnglishName(),
|
5311
|
+
surname: field("surname").isValidEnglishName()
|
5312
|
+
}),
|
5313
|
+
message: {
|
5314
|
+
defaultMessage: "Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)",
|
5315
|
+
description: "This is the error message for invalid name",
|
5316
|
+
id: "v2.error.invalidName"
|
5317
|
+
}
|
5318
|
+
}
|
5319
|
+
]
|
5165
5320
|
},
|
5166
5321
|
{
|
5167
5322
|
id: "applicant.email",
|
@@ -5383,22 +5538,6 @@ var statusOptions = [
|
|
5383
5538
|
id: "v2.advancedSearch.form.recordStatusRegistered"
|
5384
5539
|
}
|
5385
5540
|
},
|
5386
|
-
{
|
5387
|
-
value: EventStatus.enum.CERTIFIED,
|
5388
|
-
label: {
|
5389
|
-
defaultMessage: "Certified",
|
5390
|
-
description: "Option for form field: status of record",
|
5391
|
-
id: "v2.advancedSearch.form.recordStatusCertified"
|
5392
|
-
}
|
5393
|
-
},
|
5394
|
-
{
|
5395
|
-
value: VisibleStatus.enum.REJECTED,
|
5396
|
-
label: {
|
5397
|
-
defaultMessage: "Rejected",
|
5398
|
-
description: "Option for form field: status of record",
|
5399
|
-
id: "v2.advancedSearch.form.recordStatusRejected"
|
5400
|
-
}
|
5401
|
-
},
|
5402
5541
|
{
|
5403
5542
|
value: EventStatus.enum.ARCHIVED,
|
5404
5543
|
label: {
|
@@ -6308,33 +6447,24 @@ var child = defineFormPage({
|
|
6308
6447
|
},
|
6309
6448
|
fields: [
|
6310
6449
|
{
|
6311
|
-
id: "child.
|
6312
|
-
type: FieldType.
|
6313
|
-
required: true,
|
6314
|
-
configuration: { maxLength: 32 },
|
6315
|
-
hideLabel: true,
|
6316
|
-
label: {
|
6317
|
-
defaultMessage: "Child's first name",
|
6318
|
-
description: "This is the label for the field",
|
6319
|
-
id: "v2.event.birth.action.declare.form.section.child.field.name.label"
|
6320
|
-
}
|
6321
|
-
},
|
6322
|
-
{
|
6323
|
-
id: "child.familyName",
|
6324
|
-
type: FieldType.TEXT,
|
6450
|
+
id: "child.name",
|
6451
|
+
type: FieldType.NAME,
|
6325
6452
|
required: true,
|
6326
6453
|
configuration: { maxLength: 32 },
|
6327
6454
|
hideLabel: true,
|
6328
6455
|
label: {
|
6329
|
-
defaultMessage: "Child's
|
6456
|
+
defaultMessage: "Child's name",
|
6330
6457
|
description: "This is the label for the field",
|
6331
6458
|
id: "v2.event.birth.action.declare.form.section.child.field.name.label"
|
6332
|
-
}
|
6459
|
+
},
|
6460
|
+
validation: []
|
6333
6461
|
},
|
6334
6462
|
{
|
6335
|
-
id: "child.
|
6463
|
+
id: "child.dob",
|
6336
6464
|
type: "DATE",
|
6337
6465
|
required: true,
|
6466
|
+
secured: true,
|
6467
|
+
validation: [],
|
6338
6468
|
label: {
|
6339
6469
|
defaultMessage: "Date of birth",
|
6340
6470
|
description: "This is the label for the field",
|
@@ -6353,46 +6483,43 @@ var mother = defineFormPage({
|
|
6353
6483
|
},
|
6354
6484
|
fields: [
|
6355
6485
|
{
|
6356
|
-
id: "mother.
|
6357
|
-
|
6358
|
-
type: FieldType.TEXT,
|
6486
|
+
id: "mother.name",
|
6487
|
+
type: FieldType.NAME,
|
6359
6488
|
required: true,
|
6360
|
-
label: {
|
6361
|
-
defaultMessage: "First name(s)",
|
6362
|
-
description: "This is the label for the field",
|
6363
|
-
id: `v2.event.birth.action.declare.form.section.person.field.firstname.label`
|
6364
|
-
}
|
6365
|
-
},
|
6366
|
-
{
|
6367
|
-
id: `mother.familyName`,
|
6368
6489
|
configuration: { maxLength: 32 },
|
6369
|
-
|
6370
|
-
required: true,
|
6490
|
+
hideLabel: true,
|
6371
6491
|
label: {
|
6372
|
-
defaultMessage: "
|
6492
|
+
defaultMessage: "Mother's name",
|
6373
6493
|
description: "This is the label for the field",
|
6374
|
-
id:
|
6375
|
-
}
|
6494
|
+
id: "v2.event.birth.action.declare.form.section.mother.field.name.label"
|
6495
|
+
},
|
6496
|
+
conditionals: [],
|
6497
|
+
validation: []
|
6376
6498
|
},
|
6377
6499
|
{
|
6378
|
-
id:
|
6500
|
+
id: "mother.dob",
|
6379
6501
|
type: "DATE",
|
6380
6502
|
required: true,
|
6503
|
+
secured: true,
|
6504
|
+
validation: [],
|
6381
6505
|
label: {
|
6382
6506
|
defaultMessage: "Date of birth",
|
6383
6507
|
description: "This is the label for the field",
|
6384
|
-
id:
|
6385
|
-
}
|
6508
|
+
id: "v2.event.birth.action.declare.form.section.person.field.dob.label"
|
6509
|
+
},
|
6510
|
+
conditionals: []
|
6386
6511
|
},
|
6387
6512
|
{
|
6388
|
-
id: "mother.
|
6513
|
+
id: "mother.nid",
|
6389
6514
|
type: FieldType.ID,
|
6390
6515
|
required: true,
|
6391
6516
|
label: {
|
6392
6517
|
defaultMessage: "ID Number",
|
6393
6518
|
description: "This is the label for the field",
|
6394
|
-
id:
|
6395
|
-
}
|
6519
|
+
id: "v2.event.birth.action.declare.form.section.person.field.nid.label"
|
6520
|
+
},
|
6521
|
+
conditionals: [],
|
6522
|
+
validation: []
|
6396
6523
|
}
|
6397
6524
|
]
|
6398
6525
|
});
|
@@ -6850,7 +6977,11 @@ function generateActionDocument({
|
|
6850
6977
|
case ActionType.NOTIFY:
|
6851
6978
|
return { ...actionBase, type: action };
|
6852
6979
|
case ActionType.PRINT_CERTIFICATE:
|
6853
|
-
return {
|
6980
|
+
return {
|
6981
|
+
...actionBase,
|
6982
|
+
type: action,
|
6983
|
+
content: defaults.content
|
6984
|
+
};
|
6854
6985
|
case ActionType.REQUEST_CORRECTION:
|
6855
6986
|
return { ...actionBase, type: action };
|
6856
6987
|
case ActionType.APPROVE_CORRECTION:
|
@@ -7250,14 +7381,6 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7250
7381
|
ActionType.REJECT_CORRECTION,
|
7251
7382
|
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
7252
7383
|
],
|
7253
|
-
[EventStatus.enum.CERTIFIED]: [
|
7254
|
-
ActionType.READ,
|
7255
|
-
ActionType.PRINT_CERTIFICATE,
|
7256
|
-
ActionType.REQUEST_CORRECTION,
|
7257
|
-
ActionType.APPROVE_CORRECTION,
|
7258
|
-
ActionType.REJECT_CORRECTION,
|
7259
|
-
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
7260
|
-
],
|
7261
7384
|
[EventStatus.enum.ARCHIVED]: [
|
7262
7385
|
ActionType.READ,
|
7263
7386
|
ActionType.ASSIGN,
|
@@ -7265,9 +7388,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7265
7388
|
]
|
7266
7389
|
};
|
7267
7390
|
var getAvailableActionsForEvent = (event2) => {
|
7268
|
-
|
7269
|
-
|
7270
|
-
|
7271
|
-
|
7272
|
-
|
7391
|
+
if (event2.flags.includes(InherentFlags.REJECTED)) {
|
7392
|
+
return [
|
7393
|
+
ActionType.READ,
|
7394
|
+
event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
|
7395
|
+
ActionType.ARCHIVE
|
7396
|
+
];
|
7397
|
+
}
|
7398
|
+
return AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
|
7273
7399
|
};
|