@opencrvs/toolkit 1.8.0-rc.f9fb039 → 1.8.0-rc.fa564ca
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 +7047 -3158
- package/dist/commons/conditionals/conditionals.d.ts +7 -6
- package/dist/commons/events/ActionConfig.d.ts +15774 -7797
- package/dist/commons/events/ActionDocument.d.ts +292 -105
- package/dist/commons/events/ActionInput.d.ts +75 -3
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +437 -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 +11281 -7033
- package/dist/commons/events/EventDocument.d.ts +212 -99
- package/dist/commons/events/EventIndex.d.ts +281 -531
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +68 -44
- package/dist/commons/events/FieldConfig.d.ts +486 -440
- package/dist/commons/events/FieldTypeMapping.d.ts +5 -2
- package/dist/commons/events/FieldValue.d.ts +2 -0
- package/dist/commons/events/FormConfig.d.ts +3346 -3052
- package/dist/commons/events/PageConfig.d.ts +750 -680
- package/dist/commons/events/SummaryConfig.d.ts +17 -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 +3936 -807
- package/dist/commons/events/defineConfig.d.ts +1385 -576
- package/dist/commons/events/event.d.ts +5 -5
- package/dist/commons/events/field.d.ts +9 -13
- package/dist/commons/events/index.d.ts +4 -0
- package/dist/commons/events/scopes.d.ts +20 -1
- 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 +327 -291
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +28 -8
- package/dist/events/index.js +1947 -561
- 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,14 +97,18 @@ __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,
|
111
|
+
FieldReference: () => FieldReference,
|
103
112
|
FieldType: () => FieldType,
|
104
113
|
FieldUpdateValue: () => FieldUpdateValue,
|
105
114
|
FieldValue: () => FieldValue,
|
@@ -109,6 +118,7 @@ __export(events_exports, {
|
|
109
118
|
Flag: () => Flag,
|
110
119
|
FormConfig: () => FormConfig,
|
111
120
|
FormPageConfig: () => FormPageConfig,
|
121
|
+
Fuzzy: () => Fuzzy,
|
112
122
|
GenericAddressUpdateValue: () => GenericAddressUpdateValue,
|
113
123
|
GenericAddressValue: () => GenericAddressValue,
|
114
124
|
GeographicalArea: () => GeographicalArea,
|
@@ -118,36 +128,53 @@ __export(events_exports, {
|
|
118
128
|
MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
|
119
129
|
MimeType: () => MimeType,
|
120
130
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
131
|
+
Not: () => Not,
|
121
132
|
NotifyActionInput: () => NotifyActionInput,
|
122
133
|
NumberFieldValue: () => NumberFieldValue,
|
123
134
|
PageConfig: () => PageConfig,
|
124
135
|
PageTypes: () => PageTypes,
|
125
136
|
PrintCertificateActionInput: () => PrintCertificateActionInput,
|
137
|
+
QueryExpression: () => QueryExpression,
|
126
138
|
QueryInput: () => QueryInput,
|
127
139
|
QueryType: () => QueryType,
|
140
|
+
Range: () => Range,
|
128
141
|
ReadActionInput: () => ReadActionInput,
|
129
142
|
RegisterAction: () => RegisterAction,
|
130
143
|
RegisterActionInput: () => RegisterActionInput,
|
131
144
|
RegistrationCreationMetadata: () => RegistrationCreationMetadata,
|
132
145
|
RejectCorrectionActionInput: () => RejectCorrectionActionInput,
|
133
146
|
RejectDeclarationActionInput: () => RejectDeclarationActionInput,
|
147
|
+
RejectionReason: () => RejectionReason,
|
134
148
|
RequestCorrectionActionInput: () => RequestCorrectionActionInput,
|
135
149
|
ResolvedUser: () => ResolvedUser,
|
136
150
|
RuralAddressUpdateValue: () => RuralAddressUpdateValue,
|
137
151
|
RuralAddressValue: () => RuralAddressValue,
|
138
152
|
SearchField: () => SearchField,
|
153
|
+
SearchQueryParams: () => SearchQueryParams,
|
139
154
|
SelectOption: () => SelectOption,
|
140
155
|
ShowConditional: () => ShowConditional,
|
156
|
+
SignatureFieldValue: () => SignatureFieldValue,
|
141
157
|
SummaryConfig: () => SummaryConfig,
|
158
|
+
TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
|
142
159
|
TextValue: () => TextValue,
|
143
160
|
TranslationConfig: () => TranslationConfig,
|
144
161
|
UnassignActionInput: () => UnassignActionInput,
|
145
162
|
UrbanAddressUpdateValue: () => UrbanAddressUpdateValue,
|
146
163
|
UrbanAddressValue: () => UrbanAddressValue,
|
164
|
+
User: () => User,
|
147
165
|
ValidateActionInput: () => ValidateActionInput,
|
148
166
|
VerificationActionConfig: () => VerificationActionConfig,
|
149
167
|
VerificationPageConfig: () => VerificationPageConfig,
|
168
|
+
Within: () => Within,
|
169
|
+
WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
|
170
|
+
WorkqueueColumn: () => WorkqueueColumn,
|
171
|
+
WorkqueueColumnKeys: () => WorkqueueColumnKeys,
|
172
|
+
WorkqueueColumnKeysArray: () => WorkqueueColumnKeysArray,
|
173
|
+
WorkqueueColumnValue: () => WorkqueueColumnValue,
|
150
174
|
WorkqueueConfig: () => WorkqueueConfig,
|
175
|
+
WorkqueueConfigInput: () => WorkqueueConfigInput,
|
176
|
+
WorkqueueCountInput: () => WorkqueueCountInput,
|
177
|
+
WorkqueueCountOutput: () => WorkqueueCountOutput,
|
151
178
|
ZodDate: () => ZodDate,
|
152
179
|
alwaysTrue: () => alwaysTrue,
|
153
180
|
and: () => and,
|
@@ -158,9 +185,12 @@ __export(events_exports, {
|
|
158
185
|
createEmptyDraft: () => createEmptyDraft,
|
159
186
|
createEventConditionals: () => createEventConditionals,
|
160
187
|
createFieldConditionals: () => createFieldConditionals,
|
188
|
+
createPseudoRandomNumberGenerator: () => createPseudoRandomNumberGenerator,
|
161
189
|
createValidationSchema: () => createValidationSchema,
|
190
|
+
dateOfEventColumn: () => dateOfEventColumn,
|
162
191
|
deepDropNulls: () => deepDropNulls,
|
163
192
|
deepMerge: () => deepMerge,
|
193
|
+
defaultWorkqueueColumns: () => defaultWorkqueueColumns,
|
164
194
|
defineActionForm: () => defineActionForm,
|
165
195
|
defineConditional: () => defineConditional,
|
166
196
|
defineConfig: () => defineConfig,
|
@@ -169,6 +199,9 @@ __export(events_exports, {
|
|
169
199
|
defineFormPage: () => defineFormPage,
|
170
200
|
definePage: () => definePage,
|
171
201
|
defineWorkqueue: () => defineWorkqueue,
|
202
|
+
defineWorkqueues: () => defineWorkqueues,
|
203
|
+
defineWorkqueuesColumns: () => defineWorkqueuesColumns,
|
204
|
+
deserializeQuery: () => deserializeQuery,
|
172
205
|
errorMessages: () => errorMessages,
|
173
206
|
event: () => event,
|
174
207
|
eventMetadataLabelMap: () => eventMetadataLabelMap,
|
@@ -187,8 +220,10 @@ __export(events_exports, {
|
|
187
220
|
generateActionDocument: () => generateActionDocument,
|
188
221
|
generateEventDocument: () => generateEventDocument,
|
189
222
|
generateEventDraftDocument: () => generateEventDraftDocument,
|
223
|
+
generateRandomSignature: () => generateRandomSignature,
|
190
224
|
generateTransactionId: () => generateTransactionId,
|
191
225
|
generateTranslationConfig: () => generateTranslationConfig,
|
226
|
+
generateWorkqueues: () => generateWorkqueues,
|
192
227
|
getAcceptedActions: () => getAcceptedActions,
|
193
228
|
getActionAnnotation: () => getActionAnnotation,
|
194
229
|
getActionAnnotationFields: () => getActionAnnotationFields,
|
@@ -197,12 +232,15 @@ __export(events_exports, {
|
|
197
232
|
getActionVerificationPageIds: () => getActionVerificationPageIds,
|
198
233
|
getAnnotationFromDrafts: () => getAnnotationFromDrafts,
|
199
234
|
getAssignedUserFromActions: () => getAssignedUserFromActions,
|
235
|
+
getAssignedUserSignatureFromActions: () => getAssignedUserSignatureFromActions,
|
200
236
|
getCurrentEventState: () => getCurrentEventState,
|
201
237
|
getCurrentEventStateWithDrafts: () => getCurrentEventStateWithDrafts,
|
202
238
|
getDeclaration: () => getDeclaration,
|
203
239
|
getDeclarationFields: () => getDeclarationFields,
|
204
240
|
getDeclarationPages: () => getDeclarationPages,
|
205
241
|
getMixedPath: () => getMixedPath,
|
242
|
+
getRandomDatetime: () => getRandomDatetime,
|
243
|
+
getStatusFromActions: () => getStatusFromActions,
|
206
244
|
getVisibleVerificationPageIds: () => getVisibleVerificationPageIds,
|
207
245
|
hasAnyOfScopes: () => hasAnyOfScopes,
|
208
246
|
isAddressFieldType: () => isAddressFieldType,
|
@@ -226,6 +264,8 @@ __export(events_exports, {
|
|
226
264
|
isFileFieldType: () => isFileFieldType,
|
227
265
|
isFileFieldWithOptionType: () => isFileFieldWithOptionType,
|
228
266
|
isLocationFieldType: () => isLocationFieldType,
|
267
|
+
isMetaAction: () => isMetaAction,
|
268
|
+
isNonInteractiveFieldType: () => isNonInteractiveFieldType,
|
229
269
|
isNumberFieldType: () => isNumberFieldType,
|
230
270
|
isOfficeFieldType: () => isOfficeFieldType,
|
231
271
|
isPageHeaderFieldType: () => isPageHeaderFieldType,
|
@@ -253,18 +293,25 @@ __export(events_exports, {
|
|
253
293
|
user: () => user,
|
254
294
|
validate: () => validate,
|
255
295
|
validateFieldInput: () => validateFieldInput,
|
296
|
+
workqueueActions: () => workqueueActions,
|
256
297
|
writeActions: () => writeActions
|
257
298
|
});
|
258
299
|
module.exports = __toCommonJS(events_exports);
|
259
300
|
|
301
|
+
// ../commons/src/events/Constants.ts
|
302
|
+
var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
|
303
|
+
|
260
304
|
// ../commons/src/events/ActionConfig.ts
|
261
305
|
var import_zod9 = require("zod");
|
262
306
|
|
263
307
|
// ../commons/src/events/Conditional.ts
|
264
308
|
var import_zod = require("zod");
|
265
|
-
var
|
266
|
-
|
267
|
-
)
|
309
|
+
var import_zod_openapi = require("zod-openapi");
|
310
|
+
(0, import_zod_openapi.extendZodWithOpenApi)(import_zod.z);
|
311
|
+
var Conditional = import_zod.z.custom((val) => typeof val === "object" && val !== null).openapi({
|
312
|
+
description: "JSON schema conditional configuration",
|
313
|
+
ref: "Conditional"
|
314
|
+
});
|
268
315
|
var ConditionalType = {
|
269
316
|
SHOW: "SHOW",
|
270
317
|
ENABLE: "ENABLE",
|
@@ -301,7 +348,10 @@ var FieldConditional = import_zod.z.discriminatedUnion("type", [
|
|
301
348
|
EnableConditional,
|
302
349
|
// Field output can be shown / hidden on the review page
|
303
350
|
DisplayOnReviewConditional
|
304
|
-
])
|
351
|
+
]).openapi({
|
352
|
+
description: "Field conditional configuration",
|
353
|
+
ref: "FieldConditional"
|
354
|
+
});
|
305
355
|
|
306
356
|
// ../commons/src/events/PageConfig.ts
|
307
357
|
var import_zod6 = require("zod");
|
@@ -311,6 +361,8 @@ var import_zod5 = require("zod");
|
|
311
361
|
|
312
362
|
// ../commons/src/events/TranslationConfig.ts
|
313
363
|
var import_zod2 = require("zod");
|
364
|
+
var import_zod_openapi2 = require("zod-openapi");
|
365
|
+
(0, import_zod_openapi2.extendZodWithOpenApi)(import_zod2.z);
|
314
366
|
var TranslationConfig = import_zod2.z.object({
|
315
367
|
id: import_zod2.z.string().describe(
|
316
368
|
"The identifier of the translation referred in translation CSV files"
|
@@ -319,6 +371,9 @@ var TranslationConfig = import_zod2.z.object({
|
|
319
371
|
description: import_zod2.z.string().describe(
|
320
372
|
"Describe the translation for a translator to be able to identify it."
|
321
373
|
)
|
374
|
+
}).openapi({
|
375
|
+
description: "Translation configuration",
|
376
|
+
ref: "TranslationConfig"
|
322
377
|
});
|
323
378
|
|
324
379
|
// ../commons/src/events/FieldType.ts
|
@@ -448,6 +503,7 @@ var EmailValue = import_zod4.z.string().email();
|
|
448
503
|
var CheckboxFieldValue = import_zod4.z.boolean();
|
449
504
|
var NumberFieldValue = import_zod4.z.number();
|
450
505
|
var DataFieldValue = import_zod4.z.undefined();
|
506
|
+
var SignatureFieldValue = import_zod4.z.string();
|
451
507
|
var FieldValue = import_zod4.z.union([
|
452
508
|
TextValue,
|
453
509
|
DateValue,
|
@@ -476,19 +532,15 @@ var FieldUpdateValue = import_zod4.z.union([
|
|
476
532
|
]);
|
477
533
|
|
478
534
|
// ../commons/src/events/FieldConfig.ts
|
479
|
-
var
|
480
|
-
|
481
|
-
|
482
|
-
|
535
|
+
var import_zod_openapi3 = require("zod-openapi");
|
536
|
+
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod5.z);
|
537
|
+
var FieldId = import_zod5.z.string().describe("Unique identifier for the field");
|
538
|
+
var FieldReference = import_zod5.z.object({
|
539
|
+
$$field: FieldId
|
540
|
+
}).describe("Reference to a field by its ID");
|
541
|
+
var ParentReference = FieldReference.optional();
|
483
542
|
var BaseField = import_zod5.z.object({
|
484
543
|
id: FieldId,
|
485
|
-
defaultValue: import_zod5.z.union([
|
486
|
-
TextValue,
|
487
|
-
NonEmptyTextValue,
|
488
|
-
DateValue,
|
489
|
-
NumberFieldValue,
|
490
|
-
CheckboxFieldValue
|
491
|
-
]).optional(),
|
492
544
|
parent: ParentReference,
|
493
545
|
conditionals: import_zod5.z.array(FieldConditional).default([]).optional(),
|
494
546
|
required: import_zod5.z.boolean().default(false).optional(),
|
@@ -550,6 +602,7 @@ var SignatureField = BaseField.extend({
|
|
550
602
|
signaturePromptLabel: TranslationConfig.describe(
|
551
603
|
"Title of the signature modal"
|
552
604
|
),
|
605
|
+
defaultValue: SignatureFieldValue.optional(),
|
553
606
|
configuration: import_zod5.z.object({
|
554
607
|
maxFileSize: import_zod5.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
555
608
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
@@ -609,6 +662,7 @@ var PageHeader = BaseField.extend({
|
|
609
662
|
}).describe("A read-only header component for form pages");
|
610
663
|
var File = BaseField.extend({
|
611
664
|
type: import_zod5.z.literal(FieldType.FILE),
|
665
|
+
defaultValue: FileFieldValue.optional(),
|
612
666
|
configuration: import_zod5.z.object({
|
613
667
|
maxFileSize: import_zod5.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
614
668
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature"),
|
@@ -682,6 +736,7 @@ var Location = BaseField.extend({
|
|
682
736
|
var FileUploadWithOptions = BaseField.extend({
|
683
737
|
type: import_zod5.z.literal(FieldType.FILE_WITH_OPTIONS),
|
684
738
|
options: import_zod5.z.array(SelectOption).describe("A list of options"),
|
739
|
+
defaultValue: FileFieldWithOptionValue.optional(),
|
685
740
|
configuration: import_zod5.z.object({
|
686
741
|
maxFileSize: import_zod5.z.number().describe("Maximum file size in bytes").default(DEFAULT_MAX_FILE_SIZE_BYTES),
|
687
742
|
acceptedFileTypes: MimeType.array().optional().describe("List of allowed file formats for the signature")
|
@@ -741,9 +796,14 @@ var FieldConfig = import_zod5.z.discriminatedUnion("type", [
|
|
741
796
|
EmailField,
|
742
797
|
FileUploadWithOptions,
|
743
798
|
DataField
|
744
|
-
])
|
799
|
+
]).openapi({
|
800
|
+
description: "Form field configuration",
|
801
|
+
ref: "FieldConfig"
|
802
|
+
});
|
745
803
|
|
746
804
|
// ../commons/src/events/PageConfig.ts
|
805
|
+
var import_zod_openapi4 = require("zod-openapi");
|
806
|
+
(0, import_zod_openapi4.extendZodWithOpenApi)(import_zod6.z);
|
747
807
|
var PageTypes = import_zod6.z.enum(["FORM", "VERIFICATION"]);
|
748
808
|
var PageConfigBase = import_zod6.z.object({
|
749
809
|
id: import_zod6.z.string().describe("Unique identifier for the page"),
|
@@ -752,6 +812,9 @@ var PageConfigBase = import_zod6.z.object({
|
|
752
812
|
conditional: Conditional.optional().describe(
|
753
813
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
754
814
|
)
|
815
|
+
}).openapi({
|
816
|
+
description: "Form page configuration",
|
817
|
+
ref: "FormPageConfig"
|
755
818
|
});
|
756
819
|
var FormPageConfig = PageConfigBase.extend({
|
757
820
|
type: import_zod6.z.literal(PageTypes.enum.FORM).default(PageTypes.enum.FORM)
|
@@ -765,7 +828,10 @@ var VerificationActionConfig = import_zod6.z.object({
|
|
765
828
|
body: TranslationConfig
|
766
829
|
})
|
767
830
|
})
|
768
|
-
}).describe("Actions available on the verification page")
|
831
|
+
}).describe("Actions available on the verification page").openapi({
|
832
|
+
description: "Verification action configuration",
|
833
|
+
ref: "VerificationActionConfig"
|
834
|
+
});
|
769
835
|
var VerificationPageConfig = FormPageConfig.extend({
|
770
836
|
type: import_zod6.z.literal(PageTypes.enum.VERIFICATION),
|
771
837
|
actions: VerificationActionConfig
|
@@ -851,6 +917,25 @@ var writeActions = ActionTypes.exclude([
|
|
851
917
|
ActionType.ASSIGN,
|
852
918
|
ActionType.UNASSIGN
|
853
919
|
]);
|
920
|
+
var workqueueActions = ActionTypes.exclude([
|
921
|
+
ActionType.CREATE,
|
922
|
+
ActionType.NOTIFY,
|
923
|
+
ActionType.DETECT_DUPLICATE,
|
924
|
+
ActionType.REJECT,
|
925
|
+
ActionType.MARKED_AS_DUPLICATE,
|
926
|
+
ActionType.ARCHIVE,
|
927
|
+
ActionType.REQUEST_CORRECTION,
|
928
|
+
ActionType.REJECT_CORRECTION,
|
929
|
+
ActionType.APPROVE_CORRECTION
|
930
|
+
]);
|
931
|
+
var META_ACTIONS = [
|
932
|
+
ActionType.ASSIGN,
|
933
|
+
ActionType.UNASSIGN,
|
934
|
+
ActionType.READ
|
935
|
+
];
|
936
|
+
function isMetaAction(actionType) {
|
937
|
+
return META_ACTIONS.includes(actionType);
|
938
|
+
}
|
854
939
|
|
855
940
|
// ../commons/src/events/FormConfig.ts
|
856
941
|
var import_zod8 = require("zod");
|
@@ -865,8 +950,8 @@ var ActionFormConfig = import_zod8.z.object({
|
|
865
950
|
var FormConfig = import_zod8.z.union([DeclarationFormConfig, ActionFormConfig]);
|
866
951
|
|
867
952
|
// ../commons/src/events/ActionConfig.ts
|
868
|
-
var
|
869
|
-
(0,
|
953
|
+
var import_zod_openapi5 = require("zod-openapi");
|
954
|
+
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod9.z);
|
870
955
|
var ActionConditional2 = import_zod9.z.discriminatedUnion("type", [
|
871
956
|
/** If conditional is defined, the action is shown to the user only if the condition is met */
|
872
957
|
ShowConditional,
|
@@ -882,6 +967,12 @@ var ActionConfigBase = import_zod9.z.object({
|
|
882
967
|
conditionals: import_zod9.z.array(ActionConditional2).optional().default([]),
|
883
968
|
draft: import_zod9.z.boolean().optional()
|
884
969
|
});
|
970
|
+
var ReadActionConfig = ActionConfigBase.merge(
|
971
|
+
import_zod9.z.object({
|
972
|
+
type: import_zod9.z.literal(ActionType.READ),
|
973
|
+
review: DeclarationReviewConfig
|
974
|
+
})
|
975
|
+
);
|
885
976
|
var DeclareConfig = ActionConfigBase.merge(
|
886
977
|
import_zod9.z.object({
|
887
978
|
type: import_zod9.z.literal(ActionType.DECLARE),
|
@@ -948,6 +1039,7 @@ var ActionConfig = import_zod9.z.discriminatedUnion("type", [
|
|
948
1039
|
* OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
|
949
1040
|
* and treat them as "models" instead of duplicating the data structure in each endpoint.
|
950
1041
|
*/
|
1042
|
+
ReadActionConfig.openapi({ ref: "ReadActionConfig" }),
|
951
1043
|
DeclareConfig.openapi({ ref: "DeclareActionConfig" }),
|
952
1044
|
ValidateConfig.openapi({ ref: "ValidateActionConfig" }),
|
953
1045
|
RejectDeclarationConfig.openapi({ ref: "RejectDeclarationActionConfig" }),
|
@@ -1005,13 +1097,13 @@ var LanguageConfig = import_zod11.z.object({
|
|
1005
1097
|
});
|
1006
1098
|
|
1007
1099
|
// ../commons/src/events/EventConfig.ts
|
1008
|
-
var
|
1100
|
+
var import_zod18 = require("zod");
|
1009
1101
|
|
1010
1102
|
// ../commons/src/events/DeduplicationConfig.ts
|
1011
1103
|
var import_zod12 = require("zod");
|
1012
|
-
var
|
1013
|
-
(0,
|
1014
|
-
var
|
1104
|
+
var import_zod_openapi6 = require("zod-openapi");
|
1105
|
+
(0, import_zod_openapi6.extendZodWithOpenApi)(import_zod12.z);
|
1106
|
+
var FieldReference2 = import_zod12.z.string();
|
1015
1107
|
var Matcher = import_zod12.z.object({
|
1016
1108
|
fieldId: import_zod12.z.string(),
|
1017
1109
|
options: import_zod12.z.object({
|
@@ -1040,7 +1132,7 @@ var DateRangeMatcher = Matcher.extend({
|
|
1040
1132
|
type: import_zod12.z.literal("dateRange"),
|
1041
1133
|
options: import_zod12.z.object({
|
1042
1134
|
days: import_zod12.z.number(),
|
1043
|
-
origin:
|
1135
|
+
origin: FieldReference2,
|
1044
1136
|
boost: import_zod12.z.number().optional().default(1)
|
1045
1137
|
})
|
1046
1138
|
});
|
@@ -1048,7 +1140,7 @@ var DateDistanceMatcher = Matcher.extend({
|
|
1048
1140
|
type: import_zod12.z.literal("dateDistance"),
|
1049
1141
|
options: import_zod12.z.object({
|
1050
1142
|
days: import_zod12.z.number(),
|
1051
|
-
origin:
|
1143
|
+
origin: FieldReference2,
|
1052
1144
|
boost: import_zod12.z.number().optional().default(1)
|
1053
1145
|
})
|
1054
1146
|
});
|
@@ -1087,7 +1179,10 @@ var BaseField2 = import_zod13.z.object({
|
|
1087
1179
|
conditionals: import_zod13.z.array(ShowConditional).default([]).optional()
|
1088
1180
|
});
|
1089
1181
|
var ReferenceField = BaseField2.extend({
|
1090
|
-
fieldId: import_zod13.z.string()
|
1182
|
+
fieldId: import_zod13.z.string(),
|
1183
|
+
label: TranslationConfig.optional().describe(
|
1184
|
+
"By default, the configured field's label is used. This can be overridden by providing a custom label."
|
1185
|
+
)
|
1091
1186
|
}).describe("Field directly referencing event data with field id");
|
1092
1187
|
var Field = BaseField2.extend({
|
1093
1188
|
id: import_zod13.z.string().describe("Id of summary field"),
|
@@ -1109,9 +1204,46 @@ var BaseField3 = import_zod14.z.object({
|
|
1109
1204
|
type: MatchType.describe("Determines the type of field")
|
1110
1205
|
}),
|
1111
1206
|
options: import_zod14.z.array(SelectOption).optional(),
|
1112
|
-
|
1113
|
-
|
1207
|
+
searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
|
1208
|
+
`
|
1209
|
+
This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
|
1210
|
+
when rendering search parameter labels \u2014 for example, in the search results page to indicate which fields were used in the search.
|
1211
|
+
|
1212
|
+
For example, a field config like { id: "child.firstname", label: { defaultMessage: "First Name(s)" } } would render as "First Name(s)" by default.
|
1213
|
+
|
1214
|
+
A field config like { id: "mother.firstname", label: { defaultMessage: "First Name(s)" } } would also render as "First Name(s)" by default.
|
1215
|
+
|
1216
|
+
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)",
|
1217
|
+
which is ambiguous.
|
1218
|
+
|
1219
|
+
Now, if we treat the field ID prefix as a label (e.g., "applicant.firstname" \u2192 "Applicant"), and the field label is already
|
1220
|
+
descriptive \u2014 like { id: "applicant.firstname", label: { defaultMessage: "Applicant's First Name" } } \u2014 then the resulting
|
1221
|
+
label would be "Applicant Applicant's First Name", which is redundant and awkward.
|
1222
|
+
|
1223
|
+
By setting searchCriteriaLabelPrefix to a translation config object, we can explicitly define the desired prefix
|
1224
|
+
in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
|
1225
|
+
`
|
1226
|
+
),
|
1227
|
+
conditionals: import_zod14.z.array(FieldConditional).default([]).optional().describe(
|
1228
|
+
`
|
1229
|
+
In advanced search, we sometimes need to override the default field visibility conditionals.
|
1230
|
+
|
1231
|
+
For example, Informant fields in the declaration form may have conditional logic
|
1232
|
+
that hides them based on other field values. Since the advanced search form reuses
|
1233
|
+
the declaration form config, those same conditionals would apply by default.
|
1234
|
+
|
1235
|
+
However, in advanced search we often want to make all Informant fields searchable,
|
1236
|
+
regardless of their original visibility logic. To do this, we explicitly set their
|
1237
|
+
'conditionals' to an empty array ('[]') in the search config. This ensures they
|
1238
|
+
are always rendered in the advanced search form.
|
1239
|
+
`
|
1240
|
+
)
|
1114
1241
|
});
|
1242
|
+
var SearchQueryParams = import_zod14.z.object({
|
1243
|
+
eventType: import_zod14.z.string().optional().describe(
|
1244
|
+
"Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
|
1245
|
+
)
|
1246
|
+
}).catchall(FieldValue);
|
1115
1247
|
var FieldConfigSchema = BaseField3.extend({
|
1116
1248
|
fieldId: import_zod14.z.string(),
|
1117
1249
|
fieldType: import_zod14.z.literal("field")
|
@@ -1119,8 +1251,8 @@ var FieldConfigSchema = BaseField3.extend({
|
|
1119
1251
|
var EventFieldId = import_zod14.z.enum([
|
1120
1252
|
"trackingId",
|
1121
1253
|
"status",
|
1122
|
-
"
|
1123
|
-
"
|
1254
|
+
"legalStatus.REGISTERED.createdAt",
|
1255
|
+
"legalStatus.REGISTERED.createdAtLocation",
|
1124
1256
|
"updatedAt"
|
1125
1257
|
]);
|
1126
1258
|
var EventFieldConfigSchema = BaseField3.extend({
|
@@ -1140,114 +1272,127 @@ var AdvancedSearchConfig = import_zod14.z.object({
|
|
1140
1272
|
var import_lodash = require("lodash");
|
1141
1273
|
|
1142
1274
|
// ../commons/src/events/ActionDocument.ts
|
1275
|
+
var import_zod16 = require("zod");
|
1276
|
+
var import_zod_openapi7 = require("zod-openapi");
|
1277
|
+
|
1278
|
+
// ../commons/src/events/CreatedAtLocation.ts
|
1143
1279
|
var import_zod15 = require("zod");
|
1144
|
-
var
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1280
|
+
var CreatedAtLocation = import_zod15.z.string().nullish();
|
1281
|
+
|
1282
|
+
// ../commons/src/events/ActionDocument.ts
|
1283
|
+
(0, import_zod_openapi7.extendZodWithOpenApi)(import_zod16.z);
|
1284
|
+
var ActionUpdate = import_zod16.z.record(import_zod16.z.string(), FieldUpdateValue);
|
1285
|
+
var EventState = import_zod16.z.record(import_zod16.z.string(), FieldValue);
|
1148
1286
|
var ActionStatus = {
|
1149
1287
|
Requested: "Requested",
|
1150
1288
|
Accepted: "Accepted",
|
1151
1289
|
Rejected: "Rejected"
|
1152
1290
|
};
|
1153
|
-
var ActionBase =
|
1154
|
-
id:
|
1155
|
-
transactionId:
|
1156
|
-
createdAt:
|
1157
|
-
createdBy:
|
1158
|
-
createdByRole:
|
1291
|
+
var ActionBase = import_zod16.z.object({
|
1292
|
+
id: import_zod16.z.string(),
|
1293
|
+
transactionId: import_zod16.z.string(),
|
1294
|
+
createdAt: import_zod16.z.string().datetime(),
|
1295
|
+
createdBy: import_zod16.z.string(),
|
1296
|
+
createdByRole: import_zod16.z.string(),
|
1297
|
+
createdBySignature: import_zod16.z.string().nullish().describe("Reference to signature of the user who created the action"),
|
1298
|
+
createdAtLocation: CreatedAtLocation,
|
1159
1299
|
declaration: ActionUpdate,
|
1160
1300
|
annotation: ActionUpdate.optional(),
|
1161
|
-
|
1162
|
-
status: import_zod15.z.enum([
|
1301
|
+
status: import_zod16.z.enum([
|
1163
1302
|
ActionStatus.Requested,
|
1164
1303
|
ActionStatus.Accepted,
|
1165
1304
|
ActionStatus.Rejected
|
1166
1305
|
]),
|
1167
1306
|
// If the action is an asynchronous confirmation for another action, we will save the original action id here.
|
1168
|
-
originalActionId:
|
1307
|
+
originalActionId: import_zod16.z.string().optional()
|
1169
1308
|
});
|
1170
1309
|
var AssignedAction = ActionBase.merge(
|
1171
|
-
|
1172
|
-
type:
|
1173
|
-
assignedTo:
|
1310
|
+
import_zod16.z.object({
|
1311
|
+
type: import_zod16.z.literal(ActionType.ASSIGN),
|
1312
|
+
assignedTo: import_zod16.z.string()
|
1174
1313
|
})
|
1175
1314
|
);
|
1176
1315
|
var UnassignedAction = ActionBase.merge(
|
1177
|
-
|
1178
|
-
type:
|
1179
|
-
assignedTo:
|
1316
|
+
import_zod16.z.object({
|
1317
|
+
type: import_zod16.z.literal(ActionType.UNASSIGN),
|
1318
|
+
assignedTo: import_zod16.z.literal(null)
|
1180
1319
|
})
|
1181
1320
|
);
|
1182
1321
|
var RegisterAction = ActionBase.merge(
|
1183
|
-
|
1184
|
-
type:
|
1185
|
-
registrationNumber:
|
1322
|
+
import_zod16.z.object({
|
1323
|
+
type: import_zod16.z.literal(ActionType.REGISTER),
|
1324
|
+
registrationNumber: import_zod16.z.string().optional()
|
1186
1325
|
})
|
1187
1326
|
);
|
1188
1327
|
var DeclareAction = ActionBase.merge(
|
1189
|
-
|
1190
|
-
type:
|
1328
|
+
import_zod16.z.object({
|
1329
|
+
type: import_zod16.z.literal(ActionType.DECLARE)
|
1191
1330
|
})
|
1192
1331
|
);
|
1193
1332
|
var ValidateAction = ActionBase.merge(
|
1194
|
-
|
1195
|
-
type:
|
1333
|
+
import_zod16.z.object({
|
1334
|
+
type: import_zod16.z.literal(ActionType.VALIDATE)
|
1196
1335
|
})
|
1197
1336
|
);
|
1337
|
+
var RejectionReason = import_zod16.z.object({
|
1338
|
+
message: import_zod16.z.string().min(1, { message: "Message cannot be empty" }).describe("Message describing reason for rejection or archiving"),
|
1339
|
+
isDuplicate: import_zod16.z.boolean().optional().describe("If a declaration is duplicated")
|
1340
|
+
});
|
1198
1341
|
var RejectAction = ActionBase.merge(
|
1199
|
-
|
1200
|
-
type:
|
1342
|
+
import_zod16.z.object({
|
1343
|
+
type: import_zod16.z.literal(ActionType.REJECT),
|
1344
|
+
reason: RejectionReason
|
1201
1345
|
})
|
1202
1346
|
);
|
1203
1347
|
var MarkAsDuplicateAction = ActionBase.merge(
|
1204
|
-
|
1205
|
-
type:
|
1348
|
+
import_zod16.z.object({
|
1349
|
+
type: import_zod16.z.literal(ActionType.MARKED_AS_DUPLICATE)
|
1206
1350
|
})
|
1207
1351
|
);
|
1208
1352
|
var ArchiveAction = ActionBase.merge(
|
1209
|
-
|
1210
|
-
type:
|
1353
|
+
import_zod16.z.object({
|
1354
|
+
type: import_zod16.z.literal(ActionType.ARCHIVE),
|
1355
|
+
reason: RejectionReason
|
1211
1356
|
})
|
1212
1357
|
);
|
1213
1358
|
var CreatedAction = ActionBase.merge(
|
1214
|
-
|
1215
|
-
type:
|
1359
|
+
import_zod16.z.object({
|
1360
|
+
type: import_zod16.z.literal(ActionType.CREATE)
|
1216
1361
|
})
|
1217
1362
|
);
|
1218
1363
|
var NotifiedAction = ActionBase.merge(
|
1219
|
-
|
1220
|
-
type:
|
1364
|
+
import_zod16.z.object({
|
1365
|
+
type: import_zod16.z.literal(ActionType.NOTIFY)
|
1221
1366
|
})
|
1222
1367
|
);
|
1223
1368
|
var PrintCertificateAction = ActionBase.merge(
|
1224
|
-
|
1225
|
-
type:
|
1369
|
+
import_zod16.z.object({
|
1370
|
+
type: import_zod16.z.literal(ActionType.PRINT_CERTIFICATE)
|
1226
1371
|
})
|
1227
1372
|
);
|
1228
1373
|
var RequestedCorrectionAction = ActionBase.merge(
|
1229
|
-
|
1230
|
-
type:
|
1374
|
+
import_zod16.z.object({
|
1375
|
+
type: import_zod16.z.literal(ActionType.REQUEST_CORRECTION)
|
1231
1376
|
})
|
1232
1377
|
);
|
1233
1378
|
var ApprovedCorrectionAction = ActionBase.merge(
|
1234
|
-
|
1235
|
-
type:
|
1236
|
-
requestId:
|
1379
|
+
import_zod16.z.object({
|
1380
|
+
type: import_zod16.z.literal(ActionType.APPROVE_CORRECTION),
|
1381
|
+
requestId: import_zod16.z.string()
|
1237
1382
|
})
|
1238
1383
|
);
|
1239
1384
|
var RejectedCorrectionAction = ActionBase.merge(
|
1240
|
-
|
1241
|
-
type:
|
1242
|
-
requestId:
|
1385
|
+
import_zod16.z.object({
|
1386
|
+
type: import_zod16.z.literal(ActionType.REJECT_CORRECTION),
|
1387
|
+
requestId: import_zod16.z.string()
|
1243
1388
|
})
|
1244
1389
|
);
|
1245
1390
|
var ReadAction = ActionBase.merge(
|
1246
|
-
|
1247
|
-
type:
|
1391
|
+
import_zod16.z.object({
|
1392
|
+
type: import_zod16.z.literal(ActionType.READ)
|
1248
1393
|
})
|
1249
1394
|
);
|
1250
|
-
var ActionDocument =
|
1395
|
+
var ActionDocument = import_zod16.z.discriminatedUnion("type", [
|
1251
1396
|
CreatedAction.openapi({ ref: "CreatedAction" }),
|
1252
1397
|
ValidateAction.openapi({ ref: "ValidateAction" }),
|
1253
1398
|
RejectAction.openapi({ ref: "RejectAction" }),
|
@@ -1270,20 +1415,20 @@ var AsyncRejectActionDocument = ActionBase.omit({
|
|
1270
1415
|
declaration: true,
|
1271
1416
|
annotation: true
|
1272
1417
|
}).merge(
|
1273
|
-
|
1274
|
-
type:
|
1275
|
-
status:
|
1418
|
+
import_zod16.z.object({
|
1419
|
+
type: import_zod16.z.enum(ConfirmableActions),
|
1420
|
+
status: import_zod16.z.literal(ActionStatus.Rejected)
|
1276
1421
|
})
|
1277
1422
|
);
|
1278
|
-
var Action =
|
1279
|
-
var ResolvedUser =
|
1280
|
-
id:
|
1281
|
-
role:
|
1282
|
-
name:
|
1283
|
-
|
1284
|
-
use:
|
1285
|
-
given:
|
1286
|
-
family:
|
1423
|
+
var Action = import_zod16.z.union([ActionDocument, AsyncRejectActionDocument]);
|
1424
|
+
var ResolvedUser = import_zod16.z.object({
|
1425
|
+
id: import_zod16.z.string(),
|
1426
|
+
role: import_zod16.z.string(),
|
1427
|
+
name: import_zod16.z.array(
|
1428
|
+
import_zod16.z.object({
|
1429
|
+
use: import_zod16.z.string(),
|
1430
|
+
given: import_zod16.z.array(import_zod16.z.string()),
|
1431
|
+
family: import_zod16.z.string()
|
1287
1432
|
})
|
1288
1433
|
)
|
1289
1434
|
});
|
@@ -1294,7 +1439,7 @@ var import_ajv_formats = __toESM(require("ajv-formats"));
|
|
1294
1439
|
var import_date_fns = require("date-fns");
|
1295
1440
|
|
1296
1441
|
// ../commons/src/events/FieldTypeMapping.ts
|
1297
|
-
var
|
1442
|
+
var import_zod17 = require("zod");
|
1298
1443
|
function mapFieldTypeToZod(type, required) {
|
1299
1444
|
let schema;
|
1300
1445
|
switch (type) {
|
@@ -1320,7 +1465,6 @@ function mapFieldTypeToZod(type, required) {
|
|
1320
1465
|
case FieldType.ADMINISTRATIVE_AREA:
|
1321
1466
|
case FieldType.FACILITY:
|
1322
1467
|
case FieldType.OFFICE:
|
1323
|
-
case FieldType.SIGNATURE:
|
1324
1468
|
schema = required ? NonEmptyTextValue : TextValue;
|
1325
1469
|
break;
|
1326
1470
|
case FieldType.NUMBER:
|
@@ -1329,6 +1473,7 @@ function mapFieldTypeToZod(type, required) {
|
|
1329
1473
|
case FieldType.CHECKBOX:
|
1330
1474
|
schema = CheckboxFieldValue;
|
1331
1475
|
break;
|
1476
|
+
case FieldType.SIGNATURE:
|
1332
1477
|
case FieldType.FILE:
|
1333
1478
|
schema = FileFieldValue;
|
1334
1479
|
break;
|
@@ -1349,7 +1494,7 @@ function createValidationSchema(config) {
|
|
1349
1494
|
for (const field2 of config) {
|
1350
1495
|
shape[field2.id] = mapFieldTypeToZod(field2.type, field2.required);
|
1351
1496
|
}
|
1352
|
-
return
|
1497
|
+
return import_zod17.z.object(shape);
|
1353
1498
|
}
|
1354
1499
|
function mapFieldTypeToMockValue(field2, i) {
|
1355
1500
|
switch (field2.type) {
|
@@ -1362,7 +1507,6 @@ function mapFieldTypeToMockValue(field2, i) {
|
|
1362
1507
|
case FieldType.SELECT:
|
1363
1508
|
case FieldType.COUNTRY:
|
1364
1509
|
case FieldType.RADIO_GROUP:
|
1365
|
-
case FieldType.SIGNATURE:
|
1366
1510
|
case FieldType.PARAGRAPH:
|
1367
1511
|
case FieldType.ADMINISTRATIVE_AREA:
|
1368
1512
|
case FieldType.FACILITY:
|
@@ -1391,6 +1535,7 @@ function mapFieldTypeToMockValue(field2, i) {
|
|
1391
1535
|
return ["2021-01-01", "2021-01-02"];
|
1392
1536
|
case FieldType.CHECKBOX:
|
1393
1537
|
return true;
|
1538
|
+
case FieldType.SIGNATURE:
|
1394
1539
|
case FieldType.FILE:
|
1395
1540
|
return {
|
1396
1541
|
filename: "4f095fc4-4312-4de2-aa38-86dcc0f71044.png",
|
@@ -1414,7 +1559,6 @@ function mapFieldTypeToEmptyValue(field2) {
|
|
1414
1559
|
case FieldType.SELECT:
|
1415
1560
|
case FieldType.COUNTRY:
|
1416
1561
|
case FieldType.RADIO_GROUP:
|
1417
|
-
case FieldType.SIGNATURE:
|
1418
1562
|
case FieldType.PARAGRAPH:
|
1419
1563
|
case FieldType.ADMINISTRATIVE_AREA:
|
1420
1564
|
case FieldType.FACILITY:
|
@@ -1440,6 +1584,7 @@ function mapFieldTypeToEmptyValue(field2) {
|
|
1440
1584
|
number: null,
|
1441
1585
|
zipCode: null
|
1442
1586
|
};
|
1587
|
+
case FieldType.SIGNATURE:
|
1443
1588
|
case FieldType.FILE:
|
1444
1589
|
return {
|
1445
1590
|
filename: "",
|
@@ -1519,6 +1664,9 @@ var isOfficeFieldType = (field2) => {
|
|
1519
1664
|
var isDataFieldType = (field2) => {
|
1520
1665
|
return field2.config.type === FieldType.DATA;
|
1521
1666
|
};
|
1667
|
+
var isNonInteractiveFieldType = (field2) => {
|
1668
|
+
return field2.type === FieldType.DIVIDER || field2.type === FieldType.PAGE_HEADER || field2.type === FieldType.PARAGRAPH || field2.type === FieldType.BULLET_LIST || field2.type === FieldType.DATA;
|
1669
|
+
};
|
1522
1670
|
|
1523
1671
|
// ../commons/src/conditionals/validate.ts
|
1524
1672
|
var ajv = new import_ajv.default({
|
@@ -1896,23 +2044,23 @@ function getMixedPath(obj, path, defaultValue) {
|
|
1896
2044
|
}
|
1897
2045
|
|
1898
2046
|
// ../commons/src/events/EventConfig.ts
|
1899
|
-
var
|
1900
|
-
(0,
|
1901
|
-
var EventConfig =
|
1902
|
-
id:
|
2047
|
+
var import_zod_openapi8 = require("zod-openapi");
|
2048
|
+
(0, import_zod_openapi8.extendZodWithOpenApi)(import_zod18.z);
|
2049
|
+
var EventConfig = import_zod18.z.object({
|
2050
|
+
id: import_zod18.z.string().describe(
|
1903
2051
|
'A machine-readable identifier for the event, e.g. "birth" or "death"'
|
1904
2052
|
),
|
1905
|
-
dateOfEvent:
|
2053
|
+
dateOfEvent: FieldReference.optional(),
|
1906
2054
|
title: TranslationConfig,
|
1907
2055
|
fallbackTitle: TranslationConfig.optional().describe(
|
1908
2056
|
"This is a fallback title if actual title resolves to empty string"
|
1909
2057
|
),
|
1910
2058
|
summary: SummaryConfig,
|
1911
2059
|
label: TranslationConfig,
|
1912
|
-
actions:
|
2060
|
+
actions: import_zod18.z.array(ActionConfig),
|
1913
2061
|
declaration: DeclarationFormConfig,
|
1914
|
-
deduplication:
|
1915
|
-
advancedSearch:
|
2062
|
+
deduplication: import_zod18.z.array(DeduplicationConfig).optional().default([]),
|
2063
|
+
advancedSearch: import_zod18.z.array(AdvancedSearchConfig).optional().default([])
|
1916
2064
|
}).superRefine((event2, ctx) => {
|
1917
2065
|
const allFields = findAllFields(event2);
|
1918
2066
|
const fieldIds = allFields.map((field2) => field2.id);
|
@@ -1946,13 +2094,13 @@ var EventConfig = import_zod17.z.object({
|
|
1946
2094
|
}
|
1947
2095
|
if (event2.dateOfEvent) {
|
1948
2096
|
const eventDateFieldId = getDeclarationFields(event2).find(
|
1949
|
-
({ id }) => id === event2.dateOfEvent
|
2097
|
+
({ id }) => id === event2.dateOfEvent?.$$field
|
1950
2098
|
);
|
1951
2099
|
if (!eventDateFieldId) {
|
1952
2100
|
ctx.addIssue({
|
1953
2101
|
code: "custom",
|
1954
2102
|
message: `Date of event field id must match a field id in fields array.
|
1955
|
-
Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent
|
2103
|
+
Invalid date of event field ID for event ${event2.id}: ${event2.dateOfEvent.$$field}`,
|
1956
2104
|
path: ["dateOfEvent"]
|
1957
2105
|
});
|
1958
2106
|
} else if (eventDateFieldId.type !== FieldType.DATE) {
|
@@ -1974,217 +2122,24 @@ var definePage = (page) => PageConfig.parse(page);
|
|
1974
2122
|
var defineFormPage = (formPage) => FormPageConfig.parse(formPage);
|
1975
2123
|
|
1976
2124
|
// ../commons/src/events/WorkqueueConfig.ts
|
1977
|
-
var
|
2125
|
+
var import_zod25 = require("zod");
|
1978
2126
|
|
1979
|
-
// ../commons/src/events/
|
2127
|
+
// ../commons/src/events/serializers/user/serializer.ts
|
1980
2128
|
var import_zod19 = require("zod");
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
VALIDATED: "VALIDATED",
|
1989
|
-
REGISTERED: "REGISTERED",
|
1990
|
-
CERTIFIED: "CERTIFIED",
|
1991
|
-
REJECTED: "REJECTED",
|
1992
|
-
ARCHIVED: "ARCHIVED"
|
1993
|
-
};
|
1994
|
-
var CustomFlags = {
|
1995
|
-
CERTIFICATE_PRINTED: "certificate-printed"
|
1996
|
-
};
|
1997
|
-
var Flag = import_zod18.z.string().regex(
|
1998
|
-
new RegExp(
|
1999
|
-
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(ActionStatus).join("|").toLowerCase()})$`
|
2000
|
-
),
|
2001
|
-
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
2002
|
-
).or(import_zod18.z.nativeEnum(CustomFlags));
|
2003
|
-
var eventStatuses = Object.values(EventStatus);
|
2004
|
-
var EventStatuses = import_zod18.z.nativeEnum(EventStatus);
|
2005
|
-
var ZodDate = import_zod18.z.string().date();
|
2006
|
-
var ActionCreationMetadata = import_zod18.z.object({
|
2007
|
-
createdAt: import_zod18.z.string().datetime().describe("The timestamp when the action request was created."),
|
2008
|
-
createdBy: import_zod18.z.string().describe("ID of the user who created the action request."),
|
2009
|
-
createdAtLocation: import_zod18.z.string().describe("Location of the user who created the action request."),
|
2010
|
-
acceptedAt: import_zod18.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
2011
|
-
createdByRole: import_zod18.z.string().describe("Role of the user at the time of action request creation.")
|
2012
|
-
});
|
2013
|
-
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
2014
|
-
registrationNumber: import_zod18.z.string().describe(
|
2015
|
-
"Registration number of the event. Always present for accepted registrations."
|
2016
|
-
)
|
2017
|
-
});
|
2018
|
-
var LegalStatuses = import_zod18.z.object({
|
2019
|
-
[EventStatus.DECLARED]: ActionCreationMetadata.nullish(),
|
2020
|
-
[EventStatus.REGISTERED]: RegistrationCreationMetadata.nullish()
|
2021
|
-
});
|
2022
|
-
var EventMetadata = import_zod18.z.object({
|
2023
|
-
id: import_zod18.z.string(),
|
2024
|
-
type: import_zod18.z.string().describe("The type of event, such as birth, death, or marriage."),
|
2025
|
-
status: EventStatuses,
|
2026
|
-
legalStatuses: LegalStatuses.describe(
|
2027
|
-
"Metadata related to the legal registration of the event, such as who registered it and when."
|
2028
|
-
),
|
2029
|
-
createdAt: import_zod18.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
2030
|
-
dateOfEvent: ZodDate.nullish(),
|
2031
|
-
createdBy: import_zod18.z.string().describe("ID of the user who created the event."),
|
2032
|
-
updatedByUserRole: import_zod18.z.string().describe("Role of the user who last updated the declaration."),
|
2033
|
-
createdAtLocation: import_zod18.z.string().describe("Location of the user who created the event."),
|
2034
|
-
updatedAtLocation: import_zod18.z.string().nullish().describe("Location of the user who last updated the declaration."),
|
2035
|
-
updatedAt: import_zod18.z.string().datetime().describe("Timestamp of the most recent declaration update."),
|
2036
|
-
assignedTo: import_zod18.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
2037
|
-
updatedBy: import_zod18.z.string().nullish().describe("ID of the user who last updated the declaration."),
|
2038
|
-
trackingId: import_zod18.z.string().describe(
|
2039
|
-
"System-generated tracking ID used by informants or registrars to look up the event."
|
2040
|
-
),
|
2041
|
-
flags: import_zod18.z.array(Flag)
|
2042
|
-
});
|
2043
|
-
var EventMetadataKeys = import_zod18.z.enum([
|
2044
|
-
"id",
|
2045
|
-
"type",
|
2046
|
-
"status",
|
2047
|
-
"createdAt",
|
2048
|
-
"dateOfEvent",
|
2049
|
-
"createdBy",
|
2050
|
-
"updatedByUserRole",
|
2051
|
-
"createdAtLocation",
|
2052
|
-
"updatedAtLocation",
|
2053
|
-
"updatedAt",
|
2054
|
-
"assignedTo",
|
2055
|
-
"updatedBy",
|
2056
|
-
"trackingId",
|
2057
|
-
"legalStatuses",
|
2058
|
-
"flags"
|
2059
|
-
]);
|
2060
|
-
var EventMetadataParameter = import_zod18.z.object({
|
2061
|
-
// @TODO: Reconcile with the event metadata definition. How could we derive one from the other?
|
2062
|
-
$event: EventMetadataKeys
|
2063
|
-
});
|
2064
|
-
var eventMetadataLabelMap = {
|
2065
|
-
"event.assignedTo": {
|
2066
|
-
id: "event.assignedTo.label",
|
2067
|
-
defaultMessage: "Assigned To",
|
2068
|
-
description: "Assigned To"
|
2069
|
-
},
|
2070
|
-
"event.createdAt": {
|
2071
|
-
id: "event.createdAt.label",
|
2072
|
-
defaultMessage: "Created",
|
2073
|
-
description: "Created At"
|
2074
|
-
},
|
2075
|
-
"event.dateOfEvent": {
|
2076
|
-
id: "event.dateOfEvent.label",
|
2077
|
-
defaultMessage: "Date of Event",
|
2078
|
-
description: "Date of Event"
|
2079
|
-
},
|
2080
|
-
"event.createdAtLocation": {
|
2081
|
-
id: "event.createdAtLocation.label",
|
2082
|
-
defaultMessage: "Location",
|
2083
|
-
description: "Created At Location"
|
2084
|
-
},
|
2085
|
-
"event.updatedAtLocation": {
|
2086
|
-
id: "event.updatedAtLocation.label",
|
2087
|
-
defaultMessage: "Location",
|
2088
|
-
description: "Updated At Location"
|
2089
|
-
},
|
2090
|
-
"event.createdBy": {
|
2091
|
-
id: "event.createdBy.label",
|
2092
|
-
defaultMessage: "Created By",
|
2093
|
-
description: "Created By"
|
2094
|
-
},
|
2095
|
-
"event.updatedByUserRole": {
|
2096
|
-
id: "event.updatedByUserRole.label",
|
2097
|
-
defaultMessage: "Updated By Role",
|
2098
|
-
description: "Updated By Role"
|
2099
|
-
},
|
2100
|
-
"event.id": {
|
2101
|
-
id: "event.id.label",
|
2102
|
-
defaultMessage: "ID",
|
2103
|
-
description: "ID"
|
2104
|
-
},
|
2105
|
-
"event.updatedAt": {
|
2106
|
-
id: "event.modifiedAt.label",
|
2107
|
-
defaultMessage: "Updated",
|
2108
|
-
description: "Modified At"
|
2109
|
-
},
|
2110
|
-
"event.status": {
|
2111
|
-
id: "event.status.label",
|
2112
|
-
defaultMessage: "Status",
|
2113
|
-
description: "Status"
|
2114
|
-
},
|
2115
|
-
"event.type": {
|
2116
|
-
id: "event.type.label",
|
2117
|
-
defaultMessage: "Type",
|
2118
|
-
description: "Type"
|
2119
|
-
},
|
2120
|
-
"event.updatedBy": {
|
2121
|
-
id: "event.updatedBy.label",
|
2122
|
-
defaultMessage: "Updated By",
|
2123
|
-
description: "Updated By"
|
2124
|
-
},
|
2125
|
-
"event.trackingId": {
|
2126
|
-
id: "event.trackingId.label",
|
2127
|
-
defaultMessage: "Tracking ID",
|
2128
|
-
description: "Tracking ID"
|
2129
|
-
},
|
2130
|
-
"event.flags": {
|
2131
|
-
id: "event.flags.label",
|
2132
|
-
defaultMessage: "Flags",
|
2133
|
-
description: "Flags"
|
2134
|
-
}
|
2135
|
-
};
|
2136
|
-
|
2137
|
-
// ../commons/src/events/EventIndex.ts
|
2138
|
-
var EventIndex = EventMetadata.extend({
|
2139
|
-
declaration: EventState
|
2140
|
-
});
|
2141
|
-
var EventSearchIndex = import_zod19.z.record(import_zod19.z.string(), import_zod19.z.any()).and(
|
2142
|
-
import_zod19.z.object({
|
2143
|
-
type: import_zod19.z.string()
|
2144
|
-
// Ensures "type" (event-id) exists and is a string
|
2145
|
-
})
|
2146
|
-
);
|
2147
|
-
var Fuzzy = import_zod19.z.object({ type: import_zod19.z.literal("fuzzy"), term: import_zod19.z.string() });
|
2148
|
-
var Exact = import_zod19.z.object({ type: import_zod19.z.literal("exact"), term: import_zod19.z.string() });
|
2149
|
-
var AnyOf = import_zod19.z.object({
|
2150
|
-
type: import_zod19.z.literal("anyOf"),
|
2151
|
-
terms: import_zod19.z.array(import_zod19.z.string())
|
2152
|
-
});
|
2153
|
-
var Range = import_zod19.z.object({
|
2154
|
-
type: import_zod19.z.literal("range"),
|
2155
|
-
gte: import_zod19.z.string(),
|
2156
|
-
lte: import_zod19.z.string()
|
2157
|
-
});
|
2158
|
-
var Not = import_zod19.z.object({ type: import_zod19.z.literal("not"), term: import_zod19.z.string() });
|
2159
|
-
var Within = import_zod19.z.object({ type: import_zod19.z.literal("within"), location: import_zod19.z.string() });
|
2160
|
-
var DateCondition = import_zod19.z.union([Exact, Range]);
|
2161
|
-
var QueryInput = import_zod19.z.lazy(
|
2162
|
-
() => import_zod19.z.union([
|
2163
|
-
import_zod19.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf, Not]),
|
2164
|
-
import_zod19.z.record(import_zod19.z.string(), QueryInput)
|
2129
|
+
var SerializedUserField = import_zod19.z.object({
|
2130
|
+
$userField: import_zod19.z.enum([
|
2131
|
+
"id",
|
2132
|
+
"name",
|
2133
|
+
"role",
|
2134
|
+
"signatureFilename",
|
2135
|
+
"primaryOfficeId"
|
2165
2136
|
])
|
2166
|
-
);
|
2167
|
-
var QueryExpression = import_zod19.z.object({
|
2168
|
-
type: import_zod19.z.literal("and"),
|
2169
|
-
eventType: import_zod19.z.string(),
|
2170
|
-
status: import_zod19.z.optional(import_zod19.z.union([AnyOf, Exact])),
|
2171
|
-
createdAt: import_zod19.z.optional(DateCondition),
|
2172
|
-
updatedAt: import_zod19.z.optional(DateCondition),
|
2173
|
-
registeredAt: import_zod19.z.optional(DateCondition),
|
2174
|
-
registeredAtLocation: import_zod19.z.optional(import_zod19.z.union([Within, Exact])),
|
2175
|
-
createAtLocation: import_zod19.z.optional(import_zod19.z.union([Within, Exact])),
|
2176
|
-
updatedAtLocation: import_zod19.z.optional(import_zod19.z.union([Within, Exact])),
|
2177
|
-
createdBy: import_zod19.z.optional(Exact),
|
2178
|
-
updatedBy: import_zod19.z.optional(Exact),
|
2179
|
-
trackingId: import_zod19.z.optional(Exact),
|
2180
|
-
flags: import_zod19.z.optional(import_zod19.z.array(import_zod19.z.union([AnyOf, Not]))),
|
2181
|
-
data: QueryInput
|
2182
|
-
}).partial();
|
2183
|
-
var Or2 = import_zod19.z.object({
|
2184
|
-
type: import_zod19.z.literal("or"),
|
2185
|
-
clauses: import_zod19.z.array(QueryExpression)
|
2186
2137
|
});
|
2187
|
-
|
2138
|
+
function userSerializer(userField) {
|
2139
|
+
return {
|
2140
|
+
$userField: userField
|
2141
|
+
};
|
2142
|
+
}
|
2188
2143
|
|
2189
2144
|
// ../commons/src/conditionals/conditionals.ts
|
2190
2145
|
function defineConditional(schema) {
|
@@ -2227,7 +2182,7 @@ function not(condition) {
|
|
2227
2182
|
function never() {
|
2228
2183
|
return not(alwaysTrue());
|
2229
2184
|
}
|
2230
|
-
var user = {
|
2185
|
+
var user = Object.assign(userSerializer, {
|
2231
2186
|
hasScope: (scope) => defineConditional({
|
2232
2187
|
type: "object",
|
2233
2188
|
properties: {
|
@@ -2247,7 +2202,7 @@ var user = {
|
|
2247
2202
|
},
|
2248
2203
|
required: ["$user"]
|
2249
2204
|
})
|
2250
|
-
};
|
2205
|
+
});
|
2251
2206
|
function createEventConditionals() {
|
2252
2207
|
return {
|
2253
2208
|
/**
|
@@ -2298,7 +2253,7 @@ function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
|
|
2298
2253
|
};
|
2299
2254
|
}
|
2300
2255
|
function isFieldReference(value) {
|
2301
|
-
return typeof value === "object" && value !== null && "
|
2256
|
+
return typeof value === "object" && value !== null && "$$field" in value;
|
2302
2257
|
}
|
2303
2258
|
function createFieldConditionals(fieldId) {
|
2304
2259
|
const getDateRange = (date, clause) => ({
|
@@ -2313,6 +2268,10 @@ function createFieldConditionals(fieldId) {
|
|
2313
2268
|
required: [fieldId]
|
2314
2269
|
});
|
2315
2270
|
return {
|
2271
|
+
/**
|
2272
|
+
* @private Internal property used for field reference tracking.
|
2273
|
+
*/
|
2274
|
+
$$field: fieldId,
|
2316
2275
|
isAfter: () => ({
|
2317
2276
|
days: (days) => ({
|
2318
2277
|
inPast: () => defineFormConditional(
|
@@ -2324,7 +2283,7 @@ function createFieldConditionals(fieldId) {
|
|
2324
2283
|
}),
|
2325
2284
|
date: (date) => {
|
2326
2285
|
if (isFieldReference(date)) {
|
2327
|
-
const comparedFieldId = date
|
2286
|
+
const comparedFieldId = date.$$field;
|
2328
2287
|
return defineFormConditional(
|
2329
2288
|
getDateRangeToFieldReference(
|
2330
2289
|
fieldId,
|
@@ -2348,7 +2307,7 @@ function createFieldConditionals(fieldId) {
|
|
2348
2307
|
}),
|
2349
2308
|
date: (date) => {
|
2350
2309
|
if (isFieldReference(date)) {
|
2351
|
-
const comparedFieldId = date
|
2310
|
+
const comparedFieldId = date.$$field;
|
2352
2311
|
return defineFormConditional(
|
2353
2312
|
getDateRangeToFieldReference(
|
2354
2313
|
fieldId,
|
@@ -2363,7 +2322,7 @@ function createFieldConditionals(fieldId) {
|
|
2363
2322
|
}),
|
2364
2323
|
isEqualTo: (value) => {
|
2365
2324
|
if (isFieldReference(value)) {
|
2366
|
-
const comparedFieldId = value
|
2325
|
+
const comparedFieldId = value.$$field;
|
2367
2326
|
return defineFormConditional({
|
2368
2327
|
type: "object",
|
2369
2328
|
properties: {
|
@@ -2479,20 +2438,19 @@ function createFieldConditionals(fieldId) {
|
|
2479
2438
|
}
|
2480
2439
|
},
|
2481
2440
|
required: [fieldId]
|
2482
|
-
})
|
2483
|
-
getId: () => ({ fieldId })
|
2441
|
+
})
|
2484
2442
|
};
|
2485
2443
|
}
|
2486
2444
|
|
2487
2445
|
// ../commons/src/searchConfigs.ts
|
2488
|
-
function
|
2446
|
+
function createSearchConfig(baseField) {
|
2489
2447
|
return {
|
2490
2448
|
/**
|
2491
2449
|
* Creates a range configuration for the specified field.
|
2492
2450
|
*
|
2493
2451
|
* @returns An object containing the field ID and a configuration object with a type of 'range'.
|
2494
2452
|
*
|
2495
|
-
* @example event('
|
2453
|
+
* @example event('legalStatus.REGISTERED.createdAt').range()
|
2496
2454
|
* // {
|
2497
2455
|
* // ...
|
2498
2456
|
* // config: { type: 'range' }
|
@@ -2538,7 +2496,7 @@ function createEventFieldConfig(fieldId, options) {
|
|
2538
2496
|
options,
|
2539
2497
|
fieldType: "event"
|
2540
2498
|
};
|
2541
|
-
return
|
2499
|
+
return createSearchConfig(baseField);
|
2542
2500
|
}
|
2543
2501
|
|
2544
2502
|
// ../commons/src/events/event.ts
|
@@ -2554,135 +2512,673 @@ var event = Object.assign(eventFn, {
|
|
2554
2512
|
}
|
2555
2513
|
});
|
2556
2514
|
|
2557
|
-
// ../commons/src/events/
|
2558
|
-
var
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2515
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
2516
|
+
var import_zod21 = require("zod");
|
2517
|
+
|
2518
|
+
// ../commons/src/events/EventMetadata.ts
|
2519
|
+
var import_zod20 = require("zod");
|
2520
|
+
var EventStatus = {
|
2521
|
+
CREATED: "CREATED",
|
2522
|
+
NOTIFIED: "NOTIFIED",
|
2523
|
+
DECLARED: "DECLARED",
|
2524
|
+
VALIDATED: "VALIDATED",
|
2525
|
+
REGISTERED: "REGISTERED",
|
2526
|
+
CERTIFIED: "CERTIFIED",
|
2527
|
+
REJECTED: "REJECTED",
|
2528
|
+
ARCHIVED: "ARCHIVED"
|
2529
|
+
};
|
2530
|
+
var eventStatusValues = [
|
2531
|
+
EventStatus.CREATED,
|
2532
|
+
EventStatus.NOTIFIED,
|
2533
|
+
EventStatus.DECLARED,
|
2534
|
+
EventStatus.VALIDATED,
|
2535
|
+
EventStatus.REGISTERED,
|
2536
|
+
EventStatus.CERTIFIED,
|
2537
|
+
EventStatus.REJECTED,
|
2538
|
+
EventStatus.ARCHIVED
|
2539
|
+
];
|
2540
|
+
var EventStatusEnum = import_zod20.z.enum(eventStatusValues);
|
2541
|
+
var CustomFlags = {
|
2542
|
+
CERTIFICATE_PRINTED: "certificate-printed"
|
2543
|
+
};
|
2544
|
+
var Flag = import_zod20.z.string().regex(
|
2545
|
+
new RegExp(
|
2546
|
+
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
2547
|
+
ActionStatus
|
2548
|
+
).join("|").toLowerCase()})$`
|
2562
2549
|
),
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2550
|
+
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
2551
|
+
).or(import_zod20.z.nativeEnum(CustomFlags));
|
2552
|
+
var eventStatuses = Object.values(EventStatus);
|
2553
|
+
var EventStatuses = import_zod20.z.nativeEnum(EventStatus);
|
2554
|
+
var ZodDate = import_zod20.z.string().date();
|
2555
|
+
var ActionCreationMetadata = import_zod20.z.object({
|
2556
|
+
createdAt: import_zod20.z.string().datetime().describe("The timestamp when the action request was created."),
|
2557
|
+
createdBy: import_zod20.z.string().describe("ID of the user who created the action request."),
|
2558
|
+
createdAtLocation: CreatedAtLocation.describe(
|
2559
|
+
"Location of the user who created the action request."
|
2569
2560
|
),
|
2570
|
-
|
2571
|
-
|
2572
|
-
).
|
2573
|
-
{
|
2574
|
-
label: {
|
2575
|
-
id: "workqueues.dateOfEvent",
|
2576
|
-
defaultMessage: "Date of Event",
|
2577
|
-
description: "Label for workqueue column: dateOfEvent"
|
2578
|
-
},
|
2579
|
-
value: event.field("dateOfEvent")
|
2580
|
-
}
|
2581
|
-
])
|
2582
|
-
}).describe("Configuration for workqueue.");
|
2583
|
-
function defineWorkqueue(workqueues) {
|
2584
|
-
return workqueues.map((workqueue) => WorkqueueConfig.parse(workqueue));
|
2585
|
-
}
|
2586
|
-
|
2587
|
-
// ../commons/src/events/Draft.ts
|
2588
|
-
var import_zod22 = require("zod");
|
2589
|
-
|
2590
|
-
// ../commons/src/events/ActionInput.ts
|
2591
|
-
var import_zod21 = require("zod");
|
2592
|
-
var import_zod_openapi5 = require("zod-openapi");
|
2593
|
-
(0, import_zod_openapi5.extendZodWithOpenApi)(import_zod21.z);
|
2594
|
-
var BaseActionInput = import_zod21.z.object({
|
2595
|
-
eventId: import_zod21.z.string(),
|
2596
|
-
transactionId: import_zod21.z.string(),
|
2597
|
-
declaration: ActionUpdate.default({}),
|
2598
|
-
annotation: ActionUpdate.optional(),
|
2599
|
-
originalActionId: import_zod21.z.string().optional(),
|
2600
|
-
keepAssignment: import_zod21.z.boolean().optional()
|
2561
|
+
acceptedAt: import_zod20.z.string().datetime().describe("Timestamp when the action request was accepted."),
|
2562
|
+
createdByRole: import_zod20.z.string().describe("Role of the user at the time of action request creation."),
|
2563
|
+
createdBySignature: import_zod20.z.string().nullish().describe("Signature of the user who created the action request.")
|
2601
2564
|
});
|
2602
|
-
var
|
2603
|
-
|
2604
|
-
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
)
|
2565
|
+
var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
2566
|
+
registrationNumber: import_zod20.z.string().describe(
|
2567
|
+
"Registration number of the event. Always present for accepted registrations."
|
2568
|
+
)
|
2569
|
+
});
|
2570
|
+
var LegalStatuses = import_zod20.z.object({
|
2571
|
+
[EventStatus.DECLARED]: ActionCreationMetadata.nullish(),
|
2572
|
+
[EventStatus.REGISTERED]: RegistrationCreationMetadata.nullish()
|
2573
|
+
});
|
2574
|
+
var EventMetadata = import_zod20.z.object({
|
2575
|
+
id: import_zod20.z.string(),
|
2576
|
+
type: import_zod20.z.string().describe("The type of event, such as birth, death, or marriage."),
|
2577
|
+
status: EventStatuses,
|
2578
|
+
legalStatuses: LegalStatuses.describe(
|
2579
|
+
"Metadata related to the legal registration of the event, such as who registered it and when."
|
2580
|
+
),
|
2581
|
+
createdAt: import_zod20.z.string().datetime().describe("The timestamp when the event was first created and saved."),
|
2582
|
+
dateOfEvent: ZodDate.nullish(),
|
2583
|
+
createdBy: import_zod20.z.string().describe("ID of the user who created the event."),
|
2584
|
+
updatedByUserRole: import_zod20.z.string().describe("Role of the user who last updated the declaration."),
|
2585
|
+
createdAtLocation: CreatedAtLocation.describe(
|
2586
|
+
"Location of the user who created the event."
|
2587
|
+
),
|
2588
|
+
createdBySignature: import_zod20.z.string().nullish().describe("Signature of the user who created the event."),
|
2589
|
+
updatedAtLocation: import_zod20.z.string().nullish().describe("Location of the user who last updated the declaration."),
|
2590
|
+
updatedAt: import_zod20.z.string().datetime().describe("Timestamp of the most recent declaration update."),
|
2591
|
+
assignedTo: import_zod20.z.string().nullish().describe("ID of the user currently assigned to the event."),
|
2592
|
+
updatedBy: import_zod20.z.string().nullish().describe("ID of the user who last updated the declaration."),
|
2593
|
+
trackingId: import_zod20.z.string().describe(
|
2594
|
+
"System-generated tracking ID used by informants or registrars to look up the event."
|
2595
|
+
),
|
2596
|
+
flags: import_zod20.z.array(Flag)
|
2597
|
+
});
|
2598
|
+
var EventMetadataKeysArray = [
|
2599
|
+
"id",
|
2600
|
+
"type",
|
2601
|
+
"status",
|
2602
|
+
"createdAt",
|
2603
|
+
"dateOfEvent",
|
2604
|
+
"createdBy",
|
2605
|
+
"updatedByUserRole",
|
2606
|
+
"createdAtLocation",
|
2607
|
+
"updatedAtLocation",
|
2608
|
+
"updatedAt",
|
2609
|
+
"assignedTo",
|
2610
|
+
"updatedBy",
|
2611
|
+
"trackingId",
|
2612
|
+
"legalStatuses",
|
2613
|
+
"flags"
|
2614
|
+
];
|
2615
|
+
var EventMetadataKeys = import_zod20.z.enum(EventMetadataKeysArray);
|
2616
|
+
var eventMetadataLabelMap = {
|
2617
|
+
"event.assignedTo": {
|
2618
|
+
id: "event.assignedTo.label",
|
2619
|
+
defaultMessage: "Assigned To",
|
2620
|
+
description: "Assigned To"
|
2621
|
+
},
|
2622
|
+
"event.createdAt": {
|
2623
|
+
id: "event.createdAt.label",
|
2624
|
+
defaultMessage: "Created",
|
2625
|
+
description: "Created At"
|
2626
|
+
},
|
2627
|
+
"event.dateOfEvent": {
|
2628
|
+
id: "event.dateOfEvent.label",
|
2629
|
+
defaultMessage: "Date of Event",
|
2630
|
+
description: "Date of Event"
|
2631
|
+
},
|
2632
|
+
"event.createdAtLocation": {
|
2633
|
+
id: "event.createdAtLocation.label",
|
2634
|
+
defaultMessage: "Location",
|
2635
|
+
description: "Created At Location"
|
2636
|
+
},
|
2637
|
+
"event.updatedAtLocation": {
|
2638
|
+
id: "event.updatedAtLocation.label",
|
2639
|
+
defaultMessage: "Location",
|
2640
|
+
description: "Updated At Location"
|
2641
|
+
},
|
2642
|
+
"event.createdBy": {
|
2643
|
+
id: "event.createdBy.label",
|
2644
|
+
defaultMessage: "Created By",
|
2645
|
+
description: "Created By"
|
2646
|
+
},
|
2647
|
+
"event.updatedByUserRole": {
|
2648
|
+
id: "event.updatedByUserRole.label",
|
2649
|
+
defaultMessage: "Updated By Role",
|
2650
|
+
description: "Updated By Role"
|
2651
|
+
},
|
2652
|
+
"event.id": {
|
2653
|
+
id: "event.id.label",
|
2654
|
+
defaultMessage: "ID",
|
2655
|
+
description: "ID"
|
2656
|
+
},
|
2657
|
+
"event.updatedAt": {
|
2658
|
+
id: "event.modifiedAt.label",
|
2659
|
+
defaultMessage: "Updated",
|
2660
|
+
description: "Modified At"
|
2661
|
+
},
|
2662
|
+
"event.status": {
|
2663
|
+
id: "event.status.label",
|
2664
|
+
defaultMessage: "Status",
|
2665
|
+
description: "Status"
|
2666
|
+
},
|
2667
|
+
"event.type": {
|
2668
|
+
id: "event.type.label",
|
2669
|
+
defaultMessage: "Type",
|
2670
|
+
description: "Type"
|
2671
|
+
},
|
2672
|
+
"event.updatedBy": {
|
2673
|
+
id: "event.updatedBy.label",
|
2674
|
+
defaultMessage: "Updated By",
|
2675
|
+
description: "Updated By"
|
2676
|
+
},
|
2677
|
+
"event.trackingId": {
|
2678
|
+
id: "event.trackingId.label",
|
2679
|
+
defaultMessage: "Tracking ID",
|
2680
|
+
description: "Tracking ID"
|
2681
|
+
},
|
2682
|
+
"event.flags": {
|
2683
|
+
id: "event.flags.label",
|
2684
|
+
defaultMessage: "Flags",
|
2685
|
+
description: "Flags"
|
2686
|
+
}
|
2687
|
+
};
|
2688
|
+
|
2689
|
+
// ../commons/src/events/WorkqueueColumnConfig.ts
|
2690
|
+
var WorkqueueColumnKeysArray = [
|
2691
|
+
...EventMetadataKeysArray,
|
2692
|
+
"title"
|
2693
|
+
];
|
2694
|
+
var WorkqueueColumnKeys = import_zod21.z.enum(WorkqueueColumnKeysArray);
|
2695
|
+
var WorkqueueColumnValue = import_zod21.z.object({
|
2696
|
+
$event: WorkqueueColumnKeys
|
2697
|
+
});
|
2698
|
+
var WorkqueueColumn = import_zod21.z.object({
|
2699
|
+
label: TranslationConfig,
|
2700
|
+
value: WorkqueueColumnValue
|
2701
|
+
});
|
2702
|
+
function defineWorkqueuesColumns(workqueueColumns) {
|
2703
|
+
return workqueueColumns.map(
|
2704
|
+
(workqueueColumn) => WorkqueueColumn.parse(workqueueColumn)
|
2705
|
+
);
|
2706
|
+
}
|
2707
|
+
|
2708
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
2709
|
+
var import_zod23 = require("zod");
|
2710
|
+
|
2711
|
+
// ../commons/src/events/EventIndex.ts
|
2712
|
+
var import_zod22 = require("zod");
|
2713
|
+
var import_zod_openapi9 = require("zod-openapi");
|
2714
|
+
(0, import_zod_openapi9.extendZodWithOpenApi)(import_zod22.z);
|
2715
|
+
var EventIndex = EventMetadata.extend({
|
2716
|
+
declaration: EventState
|
2717
|
+
}).openapi({
|
2718
|
+
ref: "EventIndex"
|
2719
|
+
});
|
2720
|
+
var EventSearchIndex = import_zod22.z.record(import_zod22.z.string(), import_zod22.z.any()).and(
|
2721
|
+
import_zod22.z.object({
|
2722
|
+
type: import_zod22.z.string()
|
2723
|
+
// Ensures "type" (event-id) exists and is a string
|
2724
|
+
})
|
2725
|
+
).openapi({
|
2726
|
+
ref: "EventSearchIndex"
|
2727
|
+
});
|
2728
|
+
var Fuzzy = import_zod22.z.object({ type: import_zod22.z.literal("fuzzy"), term: import_zod22.z.string() }).openapi({
|
2729
|
+
ref: "Fuzzy"
|
2730
|
+
});
|
2731
|
+
var Exact = import_zod22.z.object({ type: import_zod22.z.literal("exact"), term: import_zod22.z.string() }).openapi({
|
2732
|
+
ref: "Exact"
|
2733
|
+
});
|
2734
|
+
var AnyOf = import_zod22.z.object({
|
2735
|
+
type: import_zod22.z.literal("anyOf"),
|
2736
|
+
terms: import_zod22.z.array(import_zod22.z.string())
|
2737
|
+
}).openapi({
|
2738
|
+
ref: "AnyOf"
|
2739
|
+
});
|
2740
|
+
var ExactStatus = import_zod22.z.object({
|
2741
|
+
type: import_zod22.z.literal("exact"),
|
2742
|
+
term: EventStatusEnum
|
2743
|
+
}).openapi({
|
2744
|
+
ref: "ExactStatus"
|
2745
|
+
});
|
2746
|
+
var AnyOfStatus = import_zod22.z.object({
|
2747
|
+
type: import_zod22.z.literal("anyOf"),
|
2748
|
+
terms: import_zod22.z.array(EventStatusEnum)
|
2749
|
+
}).openapi({
|
2750
|
+
ref: "AnyOfStatus"
|
2751
|
+
});
|
2752
|
+
var Range = import_zod22.z.object({
|
2753
|
+
type: import_zod22.z.literal("range"),
|
2754
|
+
gte: import_zod22.z.string(),
|
2755
|
+
lte: import_zod22.z.string()
|
2756
|
+
}).openapi({
|
2757
|
+
ref: "Range"
|
2758
|
+
});
|
2759
|
+
var Not = import_zod22.z.object({ type: import_zod22.z.literal("not"), term: import_zod22.z.string() }).openapi({
|
2760
|
+
ref: "Not"
|
2761
|
+
});
|
2762
|
+
var Within = import_zod22.z.object({ type: import_zod22.z.literal("within"), location: import_zod22.z.string() }).openapi({
|
2763
|
+
ref: "Within"
|
2764
|
+
});
|
2765
|
+
var DateCondition = import_zod22.z.union([Exact, Range]).openapi({
|
2766
|
+
ref: "DateCondition"
|
2767
|
+
});
|
2768
|
+
var QueryInput = import_zod22.z.lazy(
|
2769
|
+
() => import_zod22.z.union([
|
2770
|
+
import_zod22.z.discriminatedUnion("type", [Fuzzy, Exact, Range, Within, AnyOf, Not]),
|
2771
|
+
import_zod22.z.record(import_zod22.z.string(), QueryInput)
|
2772
|
+
])
|
2773
|
+
).openapi({
|
2774
|
+
ref: "QueryInput"
|
2775
|
+
});
|
2776
|
+
var QueryExpression = import_zod22.z.object({
|
2777
|
+
eventType: import_zod22.z.string(),
|
2778
|
+
status: import_zod22.z.optional(import_zod22.z.union([AnyOfStatus, ExactStatus])),
|
2779
|
+
createdAt: import_zod22.z.optional(DateCondition),
|
2780
|
+
updatedAt: import_zod22.z.optional(DateCondition),
|
2781
|
+
"legalStatus.REGISTERED.createdAt": import_zod22.z.optional(DateCondition),
|
2782
|
+
"legalStatus.REGISTERED.createdAtLocation": import_zod22.z.optional(
|
2783
|
+
import_zod22.z.union([Within, Exact])
|
2784
|
+
),
|
2785
|
+
createdAtLocation: import_zod22.z.optional(import_zod22.z.union([Within, Exact])),
|
2786
|
+
updatedAtLocation: import_zod22.z.optional(import_zod22.z.union([Within, Exact])),
|
2787
|
+
assignedTo: import_zod22.z.optional(Exact),
|
2788
|
+
createdBy: import_zod22.z.optional(Exact),
|
2789
|
+
updatedBy: import_zod22.z.optional(Exact),
|
2790
|
+
trackingId: import_zod22.z.optional(Exact),
|
2791
|
+
flags: import_zod22.z.optional(import_zod22.z.array(import_zod22.z.union([AnyOf, Not]))),
|
2792
|
+
data: QueryInput
|
2793
|
+
}).partial().openapi({
|
2794
|
+
ref: "QueryExpression"
|
2795
|
+
});
|
2796
|
+
var QueryType = import_zod22.z.object({
|
2797
|
+
type: import_zod22.z.literal("and").or(import_zod22.z.literal("or")).openapi({ default: "and" }),
|
2798
|
+
clauses: import_zod22.z.preprocess(
|
2799
|
+
(val) => {
|
2800
|
+
if (typeof val === "string") {
|
2801
|
+
return [JSON.parse(val)];
|
2802
|
+
}
|
2803
|
+
if (Array.isArray(val)) {
|
2804
|
+
return val.map((v) => typeof v === "string" ? JSON.parse(v) : v);
|
2805
|
+
}
|
2806
|
+
return val;
|
2807
|
+
},
|
2808
|
+
import_zod22.z.array(QueryExpression).openapi({
|
2809
|
+
default: [
|
2810
|
+
{
|
2811
|
+
eventType: TENNIS_CLUB_MEMBERSHIP,
|
2812
|
+
status: {
|
2813
|
+
type: "anyOf",
|
2814
|
+
terms: [
|
2815
|
+
"CREATED",
|
2816
|
+
"NOTIFIED",
|
2817
|
+
"DECLARED",
|
2818
|
+
"VALIDATED",
|
2819
|
+
"REGISTERED",
|
2820
|
+
"CERTIFIED",
|
2821
|
+
"REJECTED",
|
2822
|
+
"ARCHIVED"
|
2823
|
+
]
|
2824
|
+
},
|
2825
|
+
updatedAt: {
|
2826
|
+
type: "range",
|
2827
|
+
gte: "2025-05-22",
|
2828
|
+
lte: "2025-05-29"
|
2829
|
+
},
|
2830
|
+
data: {}
|
2831
|
+
}
|
2832
|
+
]
|
2833
|
+
})
|
2834
|
+
)
|
2835
|
+
}).openapi({
|
2836
|
+
ref: "QueryType"
|
2837
|
+
});
|
2838
|
+
|
2839
|
+
// ../commons/src/events/CountryConfigQueryInput.ts
|
2840
|
+
var SerializableExact = import_zod23.z.object({
|
2841
|
+
type: import_zod23.z.literal("exact"),
|
2842
|
+
term: import_zod23.z.union([import_zod23.z.string(), SerializedUserField])
|
2843
|
+
});
|
2844
|
+
var SerializableWithin = import_zod23.z.object({
|
2845
|
+
type: import_zod23.z.literal("within"),
|
2846
|
+
location: import_zod23.z.union([import_zod23.z.string(), SerializedUserField])
|
2847
|
+
});
|
2848
|
+
var SerializedQueryExpression = import_zod23.z.object({
|
2849
|
+
eventType: import_zod23.z.string(),
|
2850
|
+
status: import_zod23.z.optional(import_zod23.z.union([AnyOfStatus, ExactStatus])),
|
2851
|
+
createdAt: import_zod23.z.optional(DateCondition),
|
2852
|
+
updatedAt: import_zod23.z.optional(DateCondition),
|
2853
|
+
createdAtLocation: import_zod23.z.optional(
|
2854
|
+
import_zod23.z.union([SerializableWithin, SerializableExact])
|
2855
|
+
),
|
2856
|
+
updatedAtLocation: import_zod23.z.optional(
|
2857
|
+
import_zod23.z.union([SerializableWithin, SerializableExact])
|
2858
|
+
),
|
2859
|
+
assignedTo: import_zod23.z.optional(SerializableExact),
|
2860
|
+
createdBy: import_zod23.z.optional(SerializableExact),
|
2861
|
+
updatedBy: import_zod23.z.optional(SerializableExact),
|
2862
|
+
trackingId: import_zod23.z.optional(Exact),
|
2863
|
+
flags: import_zod23.z.optional(import_zod23.z.array(import_zod23.z.union([AnyOf, Not]))),
|
2864
|
+
data: QueryInput
|
2865
|
+
}).partial();
|
2866
|
+
var Or2 = import_zod23.z.object({
|
2867
|
+
type: import_zod23.z.literal("or"),
|
2868
|
+
clauses: import_zod23.z.array(SerializedQueryExpression)
|
2869
|
+
});
|
2870
|
+
var And2 = import_zod23.z.object({
|
2871
|
+
type: import_zod23.z.literal("and"),
|
2872
|
+
clauses: import_zod23.z.array(SerializedQueryExpression)
|
2873
|
+
});
|
2874
|
+
var CountryConfigQueryType = import_zod23.z.discriminatedUnion("type", [And2, Or2]);
|
2875
|
+
var CountryConfigQueryInputType = import_zod23.z.union([
|
2876
|
+
SerializedQueryExpression,
|
2877
|
+
And2,
|
2878
|
+
Or2
|
2879
|
+
]);
|
2880
|
+
|
2881
|
+
// ../commons/src/icons.ts
|
2882
|
+
var import_zod24 = require("zod");
|
2883
|
+
var AvailableIcons = import_zod24.z.enum([
|
2884
|
+
"Archived",
|
2885
|
+
"Assigned",
|
2886
|
+
"Certified",
|
2887
|
+
"Close",
|
2888
|
+
"Collapse",
|
2889
|
+
"Draft",
|
2890
|
+
"DuplicateYellow",
|
2891
|
+
"Expand",
|
2892
|
+
"ExternalValidate",
|
2893
|
+
"FilledCheck",
|
2894
|
+
"InReview",
|
2895
|
+
"Offline",
|
2896
|
+
"Registered",
|
2897
|
+
"RequiresUpdates",
|
2898
|
+
"Sent",
|
2899
|
+
"Validated",
|
2900
|
+
"WaitingApproval",
|
2901
|
+
"ChartActivity",
|
2902
|
+
"Activity",
|
2903
|
+
"Archive",
|
2904
|
+
"ArchiveTray",
|
2905
|
+
"ArrowLeft",
|
2906
|
+
"ArrowRight",
|
2907
|
+
"Buildings",
|
2908
|
+
"Circle",
|
2909
|
+
"CaretDown",
|
2910
|
+
"CaretLeft",
|
2911
|
+
"CaretRight",
|
2912
|
+
"ChartBar",
|
2913
|
+
"ChartLine",
|
2914
|
+
"ChatCircle",
|
2915
|
+
"CheckSquare",
|
2916
|
+
"Compass",
|
2917
|
+
"Check",
|
2918
|
+
"Copy",
|
2919
|
+
"Database",
|
2920
|
+
"DotsThreeVertical",
|
2921
|
+
"DownloadSimple",
|
2922
|
+
"ArrowCounterClockwise",
|
2923
|
+
"MagnifyingGlassMinus",
|
2924
|
+
"MagnifyingGlassPlus",
|
2925
|
+
"Export",
|
2926
|
+
"Eye",
|
2927
|
+
"EyeSlash",
|
2928
|
+
"Envelope",
|
2929
|
+
"File",
|
2930
|
+
"FileSearch",
|
2931
|
+
"FileMinus",
|
2932
|
+
"FilePlus",
|
2933
|
+
"FileText",
|
2934
|
+
"FileX",
|
2935
|
+
"Handshake",
|
2936
|
+
"Gear",
|
2937
|
+
"GitBranch",
|
2938
|
+
"IdentificationCard",
|
2939
|
+
"List",
|
2940
|
+
"ListBullets",
|
2941
|
+
"Lock",
|
2942
|
+
"MagnifyingGlass",
|
2943
|
+
"MapPin",
|
2944
|
+
"Medal",
|
2945
|
+
"NotePencil",
|
2946
|
+
"Paperclip",
|
2947
|
+
"PaperPlaneTilt",
|
2948
|
+
"Pen",
|
2949
|
+
"Pencil",
|
2950
|
+
"PencilSimpleLine",
|
2951
|
+
"Phone",
|
2952
|
+
"Plus",
|
2953
|
+
"Printer",
|
2954
|
+
"SignOut",
|
2955
|
+
"Star",
|
2956
|
+
"Target",
|
2957
|
+
"TextT",
|
2958
|
+
"Trash",
|
2959
|
+
"UploadSimple",
|
2960
|
+
"User",
|
2961
|
+
"UserPlus",
|
2962
|
+
"Users",
|
2963
|
+
"WarningCircle",
|
2964
|
+
"X",
|
2965
|
+
"CircleWavyCheck",
|
2966
|
+
"CircleWavyQuestion",
|
2967
|
+
"ArchiveBox",
|
2968
|
+
"ArrowCircleDown",
|
2969
|
+
"FileArrowUp",
|
2970
|
+
"FileDotted",
|
2971
|
+
"Files",
|
2972
|
+
"PencilLine",
|
2973
|
+
"PencilCircle",
|
2974
|
+
"UserCircle",
|
2975
|
+
"Clock",
|
2976
|
+
"QrCode",
|
2977
|
+
"Webcam",
|
2978
|
+
"Sun",
|
2979
|
+
"DeviceTabletCamera",
|
2980
|
+
"Globe",
|
2981
|
+
"Fingerprint",
|
2982
|
+
"PushPin",
|
2983
|
+
"Timer"
|
2984
|
+
]);
|
2985
|
+
|
2986
|
+
// ../commons/src/events/WorkqueueConfig.ts
|
2987
|
+
var dateOfEventColumn = defineWorkqueuesColumns([
|
2988
|
+
{
|
2989
|
+
label: {
|
2990
|
+
id: "workqueues.dateOfEvent",
|
2991
|
+
defaultMessage: "Date of Event",
|
2992
|
+
description: "Label for workqueue column: dateOfEvent"
|
2993
|
+
},
|
2994
|
+
value: event.field("dateOfEvent")
|
2995
|
+
},
|
2996
|
+
{
|
2997
|
+
label: {
|
2998
|
+
defaultMessage: "Last updated",
|
2999
|
+
description: "This is the label for the workqueue column",
|
3000
|
+
id: "workqueue.default.column.modifiedAt"
|
3001
|
+
},
|
3002
|
+
value: event.field("updatedAt")
|
3003
|
+
}
|
3004
|
+
]);
|
3005
|
+
var WorkqueueActionsWithDefault = import_zod25.z.enum([
|
3006
|
+
...workqueueActions.options,
|
3007
|
+
"DEFAULT"
|
3008
|
+
]);
|
3009
|
+
var WorkqueueConfig = import_zod25.z.object({
|
3010
|
+
slug: import_zod25.z.string().describe("Determines the url of the workqueue."),
|
3011
|
+
name: TranslationConfig.describe(
|
3012
|
+
"Title of the workflow (both in navigation and on the page)"
|
3013
|
+
),
|
3014
|
+
query: CountryConfigQueryType,
|
3015
|
+
actions: import_zod25.z.array(
|
3016
|
+
import_zod25.z.object({
|
3017
|
+
type: WorkqueueActionsWithDefault,
|
3018
|
+
conditionals: import_zod25.z.array(Conditional).optional()
|
3019
|
+
})
|
3020
|
+
),
|
3021
|
+
columns: import_zod25.z.array(WorkqueueColumn).default(dateOfEventColumn),
|
3022
|
+
icon: AvailableIcons
|
3023
|
+
}).describe("Configuration for workqueue.");
|
3024
|
+
var WorkqueueConfigInput = import_zod25.z.object({
|
3025
|
+
slug: import_zod25.z.string().describe("Determines the url of the workqueue."),
|
3026
|
+
name: TranslationConfig.describe(
|
3027
|
+
"Title of the workflow (both in navigation and on the page)"
|
3028
|
+
),
|
3029
|
+
query: CountryConfigQueryInputType,
|
3030
|
+
actions: import_zod25.z.array(
|
3031
|
+
import_zod25.z.object({
|
3032
|
+
type: WorkqueueActionsWithDefault,
|
3033
|
+
conditionals: import_zod25.z.array(Conditional).optional()
|
3034
|
+
})
|
3035
|
+
),
|
3036
|
+
columns: import_zod25.z.array(WorkqueueColumn).default(dateOfEventColumn),
|
3037
|
+
icon: AvailableIcons
|
3038
|
+
});
|
3039
|
+
function defineWorkqueue(workqueueInput) {
|
3040
|
+
const queryInput = workqueueInput.query;
|
3041
|
+
const query = "type" in queryInput ? queryInput : { type: "and", clauses: [queryInput] };
|
3042
|
+
return WorkqueueConfig.parse({ ...workqueueInput, query });
|
3043
|
+
}
|
3044
|
+
function defineWorkqueues(workqueues) {
|
3045
|
+
return workqueues.map((workqueue) => defineWorkqueue(workqueue));
|
3046
|
+
}
|
3047
|
+
var WorkqueueCountInput = import_zod25.z.array(
|
3048
|
+
import_zod25.z.object({ slug: import_zod25.z.string(), query: QueryType })
|
3049
|
+
);
|
3050
|
+
var WorkqueueCountOutput = import_zod25.z.record(import_zod25.z.string(), import_zod25.z.number());
|
3051
|
+
|
3052
|
+
// ../commons/src/events/workqueueDefaultColumns.ts
|
3053
|
+
var defaultWorkqueueColumns = [
|
3054
|
+
{
|
3055
|
+
label: {
|
3056
|
+
defaultMessage: "Title",
|
3057
|
+
description: "This is the label for the workqueue column",
|
3058
|
+
id: "workqueue.in-reveiw.column.title"
|
3059
|
+
},
|
3060
|
+
value: event.field("title")
|
3061
|
+
},
|
3062
|
+
{
|
3063
|
+
label: {
|
3064
|
+
defaultMessage: "Event",
|
3065
|
+
description: "This is the label for the workqueue column",
|
3066
|
+
id: "workqueue.default.column.event"
|
3067
|
+
},
|
3068
|
+
value: event.field("type")
|
3069
|
+
}
|
3070
|
+
];
|
3071
|
+
|
3072
|
+
// ../commons/src/events/Draft.ts
|
3073
|
+
var import_zod27 = require("zod");
|
3074
|
+
|
3075
|
+
// ../commons/src/events/ActionInput.ts
|
3076
|
+
var import_zod26 = require("zod");
|
3077
|
+
var import_zod_openapi10 = require("zod-openapi");
|
3078
|
+
var import_uuid3 = require("uuid");
|
3079
|
+
(0, import_zod_openapi10.extendZodWithOpenApi)(import_zod26.z);
|
3080
|
+
var BaseActionInput = import_zod26.z.object({
|
3081
|
+
eventId: import_zod26.z.string(),
|
3082
|
+
transactionId: import_zod26.z.string(),
|
3083
|
+
declaration: ActionUpdate.default({}),
|
3084
|
+
annotation: ActionUpdate.optional(),
|
3085
|
+
originalActionId: import_zod26.z.string().optional(),
|
3086
|
+
keepAssignment: import_zod26.z.boolean().optional()
|
3087
|
+
});
|
3088
|
+
var CreateActionInput = BaseActionInput.merge(
|
3089
|
+
import_zod26.z.object({
|
3090
|
+
type: import_zod26.z.literal(ActionType.CREATE).default(ActionType.CREATE),
|
3091
|
+
createdAtLocation: CreatedAtLocation
|
3092
|
+
})
|
3093
|
+
);
|
3094
|
+
var RegisterActionInput = BaseActionInput.merge(
|
3095
|
+
import_zod26.z.object({
|
3096
|
+
type: import_zod26.z.literal(ActionType.REGISTER).default(ActionType.REGISTER),
|
3097
|
+
registrationNumber: import_zod26.z.string().optional()
|
3098
|
+
})
|
3099
|
+
);
|
2614
3100
|
var ValidateActionInput = BaseActionInput.merge(
|
2615
|
-
|
2616
|
-
type:
|
2617
|
-
duplicates:
|
3101
|
+
import_zod26.z.object({
|
3102
|
+
type: import_zod26.z.literal(ActionType.VALIDATE).default(ActionType.VALIDATE),
|
3103
|
+
duplicates: import_zod26.z.array(import_zod26.z.string())
|
2618
3104
|
})
|
2619
3105
|
);
|
2620
3106
|
var NotifyActionInput = BaseActionInput.merge(
|
2621
|
-
|
2622
|
-
type:
|
3107
|
+
import_zod26.z.object({
|
3108
|
+
type: import_zod26.z.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
|
2623
3109
|
})
|
2624
|
-
)
|
3110
|
+
).openapi({
|
3111
|
+
default: {
|
3112
|
+
eventId: "<event-id-here>",
|
3113
|
+
transactionId: (0, import_uuid3.v4)(),
|
3114
|
+
declaration: {},
|
3115
|
+
annotation: {},
|
3116
|
+
type: ActionType.NOTIFY
|
3117
|
+
}
|
3118
|
+
});
|
2625
3119
|
var DeclareActionInput = BaseActionInput.merge(
|
2626
|
-
|
2627
|
-
type:
|
3120
|
+
import_zod26.z.object({
|
3121
|
+
type: import_zod26.z.literal(ActionType.DECLARE).default(ActionType.DECLARE)
|
2628
3122
|
})
|
2629
3123
|
);
|
2630
3124
|
var PrintCertificateActionInput = BaseActionInput.merge(
|
2631
|
-
|
2632
|
-
type:
|
3125
|
+
import_zod26.z.object({
|
3126
|
+
type: import_zod26.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE)
|
2633
3127
|
})
|
2634
3128
|
);
|
2635
3129
|
var RejectDeclarationActionInput = BaseActionInput.merge(
|
2636
|
-
|
2637
|
-
type:
|
3130
|
+
import_zod26.z.object({
|
3131
|
+
type: import_zod26.z.literal(ActionType.REJECT).default(ActionType.REJECT),
|
3132
|
+
reason: RejectionReason
|
2638
3133
|
})
|
2639
3134
|
);
|
2640
3135
|
var MarkedAsDuplicateActionInput = BaseActionInput.merge(
|
2641
|
-
|
2642
|
-
type:
|
3136
|
+
import_zod26.z.object({
|
3137
|
+
type: import_zod26.z.literal(ActionType.MARKED_AS_DUPLICATE).default(ActionType.MARKED_AS_DUPLICATE)
|
2643
3138
|
})
|
2644
3139
|
);
|
2645
3140
|
var ArchiveActionInput = BaseActionInput.merge(
|
2646
|
-
|
2647
|
-
type:
|
3141
|
+
import_zod26.z.object({
|
3142
|
+
type: import_zod26.z.literal(ActionType.ARCHIVE).default(ActionType.ARCHIVE),
|
3143
|
+
reason: RejectionReason
|
2648
3144
|
})
|
2649
3145
|
);
|
2650
3146
|
var AssignActionInput = BaseActionInput.merge(
|
2651
|
-
|
2652
|
-
type:
|
2653
|
-
assignedTo:
|
3147
|
+
import_zod26.z.object({
|
3148
|
+
type: import_zod26.z.literal(ActionType.ASSIGN).default(ActionType.ASSIGN),
|
3149
|
+
assignedTo: import_zod26.z.string()
|
2654
3150
|
})
|
2655
3151
|
);
|
2656
3152
|
var UnassignActionInput = BaseActionInput.merge(
|
2657
|
-
|
2658
|
-
type:
|
2659
|
-
assignedTo:
|
3153
|
+
import_zod26.z.object({
|
3154
|
+
type: import_zod26.z.literal(ActionType.UNASSIGN).default(ActionType.UNASSIGN),
|
3155
|
+
assignedTo: import_zod26.z.literal(null).default(null)
|
2660
3156
|
})
|
2661
3157
|
);
|
2662
3158
|
var RequestCorrectionActionInput = BaseActionInput.merge(
|
2663
|
-
|
2664
|
-
type:
|
3159
|
+
import_zod26.z.object({
|
3160
|
+
type: import_zod26.z.literal(ActionType.REQUEST_CORRECTION).default(ActionType.REQUEST_CORRECTION)
|
2665
3161
|
})
|
2666
3162
|
);
|
2667
3163
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
2668
|
-
|
2669
|
-
requestId:
|
2670
|
-
type:
|
3164
|
+
import_zod26.z.object({
|
3165
|
+
requestId: import_zod26.z.string(),
|
3166
|
+
type: import_zod26.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
|
2671
3167
|
})
|
2672
3168
|
);
|
2673
3169
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
2674
|
-
|
2675
|
-
requestId:
|
2676
|
-
type:
|
3170
|
+
import_zod26.z.object({
|
3171
|
+
requestId: import_zod26.z.string(),
|
3172
|
+
type: import_zod26.z.literal(ActionType.APPROVE_CORRECTION).default(ActionType.APPROVE_CORRECTION)
|
2677
3173
|
})
|
2678
3174
|
);
|
2679
3175
|
var ReadActionInput = BaseActionInput.merge(
|
2680
|
-
|
2681
|
-
type:
|
3176
|
+
import_zod26.z.object({
|
3177
|
+
type: import_zod26.z.literal(ActionType.READ).default(ActionType.READ)
|
2682
3178
|
})
|
2683
3179
|
);
|
2684
|
-
var DeleteActionInput =
|
2685
|
-
var ActionInput =
|
3180
|
+
var DeleteActionInput = import_zod26.z.object({ eventId: import_zod26.z.string() });
|
3181
|
+
var ActionInput = import_zod26.z.discriminatedUnion("type", [
|
2686
3182
|
CreateActionInput.openapi({ ref: "CreateActionInput" }),
|
2687
3183
|
ValidateActionInput.openapi({ ref: "ValidateActionInput" }),
|
2688
3184
|
RegisterActionInput.openapi({ ref: "RegisterActionInput" }),
|
@@ -2711,18 +3207,18 @@ var ActionInput = import_zod21.z.discriminatedUnion("type", [
|
|
2711
3207
|
});
|
2712
3208
|
|
2713
3209
|
// ../commons/src/events/Draft.ts
|
2714
|
-
var Draft =
|
2715
|
-
id:
|
2716
|
-
eventId:
|
2717
|
-
transactionId:
|
2718
|
-
createdAt:
|
3210
|
+
var Draft = import_zod27.z.object({
|
3211
|
+
id: import_zod27.z.string(),
|
3212
|
+
eventId: import_zod27.z.string(),
|
3213
|
+
transactionId: import_zod27.z.string(),
|
3214
|
+
createdAt: import_zod27.z.string().datetime(),
|
2719
3215
|
action: ActionBase.extend({
|
2720
3216
|
type: ActionTypes
|
2721
3217
|
}).omit({ id: true })
|
2722
3218
|
});
|
2723
3219
|
var DraftInput = BaseActionInput.extend({
|
2724
3220
|
type: ActionTypes,
|
2725
|
-
status:
|
3221
|
+
status: import_zod27.z.enum([
|
2726
3222
|
ActionStatus.Requested,
|
2727
3223
|
ActionStatus.Accepted,
|
2728
3224
|
ActionStatus.Rejected
|
@@ -2730,29 +3226,24 @@ var DraftInput = BaseActionInput.extend({
|
|
2730
3226
|
});
|
2731
3227
|
|
2732
3228
|
// ../commons/src/events/EventInput.ts
|
2733
|
-
var
|
2734
|
-
var
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
});
|
3229
|
+
var import_zod28 = require("zod");
|
3230
|
+
var import_uuid4 = require("uuid");
|
3231
|
+
var EventInput = import_zod28.z.object({
|
3232
|
+
transactionId: import_zod28.z.string(),
|
3233
|
+
type: import_zod28.z.string()
|
3234
|
+
}).openapi({ default: { transactionId: (0, import_uuid4.v4)(), type: "v2.birth" } });
|
2739
3235
|
|
2740
3236
|
// ../commons/src/events/EventDocument.ts
|
2741
|
-
var
|
2742
|
-
var
|
2743
|
-
(0,
|
2744
|
-
var EventDocument =
|
2745
|
-
id:
|
2746
|
-
type:
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
// search based on registeration date
|
2752
|
-
registeredAtLocation: import_zod24.z.string().optional(),
|
2753
|
-
// search based on registeration location
|
2754
|
-
actions: import_zod24.z.array(Action),
|
2755
|
-
trackingId: import_zod24.z.string()
|
3237
|
+
var import_zod29 = require("zod");
|
3238
|
+
var import_zod_openapi11 = require("zod-openapi");
|
3239
|
+
(0, import_zod_openapi11.extendZodWithOpenApi)(import_zod29.z);
|
3240
|
+
var EventDocument = import_zod29.z.object({
|
3241
|
+
id: import_zod29.z.string(),
|
3242
|
+
type: import_zod29.z.string(),
|
3243
|
+
createdAt: import_zod29.z.string().datetime(),
|
3244
|
+
updatedAt: import_zod29.z.string().datetime(),
|
3245
|
+
actions: import_zod29.z.array(Action),
|
3246
|
+
trackingId: import_zod29.z.string()
|
2756
3247
|
}).openapi({ ref: "EventDocument" });
|
2757
3248
|
|
2758
3249
|
// ../commons/src/events/state/utils.ts
|
@@ -2789,6 +3280,7 @@ function getDeclarationActionCreationMetadata(actionType, actions) {
|
|
2789
3280
|
createdAtLocation: requestAction?.createdAtLocation ?? acceptAction.createdAtLocation,
|
2790
3281
|
acceptedAt: acceptAction.createdAt,
|
2791
3282
|
createdByRole: requestAction?.createdByRole ?? acceptAction.createdByRole,
|
3283
|
+
createdBySignature: requestAction?.createdBySignature ?? acceptAction.createdBySignature,
|
2792
3284
|
registrationNumber
|
2793
3285
|
};
|
2794
3286
|
}
|
@@ -2909,23 +3401,34 @@ function getAssignedUserFromActions(actions) {
|
|
2909
3401
|
return user2;
|
2910
3402
|
}, null);
|
2911
3403
|
}
|
3404
|
+
function getAssignedUserSignatureFromActions(actions) {
|
3405
|
+
return actions.reduce((signature, action) => {
|
3406
|
+
if (action.type === ActionType.ASSIGN) {
|
3407
|
+
return action.createdBySignature || null;
|
3408
|
+
}
|
3409
|
+
if (action.type === ActionType.UNASSIGN) {
|
3410
|
+
return null;
|
3411
|
+
}
|
3412
|
+
return signature;
|
3413
|
+
}, null);
|
3414
|
+
}
|
2912
3415
|
function aggregateActionDeclarations(actions) {
|
2913
3416
|
const excludedActions = [
|
2914
3417
|
ActionType.REQUEST_CORRECTION,
|
2915
3418
|
ActionType.PRINT_CERTIFICATE
|
2916
3419
|
];
|
2917
|
-
return actions.reduce((
|
3420
|
+
return actions.reduce((declaration, action) => {
|
2918
3421
|
if (excludedActions.some((excludedAction) => excludedAction === action.type)) {
|
2919
|
-
return
|
3422
|
+
return declaration;
|
2920
3423
|
}
|
2921
3424
|
if (action.type === ActionType.APPROVE_CORRECTION) {
|
2922
3425
|
const requestAction = actions.find(({ id }) => id === action.requestId);
|
2923
3426
|
if (!requestAction) {
|
2924
|
-
return
|
3427
|
+
return declaration;
|
2925
3428
|
}
|
2926
|
-
return deepMerge(
|
3429
|
+
return deepMerge(declaration, requestAction.declaration);
|
2927
3430
|
}
|
2928
|
-
return deepMerge(
|
3431
|
+
return deepMerge(declaration, action.declaration);
|
2929
3432
|
}, {});
|
2930
3433
|
}
|
2931
3434
|
function deepDropNulls(obj) {
|
@@ -2953,7 +3456,7 @@ function getAcceptedActions(event2) {
|
|
2953
3456
|
);
|
2954
3457
|
}
|
2955
3458
|
var DEFAULT_DATE_OF_EVENT_PROPERTY = "createdAt";
|
2956
|
-
function getCurrentEventState(event2) {
|
3459
|
+
function getCurrentEventState(event2, config) {
|
2957
3460
|
const creationAction = event2.actions.find(
|
2958
3461
|
(action) => action.type === ActionType.CREATE
|
2959
3462
|
);
|
@@ -2965,9 +3468,17 @@ function getCurrentEventState(event2) {
|
|
2965
3468
|
event2.actions
|
2966
3469
|
);
|
2967
3470
|
const declaration = aggregateActionDeclarations(acceptedActions);
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
3471
|
+
let dateOfEvent;
|
3472
|
+
if (config.dateOfEvent) {
|
3473
|
+
const parsedDate = ZodDate.safeParse(
|
3474
|
+
declaration[config.dateOfEvent.$$field]
|
3475
|
+
);
|
3476
|
+
if (parsedDate.success) {
|
3477
|
+
dateOfEvent = parsedDate.data;
|
3478
|
+
}
|
3479
|
+
} else {
|
3480
|
+
dateOfEvent = event2[DEFAULT_DATE_OF_EVENT_PROPERTY].split("T")[0];
|
3481
|
+
}
|
2971
3482
|
return deepDropNulls({
|
2972
3483
|
id: event2.id,
|
2973
3484
|
type: event2.type,
|
@@ -2976,18 +3487,24 @@ function getCurrentEventState(event2) {
|
|
2976
3487
|
createdAt: creationAction.createdAt,
|
2977
3488
|
createdBy: creationAction.createdBy,
|
2978
3489
|
createdAtLocation: creationAction.createdAtLocation,
|
3490
|
+
createdBySignature: creationAction.createdBySignature,
|
2979
3491
|
updatedAt: declarationUpdateMetadata.createdAt,
|
2980
3492
|
assignedTo: getAssignedUserFromActions(acceptedActions),
|
3493
|
+
assignedToSignature: getAssignedUserSignatureFromActions(acceptedActions),
|
2981
3494
|
updatedBy: declarationUpdateMetadata.createdBy,
|
3495
|
+
updatedAtLocation: declarationUpdateMetadata.createdAtLocation,
|
2982
3496
|
declaration,
|
2983
3497
|
trackingId: event2.trackingId,
|
2984
|
-
// @TODO: unify this with rest of the code. It will trip us if updatedBy has different rules than updatedByUserRole
|
2985
3498
|
updatedByUserRole: declarationUpdateMetadata.createdByRole,
|
2986
3499
|
dateOfEvent,
|
2987
3500
|
flags: getFlagsFromActions(event2.actions)
|
2988
3501
|
});
|
2989
3502
|
}
|
2990
|
-
function getCurrentEventStateWithDrafts(
|
3503
|
+
function getCurrentEventStateWithDrafts({
|
3504
|
+
event: event2,
|
3505
|
+
drafts,
|
3506
|
+
configuration
|
3507
|
+
}) {
|
2991
3508
|
const actions = event2.actions.slice().sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
2992
3509
|
const activeDrafts = findActiveDrafts(event2, drafts).map((draft) => draft.action).flatMap((action) => {
|
2993
3510
|
if (action.type === ActionType.REQUEST_CORRECTION) {
|
@@ -3006,7 +3523,7 @@ function getCurrentEventStateWithDrafts(event2, drafts) {
|
|
3006
3523
|
...event2,
|
3007
3524
|
actions: actionWithDrafts
|
3008
3525
|
};
|
3009
|
-
return getCurrentEventState(withDrafts);
|
3526
|
+
return getCurrentEventState(withDrafts, configuration);
|
3010
3527
|
}
|
3011
3528
|
function applyDraftsToEventIndex(eventIndex, drafts) {
|
3012
3529
|
const indexedAt = eventIndex.updatedAt;
|
@@ -3060,32 +3577,45 @@ function generateTransactionId() {
|
|
3060
3577
|
return getUUID();
|
3061
3578
|
}
|
3062
3579
|
|
3580
|
+
// ../commons/src/events/User.ts
|
3581
|
+
var import_zod30 = require("zod");
|
3582
|
+
var User = import_zod30.z.object({
|
3583
|
+
id: import_zod30.z.string(),
|
3584
|
+
name: import_zod30.z.array(
|
3585
|
+
import_zod30.z.object({
|
3586
|
+
use: import_zod30.z.string(),
|
3587
|
+
given: import_zod30.z.array(import_zod30.z.string()),
|
3588
|
+
family: import_zod30.z.string()
|
3589
|
+
})
|
3590
|
+
),
|
3591
|
+
role: import_zod30.z.string(),
|
3592
|
+
signatureFilename: import_zod30.z.string().optional()
|
3593
|
+
});
|
3594
|
+
|
3063
3595
|
// ../commons/src/events/test.utils.ts
|
3064
3596
|
var import_lodash2 = require("lodash");
|
3597
|
+
var import_addDays = __toESM(require("date-fns/addDays"));
|
3065
3598
|
|
3066
3599
|
// ../commons/src/field-config/field-configuration.ts
|
3067
|
-
function
|
3600
|
+
function createFieldConfig(fieldId, options) {
|
3068
3601
|
const baseField = {
|
3069
3602
|
fieldId,
|
3070
3603
|
fieldType: "field",
|
3071
3604
|
...options
|
3072
3605
|
};
|
3073
|
-
return
|
3606
|
+
return createSearchConfig(baseField);
|
3074
3607
|
}
|
3075
3608
|
|
3076
3609
|
// ../commons/src/events/field.ts
|
3077
3610
|
function field(fieldId, options = {}) {
|
3078
3611
|
return {
|
3079
|
-
/**
|
3080
|
-
* @private Internal property used for field reference tracking.
|
3081
|
-
*/
|
3082
|
-
_fieldId: fieldId,
|
3083
3612
|
...createFieldConditionals(fieldId),
|
3084
|
-
...
|
3613
|
+
...createFieldConfig(fieldId, options)
|
3085
3614
|
};
|
3086
3615
|
}
|
3087
3616
|
|
3088
|
-
// ../commons/src/fixtures/
|
3617
|
+
// ../commons/src/fixtures/forms.ts
|
3618
|
+
var import_date_fns2 = require("date-fns");
|
3089
3619
|
var PRINT_CERTIFICATE_FORM = defineActionForm({
|
3090
3620
|
label: {
|
3091
3621
|
id: "v2.event.tennis-club-membership.action.certificate.form.label",
|
@@ -3994,65 +4524,586 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
3994
4524
|
}
|
3995
4525
|
]
|
3996
4526
|
});
|
3997
|
-
var
|
3998
|
-
|
3999
|
-
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
4527
|
+
var statusOptions = [
|
4528
|
+
{
|
4529
|
+
value: "ALL",
|
4530
|
+
label: {
|
4531
|
+
defaultMessage: "Any status",
|
4532
|
+
description: "Option for form field: status of record",
|
4533
|
+
id: "v2.advancedSearch.form.recordStatusAny"
|
4534
|
+
}
|
4003
4535
|
},
|
4004
|
-
|
4005
|
-
|
4006
|
-
|
4007
|
-
|
4536
|
+
{
|
4537
|
+
value: EventStatus.CREATED,
|
4538
|
+
label: {
|
4539
|
+
defaultMessage: "Draft",
|
4540
|
+
description: "Option for form field: status of record",
|
4541
|
+
id: "v2.advancedSearch.form.recordStatusCreated"
|
4542
|
+
}
|
4008
4543
|
},
|
4009
|
-
|
4010
|
-
|
4011
|
-
|
4012
|
-
|
4013
|
-
|
4544
|
+
{
|
4545
|
+
value: EventStatus.NOTIFIED,
|
4546
|
+
label: {
|
4547
|
+
defaultMessage: "Notified",
|
4548
|
+
description: "Option for form field: status of record",
|
4549
|
+
id: "v2.advancedSearch.form.recordStatusNotified"
|
4550
|
+
}
|
4551
|
+
},
|
4552
|
+
{
|
4553
|
+
value: EventStatus.DECLARED,
|
4554
|
+
label: {
|
4555
|
+
defaultMessage: "Declared",
|
4556
|
+
description: "Option for form field: status of record",
|
4557
|
+
id: "v2.advancedSearch.form.recordStatusDeclared"
|
4558
|
+
}
|
4559
|
+
},
|
4560
|
+
{
|
4561
|
+
value: EventStatus.VALIDATED,
|
4562
|
+
label: {
|
4563
|
+
defaultMessage: "Validated",
|
4564
|
+
description: "Option for form field: status of record",
|
4565
|
+
id: "v2.advancedSearch.form.recordStatusValidated"
|
4566
|
+
}
|
4567
|
+
},
|
4568
|
+
{
|
4569
|
+
value: EventStatus.REGISTERED,
|
4570
|
+
label: {
|
4571
|
+
defaultMessage: "Registered",
|
4572
|
+
description: "Option for form field: status of record",
|
4573
|
+
id: "v2.advancedSearch.form.recordStatusRegistered"
|
4574
|
+
}
|
4575
|
+
},
|
4576
|
+
{
|
4577
|
+
value: EventStatus.CERTIFIED,
|
4578
|
+
label: {
|
4579
|
+
defaultMessage: "Certified",
|
4580
|
+
description: "Option for form field: status of record",
|
4581
|
+
id: "v2.advancedSearch.form.recordStatusCertified"
|
4582
|
+
}
|
4583
|
+
},
|
4584
|
+
{
|
4585
|
+
value: EventStatus.REJECTED,
|
4586
|
+
label: {
|
4587
|
+
defaultMessage: "Rejected",
|
4588
|
+
description: "Option for form field: status of record",
|
4589
|
+
id: "v2.advancedSearch.form.recordStatusRejected"
|
4590
|
+
}
|
4591
|
+
},
|
4592
|
+
{
|
4593
|
+
value: EventStatus.ARCHIVED,
|
4594
|
+
label: {
|
4595
|
+
defaultMessage: "Archived",
|
4596
|
+
description: "Option for form field: status of record",
|
4597
|
+
id: "v2.advancedSearch.form.recordStatusArchived"
|
4598
|
+
}
|
4599
|
+
}
|
4600
|
+
];
|
4601
|
+
var timePeriodOptions = [
|
4602
|
+
{
|
4603
|
+
label: {
|
4604
|
+
defaultMessage: "Last 7 days",
|
4605
|
+
description: "Label for option of time period select: last 7 days",
|
4606
|
+
id: "form.section.label.timePeriodLast7Days"
|
4607
|
+
},
|
4608
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4609
|
+
/* @__PURE__ */ new Date(),
|
4610
|
+
"yyyy-MM-dd"
|
4611
|
+
)}`
|
4612
|
+
},
|
4613
|
+
{
|
4614
|
+
label: {
|
4615
|
+
defaultMessage: "Last 30 days",
|
4616
|
+
description: "Label for option of time period select: last 30 days",
|
4617
|
+
id: "form.section.label.timePeriodLast30Days"
|
4618
|
+
},
|
4619
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subMonths)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4620
|
+
/* @__PURE__ */ new Date(),
|
4621
|
+
"yyyy-MM-dd"
|
4622
|
+
)}`
|
4623
|
+
},
|
4624
|
+
{
|
4625
|
+
label: {
|
4626
|
+
defaultMessage: "Last 90 days",
|
4627
|
+
description: "Label for option of time period select: last 90 days",
|
4628
|
+
id: "form.section.label.timePeriodLast90Days"
|
4629
|
+
},
|
4630
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subQuarters)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4631
|
+
/* @__PURE__ */ new Date(),
|
4632
|
+
"yyyy-MM-dd"
|
4633
|
+
)}`
|
4634
|
+
},
|
4635
|
+
{
|
4636
|
+
label: {
|
4637
|
+
defaultMessage: "Last year",
|
4638
|
+
description: "Label for option of time period select: last year",
|
4639
|
+
id: "form.section.label.timePeriodLastYear"
|
4640
|
+
},
|
4641
|
+
value: `${(0, import_date_fns2.format)((0, import_date_fns2.subYears)(/* @__PURE__ */ new Date(), 1), "yyyy-MM-dd")},${(0, import_date_fns2.format)(
|
4642
|
+
/* @__PURE__ */ new Date(),
|
4643
|
+
"yyyy-MM-dd"
|
4644
|
+
)}`
|
4645
|
+
}
|
4646
|
+
];
|
4647
|
+
|
4648
|
+
// ../commons/src/fixtures/tennis-club-membership-event.ts
|
4649
|
+
var tennisClubMembershipEvent = defineConfig({
|
4650
|
+
id: TENNIS_CLUB_MEMBERSHIP,
|
4651
|
+
label: {
|
4652
|
+
defaultMessage: "Tennis club membership application",
|
4653
|
+
description: "This is what this event is referred as in the system",
|
4654
|
+
id: "v2.event.tennis-club-membership.label"
|
4655
|
+
},
|
4656
|
+
title: {
|
4657
|
+
defaultMessage: "{applicant.firstname} {applicant.surname}",
|
4658
|
+
description: "This is the title of the summary",
|
4659
|
+
id: "v2.event.tennis-club-membership.title"
|
4660
|
+
},
|
4661
|
+
summary: {
|
4662
|
+
fields: [
|
4663
|
+
{
|
4664
|
+
id: "applicant.firstname",
|
4665
|
+
label: {
|
4666
|
+
defaultMessage: "Applicant's first name",
|
4667
|
+
description: "This is the label for the field",
|
4668
|
+
id: "event.tennis-club-membership.summary.field.firstname.label"
|
4669
|
+
},
|
4670
|
+
value: {
|
4671
|
+
defaultMessage: "{applicant.firstname}",
|
4672
|
+
description: "This is the value to show in the summary",
|
4673
|
+
id: "event.tennis-club-membership.summary.field.firstname"
|
4674
|
+
},
|
4675
|
+
emptyValueMessage: {
|
4676
|
+
defaultMessage: "First name is not provided",
|
4677
|
+
description: "This is the message to show when the field is empty",
|
4678
|
+
id: "event.tennis-club-membership.summary.field.firstname.empty"
|
4679
|
+
}
|
4680
|
+
},
|
4681
|
+
{
|
4682
|
+
fieldId: "applicant.surname",
|
4683
|
+
label: {
|
4684
|
+
defaultMessage: "Applicant's last name",
|
4685
|
+
description: "Label for surname",
|
4686
|
+
id: "v2.event.tennis-club-membership.summary.field.surname.label"
|
4687
|
+
}
|
4688
|
+
},
|
4689
|
+
{
|
4690
|
+
fieldId: "applicant.email"
|
4691
|
+
}
|
4692
|
+
]
|
4693
|
+
},
|
4694
|
+
actions: [
|
4695
|
+
{
|
4696
|
+
type: ActionType.READ,
|
4697
|
+
label: {
|
4698
|
+
id: "v2.event.tennis-club-membership.action.read.label",
|
4699
|
+
defaultMessage: "Read",
|
4700
|
+
description: "Title of the read only page"
|
4701
|
+
},
|
4702
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4703
|
+
},
|
4704
|
+
{
|
4705
|
+
type: ActionType.DECLARE,
|
4706
|
+
label: {
|
4707
|
+
defaultMessage: "Send an application",
|
4708
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4709
|
+
id: "event.tennis-club-membership.action.declare.label"
|
4710
|
+
},
|
4711
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4712
|
+
},
|
4713
|
+
{
|
4714
|
+
type: ActionType.VALIDATE,
|
4715
|
+
label: {
|
4716
|
+
defaultMessage: "Validate",
|
4717
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4718
|
+
id: "event.tennis-club-membership.action.validate.label"
|
4719
|
+
},
|
4720
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4721
|
+
},
|
4722
|
+
{
|
4723
|
+
type: ActionType.REGISTER,
|
4724
|
+
label: {
|
4725
|
+
defaultMessage: "Register",
|
4726
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4727
|
+
id: "event.tennis-club-membership.action.register.label"
|
4728
|
+
},
|
4729
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4730
|
+
},
|
4731
|
+
{
|
4732
|
+
type: ActionType.REQUEST_CORRECTION,
|
4733
|
+
label: {
|
4734
|
+
defaultMessage: "Request correction",
|
4735
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4736
|
+
id: "event.tennis-club-membership.action.correction.request.label"
|
4737
|
+
},
|
4738
|
+
onboardingForm: [
|
4739
|
+
{
|
4740
|
+
id: "correction-requester",
|
4741
|
+
type: PageTypes.enum.FORM,
|
4742
|
+
title: {
|
4743
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4744
|
+
defaultMessage: "Correction requester",
|
4745
|
+
description: "This is the title of the section"
|
4746
|
+
},
|
4747
|
+
fields: [
|
4748
|
+
{
|
4749
|
+
id: "correction.requester.relationshop.intro",
|
4750
|
+
type: "PAGE_HEADER",
|
4751
|
+
label: {
|
4752
|
+
id: "correction.requester.relationshop.intro.label",
|
4753
|
+
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.",
|
4754
|
+
description: "The title for the corrector form"
|
4755
|
+
}
|
4756
|
+
},
|
4757
|
+
{
|
4758
|
+
id: "correction.requester.relationship",
|
4759
|
+
type: "RADIO_GROUP",
|
4760
|
+
label: {
|
4761
|
+
id: "v2.correction.corrector.title",
|
4762
|
+
defaultMessage: "Who is requesting a change to this record?",
|
4763
|
+
description: "The title for the corrector form"
|
4764
|
+
},
|
4765
|
+
defaultValue: "",
|
4766
|
+
options: [
|
4767
|
+
{
|
4768
|
+
value: "INFORMANT",
|
4769
|
+
label: {
|
4770
|
+
id: "v2.correction.corrector.informant",
|
4771
|
+
defaultMessage: "Informant",
|
4772
|
+
description: "Label for informant option in certificate correction form"
|
4773
|
+
}
|
4774
|
+
},
|
4775
|
+
{
|
4776
|
+
value: "ANOTHER_AGENT",
|
4777
|
+
label: {
|
4778
|
+
id: "v2.correction.corrector.anotherAgent",
|
4779
|
+
defaultMessage: "Another registration agent or field agent",
|
4780
|
+
description: "Label for another registration or field agent option in certificate correction form"
|
4781
|
+
}
|
4782
|
+
},
|
4783
|
+
{
|
4784
|
+
value: "REGISTRAR",
|
4785
|
+
label: {
|
4786
|
+
id: "v2.correction.corrector.me",
|
4787
|
+
defaultMessage: "Me (Registrar)",
|
4788
|
+
description: "Label for registrar option in certificate correction form"
|
4789
|
+
}
|
4790
|
+
},
|
4791
|
+
{
|
4792
|
+
value: "OTHER",
|
4793
|
+
label: {
|
4794
|
+
id: "v2.correction.corrector.others",
|
4795
|
+
defaultMessage: "Someone else",
|
4796
|
+
description: "Label for someone else option in certificate correction form"
|
4797
|
+
}
|
4798
|
+
}
|
4799
|
+
]
|
4800
|
+
}
|
4801
|
+
]
|
4802
|
+
},
|
4803
|
+
{
|
4804
|
+
id: "identity-check",
|
4805
|
+
type: PageTypes.enum.FORM,
|
4806
|
+
title: {
|
4807
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4808
|
+
defaultMessage: "Verify their identity",
|
4809
|
+
description: "This is the title of the section"
|
4810
|
+
},
|
4811
|
+
fields: [
|
4812
|
+
{
|
4813
|
+
id: "correction.identity-check.instructions",
|
4814
|
+
type: "PAGE_HEADER",
|
4815
|
+
label: {
|
4816
|
+
id: "correction.corrector.identity.instruction",
|
4817
|
+
defaultMessage: "Please verify the identity of the person making this request",
|
4818
|
+
description: "The title for the corrector form"
|
4819
|
+
}
|
4820
|
+
},
|
4821
|
+
{
|
4822
|
+
id: "correction.identity-check.verified",
|
4823
|
+
type: "RADIO_GROUP",
|
4824
|
+
label: {
|
4825
|
+
id: "correction.corrector.identity.verified.label",
|
4826
|
+
defaultMessage: "Identity verified",
|
4827
|
+
description: "The title for the corrector form"
|
4828
|
+
},
|
4829
|
+
defaultValue: "",
|
4830
|
+
required: true,
|
4831
|
+
options: [
|
4832
|
+
{
|
4833
|
+
value: "VERIFIED",
|
4834
|
+
label: {
|
4835
|
+
id: "correction.corrector.identity.verified",
|
4836
|
+
defaultMessage: "I have verified their identity",
|
4837
|
+
description: "Label for verified option in corrector identity check page"
|
4838
|
+
}
|
4839
|
+
}
|
4840
|
+
]
|
4841
|
+
}
|
4842
|
+
]
|
4843
|
+
}
|
4844
|
+
],
|
4845
|
+
additionalDetailsForm: [
|
4846
|
+
{
|
4847
|
+
id: "correction-request.supporting-documents",
|
4848
|
+
type: PageTypes.enum.FORM,
|
4849
|
+
title: {
|
4850
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.verify",
|
4851
|
+
defaultMessage: "Upload supporting documents",
|
4852
|
+
description: "This is the title of the section"
|
4853
|
+
},
|
4854
|
+
fields: [
|
4855
|
+
{
|
4856
|
+
id: "correction.supportingDocs.introduction",
|
4857
|
+
type: "PAGE_HEADER",
|
4858
|
+
label: {
|
4859
|
+
id: "correction.corrector.paragraph.title",
|
4860
|
+
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.",
|
4861
|
+
description: "The title for the corrector form"
|
4862
|
+
}
|
4863
|
+
},
|
4864
|
+
{
|
4865
|
+
id: "correction.supportingDocs",
|
4866
|
+
type: FieldType.FILE,
|
4867
|
+
label: {
|
4868
|
+
id: "correction.corrector.title",
|
4869
|
+
defaultMessage: "Upload supporting documents",
|
4870
|
+
description: "The title for the corrector form"
|
4871
|
+
}
|
4872
|
+
},
|
4873
|
+
{
|
4874
|
+
id: "correction.request.supportingDocuments",
|
4875
|
+
type: "RADIO_GROUP",
|
4876
|
+
label: {
|
4877
|
+
id: "correction.corrector.title",
|
4878
|
+
defaultMessage: "Who is requesting a change to this record?",
|
4879
|
+
description: "The title for the corrector form"
|
4880
|
+
},
|
4881
|
+
defaultValue: "",
|
4882
|
+
configuration: {
|
4883
|
+
styles: {
|
4884
|
+
size: "NORMAL"
|
4885
|
+
}
|
4886
|
+
},
|
4887
|
+
options: [
|
4888
|
+
{
|
4889
|
+
value: "ATTEST",
|
4890
|
+
label: {
|
4891
|
+
id: "correction.supportingDocuments.attest.label",
|
4892
|
+
defaultMessage: "I attest to seeing supporting documentation and have a copy filed at my office",
|
4893
|
+
description: ""
|
4894
|
+
}
|
4895
|
+
},
|
4896
|
+
{
|
4897
|
+
value: "NOT_NEEDED",
|
4898
|
+
label: {
|
4899
|
+
id: "correction.supportingDocuments.notNeeded.label",
|
4900
|
+
defaultMessage: "No supporting documents required",
|
4901
|
+
description: ""
|
4902
|
+
}
|
4903
|
+
}
|
4904
|
+
]
|
4905
|
+
}
|
4906
|
+
]
|
4907
|
+
},
|
4908
|
+
{
|
4909
|
+
id: "correction-request.additional-details",
|
4910
|
+
type: PageTypes.enum.FORM,
|
4911
|
+
title: {
|
4912
|
+
id: "event.tennis-club-membership.action.requestCorrection.form.section.corrector",
|
4913
|
+
defaultMessage: "Reason for correction",
|
4914
|
+
description: "This is the title of the section"
|
4915
|
+
},
|
4916
|
+
fields: [
|
4917
|
+
{
|
4918
|
+
id: "correction.request.reason",
|
4919
|
+
type: FieldType.TEXT,
|
4920
|
+
label: {
|
4921
|
+
id: "correction.reason.title",
|
4922
|
+
defaultMessage: "Reason for correction?",
|
4923
|
+
description: "The title for the corrector form"
|
4924
|
+
}
|
4925
|
+
}
|
4926
|
+
]
|
4927
|
+
}
|
4928
|
+
]
|
4929
|
+
},
|
4930
|
+
{
|
4931
|
+
type: ActionType.APPROVE_CORRECTION,
|
4932
|
+
label: {
|
4933
|
+
defaultMessage: "Approve correction",
|
4934
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4935
|
+
id: "event.tennis-club-membership.action.correction.approve.label"
|
4936
|
+
}
|
4937
|
+
},
|
4938
|
+
{
|
4939
|
+
type: ActionType.PRINT_CERTIFICATE,
|
4940
|
+
label: {
|
4941
|
+
id: "v2.event.tennis-club-membership.action.collect-certificate.label",
|
4942
|
+
defaultMessage: "Print certificate",
|
4943
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4944
|
+
},
|
4945
|
+
printForm: PRINT_CERTIFICATE_FORM,
|
4946
|
+
conditionals: [
|
4947
|
+
{
|
4948
|
+
type: "SHOW",
|
4949
|
+
conditional: defineConditional({
|
4950
|
+
type: "object",
|
4951
|
+
properties: {
|
4952
|
+
$event: {
|
4953
|
+
type: "object",
|
4954
|
+
properties: {
|
4955
|
+
actions: {
|
4956
|
+
type: "array",
|
4957
|
+
contains: {
|
4958
|
+
type: "object",
|
4959
|
+
properties: {
|
4960
|
+
type: {
|
4961
|
+
const: "REGISTER"
|
4962
|
+
},
|
4963
|
+
draft: {
|
4964
|
+
type: "boolean"
|
4965
|
+
}
|
4966
|
+
},
|
4967
|
+
required: ["type"],
|
4968
|
+
not: {
|
4969
|
+
properties: {
|
4970
|
+
draft: {
|
4971
|
+
const: true
|
4972
|
+
}
|
4973
|
+
}
|
4974
|
+
}
|
4975
|
+
}
|
4976
|
+
}
|
4977
|
+
},
|
4978
|
+
required: ["actions"]
|
4979
|
+
}
|
4980
|
+
},
|
4981
|
+
required: ["$event"]
|
4982
|
+
})
|
4983
|
+
}
|
4984
|
+
]
|
4985
|
+
},
|
4986
|
+
{
|
4987
|
+
type: ActionType.ARCHIVE,
|
4988
|
+
label: {
|
4989
|
+
id: "v2.event.tennis-club-membership.action.archive.label",
|
4990
|
+
defaultMessage: "Archive",
|
4991
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4992
|
+
}
|
4993
|
+
},
|
4994
|
+
{
|
4995
|
+
type: ActionType.REJECT,
|
4996
|
+
label: {
|
4997
|
+
id: "v2.event.tennis-club-membership.action.reject.label",
|
4998
|
+
defaultMessage: "Reject",
|
4999
|
+
description: "This is shown as the action name anywhere the user can trigger the action from"
|
5000
|
+
}
|
5001
|
+
}
|
5002
|
+
],
|
5003
|
+
advancedSearch: [
|
5004
|
+
{
|
5005
|
+
title: {
|
5006
|
+
defaultMessage: "Registration details",
|
5007
|
+
description: "The title of Registration details accordion",
|
5008
|
+
id: "v2.advancedSearch.form.registrationDetails"
|
5009
|
+
},
|
5010
|
+
fields: [
|
5011
|
+
event("legalStatus.REGISTERED.createdAtLocation").exact(),
|
5012
|
+
event("legalStatus.REGISTERED.createdAt").range(),
|
5013
|
+
event("status", statusOptions).exact(),
|
5014
|
+
event("updatedAt", timePeriodOptions).range()
|
5015
|
+
]
|
5016
|
+
},
|
5017
|
+
{
|
5018
|
+
title: {
|
5019
|
+
defaultMessage: "Applicant's details",
|
5020
|
+
description: "Applicant details search field section title",
|
5021
|
+
id: "v2.event.tennis-club-membership.search.applicants"
|
5022
|
+
},
|
5023
|
+
fields: [
|
5024
|
+
field("applicant.firstname").fuzzy(),
|
5025
|
+
field("applicant.surname").fuzzy(),
|
5026
|
+
field("applicant.dob").range(),
|
5027
|
+
field("applicant.email").exact()
|
5028
|
+
]
|
5029
|
+
},
|
5030
|
+
{
|
5031
|
+
title: {
|
5032
|
+
defaultMessage: "Recommender's details",
|
5033
|
+
description: "Recommender details search field section title",
|
5034
|
+
id: "v2.event.tennis-club-membership.search.recommender"
|
5035
|
+
},
|
5036
|
+
fields: [
|
5037
|
+
field("recommender.firstname").fuzzy(),
|
5038
|
+
field("recommender.surname").fuzzy()
|
5039
|
+
]
|
5040
|
+
}
|
5041
|
+
],
|
5042
|
+
declaration: TENNIS_CLUB_DECLARATION_FORM
|
5043
|
+
});
|
5044
|
+
|
5045
|
+
// ../commons/src/fixtures/football-club-membership-event.ts
|
5046
|
+
var footballClubMembershipEvent = defineConfig({
|
5047
|
+
id: "FOOTBALL_CLUB_MEMBERSHIP",
|
5048
|
+
label: {
|
5049
|
+
defaultMessage: "Football club membership application",
|
5050
|
+
description: "This is what this event is referred as in the system",
|
5051
|
+
id: "event.football-club-membership.label"
|
5052
|
+
},
|
5053
|
+
title: {
|
5054
|
+
defaultMessage: "{applicant.firstname} {applicant.surname}",
|
5055
|
+
description: "This is the title of the summary",
|
5056
|
+
id: "v2.event.football-club-membership.title"
|
5057
|
+
},
|
5058
|
+
summary: {
|
5059
|
+
fields: [
|
5060
|
+
{
|
5061
|
+
id: "applicant.firstname",
|
5062
|
+
label: {
|
4014
5063
|
defaultMessage: "Applicant's first name",
|
4015
5064
|
description: "This is the label for the field",
|
4016
|
-
id: "event.
|
5065
|
+
id: "event.football-club-membership.summary.field.firstname.label"
|
4017
5066
|
},
|
4018
5067
|
value: {
|
4019
5068
|
defaultMessage: "{applicant.firstname}",
|
4020
5069
|
description: "This is the value to show in the summary",
|
4021
|
-
id: "event.
|
5070
|
+
id: "event.football-club-membership.summary.field.firstname"
|
4022
5071
|
},
|
4023
5072
|
emptyValueMessage: {
|
4024
5073
|
defaultMessage: "First name is not provided",
|
4025
5074
|
description: "This is the message to show when the field is empty",
|
4026
|
-
id: "event.
|
5075
|
+
id: "event.football-club-membership.summary.field.firstname.empty"
|
4027
5076
|
}
|
4028
5077
|
},
|
4029
5078
|
{
|
4030
|
-
|
5079
|
+
fieldId: "applicant.surname",
|
4031
5080
|
label: {
|
4032
5081
|
defaultMessage: "Applicant's last name",
|
4033
|
-
description: "
|
4034
|
-
id: "event.
|
4035
|
-
},
|
4036
|
-
value: {
|
4037
|
-
defaultMessage: "{applicant.surname}",
|
4038
|
-
description: "This is the value to show in the summary",
|
4039
|
-
id: "event.tennis-club-membership.summary.field.surname"
|
4040
|
-
},
|
4041
|
-
emptyValueMessage: {
|
4042
|
-
defaultMessage: "Last name is not provided",
|
4043
|
-
description: "This is the message to show when the field is empty",
|
4044
|
-
id: "event.tennis-club-membership.summary.field.surname.empty"
|
5082
|
+
description: "Label for surname",
|
5083
|
+
id: "v2.event.football-club-membership.summary.field.surname.label"
|
4045
5084
|
}
|
5085
|
+
},
|
5086
|
+
{
|
5087
|
+
fieldId: "applicant.email"
|
4046
5088
|
}
|
4047
5089
|
]
|
4048
5090
|
},
|
4049
5091
|
actions: [
|
5092
|
+
{
|
5093
|
+
type: ActionType.READ,
|
5094
|
+
label: {
|
5095
|
+
id: "v2.event.football-club-membership.action.read.label",
|
5096
|
+
defaultMessage: "Read",
|
5097
|
+
description: "Title of the read only page"
|
5098
|
+
},
|
5099
|
+
review: TENNIS_CLUB_DECLARATION_REVIEW
|
5100
|
+
},
|
4050
5101
|
{
|
4051
5102
|
type: ActionType.DECLARE,
|
4052
5103
|
label: {
|
4053
5104
|
defaultMessage: "Send an application",
|
4054
5105
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4055
|
-
id: "event.
|
5106
|
+
id: "event.football-club-membership.action.declare.label"
|
4056
5107
|
},
|
4057
5108
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4058
5109
|
},
|
@@ -4061,7 +5112,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4061
5112
|
label: {
|
4062
5113
|
defaultMessage: "Validate",
|
4063
5114
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4064
|
-
id: "event.
|
5115
|
+
id: "event.football-club-membership.action.validate.label"
|
4065
5116
|
},
|
4066
5117
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4067
5118
|
},
|
@@ -4070,7 +5121,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4070
5121
|
label: {
|
4071
5122
|
defaultMessage: "Register",
|
4072
5123
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4073
|
-
id: "event.
|
5124
|
+
id: "event.football-club-membership.action.register.label"
|
4074
5125
|
},
|
4075
5126
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
4076
5127
|
},
|
@@ -4079,14 +5130,14 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4079
5130
|
label: {
|
4080
5131
|
defaultMessage: "Request correction",
|
4081
5132
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4082
|
-
id: "event.
|
5133
|
+
id: "event.football-club-membership.action.correction.request.label"
|
4083
5134
|
},
|
4084
5135
|
onboardingForm: [
|
4085
5136
|
{
|
4086
5137
|
id: "correction-requester",
|
4087
5138
|
type: PageTypes.enum.FORM,
|
4088
5139
|
title: {
|
4089
|
-
id: "event.
|
5140
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
4090
5141
|
defaultMessage: "Correction requester",
|
4091
5142
|
description: "This is the title of the section"
|
4092
5143
|
},
|
@@ -4150,7 +5201,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4150
5201
|
id: "identity-check",
|
4151
5202
|
type: PageTypes.enum.FORM,
|
4152
5203
|
title: {
|
4153
|
-
id: "event.
|
5204
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
4154
5205
|
defaultMessage: "Verify their identity",
|
4155
5206
|
description: "This is the title of the section"
|
4156
5207
|
},
|
@@ -4193,7 +5244,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4193
5244
|
id: "correction-request.supporting-documents",
|
4194
5245
|
type: PageTypes.enum.FORM,
|
4195
5246
|
title: {
|
4196
|
-
id: "event.
|
5247
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.verify",
|
4197
5248
|
defaultMessage: "Upload supporting documents",
|
4198
5249
|
description: "This is the title of the section"
|
4199
5250
|
},
|
@@ -4255,7 +5306,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4255
5306
|
id: "correction-request.additional-details",
|
4256
5307
|
type: PageTypes.enum.FORM,
|
4257
5308
|
title: {
|
4258
|
-
id: "event.
|
5309
|
+
id: "event.football-club-membership.action.requestCorrection.form.section.corrector",
|
4259
5310
|
defaultMessage: "Reason for correction",
|
4260
5311
|
description: "This is the title of the section"
|
4261
5312
|
},
|
@@ -4278,13 +5329,13 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4278
5329
|
label: {
|
4279
5330
|
defaultMessage: "Approve correction",
|
4280
5331
|
description: "This is shown as the action name anywhere the user can trigger the action from",
|
4281
|
-
id: "event.
|
5332
|
+
id: "event.football-club-membership.action.correction.approve.label"
|
4282
5333
|
}
|
4283
5334
|
},
|
4284
5335
|
{
|
4285
5336
|
type: ActionType.PRINT_CERTIFICATE,
|
4286
5337
|
label: {
|
4287
|
-
id: "v2.event.
|
5338
|
+
id: "v2.event.football-club-membership.action.collect-certificate.label",
|
4288
5339
|
defaultMessage: "Print certificate",
|
4289
5340
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4290
5341
|
},
|
@@ -4332,7 +5383,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4332
5383
|
{
|
4333
5384
|
type: ActionType.ARCHIVE,
|
4334
5385
|
label: {
|
4335
|
-
id: "v2.event.
|
5386
|
+
id: "v2.event.football-club-membership.action.archive.label",
|
4336
5387
|
defaultMessage: "Archive",
|
4337
5388
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4338
5389
|
}
|
@@ -4340,7 +5391,7 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4340
5391
|
{
|
4341
5392
|
type: ActionType.REJECT,
|
4342
5393
|
label: {
|
4343
|
-
id: "v2.event.
|
5394
|
+
id: "v2.event.football-club-membership.action.reject.label",
|
4344
5395
|
defaultMessage: "Reject",
|
4345
5396
|
description: "This is shown as the action name anywhere the user can trigger the action from"
|
4346
5397
|
}
|
@@ -4349,16 +5400,104 @@ var tennisClubMembershipEvent = defineConfig({
|
|
4349
5400
|
advancedSearch: [
|
4350
5401
|
{
|
4351
5402
|
title: {
|
4352
|
-
defaultMessage: "
|
4353
|
-
description: "
|
4354
|
-
id: "v2.
|
5403
|
+
defaultMessage: "Registration details",
|
5404
|
+
description: "The title of Registration details accordion",
|
5405
|
+
id: "v2.advancedSearch.form.registrationDetails"
|
4355
5406
|
},
|
4356
|
-
fields: [
|
5407
|
+
fields: [
|
5408
|
+
event("legalStatus.REGISTERED.createdAtLocation").exact(),
|
5409
|
+
event("legalStatus.REGISTERED.createdAt").range(),
|
5410
|
+
event("status", statusOptions).exact(),
|
5411
|
+
event("updatedAt", timePeriodOptions).range()
|
5412
|
+
]
|
5413
|
+
},
|
5414
|
+
{
|
5415
|
+
title: {
|
5416
|
+
defaultMessage: "Applicant's details",
|
5417
|
+
description: "Applicant details search field section title",
|
5418
|
+
id: "v2.event.football-club-membership.search.applicants"
|
5419
|
+
},
|
5420
|
+
fields: [
|
5421
|
+
field("applicant.firstname").fuzzy(),
|
5422
|
+
field("applicant.surname").fuzzy(),
|
5423
|
+
field("applicant.dob").range(),
|
5424
|
+
field("applicant.email").exact()
|
5425
|
+
]
|
5426
|
+
},
|
5427
|
+
{
|
5428
|
+
title: {
|
5429
|
+
defaultMessage: "Recommender's details",
|
5430
|
+
description: "Recommender details search field section title",
|
5431
|
+
id: "v2.event.football-club-membership.search.recommender"
|
5432
|
+
},
|
5433
|
+
fields: [
|
5434
|
+
field("recommender.firstname").fuzzy(),
|
5435
|
+
field("recommender.surname").fuzzy()
|
5436
|
+
]
|
4357
5437
|
}
|
4358
5438
|
],
|
4359
5439
|
declaration: TENNIS_CLUB_DECLARATION_FORM
|
4360
5440
|
});
|
4361
5441
|
|
5442
|
+
// ../commons/src/fixtures/library-membership-event.ts
|
5443
|
+
var libraryMembershipForm = defineDeclarationForm({
|
5444
|
+
label: {
|
5445
|
+
id: "v2.event.library-membership.action.declare.form.label",
|
5446
|
+
defaultMessage: "Library membership application",
|
5447
|
+
description: "This is what this form is referred as in the system"
|
5448
|
+
},
|
5449
|
+
pages: [
|
5450
|
+
{
|
5451
|
+
id: "member",
|
5452
|
+
title: {
|
5453
|
+
id: "v2.event.library-membership.action.declare.form.section.who.title",
|
5454
|
+
defaultMessage: "Who is applying for the membership?",
|
5455
|
+
description: "This is the title of the section"
|
5456
|
+
},
|
5457
|
+
fields: [
|
5458
|
+
{
|
5459
|
+
id: "member.firstname",
|
5460
|
+
type: FieldType.TEXT,
|
5461
|
+
required: true,
|
5462
|
+
conditionals: [],
|
5463
|
+
label: {
|
5464
|
+
defaultMessage: "Member's first name",
|
5465
|
+
description: "This is the label for the field",
|
5466
|
+
id: "v2.event.library-membership.action.declare.form.section.who.field.firstname.label"
|
5467
|
+
}
|
5468
|
+
},
|
5469
|
+
{
|
5470
|
+
id: "member.surname",
|
5471
|
+
type: FieldType.TEXT,
|
5472
|
+
required: true,
|
5473
|
+
conditionals: [],
|
5474
|
+
label: {
|
5475
|
+
defaultMessage: "Member's surname",
|
5476
|
+
description: "This is the label for the field",
|
5477
|
+
id: "v2.event.library-membership.action.declare.form.section.who.field.surname.label"
|
5478
|
+
}
|
5479
|
+
}
|
5480
|
+
]
|
5481
|
+
}
|
5482
|
+
]
|
5483
|
+
});
|
5484
|
+
var libraryMembershipEvent = defineConfig({
|
5485
|
+
id: "library-membership",
|
5486
|
+
label: {
|
5487
|
+
defaultMessage: "Library membership application",
|
5488
|
+
description: "This is what this event is referred as in the system",
|
5489
|
+
id: "event.library-membership.label"
|
5490
|
+
},
|
5491
|
+
title: {
|
5492
|
+
defaultMessage: "{member.firstname} {member.surname}",
|
5493
|
+
description: "This is the title of the summary",
|
5494
|
+
id: "v2.event.library-membership.title"
|
5495
|
+
},
|
5496
|
+
summary: { fields: [] },
|
5497
|
+
actions: [],
|
5498
|
+
declaration: libraryMembershipForm
|
5499
|
+
});
|
5500
|
+
|
4362
5501
|
// ../commons/src/events/test.utils.ts
|
4363
5502
|
function fieldConfigsToActionPayload(fields) {
|
4364
5503
|
return fields.reduce(
|
@@ -4406,11 +5545,11 @@ function generateActionAnnotationInput(configuration, action) {
|
|
4406
5545
|
var eventPayloadGenerator = {
|
4407
5546
|
create: (input = {}) => ({
|
4408
5547
|
transactionId: input.transactionId ?? getUUID(),
|
4409
|
-
type: input.type ??
|
5548
|
+
type: input.type ?? TENNIS_CLUB_MEMBERSHIP
|
4410
5549
|
}),
|
4411
5550
|
patch: (id, input = {}) => ({
|
4412
5551
|
transactionId: input.transactionId ?? getUUID(),
|
4413
|
-
type: input.type ??
|
5552
|
+
type: input.type ?? TENNIS_CLUB_MEMBERSHIP,
|
4414
5553
|
id
|
4415
5554
|
}),
|
4416
5555
|
draft: ({ eventId, actionType }, input = {}) => (0, import_lodash2.merge)(
|
@@ -4510,9 +5649,13 @@ var eventPayloadGenerator = {
|
|
4510
5649
|
transactionId: input.transactionId ?? getUUID(),
|
4511
5650
|
declaration: {},
|
4512
5651
|
// @TODO: Check whether generator is needed?
|
4513
|
-
annotation: {
|
5652
|
+
annotation: {},
|
4514
5653
|
duplicates: [],
|
4515
|
-
eventId
|
5654
|
+
eventId,
|
5655
|
+
reason: {
|
5656
|
+
message: `${ActionType.ARCHIVE}`,
|
5657
|
+
isDuplicate: isDuplicate ?? false
|
5658
|
+
}
|
4516
5659
|
}),
|
4517
5660
|
reject: (eventId, input = {}) => ({
|
4518
5661
|
type: ActionType.REJECT,
|
@@ -4523,7 +5666,8 @@ var eventPayloadGenerator = {
|
|
4523
5666
|
ActionType.REJECT
|
4524
5667
|
),
|
4525
5668
|
duplicates: [],
|
4526
|
-
eventId
|
5669
|
+
eventId,
|
5670
|
+
reason: { message: `${ActionType.REJECT}` }
|
4527
5671
|
}),
|
4528
5672
|
register: (eventId, input = {}) => ({
|
4529
5673
|
type: ActionType.REGISTER,
|
@@ -4620,9 +5764,9 @@ function generateActionDocument({
|
|
4620
5764
|
case ActionType.VALIDATE:
|
4621
5765
|
return { ...actionBase, type: action };
|
4622
5766
|
case ActionType.ARCHIVE:
|
4623
|
-
return { ...actionBase, type: action };
|
5767
|
+
return { ...actionBase, type: action, reason: { message: "Archive" } };
|
4624
5768
|
case ActionType.REJECT:
|
4625
|
-
return { ...actionBase, type: action };
|
5769
|
+
return { ...actionBase, type: action, reason: { message: "Reject" } };
|
4626
5770
|
case ActionType.CREATE:
|
4627
5771
|
return { ...actionBase, type: action };
|
4628
5772
|
case ActionType.NOTIFY:
|
@@ -4634,7 +5778,11 @@ function generateActionDocument({
|
|
4634
5778
|
case ActionType.APPROVE_CORRECTION:
|
4635
5779
|
return { ...actionBase, requestId: getUUID(), type: action };
|
4636
5780
|
case ActionType.REJECT_CORRECTION:
|
4637
|
-
return {
|
5781
|
+
return {
|
5782
|
+
...actionBase,
|
5783
|
+
requestId: getUUID(),
|
5784
|
+
type: action
|
5785
|
+
};
|
4638
5786
|
case ActionType.REGISTER:
|
4639
5787
|
return {
|
4640
5788
|
...actionBase,
|
@@ -4662,8 +5810,7 @@ function generateEventDocument({
|
|
4662
5810
|
id: getUUID(),
|
4663
5811
|
// Offset is needed so the createdAt timestamps for events, actions and drafts make logical sense in storybook tests.
|
4664
5812
|
// @TODO: This should be fixed in the future.
|
4665
|
-
updatedAt: new Date(Date.now() - 1e3).toISOString()
|
4666
|
-
dateOfEvent: configuration.dateOfEvent
|
5813
|
+
updatedAt: new Date(Date.now() - 1e3).toISOString()
|
4667
5814
|
};
|
4668
5815
|
}
|
4669
5816
|
function generateEventDraftDocument(eventId, actionType = ActionType.DECLARE, declaration = {}) {
|
@@ -4685,21 +5832,16 @@ function generateEventDraftDocument(eventId, actionType = ActionType.DECLARE, de
|
|
4685
5832
|
eventId
|
4686
5833
|
};
|
4687
5834
|
}
|
4688
|
-
function
|
4689
|
-
|
4690
|
-
EventStatus.CREATED,
|
4691
|
-
EventStatus.REGISTERED,
|
4692
|
-
EventStatus.DECLARED
|
4693
|
-
];
|
4694
|
-
const randomIndex = Math.floor(Math.random() * 3);
|
4695
|
-
return statuses[randomIndex];
|
5835
|
+
function pickRandom(rng, items) {
|
5836
|
+
return items[Math.floor(rng() * items.length)];
|
4696
5837
|
}
|
4697
|
-
function
|
4698
|
-
const
|
4699
|
-
const
|
4700
|
-
|
5838
|
+
function getRandomDatetime(rng, start, end) {
|
5839
|
+
const range = end.getTime() - start.getTime();
|
5840
|
+
const offset = Math.floor(rng() * range);
|
5841
|
+
const randomDate = new Date(start.getTime() + offset);
|
5842
|
+
return randomDate.toISOString();
|
4701
5843
|
}
|
4702
|
-
function
|
5844
|
+
function generateRandomApplicant(rng) {
|
4703
5845
|
const firstNames = [
|
4704
5846
|
"Danny",
|
4705
5847
|
"John",
|
@@ -4720,18 +5862,13 @@ function getRandomApplicant() {
|
|
4720
5862
|
"Garcia",
|
4721
5863
|
"Miller"
|
4722
5864
|
];
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
return randomDate.toISOString().split("T")[0];
|
4728
|
-
}
|
4729
|
-
const randomFirstName = firstNames[Math.floor(Math.random() * firstNames.length)];
|
4730
|
-
const randomSurname = surnames[Math.floor(Math.random() * surnames.length)];
|
4731
|
-
const randomDob = getRandomDate(
|
5865
|
+
const randomFirstName = pickRandom(rng, firstNames);
|
5866
|
+
const randomSurname = pickRandom(rng, surnames);
|
5867
|
+
const randomDob = getRandomDatetime(
|
5868
|
+
rng,
|
4732
5869
|
/* @__PURE__ */ new Date("1990-01-01"),
|
4733
5870
|
/* @__PURE__ */ new Date("2010-12-31")
|
4734
|
-
);
|
5871
|
+
).split("T")[0];
|
4735
5872
|
return {
|
4736
5873
|
"recommender.none": true,
|
4737
5874
|
"applicant.firstname": randomFirstName,
|
@@ -4739,28 +5876,83 @@ function getRandomApplicant() {
|
|
4739
5876
|
"applicant.dob": randomDob
|
4740
5877
|
};
|
4741
5878
|
}
|
4742
|
-
|
4743
|
-
|
4744
|
-
|
4745
|
-
|
4746
|
-
|
4747
|
-
|
4748
|
-
|
4749
|
-
|
4750
|
-
|
4751
|
-
|
4752
|
-
|
4753
|
-
|
4754
|
-
|
4755
|
-
|
4756
|
-
|
4757
|
-
|
4758
|
-
}
|
5879
|
+
function createPseudoRandomNumberGenerator(seed) {
|
5880
|
+
const MODULUS = 2 ** 32;
|
5881
|
+
const MULTIPLIER = 1664525;
|
5882
|
+
const INCREMENT = 1013904223;
|
5883
|
+
let state = seed >>> 0;
|
5884
|
+
return () => {
|
5885
|
+
state = (MULTIPLIER * state + INCREMENT) % MODULUS;
|
5886
|
+
return state / MODULUS;
|
5887
|
+
};
|
5888
|
+
}
|
5889
|
+
function generateUuid(rng) {
|
5890
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
5891
|
+
const r = Math.floor(rng() * 16);
|
5892
|
+
const v = c === "x" ? r : r & 3 | 8;
|
5893
|
+
return v.toString(16);
|
5894
|
+
});
|
5895
|
+
}
|
5896
|
+
function generateTrackingId(rng) {
|
5897
|
+
const uuid = generateUuid(rng).replace(/-/g, "");
|
5898
|
+
const trackingId = uuid.slice(0, 6).toUpperCase();
|
5899
|
+
return trackingId;
|
5900
|
+
}
|
5901
|
+
function generateRandomSignature(rng) {
|
5902
|
+
return `/random-bucket/${generateUuid(rng)}.png`;
|
5903
|
+
}
|
5904
|
+
var eventQueryDataGenerator = (overrides = {}, seed = 1) => {
|
5905
|
+
const rng = createPseudoRandomNumberGenerator(seed);
|
5906
|
+
const createdAt = getRandomDatetime(
|
5907
|
+
rng,
|
5908
|
+
/* @__PURE__ */ new Date("2024-01-01"),
|
5909
|
+
/* @__PURE__ */ new Date("2024-12-31")
|
5910
|
+
);
|
5911
|
+
return {
|
5912
|
+
id: overrides.id ?? generateUuid(rng),
|
5913
|
+
type: overrides.type ?? TENNIS_CLUB_MEMBERSHIP,
|
5914
|
+
status: overrides.status ?? pickRandom(rng, eventStatuses),
|
5915
|
+
createdAt: overrides.createdAt ?? createdAt,
|
5916
|
+
createdBy: overrides.createdBy ?? generateUuid(rng),
|
5917
|
+
createdAtLocation: overrides.createdAtLocation ?? generateUuid(rng),
|
5918
|
+
updatedAtLocation: overrides.updatedAtLocation ?? generateUuid(rng),
|
5919
|
+
createdBySignature: overrides.createdBySignature ?? generateRandomSignature(rng),
|
5920
|
+
updatedAt: overrides.updatedAt ?? (0, import_addDays.default)(new Date(createdAt), 1).toISOString(),
|
5921
|
+
assignedTo: overrides.assignedTo ?? null,
|
5922
|
+
updatedBy: overrides.updatedBy ?? generateUuid(rng),
|
5923
|
+
updatedByUserRole: overrides.updatedByUserRole ?? "FIELD_AGENT",
|
5924
|
+
flags: [],
|
5925
|
+
legalStatuses: overrides.legalStatuses ?? {},
|
5926
|
+
declaration: overrides.declaration ?? generateRandomApplicant(rng),
|
5927
|
+
trackingId: overrides.trackingId ?? generateTrackingId(rng)
|
5928
|
+
};
|
5929
|
+
};
|
4759
5930
|
var generateTranslationConfig = (message) => ({
|
4760
5931
|
defaultMessage: message,
|
4761
5932
|
description: "Description for ${message}",
|
4762
5933
|
id: message
|
4763
5934
|
});
|
5935
|
+
var BearerTokenByUserType = {
|
5936
|
+
fieldAgent: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWNvcmQuZGVjbGFyZS1iaXJ0aCIsInJlY29yZC5kZWNsYXJlLWRlYXRoIiwicmVjb3JkLmRlY2xhcmUtbWFycmlhZ2UiLCJyZWNvcmQuZGVjbGFyYXRpb24tc3VibWl0LWluY29tcGxldGUiLCJyZWNvcmQuZGVjbGFyYXRpb24tc3VibWl0LWZvci1yZXZpZXciLCJzZWFyY2guYmlydGgiLCJzZWFyY2guZGVhdGgiLCJzZWFyY2gubWFycmlhZ2UiLCJkZW1vIl0sInVzZXJUeXBlIjoidXNlciIsImlhdCI6MTc0ODUyNjQ4OCwiZXhwIjoxNzQ5MTMxMjg4LCJhdWQiOlsib3BlbmNydnM6YXV0aC11c2VyIiwib3BlbmNydnM6dXNlci1tZ250LXVzZXIiLCJvcGVuY3J2czpoZWFydGgtdXNlciIsIm9wZW5jcnZzOmdhdGV3YXktdXNlciIsIm9wZW5jcnZzOm5vdGlmaWNhdGlvbi11c2VyIiwib3BlbmNydnM6d29ya2Zsb3ctdXNlciIsIm9wZW5jcnZzOnNlYXJjaC11c2VyIiwib3BlbmNydnM6bWV0cmljcy11c2VyIiwib3BlbmNydnM6Y291bnRyeWNvbmZpZy11c2VyIiwib3BlbmNydnM6d2ViaG9va3MtdXNlciIsIm9wZW5jcnZzOmNvbmZpZy11c2VyIiwib3BlbmNydnM6ZG9jdW1lbnRzLXVzZXIiXSwiaXNzIjoib3BlbmNydnM6YXV0aC1zZXJ2aWNlIiwic3ViIjoiNjc3ZmIwODYzMGYzYWJmYTMzMDcyNzBmIn0.qLif2TmTPpqfbSUWR3TSfWf5syyCtRRJV-fDOZBtN9th-gdT0sUPZp5PB_t2QHHCLes7JLDlSA9CGNIbVvRR8a7EedXTAf0T7pwiE96PgljHSKI9jLMCYb_rhqnl8BwfsxAU3qv8EBYM9rDlcabl5iKnAOM-YLMv63CRMQxZOZ0O3Wl1Xil82dp6PqW_Lom5Qd-Esftt9BWXk5gxmqq-YegT8qU9n3hDXEsOvmIyYQvPDwmUOB-xp74CKJk_o3eBuq4TVCMYxY-tS9qkkn2A7Txhh-bzWMVNrQjQ1Yumvs8gi_F-XYTi89QbZVz8PzJ9kT8w3jshYwmAy7be9M-EQg",
|
5937
|
+
registrationAgent: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWNvcmQucmVhZCIsInJlY29yZC5kZWNsYXJlLWJpcnRoIiwicmVjb3JkLmRlY2xhcmUtZGVhdGgiLCJyZWNvcmQuZGVjbGFyZS1tYXJyaWFnZSIsInJlY29yZC5kZWNsYXJhdGlvbi1lZGl0IiwicmVjb3JkLmRlY2xhcmF0aW9uLXN1Ym1pdC1mb3ItYXBwcm92YWwiLCJyZWNvcmQuZGVjbGFyYXRpb24tc3VibWl0LWZvci11cGRhdGVzIiwicmVjb3JkLmRlY2xhcmF0aW9uLWFyY2hpdmUiLCJyZWNvcmQuZGVjbGFyYXRpb24tcmVpbnN0YXRlIiwicmVjb3JkLnJlZ2lzdHJhdGlvbi1yZXF1ZXN0LWNvcnJlY3Rpb24iLCJyZWNvcmQuZGVjbGFyYXRpb24tcHJpbnQtc3VwcG9ydGluZy1kb2N1bWVudHMiLCJyZWNvcmQuZXhwb3J0LXJlY29yZHMiLCJyZWNvcmQucmVnaXN0cmF0aW9uLXByaW50Jmlzc3VlLWNlcnRpZmllZC1jb3BpZXMiLCJwZXJmb3JtYW5jZS5yZWFkIiwicGVyZm9ybWFuY2UucmVhZC1kYXNoYm9hcmRzIiwib3JnYW5pc2F0aW9uLnJlYWQtbG9jYXRpb25zOm15LW9mZmljZSIsInNlYXJjaC5iaXJ0aCIsInNlYXJjaC5kZWF0aCIsInNlYXJjaC5tYXJyaWFnZSIsImRlbW8iXSwidXNlclR5cGUiOiJ1c2VyIiwiaWF0IjoxNzQ4NTI2NDY4LCJleHAiOjE3NDkxMzEyNjgsImF1ZCI6WyJvcGVuY3J2czphdXRoLXVzZXIiLCJvcGVuY3J2czp1c2VyLW1nbnQtdXNlciIsIm9wZW5jcnZzOmhlYXJ0aC11c2VyIiwib3BlbmNydnM6Z2F0ZXdheS11c2VyIiwib3BlbmNydnM6bm90aWZpY2F0aW9uLXVzZXIiLCJvcGVuY3J2czp3b3JrZmxvdy11c2VyIiwib3BlbmNydnM6c2VhcmNoLXVzZXIiLCJvcGVuY3J2czptZXRyaWNzLXVzZXIiLCJvcGVuY3J2czpjb3VudHJ5Y29uZmlnLXVzZXIiLCJvcGVuY3J2czp3ZWJob29rcy11c2VyIiwib3BlbmNydnM6Y29uZmlnLXVzZXIiLCJvcGVuY3J2czpkb2N1bWVudHMtdXNlciJdLCJpc3MiOiJvcGVuY3J2czphdXRoLXNlcnZpY2UiLCJzdWIiOiI2NzdmYjA4NjMwZjNhYmZhMzMwNzI3MTgifQ.C0R3cda9tczdJyadyJzk_wjVx79yiQ4r2BZbrF5VMTol97CwqMk1cPKVv5xZR1fHW5nhYl1X_vsmTYx-p9oSmcAYVud-4Z24TrA3oZ214zCB8RW_RmmFzJSczwe-9Son-96JOpRJTz2F-F_SSmblF0cjndJ-iXCAbOn1hmQ1q45NqaV-oFaFWigvAaRoBFcEvGufQxss_NjRmG12ooENSfWQl0tYM9BmTw4JQo2xerwJcgaJTrtDgRagkuiR7zhVNjcoT64AQiSRp5KmWRhbU4ozlJ2tfy1ccD9jJkbQTf1AZT2pl1diusjstJYFuM9QPFPOyCO0umaxYfgSer_Hmg",
|
5938
|
+
localRegistrar: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWNvcmQucmVhZCIsInJlY29yZC5kZWNsYXJlLWJpcnRoIiwicmVjb3JkLmRlY2xhcmUtZGVhdGgiLCJyZWNvcmQuZGVjbGFyZS1tYXJyaWFnZSIsInJlY29yZC5kZWNsYXJhdGlvbi1lZGl0IiwicmVjb3JkLmRlY2xhcmF0aW9uLXN1Ym1pdC1mb3ItdXBkYXRlcyIsInJlY29yZC5yZXZpZXctZHVwbGljYXRlcyIsInJlY29yZC5kZWNsYXJhdGlvbi1hcmNoaXZlIiwicmVjb3JkLmRlY2xhcmF0aW9uLXJlaW5zdGF0ZSIsInJlY29yZC5yZWdpc3RlciIsInJlY29yZC5yZWdpc3RyYXRpb24tY29ycmVjdCIsInJlY29yZC5kZWNsYXJhdGlvbi1wcmludC1zdXBwb3J0aW5nLWRvY3VtZW50cyIsInJlY29yZC5leHBvcnQtcmVjb3JkcyIsInJlY29yZC51bmFzc2lnbi1vdGhlcnMiLCJyZWNvcmQucmVnaXN0cmF0aW9uLXByaW50Jmlzc3VlLWNlcnRpZmllZC1jb3BpZXMiLCJyZWNvcmQuY29uZmlybS1yZWdpc3RyYXRpb24iLCJyZWNvcmQucmVqZWN0LXJlZ2lzdHJhdGlvbiIsInBlcmZvcm1hbmNlLnJlYWQiLCJwZXJmb3JtYW5jZS5yZWFkLWRhc2hib2FyZHMiLCJwcm9maWxlLmVsZWN0cm9uaWMtc2lnbmF0dXJlIiwib3JnYW5pc2F0aW9uLnJlYWQtbG9jYXRpb25zOm15LW9mZmljZSIsInNlYXJjaC5iaXJ0aCIsInNlYXJjaC5kZWF0aCIsInNlYXJjaC5tYXJyaWFnZSIsImRlbW8iXSwidXNlclR5cGUiOiJ1c2VyIiwiaWF0IjoxNzQ4NTI2NDIwLCJleHAiOjE3NDkxMzEyMjAsImF1ZCI6WyJvcGVuY3J2czphdXRoLXVzZXIiLCJvcGVuY3J2czp1c2VyLW1nbnQtdXNlciIsIm9wZW5jcnZzOmhlYXJ0aC11c2VyIiwib3BlbmNydnM6Z2F0ZXdheS11c2VyIiwib3BlbmNydnM6bm90aWZpY2F0aW9uLXVzZXIiLCJvcGVuY3J2czp3b3JrZmxvdy11c2VyIiwib3BlbmNydnM6c2VhcmNoLXVzZXIiLCJvcGVuY3J2czptZXRyaWNzLXVzZXIiLCJvcGVuY3J2czpjb3VudHJ5Y29uZmlnLXVzZXIiLCJvcGVuY3J2czp3ZWJob29rcy11c2VyIiwib3BlbmNydnM6Y29uZmlnLXVzZXIiLCJvcGVuY3J2czpkb2N1bWVudHMtdXNlciJdLCJpc3MiOiJvcGVuY3J2czphdXRoLXNlcnZpY2UiLCJzdWIiOiI2NzdmYjA4NjMwZjNhYmZhMzMwNzI3MjEifQ.Exwojy_1lsoPmp-kQ79SMWI0eQy8Qt7yO_ynGvb_oIVdqSwTxFkkNr9x4UxhBA-o0P6LkMZ2ELKOlSzBr3PRJ8IQnfMQ7Db8oG8HAPsY8sKqra_L6ryV088NW2e2LqAjoOX0dXRIqYMolUhF_OOuZpHW5K8nvog5SLlnJ1gKysQ1EuWBg2dcKbjkkB16v-9NGz4XHye3vcoZlalyha5OOujzbPhkmr9UGiksSIXFNbanBhkQdt-EJlLX9SXvQ4ACJWPKFb_f4gv8p84jdLiryzQux46zHPpTicZHzg0nZtoKKIH1AyFtqWfBFm4y8qWC3ht9TAk93NAXTfkS0wzxKA"
|
5939
|
+
};
|
5940
|
+
var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
|
5941
|
+
{
|
5942
|
+
slug,
|
5943
|
+
name: {
|
5944
|
+
id: "workqueues.inProgress.title",
|
5945
|
+
defaultMessage: slug.charAt(0).toUpperCase() + slug.slice(1).split("-").join(" "),
|
5946
|
+
description: "Title of in progress workqueue"
|
5947
|
+
},
|
5948
|
+
query: {
|
5949
|
+
type: "and",
|
5950
|
+
clauses: [{ eventType: tennisClubMembershipEvent.id }]
|
5951
|
+
},
|
5952
|
+
actions: [],
|
5953
|
+
icon: "Draft"
|
5954
|
+
}
|
5955
|
+
]);
|
4764
5956
|
|
4765
5957
|
// ../commons/src/events/TemplateConfig.ts
|
4766
5958
|
function isTemplateVariable(value) {
|
@@ -4798,6 +5990,7 @@ function isFieldConfigDefaultValue(value) {
|
|
4798
5990
|
var import_lodash3 = require("lodash");
|
4799
5991
|
|
4800
5992
|
// ../commons/src/scopes.ts
|
5993
|
+
var import_zod31 = require("zod");
|
4801
5994
|
var SCOPES = {
|
4802
5995
|
// TODO v1.8 legacy scopes
|
4803
5996
|
NATLSYSADMIN: "natlsysadmin",
|
@@ -4821,6 +6014,8 @@ var SCOPES = {
|
|
4821
6014
|
*/
|
4822
6015
|
RECORD_DECLARE: "record.declare-birth",
|
4823
6016
|
// declare
|
6017
|
+
RECORD_IMPORT: "record.import",
|
6018
|
+
// declare
|
4824
6019
|
RECORD_DECLARE_BIRTH: "record.declare-birth",
|
4825
6020
|
RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
|
4826
6021
|
RECORD_DECLARE_DEATH: "record.declare-death",
|
@@ -4908,12 +6103,119 @@ var SCOPES = {
|
|
4908
6103
|
// data seeding
|
4909
6104
|
USER_DATA_SEEDING: "user.data-seeding"
|
4910
6105
|
};
|
6106
|
+
var LiteralScopes = import_zod31.z.union([
|
6107
|
+
import_zod31.z.literal(SCOPES.NATLSYSADMIN),
|
6108
|
+
import_zod31.z.literal(SCOPES.BYPASSRATELIMIT),
|
6109
|
+
import_zod31.z.literal(SCOPES.DECLARE),
|
6110
|
+
import_zod31.z.literal(SCOPES.REGISTER),
|
6111
|
+
import_zod31.z.literal(SCOPES.VALIDATE),
|
6112
|
+
import_zod31.z.literal(SCOPES.DEMO),
|
6113
|
+
import_zod31.z.literal(SCOPES.CERTIFY),
|
6114
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE),
|
6115
|
+
import_zod31.z.literal(SCOPES.SYSADMIN),
|
6116
|
+
import_zod31.z.literal(SCOPES.TEAMS),
|
6117
|
+
import_zod31.z.literal(SCOPES.CONFIG),
|
6118
|
+
import_zod31.z.literal(SCOPES.WEBHOOK),
|
6119
|
+
import_zod31.z.literal(SCOPES.NATIONALID),
|
6120
|
+
import_zod31.z.literal(SCOPES.NOTIFICATION_API),
|
6121
|
+
import_zod31.z.literal(SCOPES.RECORDSEARCH),
|
6122
|
+
import_zod31.z.literal(SCOPES.RECORD_IMPORT),
|
6123
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
|
6124
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
|
6125
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_DEATH),
|
6126
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION),
|
6127
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE),
|
6128
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION),
|
6129
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE),
|
6130
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW),
|
6131
|
+
import_zod31.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS),
|
6132
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL),
|
6133
|
+
import_zod31.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES),
|
6134
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_EDIT),
|
6135
|
+
import_zod31.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES),
|
6136
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE),
|
6137
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE),
|
6138
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTER),
|
6139
|
+
import_zod31.z.literal(SCOPES.RECORD_EXPORT_RECORDS),
|
6140
|
+
import_zod31.z.literal(SCOPES.RECORD_DECLARATION_PRINT),
|
6141
|
+
import_zod31.z.literal(SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS),
|
6142
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_PRINT),
|
6143
|
+
import_zod31.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES),
|
6144
|
+
import_zod31.z.literal(SCOPES.RECORD_PRINT_CERTIFIED_COPIES),
|
6145
|
+
import_zod31.z.literal(SCOPES.RECORD_BULK_PRINT_CERTIFIED_COPIES),
|
6146
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_VERIFY_CERTIFIED_COPIES),
|
6147
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION),
|
6148
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT),
|
6149
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REVOCATION),
|
6150
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REVOKE),
|
6151
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REINSTATEMENT),
|
6152
|
+
import_zod31.z.literal(SCOPES.RECORD_REGISTRATION_REINSTATE),
|
6153
|
+
import_zod31.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION),
|
6154
|
+
import_zod31.z.literal(SCOPES.RECORD_REJECT_REGISTRATION),
|
6155
|
+
import_zod31.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION),
|
6156
|
+
import_zod31.z.literal(SCOPES.SEARCH_BIRTH),
|
6157
|
+
import_zod31.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION),
|
6158
|
+
import_zod31.z.literal(SCOPES.SEARCH_DEATH),
|
6159
|
+
import_zod31.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION),
|
6160
|
+
import_zod31.z.literal(SCOPES.SEARCH_MARRIAGE),
|
6161
|
+
import_zod31.z.literal(SCOPES.RECORD_READ),
|
6162
|
+
import_zod31.z.literal(SCOPES.RECORD_READ_AUDIT),
|
6163
|
+
import_zod31.z.literal(SCOPES.RECORD_READ_COMMENTS),
|
6164
|
+
import_zod31.z.literal(SCOPES.RECORD_CREATE_COMMENTS),
|
6165
|
+
import_zod31.z.literal(SCOPES.PROFILE_UPDATE),
|
6166
|
+
import_zod31.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE),
|
6167
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE_READ),
|
6168
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS),
|
6169
|
+
import_zod31.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS),
|
6170
|
+
import_zod31.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS),
|
6171
|
+
import_zod31.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE),
|
6172
|
+
import_zod31.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION),
|
6173
|
+
import_zod31.z.literal(SCOPES.USER_READ),
|
6174
|
+
import_zod31.z.literal(SCOPES.USER_READ_MY_OFFICE),
|
6175
|
+
import_zod31.z.literal(SCOPES.USER_READ_MY_JURISDICTION),
|
6176
|
+
import_zod31.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT),
|
6177
|
+
import_zod31.z.literal(SCOPES.USER_CREATE),
|
6178
|
+
import_zod31.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION),
|
6179
|
+
import_zod31.z.literal(SCOPES.USER_UPDATE),
|
6180
|
+
import_zod31.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION),
|
6181
|
+
import_zod31.z.literal(SCOPES.CONFIG_UPDATE_ALL),
|
6182
|
+
import_zod31.z.literal(SCOPES.USER_DATA_SEEDING)
|
6183
|
+
]);
|
6184
|
+
var rawConfigurableScopeRegex = /^([a-zA-Z\.]+)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
|
6185
|
+
var rawConfigurableScope = import_zod31.z.string().regex(rawConfigurableScopeRegex);
|
6186
|
+
var CreateUserScope = import_zod31.z.object({
|
6187
|
+
type: import_zod31.z.literal("user.create"),
|
6188
|
+
options: import_zod31.z.object({
|
6189
|
+
role: import_zod31.z.array(import_zod31.z.string())
|
6190
|
+
})
|
6191
|
+
});
|
6192
|
+
var EditUserScope = import_zod31.z.object({
|
6193
|
+
type: import_zod31.z.literal("user.edit"),
|
6194
|
+
options: import_zod31.z.object({
|
6195
|
+
role: import_zod31.z.array(import_zod31.z.string())
|
6196
|
+
})
|
6197
|
+
});
|
6198
|
+
var WorkqueueScope = import_zod31.z.object({
|
6199
|
+
type: import_zod31.z.literal("workqueue"),
|
6200
|
+
options: import_zod31.z.object({
|
6201
|
+
id: import_zod31.z.array(import_zod31.z.string())
|
6202
|
+
})
|
6203
|
+
});
|
6204
|
+
var NotifyRecordScope = import_zod31.z.object({
|
6205
|
+
type: import_zod31.z.literal("record.notify"),
|
6206
|
+
options: import_zod31.z.object({
|
6207
|
+
event: import_zod31.z.array(import_zod31.z.string())
|
6208
|
+
})
|
6209
|
+
});
|
6210
|
+
var ConfigurableScopes = import_zod31.z.discriminatedUnion("type", [
|
6211
|
+
CreateUserScope,
|
6212
|
+
EditUserScope,
|
6213
|
+
WorkqueueScope,
|
6214
|
+
NotifyRecordScope
|
6215
|
+
]);
|
4911
6216
|
var scopes = Object.values(SCOPES);
|
4912
6217
|
|
4913
6218
|
// ../commons/src/events/scopes.ts
|
4914
|
-
function hasAnyOfScopes(a, b) {
|
4915
|
-
return (0, import_lodash3.intersection)(a, b).length > 0;
|
4916
|
-
}
|
4917
6219
|
var CONFIG_GET_ALLOWED_SCOPES = [
|
4918
6220
|
SCOPES.RECORD_DECLARE,
|
4919
6221
|
SCOPES.RECORD_READ,
|
@@ -4971,6 +6273,28 @@ var ACTION_ALLOWED_SCOPES = {
|
|
4971
6273
|
[ActionType.UNASSIGN]: null,
|
4972
6274
|
[ActionType.DETECT_DUPLICATE]: []
|
4973
6275
|
};
|
6276
|
+
var ACTION_ALLOWED_CONFIGURABLE_SCOPES = {
|
6277
|
+
[ActionType.READ]: [],
|
6278
|
+
[ActionType.CREATE]: ["record.notify"],
|
6279
|
+
[ActionType.NOTIFY]: ["record.notify"],
|
6280
|
+
[ActionType.DECLARE]: [],
|
6281
|
+
[ActionType.DELETE]: [],
|
6282
|
+
[ActionType.VALIDATE]: [],
|
6283
|
+
[ActionType.REGISTER]: [],
|
6284
|
+
[ActionType.PRINT_CERTIFICATE]: [],
|
6285
|
+
[ActionType.REQUEST_CORRECTION]: [],
|
6286
|
+
[ActionType.REJECT_CORRECTION]: [],
|
6287
|
+
[ActionType.APPROVE_CORRECTION]: [],
|
6288
|
+
[ActionType.MARKED_AS_DUPLICATE]: [],
|
6289
|
+
[ActionType.ARCHIVE]: [],
|
6290
|
+
[ActionType.REJECT]: [],
|
6291
|
+
[ActionType.ASSIGN]: [],
|
6292
|
+
[ActionType.UNASSIGN]: [],
|
6293
|
+
[ActionType.DETECT_DUPLICATE]: []
|
6294
|
+
};
|
6295
|
+
function hasAnyOfScopes(a, b) {
|
6296
|
+
return (0, import_lodash3.intersection)(a, b).length > 0;
|
6297
|
+
}
|
4974
6298
|
function filterUnallowedActions(actions, userScopes) {
|
4975
6299
|
const allowedActions = actions.filter((action) => {
|
4976
6300
|
const requiredScopes = ACTION_ALLOWED_SCOPES[action];
|
@@ -4980,10 +6304,72 @@ function filterUnallowedActions(actions, userScopes) {
|
|
4980
6304
|
return hasAnyOfScopes(userScopes, requiredScopes);
|
4981
6305
|
});
|
4982
6306
|
const hasOtherAllowedActions = allowedActions.some(
|
4983
|
-
(action) => action
|
6307
|
+
(action) => !isMetaAction(action)
|
4984
6308
|
);
|
4985
6309
|
if (hasOtherAllowedActions) {
|
4986
6310
|
return allowedActions;
|
4987
6311
|
}
|
4988
6312
|
return [ActionType.READ];
|
4989
6313
|
}
|
6314
|
+
|
6315
|
+
// ../commons/src/events/serializers/user/deserializer.ts
|
6316
|
+
var import_zod32 = require("zod");
|
6317
|
+
var UserWithPrimaryOffice = User.extend({
|
6318
|
+
primaryOfficeId: import_zod32.z.string()
|
6319
|
+
});
|
6320
|
+
function userDeserializer(serializedUserField, user2) {
|
6321
|
+
if (typeof serializedUserField === "string") {
|
6322
|
+
return serializedUserField;
|
6323
|
+
}
|
6324
|
+
if (serializedUserField.$userField === "name" || serializedUserField.$userField === "signatureFilename") {
|
6325
|
+
throw new Error(
|
6326
|
+
`Deserializer for ${serializedUserField.$userField} is not implemented yet`
|
6327
|
+
);
|
6328
|
+
}
|
6329
|
+
return user2[serializedUserField.$userField];
|
6330
|
+
}
|
6331
|
+
function deserializeQueryExpression(expression, user2) {
|
6332
|
+
return {
|
6333
|
+
...expression,
|
6334
|
+
assignedTo: expression.assignedTo && {
|
6335
|
+
...expression.assignedTo,
|
6336
|
+
term: userDeserializer(expression.assignedTo.term, user2)
|
6337
|
+
},
|
6338
|
+
createdBy: expression.createdBy && {
|
6339
|
+
...expression.createdBy,
|
6340
|
+
term: userDeserializer(expression.createdBy.term, user2)
|
6341
|
+
},
|
6342
|
+
updatedBy: expression.updatedBy && {
|
6343
|
+
...expression.updatedBy,
|
6344
|
+
term: userDeserializer(expression.updatedBy.term, user2)
|
6345
|
+
},
|
6346
|
+
createdAtLocation: expression.createdAtLocation && (expression.createdAtLocation.type === "within" ? {
|
6347
|
+
...expression.createdAtLocation,
|
6348
|
+
location: userDeserializer(
|
6349
|
+
expression.createdAtLocation.location,
|
6350
|
+
user2
|
6351
|
+
)
|
6352
|
+
} : {
|
6353
|
+
...expression.createdAtLocation,
|
6354
|
+
term: userDeserializer(expression.createdAtLocation.term, user2)
|
6355
|
+
}),
|
6356
|
+
updatedAtLocation: expression.updatedAtLocation && (expression.updatedAtLocation.type === "within" ? {
|
6357
|
+
...expression.updatedAtLocation,
|
6358
|
+
location: userDeserializer(
|
6359
|
+
expression.updatedAtLocation.location,
|
6360
|
+
user2
|
6361
|
+
)
|
6362
|
+
} : {
|
6363
|
+
...expression.updatedAtLocation,
|
6364
|
+
term: userDeserializer(expression.updatedAtLocation.term, user2)
|
6365
|
+
})
|
6366
|
+
};
|
6367
|
+
}
|
6368
|
+
function deserializeQuery(query, user2) {
|
6369
|
+
return {
|
6370
|
+
...query,
|
6371
|
+
clauses: query.clauses.map(
|
6372
|
+
(clause) => deserializeQueryExpression(clause, user2)
|
6373
|
+
)
|
6374
|
+
};
|
6375
|
+
}
|