@opencrvs/toolkit 1.8.0-rc.fc4c805 → 1.8.0-rc.fcb9386
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 +6983 -4338
- package/dist/commons/conditionals/conditionals.d.ts +2 -1
- package/dist/commons/events/ActionConfig.d.ts +40400 -36948
- package/dist/commons/events/ActionDocument.d.ts +292 -105
- package/dist/commons/events/ActionInput.d.ts +75 -3
- package/dist/commons/events/AdvancedSearchConfig.d.ts +603 -12
- package/dist/commons/events/Constants.d.ts +2 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
- package/dist/commons/events/Draft.d.ts +10 -5
- package/dist/commons/events/EventConfig.d.ts +14558 -14829
- package/dist/commons/events/EventDocument.d.ts +212 -93
- package/dist/commons/events/EventIndex.d.ts +298 -319
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +38 -44
- package/dist/commons/events/FieldConfig.d.ts +517 -0
- package/dist/commons/events/FormConfig.d.ts +3641 -467
- package/dist/commons/events/PageConfig.d.ts +782 -0
- package/dist/commons/events/User.d.ts +31 -7
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +4033 -644
- package/dist/commons/events/defineConfig.d.ts +3050 -3519
- package/dist/commons/events/event.d.ts +37 -10
- package/dist/commons/events/field.d.ts +21 -7
- package/dist/commons/events/index.d.ts +4 -0
- package/dist/commons/events/scopes.d.ts +21 -2
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +26 -6
- package/dist/commons/events/utils.d.ts +117 -1
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +19 -2
- package/dist/events/index.js +2382 -988
- package/dist/scopes/index.d.ts +158 -1
- package/dist/scopes/index.js +152 -1
- package/package.json +1 -1
package/dist/events/index.js
CHANGED
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
// src/events/index.ts
|
31
31
|
var events_exports = {};
|
32
32
|
__export(events_exports, {
|
33
|
+
ACTION_ALLOWED_CONFIGURABLE_SCOPES: () => ACTION_ALLOWED_CONFIGURABLE_SCOPES,
|
33
34
|
ACTION_ALLOWED_SCOPES: () => ACTION_ALLOWED_SCOPES,
|
34
35
|
Action: () => Action,
|
35
36
|
ActionBase: () => ActionBase,
|
@@ -49,11 +50,14 @@ __export(events_exports, {
|
|
49
50
|
AddressType: () => AddressType,
|
50
51
|
AdministrativeAreas: () => AdministrativeAreas,
|
51
52
|
AdvancedSearchConfig: () => AdvancedSearchConfig,
|
53
|
+
AnyOf: () => AnyOf,
|
54
|
+
AnyOfStatus: () => AnyOfStatus,
|
52
55
|
ApproveCorrectionActionInput: () => ApproveCorrectionActionInput,
|
53
56
|
ArchiveActionInput: () => ArchiveActionInput,
|
54
57
|
AssignActionInput: () => AssignActionInput,
|
55
58
|
AsyncRejectActionDocument: () => AsyncRejectActionDocument,
|
56
59
|
BaseActionInput: () => BaseActionInput,
|
60
|
+
BearerTokenByUserType: () => BearerTokenByUserType,
|
57
61
|
CONFIG_GET_ALLOWED_SCOPES: () => CONFIG_GET_ALLOWED_SCOPES,
|
58
62
|
CONFIG_SEARCH_ALLOWED_SCOPES: () => CONFIG_SEARCH_ALLOWED_SCOPES,
|
59
63
|
CertificateConfig: () => CertificateConfig,
|
@@ -67,6 +71,7 @@ __export(events_exports, {
|
|
67
71
|
DEFAULT_DATE_OF_EVENT_PROPERTY: () => DEFAULT_DATE_OF_EVENT_PROPERTY,
|
68
72
|
DataEntry: () => DataEntry,
|
69
73
|
DataFieldValue: () => DataFieldValue,
|
74
|
+
DateCondition: () => DateCondition,
|
70
75
|
DateRangeFieldValue: () => DateRangeFieldValue,
|
71
76
|
DateValue: () => DateValue,
|
72
77
|
DatetimeValue: () => DatetimeValue,
|
@@ -92,11 +97,14 @@ __export(events_exports, {
|
|
92
97
|
EventInput: () => EventInput,
|
93
98
|
EventMetadata: () => EventMetadata,
|
94
99
|
EventMetadataKeys: () => EventMetadataKeys,
|
95
|
-
|
100
|
+
EventMetadataKeysArray: () => EventMetadataKeysArray,
|
96
101
|
EventSearchIndex: () => EventSearchIndex,
|
97
102
|
EventState: () => EventState,
|
98
103
|
EventStatus: () => EventStatus,
|
104
|
+
EventStatusEnum: () => EventStatusEnum,
|
99
105
|
EventStatuses: () => EventStatuses,
|
106
|
+
Exact: () => Exact,
|
107
|
+
ExactStatus: () => ExactStatus,
|
100
108
|
FieldConditional: () => FieldConditional,
|
101
109
|
FieldConfig: () => FieldConfig,
|
102
110
|
FieldConfigSchema: () => FieldConfigSchema,
|
@@ -109,6 +117,7 @@ __export(events_exports, {
|
|
109
117
|
Flag: () => Flag,
|
110
118
|
FormConfig: () => FormConfig,
|
111
119
|
FormPageConfig: () => FormPageConfig,
|
120
|
+
Fuzzy: () => Fuzzy,
|
112
121
|
GenericAddressUpdateValue: () => GenericAddressUpdateValue,
|
113
122
|
GenericAddressValue: () => GenericAddressValue,
|
114
123
|
GeographicalArea: () => GeographicalArea,
|
@@ -118,36 +127,51 @@ __export(events_exports, {
|
|
118
127
|
MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
|
119
128
|
MimeType: () => MimeType,
|
120
129
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
130
|
+
Not: () => Not,
|
121
131
|
NotifyActionInput: () => NotifyActionInput,
|
122
132
|
NumberFieldValue: () => NumberFieldValue,
|
123
133
|
PageConfig: () => PageConfig,
|
124
134
|
PageTypes: () => PageTypes,
|
125
135
|
PrintCertificateActionInput: () => PrintCertificateActionInput,
|
136
|
+
QueryExpression: () => QueryExpression,
|
126
137
|
QueryInput: () => QueryInput,
|
127
138
|
QueryType: () => QueryType,
|
139
|
+
Range: () => Range,
|
128
140
|
ReadActionInput: () => ReadActionInput,
|
129
141
|
RegisterAction: () => RegisterAction,
|
130
142
|
RegisterActionInput: () => RegisterActionInput,
|
131
143
|
RegistrationCreationMetadata: () => RegistrationCreationMetadata,
|
132
144
|
RejectCorrectionActionInput: () => RejectCorrectionActionInput,
|
133
145
|
RejectDeclarationActionInput: () => RejectDeclarationActionInput,
|
146
|
+
RejectionReason: () => RejectionReason,
|
134
147
|
RequestCorrectionActionInput: () => RequestCorrectionActionInput,
|
135
148
|
ResolvedUser: () => ResolvedUser,
|
136
149
|
RuralAddressUpdateValue: () => RuralAddressUpdateValue,
|
137
150
|
RuralAddressValue: () => RuralAddressValue,
|
138
151
|
SearchField: () => SearchField,
|
152
|
+
SearchQueryParams: () => SearchQueryParams,
|
139
153
|
SelectOption: () => SelectOption,
|
140
154
|
ShowConditional: () => ShowConditional,
|
141
155
|
SummaryConfig: () => SummaryConfig,
|
156
|
+
TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
|
142
157
|
TextValue: () => TextValue,
|
143
158
|
TranslationConfig: () => TranslationConfig,
|
144
159
|
UnassignActionInput: () => UnassignActionInput,
|
145
160
|
UrbanAddressUpdateValue: () => UrbanAddressUpdateValue,
|
146
161
|
UrbanAddressValue: () => UrbanAddressValue,
|
162
|
+
User: () => User,
|
147
163
|
ValidateActionInput: () => ValidateActionInput,
|
148
164
|
VerificationActionConfig: () => VerificationActionConfig,
|
149
165
|
VerificationPageConfig: () => VerificationPageConfig,
|
166
|
+
Within: () => Within,
|
167
|
+
WorkqueueColumn: () => WorkqueueColumn,
|
168
|
+
WorkqueueColumnKeys: () => WorkqueueColumnKeys,
|
169
|
+
WorkqueueColumnKeysArray: () => WorkqueueColumnKeysArray,
|
170
|
+
WorkqueueColumnValue: () => WorkqueueColumnValue,
|
150
171
|
WorkqueueConfig: () => WorkqueueConfig,
|
172
|
+
WorkqueueConfigInput: () => WorkqueueConfigInput,
|
173
|
+
WorkqueueCountInput: () => WorkqueueCountInput,
|
174
|
+
WorkqueueCountOutput: () => WorkqueueCountOutput,
|
151
175
|
ZodDate: () => ZodDate,
|
152
176
|
alwaysTrue: () => alwaysTrue,
|
153
177
|
and: () => and,
|
@@ -158,9 +182,12 @@ __export(events_exports, {
|
|
158
182
|
createEmptyDraft: () => createEmptyDraft,
|
159
183
|
createEventConditionals: () => createEventConditionals,
|
160
184
|
createFieldConditionals: () => createFieldConditionals,
|
185
|
+
createPseudoRandomNumberGenerator: () => createPseudoRandomNumberGenerator,
|
161
186
|
createValidationSchema: () => createValidationSchema,
|
187
|
+
dateOfEventColumn: () => dateOfEventColumn,
|
162
188
|
deepDropNulls: () => deepDropNulls,
|
163
189
|
deepMerge: () => deepMerge,
|
190
|
+
defaultWorkqueueColumns: () => defaultWorkqueueColumns,
|
164
191
|
defineActionForm: () => defineActionForm,
|
165
192
|
defineConditional: () => defineConditional,
|
166
193
|
defineConfig: () => defineConfig,
|
@@ -169,6 +196,9 @@ __export(events_exports, {
|
|
169
196
|
defineFormPage: () => defineFormPage,
|
170
197
|
definePage: () => definePage,
|
171
198
|
defineWorkqueue: () => defineWorkqueue,
|
199
|
+
defineWorkqueues: () => defineWorkqueues,
|
200
|
+
defineWorkqueuesColumns: () => defineWorkqueuesColumns,
|
201
|
+
deserializeQuery: () => deserializeQuery,
|
172
202
|
errorMessages: () => errorMessages,
|
173
203
|
event: () => event,
|
174
204
|
eventMetadataLabelMap: () => eventMetadataLabelMap,
|
@@ -187,8 +217,10 @@ __export(events_exports, {
|
|
187
217
|
generateActionDocument: () => generateActionDocument,
|
188
218
|
generateEventDocument: () => generateEventDocument,
|
189
219
|
generateEventDraftDocument: () => generateEventDraftDocument,
|
220
|
+
generateRandomSignature: () => generateRandomSignature,
|
190
221
|
generateTransactionId: () => generateTransactionId,
|
191
222
|
generateTranslationConfig: () => generateTranslationConfig,
|
223
|
+
generateWorkqueues: () => generateWorkqueues,
|
192
224
|
getAcceptedActions: () => getAcceptedActions,
|
193
225
|
getActionAnnotation: () => getActionAnnotation,
|
194
226
|
getActionAnnotationFields: () => getActionAnnotationFields,
|
@@ -197,12 +229,15 @@ __export(events_exports, {
|
|
197
229
|
getActionVerificationPageIds: () => getActionVerificationPageIds,
|
198
230
|
getAnnotationFromDrafts: () => getAnnotationFromDrafts,
|
199
231
|
getAssignedUserFromActions: () => getAssignedUserFromActions,
|
232
|
+
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
200
233
|
getCurrentEventState: () => getCurrentEventState,
|
201
234
|
getCurrentEventStateWithDrafts: () => getCurrentEventStateWithDrafts,
|
202
235
|
getDeclaration: () => getDeclaration,
|
203
236
|
getDeclarationFields: () => getDeclarationFields,
|
204
237
|
getDeclarationPages: () => getDeclarationPages,
|
205
238
|
getMixedPath: () => getMixedPath,
|
239
|
+
getRandomDatetime: () => getRandomDatetime,
|
240
|
+
getStatusFromActions: () => getStatusFromActions,
|
206
241
|
getVisibleVerificationPageIds: () => getVisibleVerificationPageIds,
|
207
242
|
hasAnyOfScopes: () => hasAnyOfScopes,
|
208
243
|
isAddressFieldType: () => isAddressFieldType,
|
@@ -257,14 +292,20 @@ __export(events_exports, {
|
|
257
292
|
});
|
258
293
|
module.exports = __toCommonJS(events_exports);
|
259
294
|
|
295
|
+
// ../commons/src/events/Constants.ts
|
296
|
+
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
297
|
+
|
260
298
|
// ../commons/src/events/ActionConfig.ts
|
261
299
|
var import_zod9 = require("zod");
|
262
300
|
|
263
301
|
// ../commons/src/events/Conditional.ts
|
264
302
|
var import_zod = require("zod");
|
265
|
-
var
|
266
|
-
|
267
|
-
)
|
303
|
+
var import_zod_openapi = require("zod-openapi");
|
304
|
+
(0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
|
305
|
+
var Conditional = import_zod.z.custom((val) => typeof val === "object" && val !== null).openapi({
|
306
|
+
description: "JSON schema conditional configuration",
|
307
|
+
ref: "Conditional"
|
308
|
+
});
|
268
309
|
var ConditionalType = {
|
269
310
|
SHOW: "SHOW",
|
270
311
|
ENABLE: "ENABLE",
|
@@ -301,16 +342,15 @@ var FieldConditional = import_zod.z.discriminatedUnion("type", [
|
|
301
342
|
EnableConditional,
|
302
343
|
// Field output can be shown / hidden on the review page
|
303
344
|
DisplayOnReviewConditional
|
304
|
-
])
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
// ../commons/src/events/FieldConfig.ts
|
310
|
-
var import_zod5 = require("zod");
|
345
|
+
]).openapi({
|
346
|
+
description: "Field conditional configuration",
|
347
|
+
ref: "FieldConditional"
|
348
|
+
});
|
311
349
|
|
312
350
|
// ../commons/src/events/TranslationConfig.ts
|
313
351
|
var import_zod2 = require("zod");
|
352
|
+
var import_zod_openapi2 = require("zod-openapi");
|
353
|
+
(0, import_zod_openapi2.extendZodWithOpenApi)(import_zod2.z);
|
314
354
|
var TranslationConfig = import_zod2.z.object({
|
315
355
|
id: import_zod2.z.string().describe(
|
316
356
|
"The identifier of the translation referred in translation CSV files"
|
@@ -319,8 +359,91 @@ var TranslationConfig = import_zod2.z.object({
|
|
319
359
|
description: import_zod2.z.string().describe(
|
320
360
|
"Describe the translation for a translator to be able to identify it."
|
321
361
|
)
|
362
|
+
}).openapi({
|
363
|
+
description: "Translation configuration",
|
364
|
+
ref: "TranslationConfig"
|
322
365
|
});
|
323
366
|
|
367
|
+
// ../commons/src/events/ActionType.ts
|
368
|
+
var import_zod3 = require("zod");
|
369
|
+
var ActionType = {
|
370
|
+
// Pre-declaration actions
|
371
|
+
DELETE: "DELETE",
|
372
|
+
CREATE: "CREATE",
|
373
|
+
NOTIFY: "NOTIFY",
|
374
|
+
// Declaration actions
|
375
|
+
DECLARE: "DECLARE",
|
376
|
+
VALIDATE: "VALIDATE",
|
377
|
+
REGISTER: "REGISTER",
|
378
|
+
// Declaration system actions. Non-configurable.
|
379
|
+
DETECT_DUPLICATE: "DETECT_DUPLICATE",
|
380
|
+
REJECT: "REJECT",
|
381
|
+
// REJECT_DECLARATION
|
382
|
+
MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE",
|
383
|
+
// MARK_AS_DUPLICATE
|
384
|
+
ARCHIVE: "ARCHIVE",
|
385
|
+
// Record actions
|
386
|
+
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
387
|
+
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
388
|
+
REJECT_CORRECTION: "REJECT_CORRECTION",
|
389
|
+
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
390
|
+
// General actions
|
391
|
+
READ: "READ",
|
392
|
+
ASSIGN: "ASSIGN",
|
393
|
+
UNASSIGN: "UNASSIGN"
|
394
|
+
};
|
395
|
+
var ConfirmableActions = [
|
396
|
+
ActionType.NOTIFY,
|
397
|
+
ActionType.DECLARE,
|
398
|
+
ActionType.VALIDATE,
|
399
|
+
ActionType.REGISTER,
|
400
|
+
ActionType.REJECT,
|
401
|
+
ActionType.ARCHIVE,
|
402
|
+
ActionType.PRINT_CERTIFICATE
|
403
|
+
];
|
404
|
+
var ActionTypes = import_zod3.z.enum([
|
405
|
+
"DELETE",
|
406
|
+
"CREATE",
|
407
|
+
"NOTIFY",
|
408
|
+
"DECLARE",
|
409
|
+
"VALIDATE",
|
410
|
+
"REGISTER",
|
411
|
+
"DETECT_DUPLICATE",
|
412
|
+
"REJECT",
|
413
|
+
"MARKED_AS_DUPLICATE",
|
414
|
+
"ARCHIVE",
|
415
|
+
"PRINT_CERTIFICATE",
|
416
|
+
"REQUEST_CORRECTION",
|
417
|
+
"REJECT_CORRECTION",
|
418
|
+
"APPROVE_CORRECTION",
|
419
|
+
"READ",
|
420
|
+
"ASSIGN",
|
421
|
+
"UNASSIGN"
|
422
|
+
]);
|
423
|
+
var declarationActionValues = [
|
424
|
+
ActionTypes.enum.DECLARE,
|
425
|
+
ActionTypes.enum.VALIDATE,
|
426
|
+
ActionTypes.enum.REGISTER
|
427
|
+
];
|
428
|
+
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
429
|
+
var declarationUpdateActionValues = [
|
430
|
+
...declarationActionValues,
|
431
|
+
ActionTypes.enum.REQUEST_CORRECTION
|
432
|
+
];
|
433
|
+
var DeclarationUpdateActions = ActionTypes.extract(
|
434
|
+
declarationUpdateActionValues
|
435
|
+
);
|
436
|
+
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
437
|
+
var writeActions = ActionTypes.exclude([
|
438
|
+
ActionType.CREATE,
|
439
|
+
ActionType.READ,
|
440
|
+
ActionType.ASSIGN,
|
441
|
+
ActionType.UNASSIGN
|
442
|
+
]);
|
443
|
+
|
444
|
+
// ../commons/src/events/FieldConfig.ts
|
445
|
+
var import_zod6 = require("zod");
|
446
|
+
|
324
447
|
// ../commons/src/events/FieldType.ts
|
325
448
|
var FieldType = {
|
326
449
|
ADDRESS: "ADDRESS",
|
@@ -356,10 +479,10 @@ var compositeFieldTypes = [
|
|
356
479
|
];
|
357
480
|
|
358
481
|
// ../commons/src/events/FieldValue.ts
|
359
|
-
var
|
482
|
+
var import_zod5 = require("zod");
|
360
483
|
|
361
484
|
// ../commons/src/events/CompositeFieldValue.ts
|
362
|
-
var
|
485
|
+
var import_zod4 = require("zod");
|
363
486
|
var GeographicalArea = {
|
364
487
|
URBAN: "URBAN",
|
365
488
|
RURAL: "RURAL"
|
@@ -368,87 +491,87 @@ var AddressType = {
|
|
368
491
|
DOMESTIC: "DOMESTIC",
|
369
492
|
INTERNATIONAL: "INTERNATIONAL"
|
370
493
|
};
|
371
|
-
var FileFieldValue =
|
372
|
-
filename:
|
373
|
-
originalFilename:
|
374
|
-
type:
|
494
|
+
var FileFieldValue = import_zod4.z.object({
|
495
|
+
filename: import_zod4.z.string(),
|
496
|
+
originalFilename: import_zod4.z.string(),
|
497
|
+
type: import_zod4.z.string()
|
375
498
|
});
|
376
|
-
var AdminStructure =
|
377
|
-
country:
|
378
|
-
addressType:
|
379
|
-
province:
|
380
|
-
district:
|
499
|
+
var AdminStructure = import_zod4.z.object({
|
500
|
+
country: import_zod4.z.string(),
|
501
|
+
addressType: import_zod4.z.literal(AddressType.DOMESTIC),
|
502
|
+
province: import_zod4.z.string(),
|
503
|
+
district: import_zod4.z.string()
|
381
504
|
});
|
382
505
|
var UrbanAddressValue = AdminStructure.extend({
|
383
|
-
urbanOrRural:
|
384
|
-
town:
|
385
|
-
residentialArea:
|
386
|
-
street:
|
387
|
-
number:
|
388
|
-
zipCode:
|
506
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.URBAN),
|
507
|
+
town: import_zod4.z.string().optional(),
|
508
|
+
residentialArea: import_zod4.z.string().optional(),
|
509
|
+
street: import_zod4.z.string().optional(),
|
510
|
+
number: import_zod4.z.string().optional(),
|
511
|
+
zipCode: import_zod4.z.string().optional()
|
389
512
|
});
|
390
513
|
var RuralAddressValue = AdminStructure.extend({
|
391
|
-
urbanOrRural:
|
392
|
-
village:
|
514
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.RURAL),
|
515
|
+
village: import_zod4.z.string().optional()
|
393
516
|
});
|
394
517
|
var UrbanAddressUpdateValue = AdminStructure.extend({
|
395
|
-
urbanOrRural:
|
396
|
-
town:
|
397
|
-
residentialArea:
|
398
|
-
street:
|
399
|
-
number:
|
400
|
-
zipCode:
|
518
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.URBAN),
|
519
|
+
town: import_zod4.z.string().nullish(),
|
520
|
+
residentialArea: import_zod4.z.string().nullish(),
|
521
|
+
street: import_zod4.z.string().nullish(),
|
522
|
+
number: import_zod4.z.string().nullish(),
|
523
|
+
zipCode: import_zod4.z.string().nullish()
|
401
524
|
});
|
402
525
|
var RuralAddressUpdateValue = AdminStructure.extend({
|
403
|
-
urbanOrRural:
|
404
|
-
village:
|
526
|
+
urbanOrRural: import_zod4.z.literal(GeographicalArea.RURAL),
|
527
|
+
village: import_zod4.z.string().nullish()
|
405
528
|
});
|
406
|
-
var GenericAddressValue =
|
407
|
-
country:
|
408
|
-
addressType:
|
409
|
-
state:
|
410
|
-
district2:
|
411
|
-
cityOrTown:
|
412
|
-
addressLine1:
|
413
|
-
addressLine2:
|
414
|
-
addressLine3:
|
415
|
-
postcodeOrZip:
|
529
|
+
var GenericAddressValue = import_zod4.z.object({
|
530
|
+
country: import_zod4.z.string(),
|
531
|
+
addressType: import_zod4.z.literal(AddressType.INTERNATIONAL),
|
532
|
+
state: import_zod4.z.string(),
|
533
|
+
district2: import_zod4.z.string(),
|
534
|
+
cityOrTown: import_zod4.z.string().optional(),
|
535
|
+
addressLine1: import_zod4.z.string().optional(),
|
536
|
+
addressLine2: import_zod4.z.string().optional(),
|
537
|
+
addressLine3: import_zod4.z.string().optional(),
|
538
|
+
postcodeOrZip: import_zod4.z.string().optional()
|
416
539
|
});
|
417
|
-
var AddressFieldValue =
|
418
|
-
var GenericAddressUpdateValue =
|
419
|
-
country:
|
420
|
-
addressType:
|
421
|
-
state:
|
422
|
-
district2:
|
423
|
-
cityOrTown:
|
424
|
-
addressLine1:
|
425
|
-
addressLine2:
|
426
|
-
addressLine3:
|
427
|
-
postcodeOrZip:
|
540
|
+
var AddressFieldValue = import_zod4.z.discriminatedUnion("urbanOrRural", [UrbanAddressValue, RuralAddressValue]).or(GenericAddressValue);
|
541
|
+
var GenericAddressUpdateValue = import_zod4.z.object({
|
542
|
+
country: import_zod4.z.string(),
|
543
|
+
addressType: import_zod4.z.literal(AddressType.INTERNATIONAL),
|
544
|
+
state: import_zod4.z.string(),
|
545
|
+
district2: import_zod4.z.string(),
|
546
|
+
cityOrTown: import_zod4.z.string().nullish(),
|
547
|
+
addressLine1: import_zod4.z.string().nullish(),
|
548
|
+
addressLine2: import_zod4.z.string().nullish(),
|
549
|
+
addressLine3: import_zod4.z.string().nullish(),
|
550
|
+
postcodeOrZip: import_zod4.z.string().nullish()
|
428
551
|
});
|
429
|
-
var AddressFieldUpdateValue =
|
552
|
+
var AddressFieldUpdateValue = import_zod4.z.discriminatedUnion("urbanOrRural", [
|
430
553
|
UrbanAddressUpdateValue,
|
431
554
|
RuralAddressUpdateValue
|
432
555
|
]).or(GenericAddressUpdateValue);
|
433
|
-
var FileFieldValueWithOption =
|
434
|
-
filename:
|
435
|
-
originalFilename:
|
436
|
-
type:
|
437
|
-
option:
|
556
|
+
var FileFieldValueWithOption = import_zod4.z.object({
|
557
|
+
filename: import_zod4.z.string(),
|
558
|
+
originalFilename: import_zod4.z.string(),
|
559
|
+
type: import_zod4.z.string(),
|
560
|
+
option: import_zod4.z.string()
|
438
561
|
});
|
439
|
-
var FileFieldWithOptionValue =
|
562
|
+
var FileFieldWithOptionValue = import_zod4.z.array(FileFieldValueWithOption);
|
440
563
|
|
441
564
|
// ../commons/src/events/FieldValue.ts
|
442
|
-
var TextValue =
|
565
|
+
var TextValue = import_zod5.z.string();
|
443
566
|
var NonEmptyTextValue = TextValue.min(1);
|
444
|
-
var DateValue =
|
445
|
-
var DatetimeValue =
|
446
|
-
var DateRangeFieldValue = DateValue.or(
|
447
|
-
var EmailValue =
|
448
|
-
var CheckboxFieldValue =
|
449
|
-
var NumberFieldValue =
|
450
|
-
var DataFieldValue =
|
451
|
-
var FieldValue =
|
567
|
+
var DateValue = import_zod5.z.string().date().describe("Date in the format YYYY-MM-DD");
|
568
|
+
var DatetimeValue = import_zod5.z.string().datetime();
|
569
|
+
var DateRangeFieldValue = DateValue.or(import_zod5.z.tuple([DateValue, DateValue]));
|
570
|
+
var EmailValue = import_zod5.z.string().email();
|
571
|
+
var CheckboxFieldValue = import_zod5.z.boolean();
|
572
|
+
var NumberFieldValue = import_zod5.z.number();
|
573
|
+
var DataFieldValue = import_zod5.z.undefined();
|
574
|
+
var FieldValue = import_zod5.z.union([
|
452
575
|
TextValue,
|
453
576
|
DateValue,
|
454
577
|
DateRangeFieldValue,
|
@@ -461,7 +584,7 @@ var FieldValue = import_zod4.z.union([
|
|
461
584
|
DataFieldValue,
|
462
585
|
GenericAddressValue
|
463
586
|
]);
|
464
|
-
var FieldUpdateValue =
|
587
|
+
var FieldUpdateValue = import_zod5.z.union([
|
465
588
|
TextValue,
|
466
589
|
DateValue,
|
467
590
|
DateRangeFieldValue,
|
@@ -476,13 +599,15 @@ var FieldUpdateValue = import_zod4.z.union([
|
|
476
599
|
]);
|
477
600
|
|
478
601
|
// ../commons/src/events/FieldConfig.ts
|
479
|
-
var
|
480
|
-
|
602
|
+
var import_zod_openapi3 = require("zod-openapi");
|
603
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod6.z);
|
604
|
+
var FieldId = import_zod6.z.string();
|
605
|
+
var ParentReference = import_zod6.z.object({
|
481
606
|
_fieldId: FieldId.optional()
|
482
607
|
}).optional();
|
483
|
-
var BaseField =
|
608
|
+
var BaseField = import_zod6.z.object({
|
484
609
|
id: FieldId,
|
485
|
-
defaultValue:
|
610
|
+
defaultValue: import_zod6.z.union([
|
486
611
|
TextValue,
|
487
612
|
NonEmptyTextValue,
|
488
613
|
DateValue,
|
@@ -490,53 +615,54 @@ var BaseField = import_zod5.z.object({
|
|
490
615
|
CheckboxFieldValue
|
491
616
|
]).optional(),
|
492
617
|
parent: ParentReference,
|
493
|
-
conditionals:
|
494
|
-
required:
|
618
|
+
conditionals: import_zod6.z.array(FieldConditional).default([]).optional(),
|
619
|
+
required: import_zod6.z.boolean().default(false).optional(),
|
495
620
|
placeholder: TranslationConfig.optional(),
|
496
|
-
validation:
|
497
|
-
|
621
|
+
validation: import_zod6.z.array(
|
622
|
+
import_zod6.z.object({
|
498
623
|
validator: Conditional,
|
499
624
|
message: TranslationConfig
|
500
625
|
})
|
501
626
|
).default([]).optional(),
|
502
627
|
label: TranslationConfig,
|
503
|
-
|
628
|
+
helperText: TranslationConfig.optional(),
|
629
|
+
hideLabel: import_zod6.z.boolean().default(false).optional()
|
504
630
|
});
|
505
631
|
var Divider = BaseField.extend({
|
506
|
-
type:
|
632
|
+
type: import_zod6.z.literal(FieldType.DIVIDER)
|
507
633
|
});
|
508
634
|
var TextField = BaseField.extend({
|
509
|
-
type:
|
635
|
+
type: import_zod6.z.literal(FieldType.TEXT),
|
510
636
|
defaultValue: NonEmptyTextValue.optional(),
|
511
|
-
configuration:
|
512
|
-
maxLength:
|
513
|
-
type:
|
637
|
+
configuration: import_zod6.z.object({
|
638
|
+
maxLength: import_zod6.z.number().optional().describe("Maximum length of the text"),
|
639
|
+
type: import_zod6.z.enum(["text", "password"]).optional(),
|
514
640
|
prefix: TranslationConfig.optional(),
|
515
641
|
postfix: TranslationConfig.optional()
|
516
642
|
}).default({ type: "text" }).optional()
|
517
643
|
}).describe("Text input");
|
518
644
|
var NumberField = BaseField.extend({
|
519
|
-
type:
|
645
|
+
type: import_zod6.z.literal(FieldType.NUMBER),
|
520
646
|
defaultValue: NumberFieldValue.optional(),
|
521
|
-
configuration:
|
522
|
-
min:
|
523
|
-
max:
|
647
|
+
configuration: import_zod6.z.object({
|
648
|
+
min: import_zod6.z.number().optional().describe("Minimum value"),
|
649
|
+
max: import_zod6.z.number().optional().describe("Maximum value"),
|
524
650
|
prefix: TranslationConfig.optional(),
|
525
651
|
postfix: TranslationConfig.optional()
|
526
652
|
}).optional()
|
527
653
|
}).describe("Number input");
|
528
654
|
var TextAreaField = BaseField.extend({
|
529
|
-
type:
|
655
|
+
type: import_zod6.z.literal(FieldType.TEXTAREA),
|
530
656
|
defaultValue: NonEmptyTextValue.optional(),
|
531
|
-
configuration:
|
532
|
-
maxLength:
|
533
|
-
rows:
|
534
|
-
cols:
|
657
|
+
configuration: import_zod6.z.object({
|
658
|
+
maxLength: import_zod6.z.number().optional().describe("Maximum length of the text"),
|
659
|
+
rows: import_zod6.z.number().optional().describe("Number of visible text lines"),
|
660
|
+
cols: import_zod6.z.number().optional().describe("Number of visible columns"),
|
535
661
|
prefix: TranslationConfig.optional(),
|
536
662
|
postfix: TranslationConfig.optional()
|
537
663
|
}).default({ rows: 4 }).optional()
|
538
664
|
}).describe("Multiline text input");
|
539
|
-
var ImageMimeType =
|
665
|
+
var ImageMimeType = import_zod6.z.enum([
|
540
666
|
"image/png",
|
541
667
|
"image/jpg",
|
542
668
|
"image/jpeg",
|
@@ -545,37 +671,37 @@ var ImageMimeType = import_zod5.z.enum([
|
|
545
671
|
var MimeType = ImageMimeType;
|
546
672
|
var DEFAULT_MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
547
673
|
var SignatureField = BaseField.extend({
|
548
|
-
type:
|
674
|
+
type: import_zod6.z.literal(FieldType.SIGNATURE),
|
549
675
|
signaturePromptLabel: TranslationConfig.describe(
|
550
676
|
"Title of the signature modal"
|
551
677
|
),
|
552
|
-
configuration:
|
553
|
-
maxFileSize:
|
678
|
+
configuration: import_zod6.z.object({
|
679
|
+
maxFileSize: import_zod6.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
554
680
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
555
681
|
}).default({
|
556
682
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
557
683
|
})
|
558
684
|
}).describe("Signature input field");
|
559
685
|
var EmailField = BaseField.extend({
|
560
|
-
type:
|
561
|
-
configuration:
|
562
|
-
maxLength:
|
686
|
+
type: import_zod6.z.literal(FieldType.EMAIL),
|
687
|
+
configuration: import_zod6.z.object({
|
688
|
+
maxLength: import_zod6.z.number().optional().describe("Maximum length of the text")
|
563
689
|
}).default({ maxLength: 10 }).optional(),
|
564
690
|
defaultValue: NonEmptyTextValue.optional()
|
565
691
|
});
|
566
692
|
var DateField = BaseField.extend({
|
567
|
-
type:
|
693
|
+
type: import_zod6.z.literal(FieldType.DATE),
|
568
694
|
defaultValue: DateValue.optional(),
|
569
|
-
configuration:
|
695
|
+
configuration: import_zod6.z.object({
|
570
696
|
notice: TranslationConfig.describe(
|
571
697
|
"Text to display above the date input"
|
572
698
|
).optional()
|
573
699
|
}).optional()
|
574
700
|
}).describe("A single date input (dd-mm-YYYY)");
|
575
701
|
var DateRangeField = BaseField.extend({
|
576
|
-
type:
|
702
|
+
type: import_zod6.z.literal(FieldType.DATE_RANGE),
|
577
703
|
defaultValue: DateRangeFieldValue.optional(),
|
578
|
-
configuration:
|
704
|
+
configuration: import_zod6.z.object({
|
579
705
|
notice: TranslationConfig.describe(
|
580
706
|
"Text to display above the date input"
|
581
707
|
).optional()
|
@@ -583,7 +709,7 @@ var DateRangeField = BaseField.extend({
|
|
583
709
|
}).describe(
|
584
710
|
"A date range input ({ rangeStart: dd-mm-YYYY, rangeEnd: dd-mm-YYYY })"
|
585
711
|
);
|
586
|
-
var HtmlFontVariant =
|
712
|
+
var HtmlFontVariant = import_zod6.z.enum([
|
587
713
|
"reg12",
|
588
714
|
"reg14",
|
589
715
|
"reg16",
|
@@ -594,25 +720,25 @@ var HtmlFontVariant = import_zod5.z.enum([
|
|
594
720
|
"h1"
|
595
721
|
]);
|
596
722
|
var Paragraph = BaseField.extend({
|
597
|
-
type:
|
723
|
+
type: import_zod6.z.literal(FieldType.PARAGRAPH),
|
598
724
|
defaultValue: NonEmptyTextValue.optional(),
|
599
|
-
configuration:
|
600
|
-
styles:
|
725
|
+
configuration: import_zod6.z.object({
|
726
|
+
styles: import_zod6.z.object({
|
601
727
|
fontVariant: HtmlFontVariant.optional()
|
602
728
|
}).optional()
|
603
729
|
}).default({})
|
604
730
|
}).describe("A read-only HTML <p> paragraph");
|
605
731
|
var PageHeader = BaseField.extend({
|
606
|
-
type:
|
732
|
+
type: import_zod6.z.literal(FieldType.PAGE_HEADER),
|
607
733
|
defaultValue: NonEmptyTextValue.optional()
|
608
734
|
}).describe("A read-only header component for form pages");
|
609
735
|
var File = BaseField.extend({
|
610
|
-
type:
|
611
|
-
configuration:
|
612
|
-
maxFileSize:
|
736
|
+
type: import_zod6.z.literal(FieldType.FILE),
|
737
|
+
configuration: import_zod6.z.object({
|
738
|
+
maxFileSize: import_zod6.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
613
739
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
614
|
-
style:
|
615
|
-
width:
|
740
|
+
style: import_zod6.z.object({
|
741
|
+
width: import_zod6.z.enum(["full", "auto"]).optional().describe(
|
616
742
|
"Whether the file upload button should take the full width of the container or not"
|
617
743
|
)
|
618
744
|
}).optional(),
|
@@ -621,102 +747,102 @@ var File = BaseField.extend({
|
|
621
747
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
622
748
|
})
|
623
749
|
}).describe("File upload");
|
624
|
-
var SelectOption =
|
625
|
-
value:
|
750
|
+
var SelectOption = import_zod6.z.object({
|
751
|
+
value: import_zod6.z.string().describe("The value of the option"),
|
626
752
|
label: TranslationConfig.describe("The label of the option")
|
627
753
|
});
|
628
754
|
var RadioGroup = BaseField.extend({
|
629
|
-
type:
|
755
|
+
type: import_zod6.z.literal(FieldType.RADIO_GROUP),
|
630
756
|
defaultValue: TextValue.optional(),
|
631
|
-
options:
|
632
|
-
configuration:
|
633
|
-
styles:
|
634
|
-
size:
|
757
|
+
options: import_zod6.z.array(SelectOption).describe("A list of options"),
|
758
|
+
configuration: import_zod6.z.object({
|
759
|
+
styles: import_zod6.z.object({
|
760
|
+
size: import_zod6.z.enum(["NORMAL", "LARGE"]).optional()
|
635
761
|
}).optional()
|
636
762
|
}).optional()
|
637
763
|
}).describe("Grouped radio options");
|
638
764
|
var BulletList = BaseField.extend({
|
639
|
-
type:
|
765
|
+
type: import_zod6.z.literal(FieldType.BULLET_LIST),
|
640
766
|
defaultValue: TextValue.optional(),
|
641
|
-
items:
|
642
|
-
configuration:
|
643
|
-
styles:
|
767
|
+
items: import_zod6.z.array(TranslationConfig).describe("A list of items"),
|
768
|
+
configuration: import_zod6.z.object({
|
769
|
+
styles: import_zod6.z.object({
|
644
770
|
fontVariant: HtmlFontVariant.optional()
|
645
771
|
}).optional()
|
646
772
|
}).default({})
|
647
773
|
}).describe("A list of bullet points");
|
648
774
|
var Select = BaseField.extend({
|
649
|
-
type:
|
775
|
+
type: import_zod6.z.literal(FieldType.SELECT),
|
650
776
|
defaultValue: TextValue.optional(),
|
651
|
-
options:
|
777
|
+
options: import_zod6.z.array(SelectOption).describe("A list of options")
|
652
778
|
}).describe("Select input");
|
653
779
|
var Checkbox = BaseField.extend({
|
654
|
-
type:
|
780
|
+
type: import_zod6.z.literal(FieldType.CHECKBOX),
|
655
781
|
defaultValue: CheckboxFieldValue.optional()
|
656
782
|
}).describe("Boolean checkbox field");
|
657
783
|
var Country = BaseField.extend({
|
658
|
-
type:
|
784
|
+
type: import_zod6.z.literal(FieldType.COUNTRY),
|
659
785
|
defaultValue: NonEmptyTextValue.optional()
|
660
786
|
}).describe("Country select field");
|
661
|
-
var AdministrativeAreas =
|
787
|
+
var AdministrativeAreas = import_zod6.z.enum([
|
662
788
|
"ADMIN_STRUCTURE",
|
663
789
|
"HEALTH_FACILITY",
|
664
790
|
"CRVS_OFFICE"
|
665
791
|
]);
|
666
|
-
var AdministrativeAreaConfiguration =
|
667
|
-
partOf:
|
668
|
-
$declaration:
|
792
|
+
var AdministrativeAreaConfiguration = import_zod6.z.object({
|
793
|
+
partOf: import_zod6.z.object({
|
794
|
+
$declaration: import_zod6.z.string()
|
669
795
|
}).optional().describe("Parent location"),
|
670
796
|
type: AdministrativeAreas
|
671
797
|
}).describe("Administrative area options");
|
672
798
|
var AdministrativeArea = BaseField.extend({
|
673
|
-
type:
|
799
|
+
type: import_zod6.z.literal(FieldType.ADMINISTRATIVE_AREA),
|
674
800
|
defaultValue: NonEmptyTextValue.optional(),
|
675
801
|
configuration: AdministrativeAreaConfiguration
|
676
802
|
}).describe("Administrative area input field e.g. facility, office");
|
677
803
|
var Location = BaseField.extend({
|
678
|
-
type:
|
804
|
+
type: import_zod6.z.literal(FieldType.LOCATION),
|
679
805
|
defaultValue: NonEmptyTextValue.optional()
|
680
806
|
}).describe("Input field for a location");
|
681
807
|
var FileUploadWithOptions = BaseField.extend({
|
682
|
-
type:
|
683
|
-
options:
|
684
|
-
configuration:
|
685
|
-
maxFileSize:
|
808
|
+
type: import_zod6.z.literal(FieldType.FILE_WITH_OPTIONS),
|
809
|
+
options: import_zod6.z.array(SelectOption).describe("A list of options"),
|
810
|
+
configuration: import_zod6.z.object({
|
811
|
+
maxFileSize: import_zod6.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
686
812
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
687
813
|
}).default({
|
688
814
|
maxFileSize: DEFAULT_MAX_FILE_SIZE_BYTES
|
689
815
|
})
|
690
816
|
});
|
691
817
|
var Facility = BaseField.extend({
|
692
|
-
type:
|
818
|
+
type: import_zod6.z.literal(FieldType.FACILITY),
|
693
819
|
defaultValue: NonEmptyTextValue.optional()
|
694
820
|
}).describe("Input field for a facility");
|
695
821
|
var Office = BaseField.extend({
|
696
|
-
type:
|
822
|
+
type: import_zod6.z.literal(FieldType.OFFICE),
|
697
823
|
defaultValue: NonEmptyTextValue.optional()
|
698
824
|
}).describe("Input field for an office");
|
699
825
|
var Address = BaseField.extend({
|
700
|
-
type:
|
826
|
+
type: import_zod6.z.literal(FieldType.ADDRESS),
|
701
827
|
defaultValue: AddressFieldValue.optional()
|
702
828
|
}).describe("Address input field \u2013 a combination of location and text fields");
|
703
|
-
var DataEntry =
|
704
|
-
|
829
|
+
var DataEntry = import_zod6.z.union([
|
830
|
+
import_zod6.z.object({
|
705
831
|
label: TranslationConfig,
|
706
|
-
value: TranslationConfig.or(
|
832
|
+
value: TranslationConfig.or(import_zod6.z.string())
|
707
833
|
}),
|
708
|
-
|
709
|
-
fieldId:
|
834
|
+
import_zod6.z.object({
|
835
|
+
fieldId: import_zod6.z.string()
|
710
836
|
})
|
711
837
|
]);
|
712
838
|
var DataField = BaseField.extend({
|
713
|
-
type:
|
714
|
-
configuration:
|
839
|
+
type: import_zod6.z.literal(FieldType.DATA),
|
840
|
+
configuration: import_zod6.z.object({
|
715
841
|
subtitle: TranslationConfig.optional(),
|
716
|
-
data:
|
842
|
+
data: import_zod6.z.array(DataEntry)
|
717
843
|
})
|
718
844
|
}).describe("Data field for displaying read-only data");
|
719
|
-
var FieldConfig =
|
845
|
+
var FieldConfig = import_zod6.z.discriminatedUnion("type", [
|
720
846
|
Address,
|
721
847
|
TextField,
|
722
848
|
NumberField,
|
@@ -740,119 +866,56 @@ var FieldConfig = import_zod5.z.discriminatedUnion("type", [
|
|
740
866
|
EmailField,
|
741
867
|
FileUploadWithOptions,
|
742
868
|
DataField
|
743
|
-
])
|
869
|
+
]).openapi({
|
870
|
+
description: "Form field configuration",
|
871
|
+
ref: "FieldConfig"
|
872
|
+
});
|
873
|
+
|
874
|
+
// ../commons/src/events/FormConfig.ts
|
875
|
+
var import_zod8 = require("zod");
|
744
876
|
|
745
877
|
// ../commons/src/events/PageConfig.ts
|
746
|
-
var
|
747
|
-
var
|
748
|
-
|
878
|
+
var import_zod7 = require("zod");
|
879
|
+
var import_zod_openapi4 = require("zod-openapi");
|
880
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod7.z);
|
881
|
+
var PageTypes = import_zod7.z.enum(["FORM", "VERIFICATION"]);
|
882
|
+
var PageConfigBase = import_zod7.z.object({
|
883
|
+
id: import_zod7.z.string().describe("Unique identifier for the page"),
|
749
884
|
title: TranslationConfig.describe("Header title of the page"),
|
750
|
-
fields:
|
885
|
+
fields: import_zod7.z.array(FieldConfig).describe("Fields to be rendered on the page"),
|
751
886
|
conditional: Conditional.optional().describe(
|
752
887
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
753
888
|
)
|
889
|
+
}).openapi({
|
890
|
+
description: "Form page configuration",
|
891
|
+
ref: "FormPageConfig"
|
754
892
|
});
|
755
893
|
var FormPageConfig = PageConfigBase.extend({
|
756
|
-
type:
|
894
|
+
type: import_zod7.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
757
895
|
});
|
758
|
-
var VerificationActionConfig =
|
759
|
-
verify:
|
760
|
-
cancel:
|
896
|
+
var VerificationActionConfig = import_zod7.z.object({
|
897
|
+
verify: import_zod7.z.object({ label: TranslationConfig }),
|
898
|
+
cancel: import_zod7.z.object({
|
761
899
|
label: TranslationConfig,
|
762
|
-
confirmation:
|
900
|
+
confirmation: import_zod7.z.object({
|
763
901
|
title: TranslationConfig,
|
764
902
|
body: TranslationConfig
|
765
903
|
})
|
766
904
|
})
|
767
|
-
}).describe("Actions available on the verification page")
|
905
|
+
}).describe("Actions available on the verification page").openapi({
|
906
|
+
description: "Verification action configuration",
|
907
|
+
ref: "VerificationActionConfig"
|
908
|
+
});
|
768
909
|
var VerificationPageConfig = FormPageConfig.extend({
|
769
|
-
type:
|
910
|
+
type: import_zod7.z.literal(PageTypes.enum.VERIFICATION),
|
770
911
|
actions: VerificationActionConfig
|
771
912
|
});
|
772
|
-
var PageConfig =
|
913
|
+
var PageConfig = import_zod7.z.discriminatedUnion("type", [
|
773
914
|
FormPageConfig,
|
774
915
|
VerificationPageConfig
|
775
916
|
]);
|
776
917
|
|
777
|
-
// ../commons/src/events/ActionType.ts
|
778
|
-
var import_zod7 = require("zod");
|
779
|
-
var ActionType = {
|
780
|
-
// Pre-declaration actions
|
781
|
-
DELETE: "DELETE",
|
782
|
-
CREATE: "CREATE",
|
783
|
-
NOTIFY: "NOTIFY",
|
784
|
-
// Declaration actions
|
785
|
-
DECLARE: "DECLARE",
|
786
|
-
VALIDATE: "VALIDATE",
|
787
|
-
REGISTER: "REGISTER",
|
788
|
-
// Declaration system actions. Non-configurable.
|
789
|
-
DETECT_DUPLICATE: "DETECT_DUPLICATE",
|
790
|
-
REJECT: "REJECT",
|
791
|
-
// REJECT_DECLARATION
|
792
|
-
MARKED_AS_DUPLICATE: "MARKED_AS_DUPLICATE",
|
793
|
-
// MARK_AS_DUPLICATE
|
794
|
-
ARCHIVE: "ARCHIVE",
|
795
|
-
// Record actions
|
796
|
-
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
797
|
-
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
798
|
-
REJECT_CORRECTION: "REJECT_CORRECTION",
|
799
|
-
APPROVE_CORRECTION: "APPROVE_CORRECTION",
|
800
|
-
// General actions
|
801
|
-
READ: "READ",
|
802
|
-
ASSIGN: "ASSIGN",
|
803
|
-
UNASSIGN: "UNASSIGN"
|
804
|
-
};
|
805
|
-
var ConfirmableActions = [
|
806
|
-
ActionType.NOTIFY,
|
807
|
-
ActionType.DECLARE,
|
808
|
-
ActionType.VALIDATE,
|
809
|
-
ActionType.REGISTER,
|
810
|
-
ActionType.REJECT,
|
811
|
-
ActionType.ARCHIVE,
|
812
|
-
ActionType.PRINT_CERTIFICATE
|
813
|
-
];
|
814
|
-
var ActionTypes = import_zod7.z.enum([
|
815
|
-
"DELETE",
|
816
|
-
"CREATE",
|
817
|
-
"NOTIFY",
|
818
|
-
"DECLARE",
|
819
|
-
"VALIDATE",
|
820
|
-
"REGISTER",
|
821
|
-
"DETECT_DUPLICATE",
|
822
|
-
"REJECT",
|
823
|
-
"MARKED_AS_DUPLICATE",
|
824
|
-
"ARCHIVE",
|
825
|
-
"PRINT_CERTIFICATE",
|
826
|
-
"REQUEST_CORRECTION",
|
827
|
-
"REJECT_CORRECTION",
|
828
|
-
"APPROVE_CORRECTION",
|
829
|
-
"READ",
|
830
|
-
"ASSIGN",
|
831
|
-
"UNASSIGN"
|
832
|
-
]);
|
833
|
-
var declarationActionValues = [
|
834
|
-
ActionTypes.enum.DECLARE,
|
835
|
-
ActionTypes.enum.VALIDATE,
|
836
|
-
ActionTypes.enum.REGISTER
|
837
|
-
];
|
838
|
-
var DeclarationActions = ActionTypes.extract(declarationActionValues);
|
839
|
-
var declarationUpdateActionValues = [
|
840
|
-
...declarationActionValues,
|
841
|
-
ActionTypes.enum.REQUEST_CORRECTION
|
842
|
-
];
|
843
|
-
var DeclarationUpdateActions = ActionTypes.extract(
|
844
|
-
declarationUpdateActionValues
|
845
|
-
);
|
846
|
-
var annotationActions = ActionTypes.exclude(declarationActionValues);
|
847
|
-
var writeActions = ActionTypes.exclude([
|
848
|
-
ActionType.CREATE,
|
849
|
-
ActionType.READ,
|
850
|
-
ActionType.ASSIGN,
|
851
|
-
ActionType.UNASSIGN
|
852
|
-
]);
|
853
|
-
|
854
918
|
// ../commons/src/events/FormConfig.ts
|
855
|
-
var import_zod8 = require("zod");
|
856
919
|
var DeclarationFormConfig = import_zod8.z.object({
|
857
920
|
label: TranslationConfig.describe("Human readable description of the form"),
|
858
921
|
pages: import_zod8.z.array(FormPageConfig)
|
@@ -864,8 +927,8 @@ var ActionFormConfig = import_zod8.z.object({
|
|
864
927
|
var FormConfig = import_zod8.z.union([DeclarationFormConfig, ActionFormConfig]);
|
865
928
|
|
866
929
|
// ../commons/src/events/ActionConfig.ts
|
867
|
-
var
|
868
|
-
(0,
|
930
|
+
var import_zod_openapi5 = require("zod-openapi");
|
931
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod9.z);
|
869
932
|
var ActionConditional2 = import_zod9.z.discriminatedUnion("type", [
|
870
933
|
/** If conditional is defined, the action is shown to the user only if the condition is met */
|
871
934
|
ShowConditional,
|
@@ -881,6 +944,12 @@ var ActionConfigBase = import_zod9.z.object({
|
|
881
944
|
conditionals: import_zod9.z.array(ActionConditional2).optional().default([]),
|
882
945
|
draft: import_zod9.z.boolean().optional()
|
883
946
|
});
|
947
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
948
|
+
import_zod9.z.object({
|
949
|
+
type: import_zod9.z.literal(ActionType.READ),
|
950
|
+
review: DeclarationReviewConfig
|
951
|
+
})
|
952
|
+
);
|
884
953
|
var DeclareConfig = ActionConfigBase.merge(
|
885
954
|
import_zod9.z.object({
|
886
955
|
type: import_zod9.z.literal(ActionType.DECLARE),
|
@@ -928,8 +997,7 @@ var PrintCertificateActionConfig = ActionConfigBase.merge(
|
|
928
997
|
var RequestCorrectionConfig = ActionConfigBase.merge(
|
929
998
|
import_zod9.z.object({
|
930
999
|
type: import_zod9.z.literal(ActionType.REQUEST_CORRECTION),
|
931
|
-
|
932
|
-
additionalDetailsForm: import_zod9.z.array(PageConfig)
|
1000
|
+
correctionForm: ActionFormConfig
|
933
1001
|
})
|
934
1002
|
);
|
935
1003
|
var RejectCorrectionConfig = ActionConfigBase.merge(
|
@@ -947,6 +1015,7 @@ var ActionConfig = import_zod9.z.discriminatedUnion("type", [
|
|
947
1015
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
948
1016
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
949
1017
|
*/
|
1018
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
950
1019
|
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
951
1020
|
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
952
1021
|
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
@@ -1004,12 +1073,12 @@ var LanguageConfig = import_zod11.z.object({
|
|
1004
1073
|
});
|
1005
1074
|
|
1006
1075
|
// ../commons/src/events/EventConfig.ts
|
1007
|
-
var
|
1076
|
+
var import_zod18 = require("zod");
|
1008
1077
|
|
1009
1078
|
// ../commons/src/events/DeduplicationConfig.ts
|
1010
1079
|
var import_zod12 = require("zod");
|
1011
|
-
var
|
1012
|
-
(0,
|
1080
|
+
var import_zod_openapi6 = require("zod-openapi");
|
1081
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod12.z);
|
1013
1082
|
var FieldReference = import_zod12.z.string();
|
1014
1083
|
var Matcher = import_zod12.z.object({
|
1015
1084
|
fieldId: import_zod12.z.string(),
|
@@ -1110,13 +1179,58 @@ var BaseField3 = import_zod14.z.object({
|
|
1110
1179
|
config: import_zod14.z.object({
|
1111
1180
|
type: MatchType.describe("Determines the type of field")
|
1112
1181
|
}),
|
1113
|
-
options: import_zod14.z.array(SelectOption).optional()
|
1182
|
+
options: import_zod14.z.array(SelectOption).optional(),
|
1183
|
+
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
1184
|
+
`
|
1185
|
+
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
1186
|
+
when rendering search parameter labels \u2014 for example, in the search results page to indicate which fields were used in the search.
|
1187
|
+
|
1188
|
+
For example, a field config like { id: "child.firstname", label: { defaultMessage: "First Name(s)" } } would render as "First Name(s)" by default.
|
1189
|
+
|
1190
|
+
A field config like { id: "mother.firstname", label: { defaultMessage: "First Name(s)" } } would also render as "First Name(s)" by default.
|
1191
|
+
|
1192
|
+
So, if both child.firstname and mother.firstname are used in a search, the resulting search criteria labels would be "First Name(s)", "First Name(s)",
|
1193
|
+
which is ambiguous.
|
1194
|
+
|
1195
|
+
Now, if we treat the field ID prefix as a label (e.g., "applicant.firstname" \u2192 "Applicant"), and the field label is already
|
1196
|
+
descriptive \u2014 like { id: "applicant.firstname", label: { defaultMessage: "Applicant's First Name" } } \u2014 then the resulting
|
1197
|
+
label would be "Applicant Applicant's First Name", which is redundant and awkward.
|
1198
|
+
|
1199
|
+
By setting searchCriteriaLabelPrefix to a translation config object, we can explicitly define the desired prefix
|
1200
|
+
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
1201
|
+
`
|
1202
|
+
),
|
1203
|
+
conditionals: import_zod14.z.array(FieldConditional).default([]).optional().describe(
|
1204
|
+
`
|
1205
|
+
In advanced search, we sometimes need to override the default field visibility conditionals.
|
1206
|
+
|
1207
|
+
For example, Informant fields in the declaration form may have conditional logic
|
1208
|
+
that hides them based on other field values. Since the advanced search form reuses
|
1209
|
+
the declaration form config, those same conditionals would apply by default.
|
1210
|
+
|
1211
|
+
However, in advanced search we often want to make all Informant fields searchable,
|
1212
|
+
regardless of their original visibility logic. To do this, we explicitly set their
|
1213
|
+
'conditionals' to an empty array ('[]') in the search config. This ensures they
|
1214
|
+
are always rendered in the advanced search form.
|
1215
|
+
`
|
1216
|
+
)
|
1114
1217
|
});
|
1218
|
+
var SearchQueryParams = import_zod14.z.object({
|
1219
|
+
eventType: import_zod14.z.string().optional().describe(
|
1220
|
+
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
1221
|
+
)
|
1222
|
+
}).catchall(FieldValue);
|
1115
1223
|
var FieldConfigSchema = BaseField3.extend({
|
1116
1224
|
fieldId: import_zod14.z.string(),
|
1117
1225
|
fieldType: import_zod14.z.literal("field")
|
1118
1226
|
});
|
1119
|
-
var EventFieldId = import_zod14.z.enum([
|
1227
|
+
var EventFieldId = import_zod14.z.enum([
|
1228
|
+
"trackingId",
|
1229
|
+
"status",
|
1230
|
+
"legalStatus.REGISTERED.createdAt",
|
1231
|
+
"legalStatus.REGISTERED.createdAtLocation",
|
1232
|
+
"updatedAt"
|
1233
|
+
]);
|
1120
1234
|
var EventFieldConfigSchema = BaseField3.extend({
|
1121
1235
|
fieldId: EventFieldId,
|
1122
1236
|
fieldType: import_zod14.z.literal("event")
|
@@ -1134,114 +1248,127 @@ var AdvancedSearchConfig = import_zod14.z.object({
|
|
1134
1248
|
var import_lodash = require("lodash");
|
1135
1249
|
|
1136
1250
|
// ../commons/src/events/ActionDocument.ts
|
1251
|
+
var import_zod16 = require("zod");
|
1252
|
+
var import_zod_openapi7 = require("zod-openapi");
|
1253
|
+
|
1254
|
+
// ../commons/src/events/CreatedAtLocation.ts
|
1137
1255
|
var import_zod15 = require("zod");
|
1138
|
-
var
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1256
|
+
var CreatedAtLocation = import_zod15.z.string().nullish();
|
1257
|
+
|
1258
|
+
// ../commons/src/events/ActionDocument.ts
|
1259
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod16.z);
|
1260
|
+
var ActionUpdate = import_zod16.z.record(import_zod16.z.string(), FieldUpdateValue);
|
1261
|
+
var EventState = import_zod16.z.record(import_zod16.z.string(), FieldValue);
|
1142
1262
|
var ActionStatus = {
|
1143
1263
|
Requested: "Requested",
|
1144
1264
|
Accepted: "Accepted",
|
1145
1265
|
Rejected: "Rejected"
|
1146
1266
|
};
|
1147
|
-
var ActionBase =
|
1148
|
-
id:
|
1149
|
-
transactionId:
|
1150
|
-
createdAt:
|
1151
|
-
createdBy:
|
1152
|
-
createdByRole:
|
1267
|
+
var ActionBase = import_zod16.z.object({
|
1268
|
+
id: import_zod16.z.string(),
|
1269
|
+
transactionId: import_zod16.z.string(),
|
1270
|
+
createdAt: import_zod16.z.string().datetime(),
|
1271
|
+
createdBy: import_zod16.z.string(),
|
1272
|
+
createdByRole: import_zod16.z.string(),
|
1273
|
+
createdBySignature: import_zod16.z.string().nullish().describe("URL to Signature file of the user who created the action"),
|
1274
|
+
createdAtLocation: CreatedAtLocation,
|
1153
1275
|
declaration: ActionUpdate,
|
1154
1276
|
annotation: ActionUpdate.optional(),
|
1155
|
-
|
1156
|
-
status: import_zod15.z.enum([
|
1277
|
+
status: import_zod16.z.enum([
|
1157
1278
|
ActionStatus.Requested,
|
1158
1279
|
ActionStatus.Accepted,
|
1159
1280
|
ActionStatus.Rejected
|
1160
1281
|
]),
|
1161
1282
|
// If the action is an asynchronous confirmation for another action, we will save the original action id here.
|
1162
|
-
originalActionId:
|
1283
|
+
originalActionId: import_zod16.z.string().optional()
|
1163
1284
|
});
|
1164
1285
|
var AssignedAction = ActionBase.merge(
|
1165
|
-
|
1166
|
-
type:
|
1167
|
-
assignedTo:
|
1286
|
+
import_zod16.z.object({
|
1287
|
+
type: import_zod16.z.literal(ActionType.ASSIGN),
|
1288
|
+
assignedTo: import_zod16.z.string()
|
1168
1289
|
})
|
1169
1290
|
);
|
1170
1291
|
var UnassignedAction = ActionBase.merge(
|
1171
|
-
|
1172
|
-
type:
|
1173
|
-
assignedTo:
|
1292
|
+
import_zod16.z.object({
|
1293
|
+
type: import_zod16.z.literal(ActionType.UNASSIGN),
|
1294
|
+
assignedTo: import_zod16.z.literal(null)
|
1174
1295
|
})
|
1175
1296
|
);
|
1176
1297
|
var RegisterAction = ActionBase.merge(
|
1177
|
-
|
1178
|
-
type:
|
1179
|
-
registrationNumber:
|
1298
|
+
import_zod16.z.object({
|
1299
|
+
type: import_zod16.z.literal(ActionType.REGISTER),
|
1300
|
+
registrationNumber: import_zod16.z.string().optional()
|
1180
1301
|
})
|
1181
1302
|
);
|
1182
1303
|
var DeclareAction = ActionBase.merge(
|
1183
|
-
|
1184
|
-
type:
|
1304
|
+
import_zod16.z.object({
|
1305
|
+
type: import_zod16.z.literal(ActionType.DECLARE)
|
1185
1306
|
})
|
1186
1307
|
);
|
1187
1308
|
var ValidateAction = ActionBase.merge(
|
1188
|
-
|
1189
|
-
type:
|
1309
|
+
import_zod16.z.object({
|
1310
|
+
type: import_zod16.z.literal(ActionType.VALIDATE)
|
1190
1311
|
})
|
1191
1312
|
);
|
1313
|
+
var RejectionReason = import_zod16.z.object({
|
1314
|
+
message: import_zod16.z.string().min(1, { message: "Message cannot be empty" }).describe("Message describing reason for rejection or archiving"),
|
1315
|
+
isDuplicate: import_zod16.z.boolean().optional().describe("If a declaration is duplicated")
|
1316
|
+
});
|
1192
1317
|
var RejectAction = ActionBase.merge(
|
1193
|
-
|
1194
|
-
type:
|
1318
|
+
import_zod16.z.object({
|
1319
|
+
type: import_zod16.z.literal(ActionType.REJECT),
|
1320
|
+
reason: RejectionReason
|
1195
1321
|
})
|
1196
1322
|
);
|
1197
1323
|
var MarkAsDuplicateAction = ActionBase.merge(
|
1198
|
-
|
1199
|
-
type:
|
1324
|
+
import_zod16.z.object({
|
1325
|
+
type: import_zod16.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1200
1326
|
})
|
1201
1327
|
);
|
1202
1328
|
var ArchiveAction = ActionBase.merge(
|
1203
|
-
|
1204
|
-
type:
|
1329
|
+
import_zod16.z.object({
|
1330
|
+
type: import_zod16.z.literal(ActionType.ARCHIVE),
|
1331
|
+
reason: RejectionReason
|
1205
1332
|
})
|
1206
1333
|
);
|
1207
1334
|
var CreatedAction = ActionBase.merge(
|
1208
|
-
|
1209
|
-
type:
|
1335
|
+
import_zod16.z.object({
|
1336
|
+
type: import_zod16.z.literal(ActionType.CREATE)
|
1210
1337
|
})
|
1211
1338
|
);
|
1212
1339
|
var NotifiedAction = ActionBase.merge(
|
1213
|
-
|
1214
|
-
type:
|
1340
|
+
import_zod16.z.object({
|
1341
|
+
type: import_zod16.z.literal(ActionType.NOTIFY)
|
1215
1342
|
})
|
1216
1343
|
);
|
1217
1344
|
var PrintCertificateAction = ActionBase.merge(
|
1218
|
-
|
1219
|
-
type:
|
1345
|
+
import_zod16.z.object({
|
1346
|
+
type: import_zod16.z.literal(ActionType.PRINT_CERTIFICATE)
|
1220
1347
|
})
|
1221
1348
|
);
|
1222
1349
|
var RequestedCorrectionAction = ActionBase.merge(
|
1223
|
-
|
1224
|
-
type:
|
1350
|
+
import_zod16.z.object({
|
1351
|
+
type: import_zod16.z.literal(ActionType.REQUEST_CORRECTION)
|
1225
1352
|
})
|
1226
1353
|
);
|
1227
1354
|
var ApprovedCorrectionAction = ActionBase.merge(
|
1228
|
-
|
1229
|
-
type:
|
1230
|
-
requestId:
|
1355
|
+
import_zod16.z.object({
|
1356
|
+
type: import_zod16.z.literal(ActionType.APPROVE_CORRECTION),
|
1357
|
+
requestId: import_zod16.z.string()
|
1231
1358
|
})
|
1232
1359
|
);
|
1233
1360
|
var RejectedCorrectionAction = ActionBase.merge(
|
1234
|
-
|
1235
|
-
type:
|
1236
|
-
requestId:
|
1361
|
+
import_zod16.z.object({
|
1362
|
+
type: import_zod16.z.literal(ActionType.REJECT_CORRECTION),
|
1363
|
+
requestId: import_zod16.z.string()
|
1237
1364
|
})
|
1238
1365
|
);
|
1239
1366
|
var ReadAction = ActionBase.merge(
|
1240
|
-
|
1241
|
-
type:
|
1367
|
+
import_zod16.z.object({
|
1368
|
+
type: import_zod16.z.literal(ActionType.READ)
|
1242
1369
|
})
|
1243
1370
|
);
|
1244
|
-
var ActionDocument =
|
1371
|
+
var ActionDocument = import_zod16.z.discriminatedUnion("type", [
|
1245
1372
|
CreatedAction.openapi({ ref: "CreatedAction" }),
|
1246
1373
|
ValidateAction.openapi({ ref: "ValidateAction" }),
|
1247
1374
|
RejectAction.openapi({ ref: "RejectAction" }),
|
@@ -1264,20 +1391,20 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
1264
1391
|
declaration: true,
|
1265
1392
|
annotation: true
|
1266
1393
|
}).merge(
|
1267
|
-
|
1268
|
-
type:
|
1269
|
-
status:
|
1394
|
+
import_zod16.z.object({
|
1395
|
+
type: import_zod16.z.enum(ConfirmableActions),
|
1396
|
+
status: import_zod16.z.literal(ActionStatus.Rejected)
|
1270
1397
|
})
|
1271
1398
|
);
|
1272
|
-
var Action =
|
1273
|
-
var ResolvedUser =
|
1274
|
-
id:
|
1275
|
-
role:
|
1276
|
-
name:
|
1277
|
-
|
1278
|
-
use:
|
1279
|
-
given:
|
1280
|
-
family:
|
1399
|
+
var Action = import_zod16.z.union([ActionDocument, AsyncRejectActionDocument]);
|
1400
|
+
var ResolvedUser = import_zod16.z.object({
|
1401
|
+
id: import_zod16.z.string(),
|
1402
|
+
role: import_zod16.z.string(),
|
1403
|
+
name: import_zod16.z.array(
|
1404
|
+
import_zod16.z.object({
|
1405
|
+
use: import_zod16.z.string(),
|
1406
|
+
given: import_zod16.z.array(import_zod16.z.string()),
|
1407
|
+
family: import_zod16.z.string()
|
1281
1408
|
})
|
1282
1409
|
)
|
1283
1410
|
});
|
@@ -1288,7 +1415,7 @@ var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
1288
1415
|
var import_date_fns = require("date-fns");
|
1289
1416
|
|
1290
1417
|
// ../commons/src/events/FieldTypeMapping.ts
|
1291
|
-
var
|
1418
|
+
var import_zod17 = require("zod");
|
1292
1419
|
function mapFieldTypeToZod(type, required) {
|
1293
1420
|
let schema;
|
1294
1421
|
switch (type) {
|
@@ -1343,7 +1470,7 @@ function createValidationSchema(config) {
|
|
1343
1470
|
for (const field2 of config) {
|
1344
1471
|
shape[field2.id] = mapFieldTypeToZod(field2.type, field2.required);
|
1345
1472
|
}
|
1346
|
-
return
|
1473
|
+
return import_zod17.z.object(shape);
|
1347
1474
|
}
|
1348
1475
|
function mapFieldTypeToMockValue(field2, i) {
|
1349
1476
|
switch (field2.type) {
|
@@ -1718,10 +1845,7 @@ function getDeclaration(configuration) {
|
|
1718
1845
|
}
|
1719
1846
|
var getActionAnnotationFields = (actionConfig) => {
|
1720
1847
|
if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
|
1721
|
-
return
|
1722
|
-
...actionConfig.onboardingForm.flatMap(({ fields }) => fields),
|
1723
|
-
...actionConfig.additionalDetailsForm.flatMap(({ fields }) => fields)
|
1724
|
-
];
|
1848
|
+
return actionConfig.correctionForm.pages.flatMap(({ fields }) => fields);
|
1725
1849
|
}
|
1726
1850
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
1727
1851
|
return actionConfig.printForm.pages.flatMap(({ fields }) => fields);
|
@@ -1737,7 +1861,7 @@ function getAllAnnotationFields(config) {
|
|
1737
1861
|
var findRecordActionPages = (config, actionType) => {
|
1738
1862
|
const action = config.actions.find((a) => a.type === actionType);
|
1739
1863
|
if (action?.type === ActionType.REQUEST_CORRECTION) {
|
1740
|
-
return
|
1864
|
+
return action.correctionForm.pages;
|
1741
1865
|
}
|
1742
1866
|
if (action?.type === ActionType.PRINT_CERTIFICATE) {
|
1743
1867
|
return action.printForm.pages;
|
@@ -1810,13 +1934,10 @@ function getVisibleVerificationPageIds(pages, annotation) {
|
|
1810
1934
|
}
|
1811
1935
|
function getActionVerificationPageIds(actionConfig, annotation) {
|
1812
1936
|
if (actionConfig.type === ActionType.REQUEST_CORRECTION) {
|
1813
|
-
return
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
annotation
|
1818
|
-
)
|
1819
|
-
];
|
1937
|
+
return getVisibleVerificationPageIds(
|
1938
|
+
actionConfig.correctionForm.pages,
|
1939
|
+
annotation
|
1940
|
+
);
|
1820
1941
|
}
|
1821
1942
|
if (actionConfig.type === ActionType.PRINT_CERTIFICATE) {
|
1822
1943
|
return getVisibleVerificationPageIds(
|
@@ -1890,23 +2011,23 @@ function getMixedPath(obj, path, defaultValue) {
|
|
1890
2011
|
}
|
1891
2012
|
|
1892
2013
|
// ../commons/src/events/EventConfig.ts
|
1893
|
-
var
|
1894
|
-
(0,
|
1895
|
-
var EventConfig =
|
1896
|
-
id:
|
2014
|
+
var import_zod_openapi8 = require("zod-openapi");
|
2015
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod18.z);
|
2016
|
+
var EventConfig = import_zod18.z.object({
|
2017
|
+
id: import_zod18.z.string().describe(
|
1897
2018
|
'A machine-readable identifier for the event, e.g. "birth" or "death"'
|
1898
2019
|
),
|
1899
|
-
dateOfEvent:
|
2020
|
+
dateOfEvent: import_zod18.z.object({ fieldId: import_zod18.z.string() }).optional(),
|
1900
2021
|
title: TranslationConfig,
|
1901
2022
|
fallbackTitle: TranslationConfig.optional().describe(
|
1902
2023
|
"This is a fallback title if actual title resolves to empty string"
|
1903
2024
|
),
|
1904
2025
|
summary: SummaryConfig,
|
1905
2026
|
label: TranslationConfig,
|
1906
|
-
actions:
|
2027
|
+
actions: import_zod18.z.array(ActionConfig),
|
1907
2028
|
declaration: DeclarationFormConfig,
|
1908
|
-
deduplication:
|
1909
|
-
advancedSearch:
|
2029
|
+
deduplication: import_zod18.z.array(DeduplicationConfig).optional().default([]),
|
2030
|
+
advancedSearch: import_zod18.z.array(AdvancedSearchConfig).optional().default([])
|
1910
2031
|
}).superRefine((event2, ctx) => {
|
1911
2032
|
const allFields = findAllFields(event2);
|
1912
2033
|
const fieldIds = allFields.map((field2) => field2.id);
|
@@ -1968,215 +2089,24 @@ var definePage = (page) => PageConfig.parse(page);
|
|
1968
2089
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
1969
2090
|
|
1970
2091
|
// ../commons/src/events/WorkqueueConfig.ts
|
1971
|
-
var
|
2092
|
+
var import_zod25 = require("zod");
|
1972
2093
|
|
1973
|
-
// ../commons/src/events/
|
2094
|
+
// ../commons/src/events/serializers/user/serializer.ts
|
1974
2095
|
var import_zod19 = require("zod");
|
1975
|
-
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
REGISTERED: "REGISTERED",
|
1984
|
-
CERTIFIED: "CERTIFIED",
|
1985
|
-
REJECTED: "REJECTED",
|
1986
|
-
ARCHIVED: "ARCHIVED"
|
1987
|
-
};
|
1988
|
-
var CustomFlags = {
|
1989
|
-
CERTIFICATE_PRINTED: "certificate-printed"
|
1990
|
-
};
|
1991
|
-
var Flag = import_zod18.z.string().regex(
|
1992
|
-
new RegExp(
|
1993
|
-
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(ActionStatus).join("|").toLowerCase()})$`
|
1994
|
-
),
|
1995
|
-
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
1996
|
-
).or(import_zod18.z.nativeEnum(CustomFlags));
|
1997
|
-
var eventStatuses = Object.values(EventStatus);
|
1998
|
-
var EventStatuses = import_zod18.z.nativeEnum(EventStatus);
|
1999
|
-
var ZodDate = import_zod18.z.string().date();
|
2000
|
-
var ActionCreationMetadata = import_zod18.z.object({
|
2001
|
-
createdAt: import_zod18.z.string().datetime().describe("The timestamp when the action request was created."),
|
2002
|
-
createdBy: import_zod18.z.string().describe("ID of the user who created the action request."),
|
2003
|
-
createdAtLocation: import_zod18.z.string().describe("Location of the user who created the action request."),
|
2004
|
-
acceptedAt: import_zod18.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
2005
|
-
createdByRole: import_zod18.z.string().describe("Role of the user at the time of action request creation.")
|
2006
|
-
});
|
2007
|
-
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
2008
|
-
registrationNumber: import_zod18.z.string().describe(
|
2009
|
-
"Registration number of the event. Always present for accepted registrations."
|
2010
|
-
)
|
2011
|
-
});
|
2012
|
-
var LegalStatuses = import_zod18.z.object({
|
2013
|
-
[EventStatus.DECLARED]: ActionCreationMetadata.nullish(),
|
2014
|
-
[EventStatus.REGISTERED]: RegistrationCreationMetadata.nullish()
|
2096
|
+
var SerializedUserField = import_zod19.z.object({
|
2097
|
+
$userField: import_zod19.z.enum([
|
2098
|
+
"id",
|
2099
|
+
"name",
|
2100
|
+
"role",
|
2101
|
+
"signatureFilename",
|
2102
|
+
"primaryOfficeId"
|
2103
|
+
])
|
2015
2104
|
});
|
2016
|
-
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
"Metadata related to the legal registration of the event, such as who registered it and when."
|
2022
|
-
),
|
2023
|
-
createdAt: import_zod18.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
2024
|
-
dateOfEvent: ZodDate.nullish(),
|
2025
|
-
createdBy: import_zod18.z.string().describe("ID of the user who created the event."),
|
2026
|
-
updatedByUserRole: import_zod18.z.string().describe("Role of the user who last updated the declaration."),
|
2027
|
-
createdAtLocation: import_zod18.z.string().describe("Location of the user who created the event."),
|
2028
|
-
updatedAtLocation: import_zod18.z.string().nullish().describe("Location of the user who last updated the declaration."),
|
2029
|
-
updatedAt: import_zod18.z.string().datetime().describe("Timestamp of the most recent declaration update."),
|
2030
|
-
assignedTo: import_zod18.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
2031
|
-
updatedBy: import_zod18.z.string().nullish().describe("ID of the user who last updated the declaration."),
|
2032
|
-
trackingId: import_zod18.z.string().describe(
|
2033
|
-
"System-generated tracking ID used by informants or registrars to look up the event."
|
2034
|
-
),
|
2035
|
-
flags: import_zod18.z.array(Flag)
|
2036
|
-
});
|
2037
|
-
var EventMetadataKeys = import_zod18.z.enum([
|
2038
|
-
"id",
|
2039
|
-
"type",
|
2040
|
-
"status",
|
2041
|
-
"createdAt",
|
2042
|
-
"dateOfEvent",
|
2043
|
-
"createdBy",
|
2044
|
-
"updatedByUserRole",
|
2045
|
-
"createdAtLocation",
|
2046
|
-
"updatedAtLocation",
|
2047
|
-
"updatedAt",
|
2048
|
-
"assignedTo",
|
2049
|
-
"updatedBy",
|
2050
|
-
"trackingId",
|
2051
|
-
"legalStatuses",
|
2052
|
-
"flags"
|
2053
|
-
]);
|
2054
|
-
var EventMetadataParameter = import_zod18.z.object({
|
2055
|
-
// @TODO: Reconcile with the event metadata definition. How could we derive one from the other?
|
2056
|
-
$event: EventMetadataKeys
|
2057
|
-
});
|
2058
|
-
var eventMetadataLabelMap = {
|
2059
|
-
"event.assignedTo": {
|
2060
|
-
id: "event.assignedTo.label",
|
2061
|
-
defaultMessage: "Assigned To",
|
2062
|
-
description: "Assigned To"
|
2063
|
-
},
|
2064
|
-
"event.createdAt": {
|
2065
|
-
id: "event.createdAt.label",
|
2066
|
-
defaultMessage: "Created",
|
2067
|
-
description: "Created At"
|
2068
|
-
},
|
2069
|
-
"event.dateOfEvent": {
|
2070
|
-
id: "event.dateOfEvent.label",
|
2071
|
-
defaultMessage: "Date of Event",
|
2072
|
-
description: "Date of Event"
|
2073
|
-
},
|
2074
|
-
"event.createdAtLocation": {
|
2075
|
-
id: "event.createdAtLocation.label",
|
2076
|
-
defaultMessage: "Location",
|
2077
|
-
description: "Created At Location"
|
2078
|
-
},
|
2079
|
-
"event.updatedAtLocation": {
|
2080
|
-
id: "event.updatedAtLocation.label",
|
2081
|
-
defaultMessage: "Location",
|
2082
|
-
description: "Updated At Location"
|
2083
|
-
},
|
2084
|
-
"event.createdBy": {
|
2085
|
-
id: "event.createdBy.label",
|
2086
|
-
defaultMessage: "Created By",
|
2087
|
-
description: "Created By"
|
2088
|
-
},
|
2089
|
-
"event.updatedByUserRole": {
|
2090
|
-
id: "event.updatedByUserRole.label",
|
2091
|
-
defaultMessage: "Updated By Role",
|
2092
|
-
description: "Updated By Role"
|
2093
|
-
},
|
2094
|
-
"event.id": {
|
2095
|
-
id: "event.id.label",
|
2096
|
-
defaultMessage: "ID",
|
2097
|
-
description: "ID"
|
2098
|
-
},
|
2099
|
-
"event.updatedAt": {
|
2100
|
-
id: "event.modifiedAt.label",
|
2101
|
-
defaultMessage: "Updated",
|
2102
|
-
description: "Modified At"
|
2103
|
-
},
|
2104
|
-
"event.status": {
|
2105
|
-
id: "event.status.label",
|
2106
|
-
defaultMessage: "Status",
|
2107
|
-
description: "Status"
|
2108
|
-
},
|
2109
|
-
"event.type": {
|
2110
|
-
id: "event.type.label",
|
2111
|
-
defaultMessage: "Type",
|
2112
|
-
description: "Type"
|
2113
|
-
},
|
2114
|
-
"event.updatedBy": {
|
2115
|
-
id: "event.updatedBy.label",
|
2116
|
-
defaultMessage: "Updated By",
|
2117
|
-
description: "Updated By"
|
2118
|
-
},
|
2119
|
-
"event.trackingId": {
|
2120
|
-
id: "event.trackingId.label",
|
2121
|
-
defaultMessage: "Tracking ID",
|
2122
|
-
description: "Tracking ID"
|
2123
|
-
},
|
2124
|
-
"event.flags": {
|
2125
|
-
id: "event.flags.label",
|
2126
|
-
defaultMessage: "Flags",
|
2127
|
-
description: "Flags"
|
2128
|
-
}
|
2129
|
-
};
|
2130
|
-
|
2131
|
-
// ../commons/src/events/EventIndex.ts
|
2132
|
-
var EventIndex = EventMetadata.extend({
|
2133
|
-
declaration: EventState
|
2134
|
-
});
|
2135
|
-
var EventSearchIndex = import_zod19.z.record(import_zod19.z.string(), import_zod19.z.any()).and(
|
2136
|
-
import_zod19.z.object({
|
2137
|
-
type: import_zod19.z.string()
|
2138
|
-
// Ensures "type" (event-id) exists and is a string
|
2139
|
-
})
|
2140
|
-
);
|
2141
|
-
var Fuzzy = import_zod19.z.object({ type: import_zod19.z.literal("fuzzy"), term: import_zod19.z.string() });
|
2142
|
-
var Exact = import_zod19.z.object({ type: import_zod19.z.literal("exact"), term: import_zod19.z.string() });
|
2143
|
-
var AnyOf = import_zod19.z.object({
|
2144
|
-
type: import_zod19.z.literal("anyOf"),
|
2145
|
-
terms: import_zod19.z.array(import_zod19.z.string())
|
2146
|
-
});
|
2147
|
-
var Range = import_zod19.z.object({
|
2148
|
-
type: import_zod19.z.literal("range"),
|
2149
|
-
gte: import_zod19.z.string(),
|
2150
|
-
lte: import_zod19.z.string()
|
2151
|
-
});
|
2152
|
-
var Not = import_zod19.z.object({ type: import_zod19.z.literal("not"), term: import_zod19.z.string() });
|
2153
|
-
var Within = import_zod19.z.object({ type: import_zod19.z.literal("within"), location: import_zod19.z.string() });
|
2154
|
-
var DateCondition = import_zod19.z.union([Exact, Range]);
|
2155
|
-
var QueryInput = import_zod19.z.lazy(
|
2156
|
-
() => import_zod19.z.union([
|
2157
|
-
import_zod19.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf, Not]),
|
2158
|
-
import_zod19.z.record(import_zod19.z.string(), QueryInput)
|
2159
|
-
])
|
2160
|
-
);
|
2161
|
-
var QueryExpression = import_zod19.z.object({
|
2162
|
-
type: import_zod19.z.literal("and"),
|
2163
|
-
eventType: import_zod19.z.string(),
|
2164
|
-
status: import_zod19.z.optional(import_zod19.z.union([AnyOf, Exact])),
|
2165
|
-
createdAt: import_zod19.z.optional(DateCondition),
|
2166
|
-
updatedAt: import_zod19.z.optional(DateCondition),
|
2167
|
-
createAtLocation: import_zod19.z.optional(import_zod19.z.union([Within, Exact])),
|
2168
|
-
updatedAtLocation: import_zod19.z.optional(import_zod19.z.union([Within, Exact])),
|
2169
|
-
createdBy: import_zod19.z.optional(Exact),
|
2170
|
-
updatedBy: import_zod19.z.optional(Exact),
|
2171
|
-
trackingId: import_zod19.z.optional(Exact),
|
2172
|
-
flags: import_zod19.z.optional(import_zod19.z.array(import_zod19.z.union([AnyOf, Not]))),
|
2173
|
-
data: QueryInput
|
2174
|
-
}).partial();
|
2175
|
-
var Or2 = import_zod19.z.object({
|
2176
|
-
type: import_zod19.z.literal("or"),
|
2177
|
-
clauses: import_zod19.z.array(QueryExpression)
|
2178
|
-
});
|
2179
|
-
var QueryType = import_zod19.z.discriminatedUnion("type", [QueryExpression, Or2]);
|
2105
|
+
function userSerializer(userField) {
|
2106
|
+
return {
|
2107
|
+
$userField: userField
|
2108
|
+
};
|
2109
|
+
}
|
2180
2110
|
|
2181
2111
|
// ../commons/src/conditionals/conditionals.ts
|
2182
2112
|
function defineConditional(schema) {
|
@@ -2219,7 +2149,7 @@ function not(condition) {
|
|
2219
2149
|
function never() {
|
2220
2150
|
return not(alwaysTrue());
|
2221
2151
|
}
|
2222
|
-
var user = {
|
2152
|
+
var user = Object.assign(userSerializer, {
|
2223
2153
|
hasScope: (scope) => defineConditional({
|
2224
2154
|
type: "object",
|
2225
2155
|
properties: {
|
@@ -2239,7 +2169,7 @@ var user = {
|
|
2239
2169
|
},
|
2240
2170
|
required: ["$user"]
|
2241
2171
|
})
|
2242
|
-
};
|
2172
|
+
});
|
2243
2173
|
function createEventConditionals() {
|
2244
2174
|
return {
|
2245
2175
|
/**
|
@@ -2476,14 +2406,61 @@ function createFieldConditionals(fieldId) {
|
|
2476
2406
|
};
|
2477
2407
|
}
|
2478
2408
|
|
2409
|
+
// ../commons/src/searchConfigs.ts
|
2410
|
+
function createSearchConfig(baseField) {
|
2411
|
+
return {
|
2412
|
+
/**
|
2413
|
+
* Creates a range configuration for the specified field.
|
2414
|
+
*
|
2415
|
+
* @returns An object containing the field ID and a configuration object with a type of 'range'.
|
2416
|
+
*
|
2417
|
+
* @example event('legalStatus.REGISTERED.createdAt').range()
|
2418
|
+
* // {
|
2419
|
+
* // ...
|
2420
|
+
* // config: { type: 'range' }
|
2421
|
+
* // }
|
2422
|
+
*/
|
2423
|
+
range: () => ({
|
2424
|
+
...baseField,
|
2425
|
+
config: { type: "range" }
|
2426
|
+
}),
|
2427
|
+
/**
|
2428
|
+
* Creates a configuration for exact matching of the specified field.
|
2429
|
+
* @returns An object containing the field ID and a configuration object with a type of 'exact'.
|
2430
|
+
* @example field('dob').exact()
|
2431
|
+
* // {
|
2432
|
+
* // ...
|
2433
|
+
* // config: { type: 'exact' }
|
2434
|
+
* // }
|
2435
|
+
*/
|
2436
|
+
exact: () => ({
|
2437
|
+
...baseField,
|
2438
|
+
config: { type: "exact" }
|
2439
|
+
}),
|
2440
|
+
/**
|
2441
|
+
* Creates a configuration for fuzzy matching of the specified field.
|
2442
|
+
* @returns An object containing the field ID and a configuration object with a type of 'exact'.
|
2443
|
+
* @example field('name').fuzzy()
|
2444
|
+
* // {
|
2445
|
+
* // ...
|
2446
|
+
* // config: { type: 'fuzzy' }
|
2447
|
+
* // }
|
2448
|
+
*/
|
2449
|
+
fuzzy: () => ({
|
2450
|
+
...baseField,
|
2451
|
+
config: { type: "fuzzy" }
|
2452
|
+
})
|
2453
|
+
};
|
2454
|
+
}
|
2455
|
+
|
2479
2456
|
// ../commons/src/event-config/event-configuration.ts
|
2480
2457
|
function createEventFieldConfig(fieldId, options) {
|
2481
|
-
|
2458
|
+
const baseField = {
|
2482
2459
|
fieldId,
|
2483
2460
|
options,
|
2484
|
-
config: { type: "exact" },
|
2485
2461
|
fieldType: "event"
|
2486
2462
|
};
|
2463
|
+
return createSearchConfig(baseField);
|
2487
2464
|
}
|
2488
2465
|
|
2489
2466
|
// ../commons/src/events/event.ts
|
@@ -2499,135 +2476,668 @@ var event = Object.assign(eventFn, {
|
|
2499
2476
|
}
|
2500
2477
|
});
|
2501
2478
|
|
2479
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
2480
|
+
var import_zod21 = require("zod");
|
2481
|
+
|
2482
|
+
// ../commons/src/events/EventMetadata.ts
|
2483
|
+
var import_zod20 = require("zod");
|
2484
|
+
var EventStatus = {
|
2485
|
+
CREATED: "CREATED",
|
2486
|
+
NOTIFIED: "NOTIFIED",
|
2487
|
+
DECLARED: "DECLARED",
|
2488
|
+
VALIDATED: "VALIDATED",
|
2489
|
+
REGISTERED: "REGISTERED",
|
2490
|
+
CERTIFIED: "CERTIFIED",
|
2491
|
+
REJECTED: "REJECTED",
|
2492
|
+
ARCHIVED: "ARCHIVED"
|
2493
|
+
};
|
2494
|
+
var eventStatusValues = [
|
2495
|
+
EventStatus.CREATED,
|
2496
|
+
EventStatus.NOTIFIED,
|
2497
|
+
EventStatus.DECLARED,
|
2498
|
+
EventStatus.VALIDATED,
|
2499
|
+
EventStatus.REGISTERED,
|
2500
|
+
EventStatus.CERTIFIED,
|
2501
|
+
EventStatus.REJECTED,
|
2502
|
+
EventStatus.ARCHIVED
|
2503
|
+
];
|
2504
|
+
var EventStatusEnum = import_zod20.z.enum(eventStatusValues);
|
2505
|
+
var CustomFlags = {
|
2506
|
+
CERTIFICATE_PRINTED: "certificate-printed"
|
2507
|
+
};
|
2508
|
+
var Flag = import_zod20.z.string().regex(
|
2509
|
+
new RegExp(
|
2510
|
+
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
2511
|
+
ActionStatus
|
2512
|
+
).join("|").toLowerCase()})$`
|
2513
|
+
),
|
2514
|
+
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
2515
|
+
).or(import_zod20.z.nativeEnum(CustomFlags));
|
2516
|
+
var eventStatuses = Object.values(EventStatus);
|
2517
|
+
var EventStatuses = import_zod20.z.nativeEnum(EventStatus);
|
2518
|
+
var ZodDate = import_zod20.z.string().date();
|
2519
|
+
var ActionCreationMetadata = import_zod20.z.object({
|
2520
|
+
createdAt: import_zod20.z.string().datetime().describe("The timestamp when the action request was created."),
|
2521
|
+
createdBy: import_zod20.z.string().describe("ID of the user who created the action request."),
|
2522
|
+
createdAtLocation: CreatedAtLocation.describe(
|
2523
|
+
"Location of the user who created the action request."
|
2524
|
+
),
|
2525
|
+
acceptedAt: import_zod20.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
2526
|
+
createdByRole: import_zod20.z.string().describe("Role of the user at the time of action request creation.")
|
2527
|
+
});
|
2528
|
+
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
2529
|
+
registrationNumber: import_zod20.z.string().describe(
|
2530
|
+
"Registration number of the event. Always present for accepted registrations."
|
2531
|
+
)
|
2532
|
+
});
|
2533
|
+
var LegalStatuses = import_zod20.z.object({
|
2534
|
+
[EventStatus.DECLARED]: ActionCreationMetadata.nullish(),
|
2535
|
+
[EventStatus.REGISTERED]: RegistrationCreationMetadata.nullish()
|
2536
|
+
});
|
2537
|
+
var EventMetadata = import_zod20.z.object({
|
2538
|
+
id: import_zod20.z.string(),
|
2539
|
+
type: import_zod20.z.string().describe("The type of event, such as birth, death, or marriage."),
|
2540
|
+
status: EventStatuses,
|
2541
|
+
legalStatuses: LegalStatuses.describe(
|
2542
|
+
"Metadata related to the legal registration of the event, such as who registered it and when."
|
2543
|
+
),
|
2544
|
+
createdAt: import_zod20.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
2545
|
+
dateOfEvent: ZodDate.nullish(),
|
2546
|
+
createdBy: import_zod20.z.string().describe("ID of the user who created the event."),
|
2547
|
+
updatedByUserRole: import_zod20.z.string().describe("Role of the user who last updated the declaration."),
|
2548
|
+
createdAtLocation: CreatedAtLocation.describe(
|
2549
|
+
"Location of the user who created the event."
|
2550
|
+
),
|
2551
|
+
createdBySignature: import_zod20.z.string().nullish().describe("Signature of the user who created the event."),
|
2552
|
+
updatedAtLocation: import_zod20.z.string().nullish().describe("Location of the user who last updated the declaration."),
|
2553
|
+
updatedAt: import_zod20.z.string().datetime().describe("Timestamp of the most recent declaration update."),
|
2554
|
+
assignedTo: import_zod20.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
2555
|
+
updatedBy: import_zod20.z.string().nullish().describe("ID of the user who last updated the declaration."),
|
2556
|
+
trackingId: import_zod20.z.string().describe(
|
2557
|
+
"System-generated tracking ID used by informants or registrars to look up the event."
|
2558
|
+
),
|
2559
|
+
flags: import_zod20.z.array(Flag)
|
2560
|
+
});
|
2561
|
+
var EventMetadataKeysArray = [
|
2562
|
+
"id",
|
2563
|
+
"type",
|
2564
|
+
"status",
|
2565
|
+
"createdAt",
|
2566
|
+
"dateOfEvent",
|
2567
|
+
"createdBy",
|
2568
|
+
"updatedByUserRole",
|
2569
|
+
"createdAtLocation",
|
2570
|
+
"updatedAtLocation",
|
2571
|
+
"updatedAt",
|
2572
|
+
"assignedTo",
|
2573
|
+
"updatedBy",
|
2574
|
+
"trackingId",
|
2575
|
+
"legalStatuses",
|
2576
|
+
"flags"
|
2577
|
+
];
|
2578
|
+
var EventMetadataKeys = import_zod20.z.enum(EventMetadataKeysArray);
|
2579
|
+
var eventMetadataLabelMap = {
|
2580
|
+
"event.assignedTo": {
|
2581
|
+
id: "event.assignedTo.label",
|
2582
|
+
defaultMessage: "Assigned To",
|
2583
|
+
description: "Assigned To"
|
2584
|
+
},
|
2585
|
+
"event.createdAt": {
|
2586
|
+
id: "event.createdAt.label",
|
2587
|
+
defaultMessage: "Created",
|
2588
|
+
description: "Created At"
|
2589
|
+
},
|
2590
|
+
"event.dateOfEvent": {
|
2591
|
+
id: "event.dateOfEvent.label",
|
2592
|
+
defaultMessage: "Date of Event",
|
2593
|
+
description: "Date of Event"
|
2594
|
+
},
|
2595
|
+
"event.createdAtLocation": {
|
2596
|
+
id: "event.createdAtLocation.label",
|
2597
|
+
defaultMessage: "Location",
|
2598
|
+
description: "Created At Location"
|
2599
|
+
},
|
2600
|
+
"event.updatedAtLocation": {
|
2601
|
+
id: "event.updatedAtLocation.label",
|
2602
|
+
defaultMessage: "Location",
|
2603
|
+
description: "Updated At Location"
|
2604
|
+
},
|
2605
|
+
"event.createdBy": {
|
2606
|
+
id: "event.createdBy.label",
|
2607
|
+
defaultMessage: "Created By",
|
2608
|
+
description: "Created By"
|
2609
|
+
},
|
2610
|
+
"event.updatedByUserRole": {
|
2611
|
+
id: "event.updatedByUserRole.label",
|
2612
|
+
defaultMessage: "Updated By Role",
|
2613
|
+
description: "Updated By Role"
|
2614
|
+
},
|
2615
|
+
"event.id": {
|
2616
|
+
id: "event.id.label",
|
2617
|
+
defaultMessage: "ID",
|
2618
|
+
description: "ID"
|
2619
|
+
},
|
2620
|
+
"event.updatedAt": {
|
2621
|
+
id: "event.modifiedAt.label",
|
2622
|
+
defaultMessage: "Updated",
|
2623
|
+
description: "Modified At"
|
2624
|
+
},
|
2625
|
+
"event.status": {
|
2626
|
+
id: "event.status.label",
|
2627
|
+
defaultMessage: "Status",
|
2628
|
+
description: "Status"
|
2629
|
+
},
|
2630
|
+
"event.type": {
|
2631
|
+
id: "event.type.label",
|
2632
|
+
defaultMessage: "Type",
|
2633
|
+
description: "Type"
|
2634
|
+
},
|
2635
|
+
"event.updatedBy": {
|
2636
|
+
id: "event.updatedBy.label",
|
2637
|
+
defaultMessage: "Updated By",
|
2638
|
+
description: "Updated By"
|
2639
|
+
},
|
2640
|
+
"event.trackingId": {
|
2641
|
+
id: "event.trackingId.label",
|
2642
|
+
defaultMessage: "Tracking ID",
|
2643
|
+
description: "Tracking ID"
|
2644
|
+
},
|
2645
|
+
"event.flags": {
|
2646
|
+
id: "event.flags.label",
|
2647
|
+
defaultMessage: "Flags",
|
2648
|
+
description: "Flags"
|
2649
|
+
}
|
2650
|
+
};
|
2651
|
+
|
2652
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
2653
|
+
var WorkqueueColumnKeysArray = [
|
2654
|
+
...EventMetadataKeysArray,
|
2655
|
+
"title"
|
2656
|
+
];
|
2657
|
+
var WorkqueueColumnKeys = import_zod21.z.enum(WorkqueueColumnKeysArray);
|
2658
|
+
var WorkqueueColumnValue = import_zod21.z.object({
|
2659
|
+
$event: WorkqueueColumnKeys
|
2660
|
+
});
|
2661
|
+
var WorkqueueColumn = import_zod21.z.object({
|
2662
|
+
label: TranslationConfig,
|
2663
|
+
value: WorkqueueColumnValue
|
2664
|
+
});
|
2665
|
+
function defineWorkqueuesColumns(workqueueColumns) {
|
2666
|
+
return workqueueColumns.map(
|
2667
|
+
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
2668
|
+
);
|
2669
|
+
}
|
2670
|
+
|
2671
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
2672
|
+
var import_zod23 = require("zod");
|
2673
|
+
|
2674
|
+
// ../commons/src/events/EventIndex.ts
|
2675
|
+
var import_zod22 = require("zod");
|
2676
|
+
var import_zod_openapi9 = require("zod-openapi");
|
2677
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod22.z);
|
2678
|
+
var EventIndex = EventMetadata.extend({
|
2679
|
+
declaration: EventState
|
2680
|
+
}).openapi({
|
2681
|
+
ref: "EventIndex"
|
2682
|
+
});
|
2683
|
+
var EventSearchIndex = import_zod22.z.record(import_zod22.z.string(), import_zod22.z.any()).and(
|
2684
|
+
import_zod22.z.object({
|
2685
|
+
type: import_zod22.z.string()
|
2686
|
+
// Ensures "type" (event-id) exists and is a string
|
2687
|
+
})
|
2688
|
+
).openapi({
|
2689
|
+
ref: "EventSearchIndex"
|
2690
|
+
});
|
2691
|
+
var Fuzzy = import_zod22.z.object({ type: import_zod22.z.literal("fuzzy"), term: import_zod22.z.string() }).openapi({
|
2692
|
+
ref: "Fuzzy"
|
2693
|
+
});
|
2694
|
+
var Exact = import_zod22.z.object({ type: import_zod22.z.literal("exact"), term: import_zod22.z.string() }).openapi({
|
2695
|
+
ref: "Exact"
|
2696
|
+
});
|
2697
|
+
var AnyOf = import_zod22.z.object({
|
2698
|
+
type: import_zod22.z.literal("anyOf"),
|
2699
|
+
terms: import_zod22.z.array(import_zod22.z.string())
|
2700
|
+
}).openapi({
|
2701
|
+
ref: "AnyOf"
|
2702
|
+
});
|
2703
|
+
var ExactStatus = import_zod22.z.object({
|
2704
|
+
type: import_zod22.z.literal("exact"),
|
2705
|
+
term: EventStatusEnum
|
2706
|
+
}).openapi({
|
2707
|
+
ref: "ExactStatus"
|
2708
|
+
});
|
2709
|
+
var AnyOfStatus = import_zod22.z.object({
|
2710
|
+
type: import_zod22.z.literal("anyOf"),
|
2711
|
+
terms: import_zod22.z.array(EventStatusEnum)
|
2712
|
+
}).openapi({
|
2713
|
+
ref: "AnyOfStatus"
|
2714
|
+
});
|
2715
|
+
var Range = import_zod22.z.object({
|
2716
|
+
type: import_zod22.z.literal("range"),
|
2717
|
+
gte: import_zod22.z.string(),
|
2718
|
+
lte: import_zod22.z.string()
|
2719
|
+
}).openapi({
|
2720
|
+
ref: "Range"
|
2721
|
+
});
|
2722
|
+
var Not = import_zod22.z.object({ type: import_zod22.z.literal("not"), term: import_zod22.z.string() }).openapi({
|
2723
|
+
ref: "Not"
|
2724
|
+
});
|
2725
|
+
var Within = import_zod22.z.object({ type: import_zod22.z.literal("within"), location: import_zod22.z.string() }).openapi({
|
2726
|
+
ref: "Within"
|
2727
|
+
});
|
2728
|
+
var DateCondition = import_zod22.z.union([Exact, Range]).openapi({
|
2729
|
+
ref: "DateCondition"
|
2730
|
+
});
|
2731
|
+
var QueryInput = import_zod22.z.lazy(
|
2732
|
+
() => import_zod22.z.union([
|
2733
|
+
import_zod22.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf, Not]),
|
2734
|
+
import_zod22.z.record(import_zod22.z.string(), QueryInput)
|
2735
|
+
])
|
2736
|
+
).openapi({
|
2737
|
+
ref: "QueryInput"
|
2738
|
+
});
|
2739
|
+
var QueryExpression = import_zod22.z.object({
|
2740
|
+
eventType: import_zod22.z.string(),
|
2741
|
+
status: import_zod22.z.optional(import_zod22.z.union([AnyOfStatus, ExactStatus])),
|
2742
|
+
createdAt: import_zod22.z.optional(DateCondition),
|
2743
|
+
updatedAt: import_zod22.z.optional(DateCondition),
|
2744
|
+
"legalStatus.REGISTERED.createdAt": import_zod22.z.optional(DateCondition),
|
2745
|
+
"legalStatus.REGISTERED.createdAtLocation": import_zod22.z.optional(
|
2746
|
+
import_zod22.z.union([Within, Exact])
|
2747
|
+
),
|
2748
|
+
createdAtLocation: import_zod22.z.optional(import_zod22.z.union([Within, Exact])),
|
2749
|
+
updatedAtLocation: import_zod22.z.optional(import_zod22.z.union([Within, Exact])),
|
2750
|
+
assignedTo: import_zod22.z.optional(Exact),
|
2751
|
+
createdBy: import_zod22.z.optional(Exact),
|
2752
|
+
updatedBy: import_zod22.z.optional(Exact),
|
2753
|
+
trackingId: import_zod22.z.optional(Exact),
|
2754
|
+
flags: import_zod22.z.optional(import_zod22.z.array(import_zod22.z.union([AnyOf, Not]))),
|
2755
|
+
data: QueryInput
|
2756
|
+
}).partial().openapi({
|
2757
|
+
ref: "QueryExpression"
|
2758
|
+
});
|
2759
|
+
var QueryType = import_zod22.z.object({
|
2760
|
+
type: import_zod22.z.literal("and").or(import_zod22.z.literal("or")).openapi({ default: "and" }),
|
2761
|
+
clauses: import_zod22.z.preprocess(
|
2762
|
+
(val) => {
|
2763
|
+
if (typeof val === "string") {
|
2764
|
+
return [JSON.parse(val)];
|
2765
|
+
}
|
2766
|
+
if (Array.isArray(val)) {
|
2767
|
+
return val.map((v) => typeof v === "string" ? JSON.parse(v) : v);
|
2768
|
+
}
|
2769
|
+
return val;
|
2770
|
+
},
|
2771
|
+
import_zod22.z.array(QueryExpression).openapi({
|
2772
|
+
default: [
|
2773
|
+
{
|
2774
|
+
eventType: TENNIS_CLUB_MEMBERSHIP,
|
2775
|
+
status: {
|
2776
|
+
type: "anyOf",
|
2777
|
+
terms: [
|
2778
|
+
"CREATED",
|
2779
|
+
"NOTIFIED",
|
2780
|
+
"DECLARED",
|
2781
|
+
"VALIDATED",
|
2782
|
+
"REGISTERED",
|
2783
|
+
"CERTIFIED",
|
2784
|
+
"REJECTED",
|
2785
|
+
"ARCHIVED"
|
2786
|
+
]
|
2787
|
+
},
|
2788
|
+
updatedAt: {
|
2789
|
+
type: "range",
|
2790
|
+
gte: "2025-05-22",
|
2791
|
+
lte: "2025-05-29"
|
2792
|
+
},
|
2793
|
+
data: {}
|
2794
|
+
}
|
2795
|
+
]
|
2796
|
+
})
|
2797
|
+
)
|
2798
|
+
}).openapi({
|
2799
|
+
ref: "QueryType"
|
2800
|
+
});
|
2801
|
+
|
2802
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
2803
|
+
var SerializableExact = import_zod23.z.object({
|
2804
|
+
type: import_zod23.z.literal("exact"),
|
2805
|
+
term: import_zod23.z.union([import_zod23.z.string(), SerializedUserField])
|
2806
|
+
});
|
2807
|
+
var SerializableWithin = import_zod23.z.object({
|
2808
|
+
type: import_zod23.z.literal("within"),
|
2809
|
+
location: import_zod23.z.union([import_zod23.z.string(), SerializedUserField])
|
2810
|
+
});
|
2811
|
+
var SerializedQueryExpression = import_zod23.z.object({
|
2812
|
+
eventType: import_zod23.z.string(),
|
2813
|
+
status: import_zod23.z.optional(import_zod23.z.union([AnyOfStatus, ExactStatus])),
|
2814
|
+
createdAt: import_zod23.z.optional(DateCondition),
|
2815
|
+
updatedAt: import_zod23.z.optional(DateCondition),
|
2816
|
+
createdAtLocation: import_zod23.z.optional(
|
2817
|
+
import_zod23.z.union([SerializableWithin, SerializableExact])
|
2818
|
+
),
|
2819
|
+
updatedAtLocation: import_zod23.z.optional(
|
2820
|
+
import_zod23.z.union([SerializableWithin, SerializableExact])
|
2821
|
+
),
|
2822
|
+
assignedTo: import_zod23.z.optional(SerializableExact),
|
2823
|
+
createdBy: import_zod23.z.optional(SerializableExact),
|
2824
|
+
updatedBy: import_zod23.z.optional(SerializableExact),
|
2825
|
+
trackingId: import_zod23.z.optional(Exact),
|
2826
|
+
flags: import_zod23.z.optional(import_zod23.z.array(import_zod23.z.union([AnyOf, Not]))),
|
2827
|
+
data: QueryInput
|
2828
|
+
}).partial();
|
2829
|
+
var Or2 = import_zod23.z.object({
|
2830
|
+
type: import_zod23.z.literal("or"),
|
2831
|
+
clauses: import_zod23.z.array(SerializedQueryExpression)
|
2832
|
+
});
|
2833
|
+
var And2 = import_zod23.z.object({
|
2834
|
+
type: import_zod23.z.literal("and"),
|
2835
|
+
clauses: import_zod23.z.array(SerializedQueryExpression)
|
2836
|
+
});
|
2837
|
+
var CountryConfigQueryType = import_zod23.z.discriminatedUnion("type", [And2, Or2]);
|
2838
|
+
var CountryConfigQueryInputType = import_zod23.z.union([
|
2839
|
+
SerializedQueryExpression,
|
2840
|
+
And2,
|
2841
|
+
Or2
|
2842
|
+
]);
|
2843
|
+
|
2844
|
+
// ../commons/src/icons.ts
|
2845
|
+
var import_zod24 = require("zod");
|
2846
|
+
var AvailableIcons = import_zod24.z.enum([
|
2847
|
+
"Archived",
|
2848
|
+
"Assigned",
|
2849
|
+
"Certified",
|
2850
|
+
"Close",
|
2851
|
+
"Collapse",
|
2852
|
+
"Draft",
|
2853
|
+
"DuplicateYellow",
|
2854
|
+
"Expand",
|
2855
|
+
"ExternalValidate",
|
2856
|
+
"FilledCheck",
|
2857
|
+
"InReview",
|
2858
|
+
"Offline",
|
2859
|
+
"Registered",
|
2860
|
+
"RequiresUpdates",
|
2861
|
+
"Sent",
|
2862
|
+
"Validated",
|
2863
|
+
"WaitingApproval",
|
2864
|
+
"ChartActivity",
|
2865
|
+
"Activity",
|
2866
|
+
"Archive",
|
2867
|
+
"ArchiveTray",
|
2868
|
+
"ArrowLeft",
|
2869
|
+
"ArrowRight",
|
2870
|
+
"Buildings",
|
2871
|
+
"Circle",
|
2872
|
+
"CaretDown",
|
2873
|
+
"CaretLeft",
|
2874
|
+
"CaretRight",
|
2875
|
+
"ChartBar",
|
2876
|
+
"ChartLine",
|
2877
|
+
"ChatCircle",
|
2878
|
+
"CheckSquare",
|
2879
|
+
"Compass",
|
2880
|
+
"Check",
|
2881
|
+
"Copy",
|
2882
|
+
"Database",
|
2883
|
+
"DotsThreeVertical",
|
2884
|
+
"DownloadSimple",
|
2885
|
+
"ArrowCounterClockwise",
|
2886
|
+
"MagnifyingGlassMinus",
|
2887
|
+
"MagnifyingGlassPlus",
|
2888
|
+
"Export",
|
2889
|
+
"Eye",
|
2890
|
+
"EyeSlash",
|
2891
|
+
"Envelope",
|
2892
|
+
"File",
|
2893
|
+
"FileSearch",
|
2894
|
+
"FileMinus",
|
2895
|
+
"FilePlus",
|
2896
|
+
"FileText",
|
2897
|
+
"FileX",
|
2898
|
+
"Handshake",
|
2899
|
+
"Gear",
|
2900
|
+
"GitBranch",
|
2901
|
+
"IdentificationCard",
|
2902
|
+
"List",
|
2903
|
+
"ListBullets",
|
2904
|
+
"Lock",
|
2905
|
+
"MagnifyingGlass",
|
2906
|
+
"MapPin",
|
2907
|
+
"Medal",
|
2908
|
+
"NotePencil",
|
2909
|
+
"Paperclip",
|
2910
|
+
"PaperPlaneTilt",
|
2911
|
+
"Pen",
|
2912
|
+
"Pencil",
|
2913
|
+
"PencilSimpleLine",
|
2914
|
+
"Phone",
|
2915
|
+
"Plus",
|
2916
|
+
"Printer",
|
2917
|
+
"SignOut",
|
2918
|
+
"Star",
|
2919
|
+
"Target",
|
2920
|
+
"TextT",
|
2921
|
+
"Trash",
|
2922
|
+
"UploadSimple",
|
2923
|
+
"User",
|
2924
|
+
"UserPlus",
|
2925
|
+
"Users",
|
2926
|
+
"WarningCircle",
|
2927
|
+
"X",
|
2928
|
+
"CircleWavyCheck",
|
2929
|
+
"CircleWavyQuestion",
|
2930
|
+
"ArchiveBox",
|
2931
|
+
"ArrowCircleDown",
|
2932
|
+
"FileArrowUp",
|
2933
|
+
"FileDotted",
|
2934
|
+
"Files",
|
2935
|
+
"PencilLine",
|
2936
|
+
"PencilCircle",
|
2937
|
+
"UserCircle",
|
2938
|
+
"Clock",
|
2939
|
+
"QrCode",
|
2940
|
+
"Webcam",
|
2941
|
+
"Sun",
|
2942
|
+
"DeviceTabletCamera",
|
2943
|
+
"Globe",
|
2944
|
+
"Fingerprint",
|
2945
|
+
"PushPin",
|
2946
|
+
"Timer"
|
2947
|
+
]);
|
2948
|
+
|
2502
2949
|
// ../commons/src/events/WorkqueueConfig.ts
|
2503
|
-
var
|
2504
|
-
|
2950
|
+
var dateOfEventColumn = defineWorkqueuesColumns([
|
2951
|
+
{
|
2952
|
+
label: {
|
2953
|
+
id: "workqueues.dateOfEvent",
|
2954
|
+
defaultMessage: "Date of Event",
|
2955
|
+
description: "Label for workqueue column: dateOfEvent"
|
2956
|
+
},
|
2957
|
+
value: event.field("dateOfEvent")
|
2958
|
+
},
|
2959
|
+
{
|
2960
|
+
label: {
|
2961
|
+
defaultMessage: "Last updated",
|
2962
|
+
description: "This is the label for the workqueue column",
|
2963
|
+
id: "workqueue.default.column.modifiedAt"
|
2964
|
+
},
|
2965
|
+
value: event.field("updatedAt")
|
2966
|
+
}
|
2967
|
+
]);
|
2968
|
+
var WorkqueueConfig = import_zod25.z.object({
|
2969
|
+
slug: import_zod25.z.string().describe("Determines the url of the workqueue."),
|
2505
2970
|
name: TranslationConfig.describe(
|
2506
2971
|
"Title of the workflow (both in navigation and on the page)"
|
2507
2972
|
),
|
2508
|
-
query:
|
2509
|
-
actions:
|
2510
|
-
|
2511
|
-
type:
|
2512
|
-
conditionals:
|
2973
|
+
query: CountryConfigQueryType,
|
2974
|
+
actions: import_zod25.z.array(
|
2975
|
+
import_zod25.z.object({
|
2976
|
+
type: import_zod25.z.string(),
|
2977
|
+
conditionals: import_zod25.z.array(Conditional).optional()
|
2513
2978
|
})
|
2514
2979
|
),
|
2515
|
-
columns:
|
2516
|
-
|
2517
|
-
).default([
|
2518
|
-
{
|
2519
|
-
label: {
|
2520
|
-
id: "workqueues.dateOfEvent",
|
2521
|
-
defaultMessage: "Date of Event",
|
2522
|
-
description: "Label for workqueue column: dateOfEvent"
|
2523
|
-
},
|
2524
|
-
value: event.field("dateOfEvent")
|
2525
|
-
}
|
2526
|
-
])
|
2980
|
+
columns: import_zod25.z.array(WorkqueueColumn).default(dateOfEventColumn),
|
2981
|
+
icon: AvailableIcons
|
2527
2982
|
}).describe("Configuration for workqueue.");
|
2528
|
-
|
2529
|
-
|
2983
|
+
var WorkqueueConfigInput = import_zod25.z.object({
|
2984
|
+
slug: import_zod25.z.string().describe("Determines the url of the workqueue."),
|
2985
|
+
name: TranslationConfig.describe(
|
2986
|
+
"Title of the workflow (both in navigation and on the page)"
|
2987
|
+
),
|
2988
|
+
query: CountryConfigQueryInputType,
|
2989
|
+
actions: import_zod25.z.array(
|
2990
|
+
import_zod25.z.object({
|
2991
|
+
type: import_zod25.z.string(),
|
2992
|
+
conditionals: import_zod25.z.array(Conditional).optional()
|
2993
|
+
})
|
2994
|
+
),
|
2995
|
+
columns: import_zod25.z.array(WorkqueueColumn).default(dateOfEventColumn),
|
2996
|
+
icon: AvailableIcons
|
2997
|
+
});
|
2998
|
+
function defineWorkqueue(workqueueInput) {
|
2999
|
+
const queryInput = workqueueInput.query;
|
3000
|
+
const query = "type" in queryInput ? queryInput : { type: "and", clauses: [queryInput] };
|
3001
|
+
return WorkqueueConfig.parse({ ...workqueueInput, query });
|
3002
|
+
}
|
3003
|
+
function defineWorkqueues(workqueues) {
|
3004
|
+
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
2530
3005
|
}
|
3006
|
+
var WorkqueueCountInput = import_zod25.z.array(
|
3007
|
+
import_zod25.z.object({ slug: import_zod25.z.string(), query: QueryType })
|
3008
|
+
);
|
3009
|
+
var WorkqueueCountOutput = import_zod25.z.record(import_zod25.z.string(), import_zod25.z.number());
|
3010
|
+
|
3011
|
+
// ../commons/src/events/workqueueDefaultColumns.ts
|
3012
|
+
var defaultWorkqueueColumns = [
|
3013
|
+
{
|
3014
|
+
label: {
|
3015
|
+
defaultMessage: "Title",
|
3016
|
+
description: "This is the label for the workqueue column",
|
3017
|
+
id: "workqueue.in-reveiw.column.title"
|
3018
|
+
},
|
3019
|
+
value: event.field("title")
|
3020
|
+
},
|
3021
|
+
{
|
3022
|
+
label: {
|
3023
|
+
defaultMessage: "Event",
|
3024
|
+
description: "This is the label for the workqueue column",
|
3025
|
+
id: "workqueue.default.column.event"
|
3026
|
+
},
|
3027
|
+
value: event.field("type")
|
3028
|
+
}
|
3029
|
+
];
|
2531
3030
|
|
2532
3031
|
// ../commons/src/events/Draft.ts
|
2533
|
-
var
|
3032
|
+
var import_zod27 = require("zod");
|
2534
3033
|
|
2535
3034
|
// ../commons/src/events/ActionInput.ts
|
2536
|
-
var
|
2537
|
-
var
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
3035
|
+
var import_zod26 = require("zod");
|
3036
|
+
var import_zod_openapi10 = require("zod-openapi");
|
3037
|
+
var import_uuid3 = require("uuid");
|
3038
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
3039
|
+
var BaseActionInput = import_zod26.z.object({
|
3040
|
+
eventId: import_zod26.z.string(),
|
3041
|
+
transactionId: import_zod26.z.string(),
|
2542
3042
|
declaration: ActionUpdate.default({}),
|
2543
3043
|
annotation: ActionUpdate.optional(),
|
2544
|
-
originalActionId:
|
2545
|
-
keepAssignment:
|
3044
|
+
originalActionId: import_zod26.z.string().optional(),
|
3045
|
+
keepAssignment: import_zod26.z.boolean().optional()
|
2546
3046
|
});
|
2547
3047
|
var CreateActionInput = BaseActionInput.merge(
|
2548
|
-
|
2549
|
-
type:
|
2550
|
-
createdAtLocation:
|
3048
|
+
import_zod26.z.object({
|
3049
|
+
type: import_zod26.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
3050
|
+
createdAtLocation: CreatedAtLocation
|
2551
3051
|
})
|
2552
3052
|
);
|
2553
3053
|
var RegisterActionInput = BaseActionInput.merge(
|
2554
|
-
|
2555
|
-
type:
|
2556
|
-
registrationNumber:
|
3054
|
+
import_zod26.z.object({
|
3055
|
+
type: import_zod26.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
3056
|
+
registrationNumber: import_zod26.z.string().optional()
|
2557
3057
|
})
|
2558
3058
|
);
|
2559
3059
|
var ValidateActionInput = BaseActionInput.merge(
|
2560
|
-
|
2561
|
-
type:
|
2562
|
-
duplicates:
|
3060
|
+
import_zod26.z.object({
|
3061
|
+
type: import_zod26.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE),
|
3062
|
+
duplicates: import_zod26.z.array(import_zod26.z.string())
|
2563
3063
|
})
|
2564
3064
|
);
|
2565
3065
|
var NotifyActionInput = BaseActionInput.merge(
|
2566
|
-
|
2567
|
-
type:
|
3066
|
+
import_zod26.z.object({
|
3067
|
+
type: import_zod26.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
2568
3068
|
})
|
2569
|
-
)
|
3069
|
+
).openapi({
|
3070
|
+
default: {
|
3071
|
+
eventId: "<event-id-here>",
|
3072
|
+
transactionId: (0, import_uuid3.v4)(),
|
3073
|
+
declaration: {},
|
3074
|
+
annotation: {},
|
3075
|
+
type: ActionType.NOTIFY
|
3076
|
+
}
|
3077
|
+
});
|
2570
3078
|
var DeclareActionInput = BaseActionInput.merge(
|
2571
|
-
|
2572
|
-
type:
|
3079
|
+
import_zod26.z.object({
|
3080
|
+
type: import_zod26.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
2573
3081
|
})
|
2574
3082
|
);
|
2575
3083
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
2576
|
-
|
2577
|
-
type:
|
3084
|
+
import_zod26.z.object({
|
3085
|
+
type: import_zod26.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE)
|
2578
3086
|
})
|
2579
3087
|
);
|
2580
3088
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
2581
|
-
|
2582
|
-
type:
|
3089
|
+
import_zod26.z.object({
|
3090
|
+
type: import_zod26.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
3091
|
+
reason: RejectionReason
|
2583
3092
|
})
|
2584
3093
|
);
|
2585
3094
|
var MarkedAsDuplicateActionInput = BaseActionInput.merge(
|
2586
|
-
|
2587
|
-
type:
|
3095
|
+
import_zod26.z.object({
|
3096
|
+
type: import_zod26.z.literal(ActionType.MARKED_AS_DUPLICATE).default(ActionType.MARKED_AS_DUPLICATE)
|
2588
3097
|
})
|
2589
3098
|
);
|
2590
3099
|
var ArchiveActionInput = BaseActionInput.merge(
|
2591
|
-
|
2592
|
-
type:
|
3100
|
+
import_zod26.z.object({
|
3101
|
+
type: import_zod26.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
3102
|
+
reason: RejectionReason
|
2593
3103
|
})
|
2594
3104
|
);
|
2595
3105
|
var AssignActionInput = BaseActionInput.merge(
|
2596
|
-
|
2597
|
-
type:
|
2598
|
-
assignedTo:
|
3106
|
+
import_zod26.z.object({
|
3107
|
+
type: import_zod26.z.literal(ActionType.ASSIGN).default(ActionType.ASSIGN),
|
3108
|
+
assignedTo: import_zod26.z.string()
|
2599
3109
|
})
|
2600
3110
|
);
|
2601
3111
|
var UnassignActionInput = BaseActionInput.merge(
|
2602
|
-
|
2603
|
-
type:
|
2604
|
-
assignedTo:
|
3112
|
+
import_zod26.z.object({
|
3113
|
+
type: import_zod26.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
3114
|
+
assignedTo: import_zod26.z.literal(null).default(null)
|
2605
3115
|
})
|
2606
3116
|
);
|
2607
3117
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
2608
|
-
|
2609
|
-
type:
|
3118
|
+
import_zod26.z.object({
|
3119
|
+
type: import_zod26.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
2610
3120
|
})
|
2611
3121
|
);
|
2612
3122
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
2613
|
-
|
2614
|
-
requestId:
|
2615
|
-
type:
|
3123
|
+
import_zod26.z.object({
|
3124
|
+
requestId: import_zod26.z.string(),
|
3125
|
+
type: import_zod26.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
|
2616
3126
|
})
|
2617
3127
|
);
|
2618
3128
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
2619
|
-
|
2620
|
-
requestId:
|
2621
|
-
type:
|
3129
|
+
import_zod26.z.object({
|
3130
|
+
requestId: import_zod26.z.string(),
|
3131
|
+
type: import_zod26.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
2622
3132
|
})
|
2623
3133
|
);
|
2624
3134
|
var ReadActionInput = BaseActionInput.merge(
|
2625
|
-
|
2626
|
-
type:
|
3135
|
+
import_zod26.z.object({
|
3136
|
+
type: import_zod26.z.literal(ActionType.READ).default(ActionType.READ)
|
2627
3137
|
})
|
2628
3138
|
);
|
2629
|
-
var DeleteActionInput =
|
2630
|
-
var ActionInput =
|
3139
|
+
var DeleteActionInput = import_zod26.z.object({ eventId: import_zod26.z.string() });
|
3140
|
+
var ActionInput = import_zod26.z.discriminatedUnion("type", [
|
2631
3141
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
2632
3142
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
2633
3143
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
@@ -2656,18 +3166,18 @@ var ActionInput = import_zod21.z.discriminatedUnion("type", [
|
|
2656
3166
|
});
|
2657
3167
|
|
2658
3168
|
// ../commons/src/events/Draft.ts
|
2659
|
-
var Draft =
|
2660
|
-
id:
|
2661
|
-
eventId:
|
2662
|
-
transactionId:
|
2663
|
-
createdAt:
|
3169
|
+
var Draft = import_zod27.z.object({
|
3170
|
+
id: import_zod27.z.string(),
|
3171
|
+
eventId: import_zod27.z.string(),
|
3172
|
+
transactionId: import_zod27.z.string(),
|
3173
|
+
createdAt: import_zod27.z.string().datetime(),
|
2664
3174
|
action: ActionBase.extend({
|
2665
3175
|
type: ActionTypes
|
2666
3176
|
}).omit({ id: true })
|
2667
3177
|
});
|
2668
3178
|
var DraftInput = BaseActionInput.extend({
|
2669
3179
|
type: ActionTypes,
|
2670
|
-
status:
|
3180
|
+
status: import_zod27.z.enum([
|
2671
3181
|
ActionStatus.Requested,
|
2672
3182
|
ActionStatus.Accepted,
|
2673
3183
|
ActionStatus.Rejected
|
@@ -2675,25 +3185,24 @@ var DraftInput = BaseActionInput.extend({
|
|
2675
3185
|
});
|
2676
3186
|
|
2677
3187
|
// ../commons/src/events/EventInput.ts
|
2678
|
-
var
|
2679
|
-
var
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2683
|
-
});
|
3188
|
+
var import_zod28 = require("zod");
|
3189
|
+
var import_uuid4 = require("uuid");
|
3190
|
+
var EventInput = import_zod28.z.object({
|
3191
|
+
transactionId: import_zod28.z.string(),
|
3192
|
+
type: import_zod28.z.string()
|
3193
|
+
}).openapi({ default: { transactionId: (0, import_uuid4.v4)(), type: "v2.birth" } });
|
2684
3194
|
|
2685
3195
|
// ../commons/src/events/EventDocument.ts
|
2686
|
-
var
|
2687
|
-
var
|
2688
|
-
(0,
|
2689
|
-
var EventDocument =
|
2690
|
-
id:
|
2691
|
-
type:
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
trackingId: import_zod24.z.string()
|
3196
|
+
var import_zod29 = require("zod");
|
3197
|
+
var import_zod_openapi11 = require("zod-openapi");
|
3198
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod29.z);
|
3199
|
+
var EventDocument = import_zod29.z.object({
|
3200
|
+
id: import_zod29.z.string(),
|
3201
|
+
type: import_zod29.z.string(),
|
3202
|
+
createdAt: import_zod29.z.string().datetime(),
|
3203
|
+
updatedAt: import_zod29.z.string().datetime(),
|
3204
|
+
actions: import_zod29.z.array(Action),
|
3205
|
+
trackingId: import_zod29.z.string()
|
2697
3206
|
}).openapi({ ref: "EventDocument" });
|
2698
3207
|
|
2699
3208
|
// ../commons/src/events/state/utils.ts
|
@@ -2850,23 +3359,34 @@ function getAssignedUserFromActions(actions) {
|
|
2850
3359
|
return user2;
|
2851
3360
|
}, null);
|
2852
3361
|
}
|
3362
|
+
function getAssignedUserSignatureFromActions(actions) {
|
3363
|
+
return actions.reduce((signature, action) => {
|
3364
|
+
if (action.type === ActionType.ASSIGN) {
|
3365
|
+
return action.createdBySignature || null;
|
3366
|
+
}
|
3367
|
+
if (action.type === ActionType.UNASSIGN) {
|
3368
|
+
return null;
|
3369
|
+
}
|
3370
|
+
return signature;
|
3371
|
+
}, null);
|
3372
|
+
}
|
2853
3373
|
function aggregateActionDeclarations(actions) {
|
2854
3374
|
const excludedActions = [
|
2855
3375
|
ActionType.REQUEST_CORRECTION,
|
2856
3376
|
ActionType.PRINT_CERTIFICATE
|
2857
3377
|
];
|
2858
|
-
return actions.reduce((
|
3378
|
+
return actions.reduce((declaration, action) => {
|
2859
3379
|
if (excludedActions.some((excludedAction) => excludedAction === action.type)) {
|
2860
|
-
return
|
3380
|
+
return declaration;
|
2861
3381
|
}
|
2862
3382
|
if (action.type === ActionType.APPROVE_CORRECTION) {
|
2863
3383
|
const requestAction = actions.find(({ id }) => id === action.requestId);
|
2864
3384
|
if (!requestAction) {
|
2865
|
-
return
|
3385
|
+
return declaration;
|
2866
3386
|
}
|
2867
|
-
return deepMerge(
|
3387
|
+
return deepMerge(declaration, requestAction.declaration);
|
2868
3388
|
}
|
2869
|
-
return deepMerge(
|
3389
|
+
return deepMerge(declaration, action.declaration);
|
2870
3390
|
}, {});
|
2871
3391
|
}
|
2872
3392
|
function deepDropNulls(obj) {
|
@@ -2894,7 +3414,7 @@ function getAcceptedActions(event2) {
|
|
2894
3414
|
);
|
2895
3415
|
}
|
2896
3416
|
var DEFAULT_DATE_OF_EVENT_PROPERTY = "createdAt";
|
2897
|
-
function getCurrentEventState(event2) {
|
3417
|
+
function getCurrentEventState(event2, config) {
|
2898
3418
|
const creationAction = event2.actions.find(
|
2899
3419
|
(action) => action.type === ActionType.CREATE
|
2900
3420
|
);
|
@@ -2906,9 +3426,17 @@ function getCurrentEventState(event2) {
|
|
2906
3426
|
event2.actions
|
2907
3427
|
);
|
2908
3428
|
const declaration = aggregateActionDeclarations(acceptedActions);
|
2909
|
-
|
2910
|
-
|
2911
|
-
|
3429
|
+
let dateOfEvent;
|
3430
|
+
if (config.dateOfEvent) {
|
3431
|
+
const parsedDate = ZodDate.safeParse(
|
3432
|
+
declaration[config.dateOfEvent.fieldId]
|
3433
|
+
);
|
3434
|
+
if (parsedDate.success) {
|
3435
|
+
dateOfEvent = parsedDate.data;
|
3436
|
+
}
|
3437
|
+
} else {
|
3438
|
+
dateOfEvent = event2[DEFAULT_DATE_OF_EVENT_PROPERTY].split("T")[0];
|
3439
|
+
}
|
2912
3440
|
return deepDropNulls({
|
2913
3441
|
id: event2.id,
|
2914
3442
|
type: event2.type,
|
@@ -2917,19 +3445,24 @@ function getCurrentEventState(event2) {
|
|
2917
3445
|
createdAt: creationAction.createdAt,
|
2918
3446
|
createdBy: creationAction.createdBy,
|
2919
3447
|
createdAtLocation: creationAction.createdAtLocation,
|
3448
|
+
createdBySignature: creationAction.createdBySignature,
|
2920
3449
|
updatedAt: declarationUpdateMetadata.createdAt,
|
2921
3450
|
assignedTo: getAssignedUserFromActions(acceptedActions),
|
3451
|
+
assignedToSignature: getAssignedUserSignatureFromActions(acceptedActions),
|
2922
3452
|
updatedBy: declarationUpdateMetadata.createdBy,
|
2923
3453
|
updatedAtLocation: declarationUpdateMetadata.createdAtLocation,
|
2924
3454
|
declaration,
|
2925
3455
|
trackingId: event2.trackingId,
|
2926
|
-
// @TODO: unify this with rest of the code. It will trip us if updatedBy has different rules than updatedByUserRole
|
2927
3456
|
updatedByUserRole: declarationUpdateMetadata.createdByRole,
|
2928
3457
|
dateOfEvent,
|
2929
3458
|
flags: getFlagsFromActions(event2.actions)
|
2930
3459
|
});
|
2931
3460
|
}
|
2932
|
-
function getCurrentEventStateWithDrafts(
|
3461
|
+
function getCurrentEventStateWithDrafts({
|
3462
|
+
event: event2,
|
3463
|
+
drafts,
|
3464
|
+
configuration
|
3465
|
+
}) {
|
2933
3466
|
const actions = event2.actions.slice().sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
2934
3467
|
const activeDrafts = findActiveDrafts(event2, drafts).map((draft) => draft.action).flatMap((action) => {
|
2935
3468
|
if (action.type === ActionType.REQUEST_CORRECTION) {
|
@@ -2948,7 +3481,7 @@ function getCurrentEventStateWithDrafts(event2, drafts) {
|
|
2948
3481
|
...event2,
|
2949
3482
|
actions: actionWithDrafts
|
2950
3483
|
};
|
2951
|
-
return getCurrentEventState(withDrafts);
|
3484
|
+
return getCurrentEventState(withDrafts, configuration);
|
2952
3485
|
}
|
2953
3486
|
function applyDraftsToEventIndex(eventIndex, drafts) {
|
2954
3487
|
const indexedAt = eventIndex.updatedAt;
|
@@ -2983,92 +3516,68 @@ function getActionAnnotation({
|
|
2983
3516
|
const eventDrafts = drafts.filter((draft) => draft.eventId === event2.id);
|
2984
3517
|
const sorted = [
|
2985
3518
|
...action ? [action] : [],
|
2986
|
-
...eventDrafts.map((draft) => draft.action)
|
2987
|
-
].sort();
|
2988
|
-
const annotation = sorted.reduce((ann, sortedAction) => {
|
2989
|
-
return deepMerge(ann, sortedAction.annotation ?? {});
|
2990
|
-
}, {});
|
2991
|
-
return deepDropNulls(annotation);
|
2992
|
-
}
|
2993
|
-
|
2994
|
-
// ../commons/src/events/defineConfig.ts
|
2995
|
-
var defineConfig = (config) => {
|
2996
|
-
const input = EventConfig.parse(config);
|
2997
|
-
return input;
|
2998
|
-
};
|
2999
|
-
|
3000
|
-
// ../commons/src/events/transactions.ts
|
3001
|
-
function generateTransactionId() {
|
3002
|
-
return getUUID();
|
3003
|
-
}
|
3004
|
-
|
3005
|
-
// ../commons/src/events/
|
3006
|
-
var
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3014
|
-
return {
|
3015
|
-
/**
|
3016
|
-
* Creates a range configuration for the specified field.
|
3017
|
-
*
|
3018
|
-
* @returns An object containing the field ID and a configuration object with a type of 'range'.
|
3019
|
-
*
|
3020
|
-
* @example field('age').range()
|
3021
|
-
* // {
|
3022
|
-
* // fieldId: 'age',
|
3023
|
-
* // config: { type: 'range' }
|
3024
|
-
* // }
|
3025
|
-
*/
|
3026
|
-
range: () => ({
|
3027
|
-
...baseField,
|
3028
|
-
config: { type: "range" }
|
3029
|
-
}),
|
3030
|
-
/**
|
3031
|
-
* Creates a configuration for exact matching of the specified field.
|
3032
|
-
* @returns An object containing the field ID and a configuration object with a type of 'exact'.
|
3033
|
-
* @example field('dob').exact()
|
3034
|
-
* // {
|
3035
|
-
* // fieldId: 'dob',
|
3036
|
-
* // config: { type: 'exact' }
|
3037
|
-
* // }
|
3038
|
-
*/
|
3039
|
-
exact: () => ({
|
3040
|
-
...baseField,
|
3041
|
-
config: { type: "exact" }
|
3042
|
-
}),
|
3043
|
-
/**
|
3044
|
-
* Creates a configuration for fuzzy matching of the specified field.
|
3045
|
-
* @returns An object containing the field ID and a configuration object with a type of 'exact'.
|
3046
|
-
* @example field('name').fuzzy()
|
3047
|
-
* // {
|
3048
|
-
* // fieldId: 'name',
|
3049
|
-
* // config: { type: 'fuzzy' }
|
3050
|
-
* // }
|
3051
|
-
*/
|
3052
|
-
fuzzy: () => ({
|
3053
|
-
...baseField,
|
3054
|
-
config: { type: "fuzzy" }
|
3519
|
+
...eventDrafts.map((draft) => draft.action)
|
3520
|
+
].sort();
|
3521
|
+
const annotation = sorted.reduce((ann, sortedAction) => {
|
3522
|
+
return deepMerge(ann, sortedAction.annotation ?? {});
|
3523
|
+
}, {});
|
3524
|
+
return deepDropNulls(annotation);
|
3525
|
+
}
|
3526
|
+
|
3527
|
+
// ../commons/src/events/defineConfig.ts
|
3528
|
+
var defineConfig = (config) => {
|
3529
|
+
const input = EventConfig.parse(config);
|
3530
|
+
return input;
|
3531
|
+
};
|
3532
|
+
|
3533
|
+
// ../commons/src/events/transactions.ts
|
3534
|
+
function generateTransactionId() {
|
3535
|
+
return getUUID();
|
3536
|
+
}
|
3537
|
+
|
3538
|
+
// ../commons/src/events/User.ts
|
3539
|
+
var import_zod30 = require("zod");
|
3540
|
+
var User = import_zod30.z.object({
|
3541
|
+
id: import_zod30.z.string(),
|
3542
|
+
name: import_zod30.z.array(
|
3543
|
+
import_zod30.z.object({
|
3544
|
+
use: import_zod30.z.string(),
|
3545
|
+
given: import_zod30.z.array(import_zod30.z.string()),
|
3546
|
+
family: import_zod30.z.string()
|
3055
3547
|
})
|
3548
|
+
),
|
3549
|
+
role: import_zod30.z.string(),
|
3550
|
+
signatureFilename: import_zod30.z.string().optional()
|
3551
|
+
});
|
3552
|
+
|
3553
|
+
// ../commons/src/events/test.utils.ts
|
3554
|
+
var import_lodash2 = require("lodash");
|
3555
|
+
var import_addDays = __toESM(require("date-fns/addDays"));
|
3556
|
+
|
3557
|
+
// ../commons/src/field-config/field-configuration.ts
|
3558
|
+
function createFieldConfig(fieldId, options) {
|
3559
|
+
const baseField = {
|
3560
|
+
fieldId,
|
3561
|
+
fieldType: "field",
|
3562
|
+
...options
|
3056
3563
|
};
|
3564
|
+
return createSearchConfig(baseField);
|
3057
3565
|
}
|
3058
3566
|
|
3059
3567
|
// ../commons/src/events/field.ts
|
3060
|
-
function field(fieldId) {
|
3568
|
+
function field(fieldId, options = {}) {
|
3061
3569
|
return {
|
3062
3570
|
/**
|
3063
3571
|
* @private Internal property used for field reference tracking.
|
3064
3572
|
*/
|
3065
3573
|
_fieldId: fieldId,
|
3066
3574
|
...createFieldConditionals(fieldId),
|
3067
|
-
...
|
3575
|
+
...createFieldConfig(fieldId, options)
|
3068
3576
|
};
|
3069
3577
|
}
|
3070
3578
|
|
3071
|
-
// ../commons/src/fixtures/
|
3579
|
+
// ../commons/src/fixtures/forms.ts
|
3580
|
+
var import_date_fns2 = require("date-fns");
|
3072
3581
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
3073
3582
|
label: {
|
3074
3583
|
id: "v2.event.tennis-club-membership.action.certificate.form.label",
|
@@ -3975,19 +4484,560 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
3975
4484
|
}
|
3976
4485
|
]
|
3977
4486
|
}
|
3978
|
-
]
|
4487
|
+
]
|
4488
|
+
});
|
4489
|
+
var statusOptions = [
|
4490
|
+
{
|
4491
|
+
value: "ALL",
|
4492
|
+
label: {
|
4493
|
+
defaultMessage: "Any status",
|
4494
|
+
description: "Option for form field: status of record",
|
4495
|
+
id: "v2.advancedSearch.form.recordStatusAny"
|
4496
|
+
}
|
4497
|
+
},
|
4498
|
+
{
|
4499
|
+
value: EventStatus.CREATED,
|
4500
|
+
label: {
|
4501
|
+
defaultMessage: "Draft",
|
4502
|
+
description: "Option for form field: status of record",
|
4503
|
+
id: "v2.advancedSearch.form.recordStatusCreated"
|
4504
|
+
}
|
4505
|
+
},
|
4506
|
+
{
|
4507
|
+
value: EventStatus.NOTIFIED,
|
4508
|
+
label: {
|
4509
|
+
defaultMessage: "Notified",
|
4510
|
+
description: "Option for form field: status of record",
|
4511
|
+
id: "v2.advancedSearch.form.recordStatusNotified"
|
4512
|
+
}
|
4513
|
+
},
|
4514
|
+
{
|
4515
|
+
value: EventStatus.DECLARED,
|
4516
|
+
label: {
|
4517
|
+
defaultMessage: "Declared",
|
4518
|
+
description: "Option for form field: status of record",
|
4519
|
+
id: "v2.advancedSearch.form.recordStatusDeclared"
|
4520
|
+
}
|
4521
|
+
},
|
4522
|
+
{
|
4523
|
+
value: EventStatus.VALIDATED,
|
4524
|
+
label: {
|
4525
|
+
defaultMessage: "Validated",
|
4526
|
+
description: "Option for form field: status of record",
|
4527
|
+
id: "v2.advancedSearch.form.recordStatusValidated"
|
4528
|
+
}
|
4529
|
+
},
|
4530
|
+
{
|
4531
|
+
value: EventStatus.REGISTERED,
|
4532
|
+
label: {
|
4533
|
+
defaultMessage: "Registered",
|
4534
|
+
description: "Option for form field: status of record",
|
4535
|
+
id: "v2.advancedSearch.form.recordStatusRegistered"
|
4536
|
+
}
|
4537
|
+
},
|
4538
|
+
{
|
4539
|
+
value: EventStatus.CERTIFIED,
|
4540
|
+
label: {
|
4541
|
+
defaultMessage: "Certified",
|
4542
|
+
description: "Option for form field: status of record",
|
4543
|
+
id: "v2.advancedSearch.form.recordStatusCertified"
|
4544
|
+
}
|
4545
|
+
},
|
4546
|
+
{
|
4547
|
+
value: EventStatus.REJECTED,
|
4548
|
+
label: {
|
4549
|
+
defaultMessage: "Rejected",
|
4550
|
+
description: "Option for form field: status of record",
|
4551
|
+
id: "v2.advancedSearch.form.recordStatusRejected"
|
4552
|
+
}
|
4553
|
+
},
|
4554
|
+
{
|
4555
|
+
value: EventStatus.ARCHIVED,
|
4556
|
+
label: {
|
4557
|
+
defaultMessage: "Archived",
|
4558
|
+
description: "Option for form field: status of record",
|
4559
|
+
id: "v2.advancedSearch.form.recordStatusArchived"
|
4560
|
+
}
|
4561
|
+
}
|
4562
|
+
];
|
4563
|
+
var timePeriodOptions = [
|
4564
|
+
{
|
4565
|
+
label: {
|
4566
|
+
defaultMessage: "Last 7 days",
|
4567
|
+
description: "Label for option of time period select: last 7 days",
|
4568
|
+
id: "form.section.label.timePeriodLast7Days"
|
4569
|
+
},
|
4570
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4571
|
+
/* @__PURE__ */ new Date(),
|
4572
|
+
"yyyy-MM-dd"
|
4573
|
+
)}`
|
4574
|
+
},
|
4575
|
+
{
|
4576
|
+
label: {
|
4577
|
+
defaultMessage: "Last 30 days",
|
4578
|
+
description: "Label for option of time period select: last 30 days",
|
4579
|
+
id: "form.section.label.timePeriodLast30Days"
|
4580
|
+
},
|
4581
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4582
|
+
/* @__PURE__ */ new Date(),
|
4583
|
+
"yyyy-MM-dd"
|
4584
|
+
)}`
|
4585
|
+
},
|
4586
|
+
{
|
4587
|
+
label: {
|
4588
|
+
defaultMessage: "Last 90 days",
|
4589
|
+
description: "Label for option of time period select: last 90 days",
|
4590
|
+
id: "form.section.label.timePeriodLast90Days"
|
4591
|
+
},
|
4592
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4593
|
+
/* @__PURE__ */ new Date(),
|
4594
|
+
"yyyy-MM-dd"
|
4595
|
+
)}`
|
4596
|
+
},
|
4597
|
+
{
|
4598
|
+
label: {
|
4599
|
+
defaultMessage: "Last year",
|
4600
|
+
description: "Label for option of time period select: last year",
|
4601
|
+
id: "form.section.label.timePeriodLastYear"
|
4602
|
+
},
|
4603
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4604
|
+
/* @__PURE__ */ new Date(),
|
4605
|
+
"yyyy-MM-dd"
|
4606
|
+
)}`
|
4607
|
+
}
|
4608
|
+
];
|
4609
|
+
|
4610
|
+
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
4611
|
+
var tennisClubMembershipEvent = defineConfig({
|
4612
|
+
id: TENNIS_CLUB_MEMBERSHIP,
|
4613
|
+
label: {
|
4614
|
+
defaultMessage: "Tennis club membership application",
|
4615
|
+
description: "This is what this event is referred as in the system",
|
4616
|
+
id: "v2.event.tennis-club-membership.label"
|
4617
|
+
},
|
4618
|
+
title: {
|
4619
|
+
defaultMessage: "{applicant.firstname} {applicant.surname}",
|
4620
|
+
description: "This is the title of the summary",
|
4621
|
+
id: "v2.event.tennis-club-membership.title"
|
4622
|
+
},
|
4623
|
+
summary: {
|
4624
|
+
fields: [
|
4625
|
+
{
|
4626
|
+
id: "applicant.firstname",
|
4627
|
+
label: {
|
4628
|
+
defaultMessage: "Applicant's first name",
|
4629
|
+
description: "This is the label for the field",
|
4630
|
+
id: "event.tennis-club-membership.summary.field.firstname.label"
|
4631
|
+
},
|
4632
|
+
value: {
|
4633
|
+
defaultMessage: "{applicant.firstname}",
|
4634
|
+
description: "This is the value to show in the summary",
|
4635
|
+
id: "event.tennis-club-membership.summary.field.firstname"
|
4636
|
+
},
|
4637
|
+
emptyValueMessage: {
|
4638
|
+
defaultMessage: "First name is not provided",
|
4639
|
+
description: "This is the message to show when the field is empty",
|
4640
|
+
id: "event.tennis-club-membership.summary.field.firstname.empty"
|
4641
|
+
}
|
4642
|
+
},
|
4643
|
+
{
|
4644
|
+
fieldId: "applicant.surname",
|
4645
|
+
label: {
|
4646
|
+
defaultMessage: "Applicant's last name",
|
4647
|
+
description: "Label for surname",
|
4648
|
+
id: "v2.event.tennis-club-membership.summary.field.surname.label"
|
4649
|
+
}
|
4650
|
+
},
|
4651
|
+
{
|
4652
|
+
fieldId: "applicant.email"
|
4653
|
+
}
|
4654
|
+
]
|
4655
|
+
},
|
4656
|
+
actions: [
|
4657
|
+
{
|
4658
|
+
type: ActionType.READ,
|
4659
|
+
label: {
|
4660
|
+
id: "v2.event.tennis-club-membership.action.read.label",
|
4661
|
+
defaultMessage: "Read",
|
4662
|
+
description: "Title of the read only page"
|
4663
|
+
},
|
4664
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4665
|
+
},
|
4666
|
+
{
|
4667
|
+
type: ActionType.DECLARE,
|
4668
|
+
label: {
|
4669
|
+
defaultMessage: "Send an application",
|
4670
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4671
|
+
id: "event.tennis-club-membership.action.declare.label"
|
4672
|
+
},
|
4673
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4674
|
+
},
|
4675
|
+
{
|
4676
|
+
type: ActionType.VALIDATE,
|
4677
|
+
label: {
|
4678
|
+
defaultMessage: "Validate",
|
4679
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4680
|
+
id: "event.tennis-club-membership.action.validate.label"
|
4681
|
+
},
|
4682
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4683
|
+
},
|
4684
|
+
{
|
4685
|
+
type: ActionType.REGISTER,
|
4686
|
+
label: {
|
4687
|
+
defaultMessage: "Register",
|
4688
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4689
|
+
id: "event.tennis-club-membership.action.register.label"
|
4690
|
+
},
|
4691
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4692
|
+
},
|
4693
|
+
{
|
4694
|
+
type: ActionType.REQUEST_CORRECTION,
|
4695
|
+
label: {
|
4696
|
+
defaultMessage: "Request correction",
|
4697
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4698
|
+
id: "event.tennis-club-membership.action.correction.request.label"
|
4699
|
+
},
|
4700
|
+
correctionForm: {
|
4701
|
+
label: {
|
4702
|
+
id: "v2.event.tennis-club-membership.action.request-correction.label",
|
4703
|
+
defaultMessage: "Request correction",
|
4704
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4705
|
+
},
|
4706
|
+
pages: [
|
4707
|
+
{
|
4708
|
+
id: "correction-requester",
|
4709
|
+
type: PageTypes.enum.FORM,
|
4710
|
+
title: {
|
4711
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4712
|
+
defaultMessage: "Correction requester",
|
4713
|
+
description: "This is the title of the section"
|
4714
|
+
},
|
4715
|
+
fields: [
|
4716
|
+
{
|
4717
|
+
id: "correction.requester.relationshop.intro",
|
4718
|
+
type: "PAGE_HEADER",
|
4719
|
+
label: {
|
4720
|
+
id: "correction.requester.relationshop.intro.label",
|
4721
|
+
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
4722
|
+
description: "The title for the corrector form"
|
4723
|
+
}
|
4724
|
+
},
|
4725
|
+
{
|
4726
|
+
id: "correction.requester.relationship",
|
4727
|
+
type: "RADIO_GROUP",
|
4728
|
+
label: {
|
4729
|
+
id: "v2.correction.corrector.title",
|
4730
|
+
defaultMessage: "Who is requesting a change to this record?",
|
4731
|
+
description: "The title for the corrector form"
|
4732
|
+
},
|
4733
|
+
defaultValue: "",
|
4734
|
+
options: [
|
4735
|
+
{
|
4736
|
+
value: "INFORMANT",
|
4737
|
+
label: {
|
4738
|
+
id: "v2.correction.corrector.informant",
|
4739
|
+
defaultMessage: "Informant",
|
4740
|
+
description: "Label for informant option in certificate correction form"
|
4741
|
+
}
|
4742
|
+
},
|
4743
|
+
{
|
4744
|
+
value: "ANOTHER_AGENT",
|
4745
|
+
label: {
|
4746
|
+
id: "v2.correction.corrector.anotherAgent",
|
4747
|
+
defaultMessage: "Another registration agent or field agent",
|
4748
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
4749
|
+
}
|
4750
|
+
},
|
4751
|
+
{
|
4752
|
+
value: "REGISTRAR",
|
4753
|
+
label: {
|
4754
|
+
id: "v2.correction.corrector.me",
|
4755
|
+
defaultMessage: "Me (Registrar)",
|
4756
|
+
description: "Label for registrar option in certificate correction form"
|
4757
|
+
}
|
4758
|
+
},
|
4759
|
+
{
|
4760
|
+
value: "OTHER",
|
4761
|
+
label: {
|
4762
|
+
id: "v2.correction.corrector.others",
|
4763
|
+
defaultMessage: "Someone else",
|
4764
|
+
description: "Label for someone else option in certificate correction form"
|
4765
|
+
}
|
4766
|
+
}
|
4767
|
+
]
|
4768
|
+
}
|
4769
|
+
]
|
4770
|
+
},
|
4771
|
+
{
|
4772
|
+
id: "identity-check",
|
4773
|
+
type: PageTypes.enum.FORM,
|
4774
|
+
title: {
|
4775
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4776
|
+
defaultMessage: "Verify their identity",
|
4777
|
+
description: "This is the title of the section"
|
4778
|
+
},
|
4779
|
+
fields: [
|
4780
|
+
{
|
4781
|
+
id: "correction.identity-check.instructions",
|
4782
|
+
type: "PAGE_HEADER",
|
4783
|
+
label: {
|
4784
|
+
id: "correction.corrector.identity.instruction",
|
4785
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
4786
|
+
description: "The title for the corrector form"
|
4787
|
+
}
|
4788
|
+
},
|
4789
|
+
{
|
4790
|
+
id: "correction.identity-check.verified",
|
4791
|
+
type: "RADIO_GROUP",
|
4792
|
+
label: {
|
4793
|
+
id: "correction.corrector.identity.verified.label",
|
4794
|
+
defaultMessage: "Identity verified",
|
4795
|
+
description: "The title for the corrector form"
|
4796
|
+
},
|
4797
|
+
defaultValue: "",
|
4798
|
+
required: true,
|
4799
|
+
options: [
|
4800
|
+
{
|
4801
|
+
value: "VERIFIED",
|
4802
|
+
label: {
|
4803
|
+
id: "correction.corrector.identity.verified",
|
4804
|
+
defaultMessage: "I have verified their identity",
|
4805
|
+
description: "Label for verified option in corrector identity check page"
|
4806
|
+
}
|
4807
|
+
}
|
4808
|
+
]
|
4809
|
+
}
|
4810
|
+
]
|
4811
|
+
},
|
4812
|
+
{
|
4813
|
+
id: "correction-request.supporting-documents",
|
4814
|
+
type: PageTypes.enum.FORM,
|
4815
|
+
title: {
|
4816
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4817
|
+
defaultMessage: "Upload supporting documents",
|
4818
|
+
description: "This is the title of the section"
|
4819
|
+
},
|
4820
|
+
fields: [
|
4821
|
+
{
|
4822
|
+
id: "correction.supportingDocs.introduction",
|
4823
|
+
type: "PAGE_HEADER",
|
4824
|
+
label: {
|
4825
|
+
id: "correction.corrector.paragraph.title",
|
4826
|
+
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
4827
|
+
description: "The title for the corrector form"
|
4828
|
+
}
|
4829
|
+
},
|
4830
|
+
{
|
4831
|
+
id: "correction.supportingDocs",
|
4832
|
+
type: FieldType.FILE,
|
4833
|
+
label: {
|
4834
|
+
id: "correction.corrector.title",
|
4835
|
+
defaultMessage: "Upload supporting documents",
|
4836
|
+
description: "The title for the corrector form"
|
4837
|
+
}
|
4838
|
+
},
|
4839
|
+
{
|
4840
|
+
id: "correction.request.supportingDocuments",
|
4841
|
+
type: "RADIO_GROUP",
|
4842
|
+
label: {
|
4843
|
+
id: "correction.corrector.title",
|
4844
|
+
defaultMessage: "Who is requesting a change to this record?",
|
4845
|
+
description: "The title for the corrector form"
|
4846
|
+
},
|
4847
|
+
defaultValue: "",
|
4848
|
+
configuration: {
|
4849
|
+
styles: {
|
4850
|
+
size: "NORMAL"
|
4851
|
+
}
|
4852
|
+
},
|
4853
|
+
options: [
|
4854
|
+
{
|
4855
|
+
value: "ATTEST",
|
4856
|
+
label: {
|
4857
|
+
id: "correction.supportingDocuments.attest.label",
|
4858
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
4859
|
+
description: ""
|
4860
|
+
}
|
4861
|
+
},
|
4862
|
+
{
|
4863
|
+
value: "NOT_NEEDED",
|
4864
|
+
label: {
|
4865
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
4866
|
+
defaultMessage: "No supporting documents required",
|
4867
|
+
description: ""
|
4868
|
+
}
|
4869
|
+
}
|
4870
|
+
]
|
4871
|
+
}
|
4872
|
+
]
|
4873
|
+
},
|
4874
|
+
{
|
4875
|
+
id: "correction-request.additional-details",
|
4876
|
+
type: PageTypes.enum.FORM,
|
4877
|
+
title: {
|
4878
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4879
|
+
defaultMessage: "Reason for correction",
|
4880
|
+
description: "This is the title of the section"
|
4881
|
+
},
|
4882
|
+
fields: [
|
4883
|
+
{
|
4884
|
+
id: "correction.request.reason",
|
4885
|
+
type: FieldType.TEXT,
|
4886
|
+
label: {
|
4887
|
+
id: "correction.reason.title",
|
4888
|
+
defaultMessage: "Reason for correction?",
|
4889
|
+
description: "The title for the corrector form"
|
4890
|
+
}
|
4891
|
+
}
|
4892
|
+
]
|
4893
|
+
}
|
4894
|
+
]
|
4895
|
+
}
|
4896
|
+
},
|
4897
|
+
{
|
4898
|
+
type: ActionType.APPROVE_CORRECTION,
|
4899
|
+
label: {
|
4900
|
+
defaultMessage: "Approve correction",
|
4901
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4902
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
4903
|
+
}
|
4904
|
+
},
|
4905
|
+
{
|
4906
|
+
type: ActionType.PRINT_CERTIFICATE,
|
4907
|
+
label: {
|
4908
|
+
id: "v2.event.tennis-club-membership.action.collect-certificate.label",
|
4909
|
+
defaultMessage: "Print certificate",
|
4910
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4911
|
+
},
|
4912
|
+
printForm: PRINT_CERTIFICATE_FORM,
|
4913
|
+
conditionals: [
|
4914
|
+
{
|
4915
|
+
type: "SHOW",
|
4916
|
+
conditional: defineConditional({
|
4917
|
+
type: "object",
|
4918
|
+
properties: {
|
4919
|
+
$event: {
|
4920
|
+
type: "object",
|
4921
|
+
properties: {
|
4922
|
+
actions: {
|
4923
|
+
type: "array",
|
4924
|
+
contains: {
|
4925
|
+
type: "object",
|
4926
|
+
properties: {
|
4927
|
+
type: {
|
4928
|
+
const: "REGISTER"
|
4929
|
+
},
|
4930
|
+
draft: {
|
4931
|
+
type: "boolean"
|
4932
|
+
}
|
4933
|
+
},
|
4934
|
+
required: ["type"],
|
4935
|
+
not: {
|
4936
|
+
properties: {
|
4937
|
+
draft: {
|
4938
|
+
const: true
|
4939
|
+
}
|
4940
|
+
}
|
4941
|
+
}
|
4942
|
+
}
|
4943
|
+
}
|
4944
|
+
},
|
4945
|
+
required: ["actions"]
|
4946
|
+
}
|
4947
|
+
},
|
4948
|
+
required: ["$event"]
|
4949
|
+
})
|
4950
|
+
}
|
4951
|
+
]
|
4952
|
+
},
|
4953
|
+
{
|
4954
|
+
type: ActionType.ARCHIVE,
|
4955
|
+
label: {
|
4956
|
+
id: "v2.event.tennis-club-membership.action.archive.label",
|
4957
|
+
defaultMessage: "Archive",
|
4958
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4959
|
+
}
|
4960
|
+
},
|
4961
|
+
{
|
4962
|
+
type: ActionType.REJECT,
|
4963
|
+
label: {
|
4964
|
+
id: "v2.event.tennis-club-membership.action.reject.label",
|
4965
|
+
defaultMessage: "Reject",
|
4966
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4967
|
+
}
|
4968
|
+
}
|
4969
|
+
],
|
4970
|
+
advancedSearch: [
|
4971
|
+
{
|
4972
|
+
title: {
|
4973
|
+
defaultMessage: "Registration details",
|
4974
|
+
description: "The title of Registration details accordion",
|
4975
|
+
id: "v2.advancedSearch.form.registrationDetails"
|
4976
|
+
},
|
4977
|
+
fields: [
|
4978
|
+
event("legalStatus.REGISTERED.createdAtLocation").exact(),
|
4979
|
+
event("legalStatus.REGISTERED.createdAt").range(),
|
4980
|
+
event("status", statusOptions).exact(),
|
4981
|
+
event("updatedAt", timePeriodOptions).range()
|
4982
|
+
]
|
4983
|
+
},
|
4984
|
+
{
|
4985
|
+
title: {
|
4986
|
+
defaultMessage: "Applicant's details",
|
4987
|
+
description: "Applicant details search field section title",
|
4988
|
+
id: "v2.event.tennis-club-membership.search.applicants"
|
4989
|
+
},
|
4990
|
+
fields: [
|
4991
|
+
field("applicant.firstname").fuzzy(),
|
4992
|
+
field("applicant.surname").fuzzy(),
|
4993
|
+
field("applicant.dob").range(),
|
4994
|
+
field("applicant.email").exact()
|
4995
|
+
]
|
4996
|
+
},
|
4997
|
+
{
|
4998
|
+
title: {
|
4999
|
+
defaultMessage: "Recommender's details",
|
5000
|
+
description: "Recommender details search field section title",
|
5001
|
+
id: "v2.event.tennis-club-membership.search.recommender"
|
5002
|
+
},
|
5003
|
+
fields: [
|
5004
|
+
field("recommender.firstname").fuzzy(),
|
5005
|
+
field("recommender.surname").fuzzy()
|
5006
|
+
]
|
5007
|
+
}
|
5008
|
+
],
|
5009
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
3979
5010
|
});
|
3980
|
-
var
|
3981
|
-
|
5011
|
+
var WorkqueueFixture = defineWorkqueues([
|
5012
|
+
{
|
5013
|
+
columns: [],
|
5014
|
+
slug: "in-progress",
|
5015
|
+
name: {
|
5016
|
+
id: "workqueues.inProgress.title",
|
5017
|
+
defaultMessage: "In progress",
|
5018
|
+
description: "Title of in progress workqueue"
|
5019
|
+
},
|
5020
|
+
query: {
|
5021
|
+
type: "and",
|
5022
|
+
clauses: [{ eventType: tennisClubMembershipEvent.id }]
|
5023
|
+
},
|
5024
|
+
actions: [],
|
5025
|
+
icon: "Draft"
|
5026
|
+
}
|
5027
|
+
]);
|
5028
|
+
|
5029
|
+
// ../commons/src/fixtures/football-club-membership-event.ts
|
5030
|
+
var footballClubMembershipEvent = defineConfig({
|
5031
|
+
id: "FOOTBALL_CLUB_MEMBERSHIP",
|
3982
5032
|
label: {
|
3983
|
-
defaultMessage: "
|
5033
|
+
defaultMessage: "Football club membership application",
|
3984
5034
|
description: "This is what this event is referred as in the system",
|
3985
|
-
id: "event.
|
5035
|
+
id: "event.football-club-membership.label"
|
3986
5036
|
},
|
3987
5037
|
title: {
|
3988
5038
|
defaultMessage: "{applicant.firstname} {applicant.surname}",
|
3989
5039
|
description: "This is the title of the summary",
|
3990
|
-
id: "v2.event.
|
5040
|
+
id: "v2.event.football-club-membership.title"
|
3991
5041
|
},
|
3992
5042
|
summary: {
|
3993
5043
|
fields: [
|
@@ -3996,46 +5046,48 @@ var tennisClubMembershipEvent = defineConfig({
|
|
3996
5046
|
label: {
|
3997
5047
|
defaultMessage: "Applicant's first name",
|
3998
5048
|
description: "This is the label for the field",
|
3999
|
-
id: "event.
|
5049
|
+
id: "event.football-club-membership.summary.field.firstname.label"
|
4000
5050
|
},
|
4001
5051
|
value: {
|
4002
5052
|
defaultMessage: "{applicant.firstname}",
|
4003
5053
|
description: "This is the value to show in the summary",
|
4004
|
-
id: "event.
|
5054
|
+
id: "event.football-club-membership.summary.field.firstname"
|
4005
5055
|
},
|
4006
5056
|
emptyValueMessage: {
|
4007
5057
|
defaultMessage: "First name is not provided",
|
4008
5058
|
description: "This is the message to show when the field is empty",
|
4009
|
-
id: "event.
|
5059
|
+
id: "event.football-club-membership.summary.field.firstname.empty"
|
4010
5060
|
}
|
4011
5061
|
},
|
4012
5062
|
{
|
4013
|
-
|
5063
|
+
fieldId: "applicant.surname",
|
4014
5064
|
label: {
|
4015
5065
|
defaultMessage: "Applicant's last name",
|
4016
|
-
description: "
|
4017
|
-
id: "event.
|
4018
|
-
},
|
4019
|
-
value: {
|
4020
|
-
defaultMessage: "{applicant.surname}",
|
4021
|
-
description: "This is the value to show in the summary",
|
4022
|
-
id: "event.tennis-club-membership.summary.field.surname"
|
4023
|
-
},
|
4024
|
-
emptyValueMessage: {
|
4025
|
-
defaultMessage: "Last name is not provided",
|
4026
|
-
description: "This is the message to show when the field is empty",
|
4027
|
-
id: "event.tennis-club-membership.summary.field.surname.empty"
|
5066
|
+
description: "Label for surname",
|
5067
|
+
id: "v2.event.football-club-membership.summary.field.surname.label"
|
4028
5068
|
}
|
5069
|
+
},
|
5070
|
+
{
|
5071
|
+
fieldId: "applicant.email"
|
4029
5072
|
}
|
4030
5073
|
]
|
4031
5074
|
},
|
4032
5075
|
actions: [
|
5076
|
+
{
|
5077
|
+
type: ActionType.READ,
|
5078
|
+
label: {
|
5079
|
+
id: "v2.event.football-club-membership.action.read.label",
|
5080
|
+
defaultMessage: "Read",
|
5081
|
+
description: "Title of the read only page"
|
5082
|
+
},
|
5083
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
5084
|
+
},
|
4033
5085
|
{
|
4034
5086
|
type: ActionType.DECLARE,
|
4035
5087
|
label: {
|
4036
5088
|
defaultMessage: "Send an application",
|
4037
5089
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4038
|
-
id: "event.
|
5090
|
+
id: "event.football-club-membership.action.declare.label"
|
4039
5091
|
},
|
4040
5092
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4041
5093
|
},
|
@@ -4044,7 +5096,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4044
5096
|
label: {
|
4045
5097
|
defaultMessage: "Validate",
|
4046
5098
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4047
|
-
id: "event.
|
5099
|
+
id: "event.football-club-membership.action.validate.label"
|
4048
5100
|
},
|
4049
5101
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4050
5102
|
},
|
@@ -4053,7 +5105,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4053
5105
|
label: {
|
4054
5106
|
defaultMessage: "Register",
|
4055
5107
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4056
|
-
id: "event.
|
5108
|
+
id: "event.football-club-membership.action.register.label"
|
4057
5109
|
},
|
4058
5110
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4059
5111
|
},
|
@@ -4062,212 +5114,217 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4062
5114
|
label: {
|
4063
5115
|
defaultMessage: "Request correction",
|
4064
5116
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4065
|
-
id: "event.
|
5117
|
+
id: "event.football-club-membership.action.correction.request.label"
|
4066
5118
|
},
|
4067
|
-
|
4068
|
-
{
|
4069
|
-
id: "correction
|
4070
|
-
|
4071
|
-
|
4072
|
-
|
4073
|
-
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4077
|
-
{
|
4078
|
-
id: "
|
4079
|
-
|
4080
|
-
|
4081
|
-
id: "correction.requester.relationshop.intro.label",
|
4082
|
-
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
4083
|
-
description: "The title for the corrector form"
|
4084
|
-
}
|
5119
|
+
correctionForm: {
|
5120
|
+
label: {
|
5121
|
+
id: "event.football-club-membership.action.correction.request.label",
|
5122
|
+
defaultMessage: "Request correction",
|
5123
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
5124
|
+
},
|
5125
|
+
pages: [
|
5126
|
+
{
|
5127
|
+
id: "correction-requester",
|
5128
|
+
type: PageTypes.enum.FORM,
|
5129
|
+
title: {
|
5130
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5131
|
+
defaultMessage: "Correction requester",
|
5132
|
+
description: "This is the title of the section"
|
4085
5133
|
},
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
5134
|
+
fields: [
|
5135
|
+
{
|
5136
|
+
id: "correction.requester.relationshop.intro",
|
5137
|
+
type: "PAGE_HEADER",
|
5138
|
+
label: {
|
5139
|
+
id: "correction.requester.relationshop.intro.label",
|
5140
|
+
defaultMessage: "Note: In the case that the child is now of legal age (18) then only they should be able to request a change to their birth record.",
|
5141
|
+
description: "The title for the corrector form"
|
5142
|
+
}
|
4093
5143
|
},
|
4094
|
-
|
4095
|
-
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4099
|
-
|
4100
|
-
|
4101
|
-
description: "Label for informant option in certificate correction form"
|
4102
|
-
}
|
5144
|
+
{
|
5145
|
+
id: "correction.requester.relationship",
|
5146
|
+
type: "RADIO_GROUP",
|
5147
|
+
label: {
|
5148
|
+
id: "v2.correction.corrector.title",
|
5149
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5150
|
+
description: "The title for the corrector form"
|
4103
5151
|
},
|
4104
|
-
|
4105
|
-
|
4106
|
-
|
4107
|
-
|
4108
|
-
|
4109
|
-
|
4110
|
-
|
4111
|
-
|
4112
|
-
|
4113
|
-
|
4114
|
-
|
4115
|
-
|
4116
|
-
|
4117
|
-
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
4121
|
-
|
4122
|
-
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
5152
|
+
defaultValue: "",
|
5153
|
+
options: [
|
5154
|
+
{
|
5155
|
+
value: "INFORMANT",
|
5156
|
+
label: {
|
5157
|
+
id: "v2.correction.corrector.informant",
|
5158
|
+
defaultMessage: "Informant",
|
5159
|
+
description: "Label for informant option in certificate correction form"
|
5160
|
+
}
|
5161
|
+
},
|
5162
|
+
{
|
5163
|
+
value: "ANOTHER_AGENT",
|
5164
|
+
label: {
|
5165
|
+
id: "v2.correction.corrector.anotherAgent",
|
5166
|
+
defaultMessage: "Another registration agent or field agent",
|
5167
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
5168
|
+
}
|
5169
|
+
},
|
5170
|
+
{
|
5171
|
+
value: "REGISTRAR",
|
5172
|
+
label: {
|
5173
|
+
id: "v2.correction.corrector.me",
|
5174
|
+
defaultMessage: "Me (Registrar)",
|
5175
|
+
description: "Label for registrar option in certificate correction form"
|
5176
|
+
}
|
5177
|
+
},
|
5178
|
+
{
|
5179
|
+
value: "OTHER",
|
5180
|
+
label: {
|
5181
|
+
id: "v2.correction.corrector.others",
|
5182
|
+
defaultMessage: "Someone else",
|
5183
|
+
description: "Label for someone else option in certificate correction form"
|
5184
|
+
}
|
4126
5185
|
}
|
4127
|
-
|
4128
|
-
]
|
4129
|
-
}
|
4130
|
-
]
|
4131
|
-
},
|
4132
|
-
{
|
4133
|
-
id: "identity-check",
|
4134
|
-
type: PageTypes.enum.FORM,
|
4135
|
-
title: {
|
4136
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4137
|
-
defaultMessage: "Verify their identity",
|
4138
|
-
description: "This is the title of the section"
|
4139
|
-
},
|
4140
|
-
fields: [
|
4141
|
-
{
|
4142
|
-
id: "correction.identity-check.instructions",
|
4143
|
-
type: "PAGE_HEADER",
|
4144
|
-
label: {
|
4145
|
-
id: "correction.corrector.identity.instruction",
|
4146
|
-
defaultMessage: "Please verify the identity of the person making this request",
|
4147
|
-
description: "The title for the corrector form"
|
5186
|
+
]
|
4148
5187
|
}
|
5188
|
+
]
|
5189
|
+
},
|
5190
|
+
{
|
5191
|
+
id: "identity-check",
|
5192
|
+
type: PageTypes.enum.FORM,
|
5193
|
+
title: {
|
5194
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5195
|
+
defaultMessage: "Verify their identity",
|
5196
|
+
description: "This is the title of the section"
|
4149
5197
|
},
|
4150
|
-
|
4151
|
-
|
4152
|
-
|
4153
|
-
|
4154
|
-
|
4155
|
-
|
4156
|
-
|
5198
|
+
fields: [
|
5199
|
+
{
|
5200
|
+
id: "correction.identity-check.instructions",
|
5201
|
+
type: "PAGE_HEADER",
|
5202
|
+
label: {
|
5203
|
+
id: "correction.corrector.identity.instruction",
|
5204
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
5205
|
+
description: "The title for the corrector form"
|
5206
|
+
}
|
4157
5207
|
},
|
4158
|
-
|
4159
|
-
|
4160
|
-
|
4161
|
-
{
|
4162
|
-
|
4163
|
-
|
4164
|
-
|
4165
|
-
|
4166
|
-
|
5208
|
+
{
|
5209
|
+
id: "correction.identity-check.verified",
|
5210
|
+
type: "RADIO_GROUP",
|
5211
|
+
label: {
|
5212
|
+
id: "correction.corrector.identity.verified.label",
|
5213
|
+
defaultMessage: "Identity verified",
|
5214
|
+
description: "The title for the corrector form"
|
5215
|
+
},
|
5216
|
+
defaultValue: "",
|
5217
|
+
required: true,
|
5218
|
+
options: [
|
5219
|
+
{
|
5220
|
+
value: "VERIFIED",
|
5221
|
+
label: {
|
5222
|
+
id: "correction.corrector.identity.verified",
|
5223
|
+
defaultMessage: "I have verified their identity",
|
5224
|
+
description: "Label for verified option in corrector identity check page"
|
5225
|
+
}
|
4167
5226
|
}
|
4168
|
-
|
4169
|
-
]
|
4170
|
-
}
|
4171
|
-
]
|
4172
|
-
}
|
4173
|
-
],
|
4174
|
-
additionalDetailsForm: [
|
4175
|
-
{
|
4176
|
-
id: "correction-request.supporting-documents",
|
4177
|
-
type: PageTypes.enum.FORM,
|
4178
|
-
title: {
|
4179
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4180
|
-
defaultMessage: "Upload supporting documents",
|
4181
|
-
description: "This is the title of the section"
|
4182
|
-
},
|
4183
|
-
fields: [
|
4184
|
-
{
|
4185
|
-
id: "correction.supportingDocs.introduction",
|
4186
|
-
type: "PAGE_HEADER",
|
4187
|
-
label: {
|
4188
|
-
id: "correction.corrector.paragraph.title",
|
4189
|
-
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
4190
|
-
description: "The title for the corrector form"
|
4191
|
-
}
|
4192
|
-
},
|
4193
|
-
{
|
4194
|
-
id: "correction.supportingDocs",
|
4195
|
-
type: FieldType.FILE,
|
4196
|
-
label: {
|
4197
|
-
id: "correction.corrector.title",
|
4198
|
-
defaultMessage: "Upload supporting documents",
|
4199
|
-
description: "The title for the corrector form"
|
5227
|
+
]
|
4200
5228
|
}
|
5229
|
+
]
|
5230
|
+
},
|
5231
|
+
{
|
5232
|
+
id: "correction-request.supporting-documents",
|
5233
|
+
type: PageTypes.enum.FORM,
|
5234
|
+
title: {
|
5235
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
5236
|
+
defaultMessage: "Upload supporting documents",
|
5237
|
+
description: "This is the title of the section"
|
4201
5238
|
},
|
4202
|
-
|
4203
|
-
|
4204
|
-
|
4205
|
-
|
4206
|
-
|
4207
|
-
|
4208
|
-
|
5239
|
+
fields: [
|
5240
|
+
{
|
5241
|
+
id: "correction.supportingDocs.introduction",
|
5242
|
+
type: "PAGE_HEADER",
|
5243
|
+
label: {
|
5244
|
+
id: "correction.corrector.paragraph.title",
|
5245
|
+
defaultMessage: "For all record corrections at a minimum an affidavit must be provided. For material errors and omissions eg. in paternity cases, a court order must also be provided.",
|
5246
|
+
description: "The title for the corrector form"
|
5247
|
+
}
|
4209
5248
|
},
|
4210
|
-
|
4211
|
-
|
4212
|
-
|
4213
|
-
|
5249
|
+
{
|
5250
|
+
id: "correction.supportingDocs",
|
5251
|
+
type: FieldType.FILE,
|
5252
|
+
label: {
|
5253
|
+
id: "correction.corrector.title",
|
5254
|
+
defaultMessage: "Upload supporting documents",
|
5255
|
+
description: "The title for the corrector form"
|
4214
5256
|
}
|
4215
5257
|
},
|
4216
|
-
|
4217
|
-
|
4218
|
-
|
4219
|
-
|
4220
|
-
|
4221
|
-
|
4222
|
-
|
5258
|
+
{
|
5259
|
+
id: "correction.request.supportingDocuments",
|
5260
|
+
type: "RADIO_GROUP",
|
5261
|
+
label: {
|
5262
|
+
id: "correction.corrector.title",
|
5263
|
+
defaultMessage: "Who is requesting a change to this record?",
|
5264
|
+
description: "The title for the corrector form"
|
5265
|
+
},
|
5266
|
+
defaultValue: "",
|
5267
|
+
configuration: {
|
5268
|
+
styles: {
|
5269
|
+
size: "NORMAL"
|
4223
5270
|
}
|
4224
5271
|
},
|
4225
|
-
|
4226
|
-
|
4227
|
-
|
4228
|
-
|
4229
|
-
|
4230
|
-
|
5272
|
+
options: [
|
5273
|
+
{
|
5274
|
+
value: "ATTEST",
|
5275
|
+
label: {
|
5276
|
+
id: "correction.supportingDocuments.attest.label",
|
5277
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
5278
|
+
description: ""
|
5279
|
+
}
|
5280
|
+
},
|
5281
|
+
{
|
5282
|
+
value: "NOT_NEEDED",
|
5283
|
+
label: {
|
5284
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
5285
|
+
defaultMessage: "No supporting documents required",
|
5286
|
+
description: ""
|
5287
|
+
}
|
4231
5288
|
}
|
4232
|
-
|
4233
|
-
|
4234
|
-
|
4235
|
-
]
|
4236
|
-
},
|
4237
|
-
{
|
4238
|
-
id: "correction-request.additional-details",
|
4239
|
-
type: PageTypes.enum.FORM,
|
4240
|
-
title: {
|
4241
|
-
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4242
|
-
defaultMessage: "Reason for correction",
|
4243
|
-
description: "This is the title of the section"
|
5289
|
+
]
|
5290
|
+
}
|
5291
|
+
]
|
4244
5292
|
},
|
4245
|
-
|
4246
|
-
|
4247
|
-
|
4248
|
-
|
4249
|
-
|
4250
|
-
|
4251
|
-
|
4252
|
-
|
5293
|
+
{
|
5294
|
+
id: "correction-request.additional-details",
|
5295
|
+
type: PageTypes.enum.FORM,
|
5296
|
+
title: {
|
5297
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
5298
|
+
defaultMessage: "Reason for correction",
|
5299
|
+
description: "This is the title of the section"
|
5300
|
+
},
|
5301
|
+
fields: [
|
5302
|
+
{
|
5303
|
+
id: "correction.request.reason",
|
5304
|
+
type: FieldType.TEXT,
|
5305
|
+
label: {
|
5306
|
+
id: "correction.reason.title",
|
5307
|
+
defaultMessage: "Reason for correction?",
|
5308
|
+
description: "The title for the corrector form"
|
5309
|
+
}
|
4253
5310
|
}
|
4254
|
-
|
4255
|
-
|
4256
|
-
|
4257
|
-
|
5311
|
+
]
|
5312
|
+
}
|
5313
|
+
]
|
5314
|
+
}
|
4258
5315
|
},
|
4259
5316
|
{
|
4260
5317
|
type: ActionType.APPROVE_CORRECTION,
|
4261
5318
|
label: {
|
4262
5319
|
defaultMessage: "Approve correction",
|
4263
5320
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4264
|
-
id: "event.
|
5321
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
4265
5322
|
}
|
4266
5323
|
},
|
4267
5324
|
{
|
4268
5325
|
type: ActionType.PRINT_CERTIFICATE,
|
4269
5326
|
label: {
|
4270
|
-
id: "v2.event.
|
5327
|
+
id: "v2.event.football-club-membership.action.collect-certificate.label",
|
4271
5328
|
defaultMessage: "Print certificate",
|
4272
5329
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4273
5330
|
},
|
@@ -4315,7 +5372,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4315
5372
|
{
|
4316
5373
|
type: ActionType.ARCHIVE,
|
4317
5374
|
label: {
|
4318
|
-
id: "v2.event.
|
5375
|
+
id: "v2.event.football-club-membership.action.archive.label",
|
4319
5376
|
defaultMessage: "Archive",
|
4320
5377
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4321
5378
|
}
|
@@ -4323,7 +5380,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4323
5380
|
{
|
4324
5381
|
type: ActionType.REJECT,
|
4325
5382
|
label: {
|
4326
|
-
id: "v2.event.
|
5383
|
+
id: "v2.event.football-club-membership.action.reject.label",
|
4327
5384
|
defaultMessage: "Reject",
|
4328
5385
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4329
5386
|
}
|
@@ -4332,16 +5389,104 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4332
5389
|
advancedSearch: [
|
4333
5390
|
{
|
4334
5391
|
title: {
|
4335
|
-
defaultMessage: "
|
4336
|
-
description: "
|
4337
|
-
id: "v2.
|
5392
|
+
defaultMessage: "Registration details",
|
5393
|
+
description: "The title of Registration details accordion",
|
5394
|
+
id: "v2.advancedSearch.form.registrationDetails"
|
4338
5395
|
},
|
4339
|
-
fields: [
|
5396
|
+
fields: [
|
5397
|
+
event("legalStatus.REGISTERED.createdAtLocation").exact(),
|
5398
|
+
event("legalStatus.REGISTERED.createdAt").range(),
|
5399
|
+
event("status", statusOptions).exact(),
|
5400
|
+
event("updatedAt", timePeriodOptions).range()
|
5401
|
+
]
|
5402
|
+
},
|
5403
|
+
{
|
5404
|
+
title: {
|
5405
|
+
defaultMessage: "Applicant's details",
|
5406
|
+
description: "Applicant details search field section title",
|
5407
|
+
id: "v2.event.football-club-membership.search.applicants"
|
5408
|
+
},
|
5409
|
+
fields: [
|
5410
|
+
field("applicant.firstname").fuzzy(),
|
5411
|
+
field("applicant.surname").fuzzy(),
|
5412
|
+
field("applicant.dob").range(),
|
5413
|
+
field("applicant.email").exact()
|
5414
|
+
]
|
5415
|
+
},
|
5416
|
+
{
|
5417
|
+
title: {
|
5418
|
+
defaultMessage: "Recommender's details",
|
5419
|
+
description: "Recommender details search field section title",
|
5420
|
+
id: "v2.event.football-club-membership.search.recommender"
|
5421
|
+
},
|
5422
|
+
fields: [
|
5423
|
+
field("recommender.firstname").fuzzy(),
|
5424
|
+
field("recommender.surname").fuzzy()
|
5425
|
+
]
|
4340
5426
|
}
|
4341
5427
|
],
|
4342
5428
|
declaration: TENNIS_CLUB_DECLARATION_FORM
|
4343
5429
|
});
|
4344
5430
|
|
5431
|
+
// ../commons/src/fixtures/library-membership-event.ts
|
5432
|
+
var libraryMembershipForm = defineDeclarationForm({
|
5433
|
+
label: {
|
5434
|
+
id: "v2.event.library-membership.action.declare.form.label",
|
5435
|
+
defaultMessage: "Library membership application",
|
5436
|
+
description: "This is what this form is referred as in the system"
|
5437
|
+
},
|
5438
|
+
pages: [
|
5439
|
+
{
|
5440
|
+
id: "member",
|
5441
|
+
title: {
|
5442
|
+
id: "v2.event.library-membership.action.declare.form.section.who.title",
|
5443
|
+
defaultMessage: "Who is applying for the membership?",
|
5444
|
+
description: "This is the title of the section"
|
5445
|
+
},
|
5446
|
+
fields: [
|
5447
|
+
{
|
5448
|
+
id: "member.firstname",
|
5449
|
+
type: FieldType.TEXT,
|
5450
|
+
required: true,
|
5451
|
+
conditionals: [],
|
5452
|
+
label: {
|
5453
|
+
defaultMessage: "Member's first name",
|
5454
|
+
description: "This is the label for the field",
|
5455
|
+
id: "v2.event.library-membership.action.declare.form.section.who.field.firstname.label"
|
5456
|
+
}
|
5457
|
+
},
|
5458
|
+
{
|
5459
|
+
id: "member.surname",
|
5460
|
+
type: FieldType.TEXT,
|
5461
|
+
required: true,
|
5462
|
+
conditionals: [],
|
5463
|
+
label: {
|
5464
|
+
defaultMessage: "Member's surname",
|
5465
|
+
description: "This is the label for the field",
|
5466
|
+
id: "v2.event.library-membership.action.declare.form.section.who.field.surname.label"
|
5467
|
+
}
|
5468
|
+
}
|
5469
|
+
]
|
5470
|
+
}
|
5471
|
+
]
|
5472
|
+
});
|
5473
|
+
var libraryMembershipEvent = defineConfig({
|
5474
|
+
id: "library-membership",
|
5475
|
+
label: {
|
5476
|
+
defaultMessage: "Library membership application",
|
5477
|
+
description: "This is what this event is referred as in the system",
|
5478
|
+
id: "event.library-membership.label"
|
5479
|
+
},
|
5480
|
+
title: {
|
5481
|
+
defaultMessage: "{member.firstname} {member.surname}",
|
5482
|
+
description: "This is the title of the summary",
|
5483
|
+
id: "v2.event.library-membership.title"
|
5484
|
+
},
|
5485
|
+
summary: { fields: [] },
|
5486
|
+
actions: [],
|
5487
|
+
declaration: libraryMembershipForm
|
5488
|
+
});
|
5489
|
+
|
4345
5490
|
// ../commons/src/events/test.utils.ts
|
4346
5491
|
function fieldConfigsToActionPayload(fields) {
|
4347
5492
|
return fields.reduce(
|
@@ -4389,11 +5534,11 @@ function generateActionAnnotationInput(configuration, action) {
|
|
4389
5534
|
var eventPayloadGenerator = {
|
4390
5535
|
create: (input = {}) => ({
|
4391
5536
|
transactionId: input.transactionId ?? getUUID(),
|
4392
|
-
type: input.type ??
|
5537
|
+
type: input.type ?? TENNIS_CLUB_MEMBERSHIP
|
4393
5538
|
}),
|
4394
5539
|
patch: (id, input = {}) => ({
|
4395
5540
|
transactionId: input.transactionId ?? getUUID(),
|
4396
|
-
type: input.type ??
|
5541
|
+
type: input.type ?? TENNIS_CLUB_MEMBERSHIP,
|
4397
5542
|
id
|
4398
5543
|
}),
|
4399
5544
|
draft: ({ eventId, actionType }, input = {}) => (0, import_lodash2.merge)(
|
@@ -4493,9 +5638,13 @@ var eventPayloadGenerator = {
|
|
4493
5638
|
transactionId: input.transactionId ?? getUUID(),
|
4494
5639
|
declaration: {},
|
4495
5640
|
// @TODO: Check whether generator is needed?
|
4496
|
-
annotation: {
|
5641
|
+
annotation: {},
|
4497
5642
|
duplicates: [],
|
4498
|
-
eventId
|
5643
|
+
eventId,
|
5644
|
+
reason: {
|
5645
|
+
message: `${ActionType.ARCHIVE}`,
|
5646
|
+
isDuplicate: isDuplicate ?? false
|
5647
|
+
}
|
4499
5648
|
}),
|
4500
5649
|
reject: (eventId, input = {}) => ({
|
4501
5650
|
type: ActionType.REJECT,
|
@@ -4506,7 +5655,8 @@ var eventPayloadGenerator = {
|
|
4506
5655
|
ActionType.REJECT
|
4507
5656
|
),
|
4508
5657
|
duplicates: [],
|
4509
|
-
eventId
|
5658
|
+
eventId,
|
5659
|
+
reason: { message: `${ActionType.REJECT}` }
|
4510
5660
|
}),
|
4511
5661
|
register: (eventId, input = {}) => ({
|
4512
5662
|
type: ActionType.REGISTER,
|
@@ -4603,9 +5753,9 @@ function generateActionDocument({
|
|
4603
5753
|
case ActionType.VALIDATE:
|
4604
5754
|
return { ...actionBase, type: action };
|
4605
5755
|
case ActionType.ARCHIVE:
|
4606
|
-
return { ...actionBase, type: action };
|
5756
|
+
return { ...actionBase, type: action, reason: { message: "Archive" } };
|
4607
5757
|
case ActionType.REJECT:
|
4608
|
-
return { ...actionBase, type: action };
|
5758
|
+
return { ...actionBase, type: action, reason: { message: "Reject" } };
|
4609
5759
|
case ActionType.CREATE:
|
4610
5760
|
return { ...actionBase, type: action };
|
4611
5761
|
case ActionType.NOTIFY:
|
@@ -4617,7 +5767,11 @@ function generateActionDocument({
|
|
4617
5767
|
case ActionType.APPROVE_CORRECTION:
|
4618
5768
|
return { ...actionBase, requestId: getUUID(), type: action };
|
4619
5769
|
case ActionType.REJECT_CORRECTION:
|
4620
|
-
return {
|
5770
|
+
return {
|
5771
|
+
...actionBase,
|
5772
|
+
requestId: getUUID(),
|
5773
|
+
type: action
|
5774
|
+
};
|
4621
5775
|
case ActionType.REGISTER:
|
4622
5776
|
return {
|
4623
5777
|
...actionBase,
|
@@ -4645,8 +5799,7 @@ function generateEventDocument({
|
|
4645
5799
|
id: getUUID(),
|
4646
5800
|
// Offset is needed so the createdAt timestamps for events, actions and drafts make logical sense in storybook tests.
|
4647
5801
|
// @TODO: This should be fixed in the future.
|
4648
|
-
updatedAt: new Date(Date.now() - 1e3).toISOString()
|
4649
|
-
dateOfEvent: configuration.dateOfEvent
|
5802
|
+
updatedAt: new Date(Date.now() - 1e3).toISOString()
|
4650
5803
|
};
|
4651
5804
|
}
|
4652
5805
|
function generateEventDraftDocument(eventId, actionType = ActionType.DECLARE, declaration = {}) {
|
@@ -4668,21 +5821,16 @@ function generateEventDraftDocument(eventId, actionType = ActionType.DECLARE, de
|
|
4668
5821
|
eventId
|
4669
5822
|
};
|
4670
5823
|
}
|
4671
|
-
function
|
4672
|
-
|
4673
|
-
EventStatus.CREATED,
|
4674
|
-
EventStatus.REGISTERED,
|
4675
|
-
EventStatus.DECLARED
|
4676
|
-
];
|
4677
|
-
const randomIndex = Math.floor(Math.random() * 3);
|
4678
|
-
return statuses[randomIndex];
|
5824
|
+
function pickRandom(rng, items) {
|
5825
|
+
return items[Math.floor(rng() * items.length)];
|
4679
5826
|
}
|
4680
|
-
function
|
4681
|
-
const
|
4682
|
-
const
|
4683
|
-
|
5827
|
+
function getRandomDatetime(rng, start, end) {
|
5828
|
+
const range = end.getTime() - start.getTime();
|
5829
|
+
const offset = Math.floor(rng() * range);
|
5830
|
+
const randomDate = new Date(start.getTime() + offset);
|
5831
|
+
return randomDate.toISOString();
|
4684
5832
|
}
|
4685
|
-
function
|
5833
|
+
function generateRandomApplicant(rng) {
|
4686
5834
|
const firstNames = [
|
4687
5835
|
"Danny",
|
4688
5836
|
"John",
|
@@ -4703,18 +5851,13 @@ function getRandomApplicant() {
|
|
4703
5851
|
"Garcia",
|
4704
5852
|
"Miller"
|
4705
5853
|
];
|
4706
|
-
|
4707
|
-
|
4708
|
-
|
4709
|
-
|
4710
|
-
return randomDate.toISOString().split("T")[0];
|
4711
|
-
}
|
4712
|
-
const randomFirstName = firstNames[Math.floor(Math.random() * firstNames.length)];
|
4713
|
-
const randomSurname = surnames[Math.floor(Math.random() * surnames.length)];
|
4714
|
-
const randomDob = getRandomDate(
|
5854
|
+
const randomFirstName = pickRandom(rng, firstNames);
|
5855
|
+
const randomSurname = pickRandom(rng, surnames);
|
5856
|
+
const randomDob = getRandomDatetime(
|
5857
|
+
rng,
|
4715
5858
|
/* @__PURE__ */ new Date("1990-01-01"),
|
4716
5859
|
/* @__PURE__ */ new Date("2010-12-31")
|
4717
|
-
);
|
5860
|
+
).split("T")[0];
|
4718
5861
|
return {
|
4719
5862
|
"recommender.none": true,
|
4720
5863
|
"applicant.firstname": randomFirstName,
|
@@ -4722,28 +5865,84 @@ function getRandomApplicant() {
|
|
4722
5865
|
"applicant.dob": randomDob
|
4723
5866
|
};
|
4724
5867
|
}
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
|
4737
|
-
|
4738
|
-
|
4739
|
-
|
4740
|
-
|
4741
|
-
}
|
5868
|
+
function createPseudoRandomNumberGenerator(seed) {
|
5869
|
+
const MODULUS = 2 ** 32;
|
5870
|
+
const MULTIPLIER = 1664525;
|
5871
|
+
const INCREMENT = 1013904223;
|
5872
|
+
let state = seed >>> 0;
|
5873
|
+
return () => {
|
5874
|
+
state = (MULTIPLIER * state + INCREMENT) % MODULUS;
|
5875
|
+
return state / MODULUS;
|
5876
|
+
};
|
5877
|
+
}
|
5878
|
+
function generateUuid(rng) {
|
5879
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
5880
|
+
const r = Math.floor(rng() * 16);
|
5881
|
+
const v = c === "x" ? r : r & 3 | 8;
|
5882
|
+
return v.toString(16);
|
5883
|
+
});
|
5884
|
+
}
|
5885
|
+
function generateTrackingId(rng) {
|
5886
|
+
const uuid = generateUuid(rng).replace(/-/g, "");
|
5887
|
+
const trackingId = uuid.slice(0, 6).toUpperCase();
|
5888
|
+
return trackingId;
|
5889
|
+
}
|
5890
|
+
function generateRandomSignature(rng) {
|
5891
|
+
return `/random-bucket/${generateUuid(rng)}.png`;
|
5892
|
+
}
|
5893
|
+
var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
5894
|
+
const rng = createPseudoRandomNumberGenerator(seed);
|
5895
|
+
const createdAt = getRandomDatetime(
|
5896
|
+
rng,
|
5897
|
+
/* @__PURE__ */ new Date("2024-01-01"),
|
5898
|
+
/* @__PURE__ */ new Date("2024-12-31")
|
5899
|
+
);
|
5900
|
+
return {
|
5901
|
+
id: overrides.id ?? generateUuid(rng),
|
5902
|
+
type: overrides.type ?? TENNIS_CLUB_MEMBERSHIP,
|
5903
|
+
status: overrides.status ?? pickRandom(rng, eventStatuses),
|
5904
|
+
createdAt: overrides.createdAt ?? createdAt,
|
5905
|
+
createdBy: overrides.createdBy ?? generateUuid(rng),
|
5906
|
+
createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
|
5907
|
+
updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
|
5908
|
+
createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
|
5909
|
+
updatedAt: overrides.updatedAt ?? (0, import_addDays.default)(new Date(createdAt), 1).toISOString(),
|
5910
|
+
assignedTo: overrides.assignedTo ?? null,
|
5911
|
+
updatedBy: overrides.updatedBy ?? generateUuid(rng),
|
5912
|
+
updatedByUserRole: overrides.updatedByUserRole ?? "FIELD_AGENT",
|
5913
|
+
flags: [],
|
5914
|
+
legalStatuses: overrides.legalStatuses ?? {},
|
5915
|
+
declaration: overrides.declaration ?? generateRandomApplicant(rng),
|
5916
|
+
trackingId: overrides.trackingId ?? generateTrackingId(rng)
|
5917
|
+
};
|
5918
|
+
};
|
4742
5919
|
var generateTranslationConfig = (message) => ({
|
4743
5920
|
defaultMessage: message,
|
4744
5921
|
description: "Description for ${message}",
|
4745
5922
|
id: message
|
4746
5923
|
});
|
5924
|
+
var BearerTokenByUserType = {
|
5925
|
+
fieldAgent: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWNvcmQuZGVjbGFyZS1iaXJ0aCIsInJlY29yZC5kZWNsYXJlLWRlYXRoIiwicmVjb3JkLmRlY2xhcmUtbWFycmlhZ2UiLCJyZWNvcmQuZGVjbGFyYXRpb24tc3VibWl0LWluY29tcGxldGUiLCJyZWNvcmQuZGVjbGFyYXRpb24tc3VibWl0LWZvci1yZXZpZXciLCJzZWFyY2guYmlydGgiLCJzZWFyY2guZGVhdGgiLCJzZWFyY2gubWFycmlhZ2UiLCJkZW1vIl0sInVzZXJUeXBlIjoidXNlciIsImlhdCI6MTc0ODUyNjQ4OCwiZXhwIjoxNzQ5MTMxMjg4LCJhdWQiOlsib3BlbmNydnM6YXV0aC11c2VyIiwib3BlbmNydnM6dXNlci1tZ250LXVzZXIiLCJvcGVuY3J2czpoZWFydGgtdXNlciIsIm9wZW5jcnZzOmdhdGV3YXktdXNlciIsIm9wZW5jcnZzOm5vdGlmaWNhdGlvbi11c2VyIiwib3BlbmNydnM6d29ya2Zsb3ctdXNlciIsIm9wZW5jcnZzOnNlYXJjaC11c2VyIiwib3BlbmNydnM6bWV0cmljcy11c2VyIiwib3BlbmNydnM6Y291bnRyeWNvbmZpZy11c2VyIiwib3BlbmNydnM6d2ViaG9va3MtdXNlciIsIm9wZW5jcnZzOmNvbmZpZy11c2VyIiwib3BlbmNydnM6ZG9jdW1lbnRzLXVzZXIiXSwiaXNzIjoib3BlbmNydnM6YXV0aC1zZXJ2aWNlIiwic3ViIjoiNjc3ZmIwODYzMGYzYWJmYTMzMDcyNzBmIn0.qLif2TmTPpqfbSUWR3TSfWf5syyCtRRJV-fDOZBtN9th-gdT0sUPZp5PB_t2QHHCLes7JLDlSA9CGNIbVvRR8a7EedXTAf0T7pwiE96PgljHSKI9jLMCYb_rhqnl8BwfsxAU3qv8EBYM9rDlcabl5iKnAOM-YLMv63CRMQxZOZ0O3Wl1Xil82dp6PqW_Lom5Qd-Esftt9BWXk5gxmqq-YegT8qU9n3hDXEsOvmIyYQvPDwmUOB-xp74CKJk_o3eBuq4TVCMYxY-tS9qkkn2A7Txhh-bzWMVNrQjQ1Yumvs8gi_F-XYTi89QbZVz8PzJ9kT8w3jshYwmAy7be9M-EQg",
|
5926
|
+
registrationAgent: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWNvcmQucmVhZCIsInJlY29yZC5kZWNsYXJlLWJpcnRoIiwicmVjb3JkLmRlY2xhcmUtZGVhdGgiLCJyZWNvcmQuZGVjbGFyZS1tYXJyaWFnZSIsInJlY29yZC5kZWNsYXJhdGlvbi1lZGl0IiwicmVjb3JkLmRlY2xhcmF0aW9uLXN1Ym1pdC1mb3ItYXBwcm92YWwiLCJyZWNvcmQuZGVjbGFyYXRpb24tc3VibWl0LWZvci11cGRhdGVzIiwicmVjb3JkLmRlY2xhcmF0aW9uLWFyY2hpdmUiLCJyZWNvcmQuZGVjbGFyYXRpb24tcmVpbnN0YXRlIiwicmVjb3JkLnJlZ2lzdHJhdGlvbi1yZXF1ZXN0LWNvcnJlY3Rpb24iLCJyZWNvcmQuZGVjbGFyYXRpb24tcHJpbnQtc3VwcG9ydGluZy1kb2N1bWVudHMiLCJyZWNvcmQuZXhwb3J0LXJlY29yZHMiLCJyZWNvcmQucmVnaXN0cmF0aW9uLXByaW50Jmlzc3VlLWNlcnRpZmllZC1jb3BpZXMiLCJwZXJmb3JtYW5jZS5yZWFkIiwicGVyZm9ybWFuY2UucmVhZC1kYXNoYm9hcmRzIiwib3JnYW5pc2F0aW9uLnJlYWQtbG9jYXRpb25zOm15LW9mZmljZSIsInNlYXJjaC5iaXJ0aCIsInNlYXJjaC5kZWF0aCIsInNlYXJjaC5tYXJyaWFnZSIsImRlbW8iXSwidXNlclR5cGUiOiJ1c2VyIiwiaWF0IjoxNzQ4NTI2NDY4LCJleHAiOjE3NDkxMzEyNjgsImF1ZCI6WyJvcGVuY3J2czphdXRoLXVzZXIiLCJvcGVuY3J2czp1c2VyLW1nbnQtdXNlciIsIm9wZW5jcnZzOmhlYXJ0aC11c2VyIiwib3BlbmNydnM6Z2F0ZXdheS11c2VyIiwib3BlbmNydnM6bm90aWZpY2F0aW9uLXVzZXIiLCJvcGVuY3J2czp3b3JrZmxvdy11c2VyIiwib3BlbmNydnM6c2VhcmNoLXVzZXIiLCJvcGVuY3J2czptZXRyaWNzLXVzZXIiLCJvcGVuY3J2czpjb3VudHJ5Y29uZmlnLXVzZXIiLCJvcGVuY3J2czp3ZWJob29rcy11c2VyIiwib3BlbmNydnM6Y29uZmlnLXVzZXIiLCJvcGVuY3J2czpkb2N1bWVudHMtdXNlciJdLCJpc3MiOiJvcGVuY3J2czphdXRoLXNlcnZpY2UiLCJzdWIiOiI2NzdmYjA4NjMwZjNhYmZhMzMwNzI3MTgifQ.C0R3cda9tczdJyadyJzk_wjVx79yiQ4r2BZbrF5VMTol97CwqMk1cPKVv5xZR1fHW5nhYl1X_vsmTYx-p9oSmcAYVud-4Z24TrA3oZ214zCB8RW_RmmFzJSczwe-9Son-96JOpRJTz2F-F_SSmblF0cjndJ-iXCAbOn1hmQ1q45NqaV-oFaFWigvAaRoBFcEvGufQxss_NjRmG12ooENSfWQl0tYM9BmTw4JQo2xerwJcgaJTrtDgRagkuiR7zhVNjcoT64AQiSRp5KmWRhbU4ozlJ2tfy1ccD9jJkbQTf1AZT2pl1diusjstJYFuM9QPFPOyCO0umaxYfgSer_Hmg",
|
5927
|
+
localRegistrar: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWNvcmQucmVhZCIsInJlY29yZC5kZWNsYXJlLWJpcnRoIiwicmVjb3JkLmRlY2xhcmUtZGVhdGgiLCJyZWNvcmQuZGVjbGFyZS1tYXJyaWFnZSIsInJlY29yZC5kZWNsYXJhdGlvbi1lZGl0IiwicmVjb3JkLmRlY2xhcmF0aW9uLXN1Ym1pdC1mb3ItdXBkYXRlcyIsInJlY29yZC5yZXZpZXctZHVwbGljYXRlcyIsInJlY29yZC5kZWNsYXJhdGlvbi1hcmNoaXZlIiwicmVjb3JkLmRlY2xhcmF0aW9uLXJlaW5zdGF0ZSIsInJlY29yZC5yZWdpc3RlciIsInJlY29yZC5yZWdpc3RyYXRpb24tY29ycmVjdCIsInJlY29yZC5kZWNsYXJhdGlvbi1wcmludC1zdXBwb3J0aW5nLWRvY3VtZW50cyIsInJlY29yZC5leHBvcnQtcmVjb3JkcyIsInJlY29yZC51bmFzc2lnbi1vdGhlcnMiLCJyZWNvcmQucmVnaXN0cmF0aW9uLXByaW50Jmlzc3VlLWNlcnRpZmllZC1jb3BpZXMiLCJyZWNvcmQuY29uZmlybS1yZWdpc3RyYXRpb24iLCJyZWNvcmQucmVqZWN0LXJlZ2lzdHJhdGlvbiIsInBlcmZvcm1hbmNlLnJlYWQiLCJwZXJmb3JtYW5jZS5yZWFkLWRhc2hib2FyZHMiLCJwcm9maWxlLmVsZWN0cm9uaWMtc2lnbmF0dXJlIiwib3JnYW5pc2F0aW9uLnJlYWQtbG9jYXRpb25zOm15LW9mZmljZSIsInNlYXJjaC5iaXJ0aCIsInNlYXJjaC5kZWF0aCIsInNlYXJjaC5tYXJyaWFnZSIsImRlbW8iXSwidXNlclR5cGUiOiJ1c2VyIiwiaWF0IjoxNzQ4NTI2NDIwLCJleHAiOjE3NDkxMzEyMjAsImF1ZCI6WyJvcGVuY3J2czphdXRoLXVzZXIiLCJvcGVuY3J2czp1c2VyLW1nbnQtdXNlciIsIm9wZW5jcnZzOmhlYXJ0aC11c2VyIiwib3BlbmNydnM6Z2F0ZXdheS11c2VyIiwib3BlbmNydnM6bm90aWZpY2F0aW9uLXVzZXIiLCJvcGVuY3J2czp3b3JrZmxvdy11c2VyIiwib3BlbmNydnM6c2VhcmNoLXVzZXIiLCJvcGVuY3J2czptZXRyaWNzLXVzZXIiLCJvcGVuY3J2czpjb3VudHJ5Y29uZmlnLXVzZXIiLCJvcGVuY3J2czp3ZWJob29rcy11c2VyIiwib3BlbmNydnM6Y29uZmlnLXVzZXIiLCJvcGVuY3J2czpkb2N1bWVudHMtdXNlciJdLCJpc3MiOiJvcGVuY3J2czphdXRoLXNlcnZpY2UiLCJzdWIiOiI2NzdmYjA4NjMwZjNhYmZhMzMwNzI3MjEifQ.Exwojy_1lsoPmp-kQ79SMWI0eQy8Qt7yO_ynGvb_oIVdqSwTxFkkNr9x4UxhBA-o0P6LkMZ2ELKOlSzBr3PRJ8IQnfMQ7Db8oG8HAPsY8sKqra_L6ryV088NW2e2LqAjoOX0dXRIqYMolUhF_OOuZpHW5K8nvog5SLlnJ1gKysQ1EuWBg2dcKbjkkB16v-9NGz4XHye3vcoZlalyha5OOujzbPhkmr9UGiksSIXFNbanBhkQdt-EJlLX9SXvQ4ACJWPKFb_f4gv8p84jdLiryzQux46zHPpTicZHzg0nZtoKKIH1AyFtqWfBFm4y8qWC3ht9TAk93NAXTfkS0wzxKA"
|
5928
|
+
};
|
5929
|
+
var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
|
5930
|
+
{
|
5931
|
+
slug,
|
5932
|
+
name: {
|
5933
|
+
id: "workqueues.inProgress.title",
|
5934
|
+
defaultMessage: slug.charAt(0).toUpperCase() + slug.slice(1).split("-").join(" "),
|
5935
|
+
description: "Title of in progress workqueue"
|
5936
|
+
},
|
5937
|
+
query: {
|
5938
|
+
type: "and",
|
5939
|
+
clauses: [{ eventType: tennisClubMembershipEvent.id }]
|
5940
|
+
},
|
5941
|
+
actions: [],
|
5942
|
+
icon: "Draft",
|
5943
|
+
columns: []
|
5944
|
+
}
|
5945
|
+
]);
|
4747
5946
|
|
4748
5947
|
// ../commons/src/events/TemplateConfig.ts
|
4749
5948
|
function isTemplateVariable(value) {
|
@@ -4781,6 +5980,7 @@ function isFieldConfigDefaultValue(value) {
|
|
4781
5980
|
var import_lodash3 = require("lodash");
|
4782
5981
|
|
4783
5982
|
// ../commons/src/scopes.ts
|
5983
|
+
var import_zod31 = require("zod");
|
4784
5984
|
var SCOPES = {
|
4785
5985
|
// TODO v1.8 legacy scopes
|
4786
5986
|
NATLSYSADMIN: "natlsysadmin",
|
@@ -4804,6 +6004,8 @@ var SCOPES = {
|
|
4804
6004
|
*/
|
4805
6005
|
RECORD_DECLARE: "record.declare-birth",
|
4806
6006
|
// declare
|
6007
|
+
RECORD_IMPORT: "record.import",
|
6008
|
+
// declare
|
4807
6009
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
4808
6010
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
4809
6011
|
RECORD_DECLARE_DEATH: "record.declare-death",
|
@@ -4891,12 +6093,119 @@ var SCOPES = {
|
|
4891
6093
|
// data seeding
|
4892
6094
|
USER_DATA_SEEDING: "user.data-seeding"
|
4893
6095
|
};
|
6096
|
+
var LiteralScopes = import_zod31.z.union([
|
6097
|
+
import_zod31.z.literal(SCOPES.NATLSYSADMIN),
|
6098
|
+
import_zod31.z.literal(SCOPES.BYPASSRATELIMIT),
|
6099
|
+
import_zod31.z.literal(SCOPES.DECLARE),
|
6100
|
+
import_zod31.z.literal(SCOPES.REGISTER),
|
6101
|
+
import_zod31.z.literal(SCOPES.VALIDATE),
|
6102
|
+
import_zod31.z.literal(SCOPES.DEMO),
|
6103
|
+
import_zod31.z.literal(SCOPES.CERTIFY),
|
6104
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE),
|
6105
|
+
import_zod31.z.literal(SCOPES.SYSADMIN),
|
6106
|
+
import_zod31.z.literal(SCOPES.TEAMS),
|
6107
|
+
import_zod31.z.literal(SCOPES.CONFIG),
|
6108
|
+
import_zod31.z.literal(SCOPES.WEBHOOK),
|
6109
|
+
import_zod31.z.literal(SCOPES.NATIONALID),
|
6110
|
+
import_zod31.z.literal(SCOPES.NOTIFICATION_API),
|
6111
|
+
import_zod31.z.literal(SCOPES.RECORDSEARCH),
|
6112
|
+
import_zod31.z.literal(SCOPES.RECORD_IMPORT),
|
6113
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
6114
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
6115
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
6116
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
6117
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
6118
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
6119
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
6120
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW),
|
6121
|
+
import_zod31.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS),
|
6122
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
6123
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
6124
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
6125
|
+
import_zod31.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
6126
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
6127
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE),
|
6128
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTER),
|
6129
|
+
import_zod31.z.literal(SCOPES.RECORD_EXPORT_RECORDS),
|
6130
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_PRINT),
|
6131
|
+
import_zod31.z.literal(SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS),
|
6132
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_PRINT),
|
6133
|
+
import_zod31.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
6134
|
+
import_zod31.z.literal(SCOPES.RECORD_PRINT_CERTIFIED_COPIES),
|
6135
|
+
import_zod31.z.literal(SCOPES.RECORD_BULK_PRINT_CERTIFIED_COPIES),
|
6136
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_VERIFY_CERTIFIED_COPIES),
|
6137
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
6138
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
6139
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REVOCATION),
|
6140
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REVOKE),
|
6141
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REINSTATEMENT),
|
6142
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REINSTATE),
|
6143
|
+
import_zod31.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
6144
|
+
import_zod31.z.literal(SCOPES.RECORD_REJECT_REGISTRATION),
|
6145
|
+
import_zod31.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
6146
|
+
import_zod31.z.literal(SCOPES.SEARCH_BIRTH),
|
6147
|
+
import_zod31.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
6148
|
+
import_zod31.z.literal(SCOPES.SEARCH_DEATH),
|
6149
|
+
import_zod31.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
6150
|
+
import_zod31.z.literal(SCOPES.SEARCH_MARRIAGE),
|
6151
|
+
import_zod31.z.literal(SCOPES.RECORD_READ),
|
6152
|
+
import_zod31.z.literal(SCOPES.RECORD_READ_AUDIT),
|
6153
|
+
import_zod31.z.literal(SCOPES.RECORD_READ_COMMENTS),
|
6154
|
+
import_zod31.z.literal(SCOPES.RECORD_CREATE_COMMENTS),
|
6155
|
+
import_zod31.z.literal(SCOPES.PROFILE_UPDATE),
|
6156
|
+
import_zod31.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
6157
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE_READ),
|
6158
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
6159
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS),
|
6160
|
+
import_zod31.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
6161
|
+
import_zod31.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
6162
|
+
import_zod31.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION),
|
6163
|
+
import_zod31.z.literal(SCOPES.USER_READ),
|
6164
|
+
import_zod31.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
6165
|
+
import_zod31.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
6166
|
+
import_zod31.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
6167
|
+
import_zod31.z.literal(SCOPES.USER_CREATE),
|
6168
|
+
import_zod31.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
6169
|
+
import_zod31.z.literal(SCOPES.USER_UPDATE),
|
6170
|
+
import_zod31.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION),
|
6171
|
+
import_zod31.z.literal(SCOPES.CONFIG_UPDATE_ALL),
|
6172
|
+
import_zod31.z.literal(SCOPES.USER_DATA_SEEDING)
|
6173
|
+
]);
|
6174
|
+
var rawConfigurableScopeRegex = /^([a-zA-Z\.]+)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
6175
|
+
var rawConfigurableScope = import_zod31.z.string().regex(rawConfigurableScopeRegex);
|
6176
|
+
var CreateUserScope = import_zod31.z.object({
|
6177
|
+
type: import_zod31.z.literal("user.create"),
|
6178
|
+
options: import_zod31.z.object({
|
6179
|
+
role: import_zod31.z.array(import_zod31.z.string())
|
6180
|
+
})
|
6181
|
+
});
|
6182
|
+
var EditUserScope = import_zod31.z.object({
|
6183
|
+
type: import_zod31.z.literal("user.edit"),
|
6184
|
+
options: import_zod31.z.object({
|
6185
|
+
role: import_zod31.z.array(import_zod31.z.string())
|
6186
|
+
})
|
6187
|
+
});
|
6188
|
+
var WorkqueueScope = import_zod31.z.object({
|
6189
|
+
type: import_zod31.z.literal("workqueue"),
|
6190
|
+
options: import_zod31.z.object({
|
6191
|
+
id: import_zod31.z.array(import_zod31.z.string())
|
6192
|
+
})
|
6193
|
+
});
|
6194
|
+
var NotifyRecordScope = import_zod31.z.object({
|
6195
|
+
type: import_zod31.z.literal("record.notify"),
|
6196
|
+
options: import_zod31.z.object({
|
6197
|
+
event: import_zod31.z.array(import_zod31.z.string())
|
6198
|
+
})
|
6199
|
+
});
|
6200
|
+
var ConfigurableScopes = import_zod31.z.discriminatedUnion("type", [
|
6201
|
+
CreateUserScope,
|
6202
|
+
EditUserScope,
|
6203
|
+
WorkqueueScope,
|
6204
|
+
NotifyRecordScope
|
6205
|
+
]);
|
4894
6206
|
var scopes = Object.values(SCOPES);
|
4895
6207
|
|
4896
6208
|
// ../commons/src/events/scopes.ts
|
4897
|
-
function hasAnyOfScopes(a, b) {
|
4898
|
-
return (0, import_lodash3.intersection)(a, b).length > 0;
|
4899
|
-
}
|
4900
6209
|
var CONFIG_GET_ALLOWED_SCOPES = [
|
4901
6210
|
SCOPES.RECORD_DECLARE,
|
4902
6211
|
SCOPES.RECORD_READ,
|
@@ -4943,7 +6252,8 @@ var ACTION_ALLOWED_SCOPES = {
|
|
4943
6252
|
[ActionType.REGISTER]: [SCOPES.RECORD_REGISTER],
|
4944
6253
|
[ActionType.PRINT_CERTIFICATE]: [SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES],
|
4945
6254
|
[ActionType.REQUEST_CORRECTION]: [
|
4946
|
-
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION
|
6255
|
+
SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION,
|
6256
|
+
SCOPES.RECORD_REGISTRATION_CORRECT
|
4947
6257
|
],
|
4948
6258
|
[ActionType.REJECT_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
|
4949
6259
|
[ActionType.APPROVE_CORRECTION]: [SCOPES.RECORD_REGISTRATION_CORRECT],
|
@@ -4954,6 +6264,28 @@ var ACTION_ALLOWED_SCOPES = {
|
|
4954
6264
|
[ActionType.UNASSIGN]: null,
|
4955
6265
|
[ActionType.DETECT_DUPLICATE]: []
|
4956
6266
|
};
|
6267
|
+
var ACTION_ALLOWED_CONFIGURABLE_SCOPES = {
|
6268
|
+
[ActionType.READ]: [],
|
6269
|
+
[ActionType.CREATE]: ["record.notify"],
|
6270
|
+
[ActionType.NOTIFY]: ["record.notify"],
|
6271
|
+
[ActionType.DECLARE]: [],
|
6272
|
+
[ActionType.DELETE]: [],
|
6273
|
+
[ActionType.VALIDATE]: [],
|
6274
|
+
[ActionType.REGISTER]: [],
|
6275
|
+
[ActionType.PRINT_CERTIFICATE]: [],
|
6276
|
+
[ActionType.REQUEST_CORRECTION]: [],
|
6277
|
+
[ActionType.REJECT_CORRECTION]: [],
|
6278
|
+
[ActionType.APPROVE_CORRECTION]: [],
|
6279
|
+
[ActionType.MARKED_AS_DUPLICATE]: [],
|
6280
|
+
[ActionType.ARCHIVE]: [],
|
6281
|
+
[ActionType.REJECT]: [],
|
6282
|
+
[ActionType.ASSIGN]: [],
|
6283
|
+
[ActionType.UNASSIGN]: [],
|
6284
|
+
[ActionType.DETECT_DUPLICATE]: []
|
6285
|
+
};
|
6286
|
+
function hasAnyOfScopes(a, b) {
|
6287
|
+
return (0, import_lodash3.intersection)(a, b).length > 0;
|
6288
|
+
}
|
4957
6289
|
function filterUnallowedActions(actions, userScopes) {
|
4958
6290
|
const allowedActions = actions.filter((action) => {
|
4959
6291
|
const requiredScopes = ACTION_ALLOWED_SCOPES[action];
|
@@ -4970,3 +6302,65 @@ function filterUnallowedActions(actions, userScopes) {
|
|
4970
6302
|
}
|
4971
6303
|
return [ActionType.READ];
|
4972
6304
|
}
|
6305
|
+
|
6306
|
+
// ../commons/src/events/serializers/user/deserializer.ts
|
6307
|
+
var import_zod32 = require("zod");
|
6308
|
+
var UserWithPrimaryOffice = User.extend({
|
6309
|
+
primaryOfficeId: import_zod32.z.string()
|
6310
|
+
});
|
6311
|
+
function userDeserializer(serializedUserField, user2) {
|
6312
|
+
if (typeof serializedUserField === "string") {
|
6313
|
+
return serializedUserField;
|
6314
|
+
}
|
6315
|
+
if (serializedUserField.$userField === "name" || serializedUserField.$userField === "signatureFilename") {
|
6316
|
+
throw new Error(
|
6317
|
+
`Deserializer for ${serializedUserField.$userField} is not implemented yet`
|
6318
|
+
);
|
6319
|
+
}
|
6320
|
+
return user2[serializedUserField.$userField];
|
6321
|
+
}
|
6322
|
+
function deserializeQueryExpression(expression, user2) {
|
6323
|
+
return {
|
6324
|
+
...expression,
|
6325
|
+
assignedTo: expression.assignedTo && {
|
6326
|
+
...expression.assignedTo,
|
6327
|
+
term: userDeserializer(expression.assignedTo.term, user2)
|
6328
|
+
},
|
6329
|
+
createdBy: expression.createdBy && {
|
6330
|
+
...expression.createdBy,
|
6331
|
+
term: userDeserializer(expression.createdBy.term, user2)
|
6332
|
+
},
|
6333
|
+
updatedBy: expression.updatedBy && {
|
6334
|
+
...expression.updatedBy,
|
6335
|
+
term: userDeserializer(expression.updatedBy.term, user2)
|
6336
|
+
},
|
6337
|
+
createdAtLocation: expression.createdAtLocation && (expression.createdAtLocation.type === "within" ? {
|
6338
|
+
...expression.createdAtLocation,
|
6339
|
+
location: userDeserializer(
|
6340
|
+
expression.createdAtLocation.location,
|
6341
|
+
user2
|
6342
|
+
)
|
6343
|
+
} : {
|
6344
|
+
...expression.createdAtLocation,
|
6345
|
+
term: userDeserializer(expression.createdAtLocation.term, user2)
|
6346
|
+
}),
|
6347
|
+
updatedAtLocation: expression.updatedAtLocation && (expression.updatedAtLocation.type === "within" ? {
|
6348
|
+
...expression.updatedAtLocation,
|
6349
|
+
location: userDeserializer(
|
6350
|
+
expression.updatedAtLocation.location,
|
6351
|
+
user2
|
6352
|
+
)
|
6353
|
+
} : {
|
6354
|
+
...expression.updatedAtLocation,
|
6355
|
+
term: userDeserializer(expression.updatedAtLocation.term, user2)
|
6356
|
+
})
|
6357
|
+
};
|
6358
|
+
}
|
6359
|
+
function deserializeQuery(query, user2) {
|
6360
|
+
return {
|
6361
|
+
...query,
|
6362
|
+
clauses: query.clauses.map(
|
6363
|
+
(clause) => deserializeQueryExpression(clause, user2)
|
6364
|
+
)
|
6365
|
+
};
|
6366
|
+
}
|