@opencrvs/toolkit 1.8.0-rc.fa72fdf → 1.8.0-rc.fa82472

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.
Files changed (47) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +21601 -10324
  3. package/dist/commons/conditionals/conditionals.d.ts +37 -6
  4. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  5. package/dist/commons/conditionals/validate.d.ts +18 -17
  6. package/dist/commons/events/ActionConfig.d.ts +116825 -2069
  7. package/dist/commons/events/ActionDocument.d.ts +11604 -401
  8. package/dist/commons/events/ActionInput.d.ts +6659 -522
  9. package/dist/commons/events/ActionType.d.ts +32 -11
  10. package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
  11. package/dist/commons/events/CompositeFieldValue.d.ts +183 -2
  12. package/dist/commons/events/Conditional.d.ts +21 -5
  13. package/dist/commons/events/Constants.d.ts +3 -0
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +3068 -0
  15. package/dist/commons/events/CreatedAtLocation.d.ts +3 -0
  16. package/dist/commons/events/Draft.d.ts +481 -59
  17. package/dist/commons/events/EventConfig.d.ts +56158 -1798
  18. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  19. package/dist/commons/events/EventDocument.d.ts +4728 -568
  20. package/dist/commons/events/EventIndex.d.ts +2026 -22
  21. package/dist/commons/events/EventMetadata.d.ts +332 -40
  22. package/dist/commons/events/FieldConfig.d.ts +5823 -973
  23. package/dist/commons/events/FieldType.d.ts +7 -3
  24. package/dist/commons/events/FieldTypeMapping.d.ts +208 -38
  25. package/dist/commons/events/FieldValue.d.ts +123 -8
  26. package/dist/commons/events/FormConfig.d.ts +49317 -90
  27. package/dist/commons/events/PageConfig.d.ts +12337 -0
  28. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  29. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  30. package/dist/commons/events/User.d.ts +31 -2
  31. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  32. package/dist/commons/events/WorkqueueConfig.d.ts +6290 -20
  33. package/dist/commons/events/defineConfig.d.ts +9111 -301
  34. package/dist/commons/events/event.d.ts +54 -0
  35. package/dist/commons/events/field.d.ts +77 -0
  36. package/dist/commons/events/index.d.ts +9 -1
  37. package/dist/commons/events/scopes.d.ts +51 -0
  38. package/dist/commons/events/serializer.d.ts +2 -0
  39. package/dist/commons/events/test.utils.d.ts +233 -224
  40. package/dist/commons/events/utils.d.ts +13421 -94
  41. package/dist/commons/events/utils.test.d.ts +2 -0
  42. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  43. package/dist/conditionals/index.js +233 -108
  44. package/dist/events/index.js +4969 -1854
  45. package/dist/scopes/index.d.ts +161 -1
  46. package/dist/scopes/index.js +202 -1
  47. package/package.json +3 -2
@@ -1,39 +1,33 @@
1
- import { ActionDocument } from './ActionDocument';
2
- import { ArchiveActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, ValidateActionInput } from './ActionInput';
1
+ import { ActionDocument, EventState } from './ActionDocument';
2
+ import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
3
3
  import { ActionType } from './ActionType';
4
4
  import { Draft } from './Draft';
5
5
  import { EventConfig } from './EventConfig';
6
6
  import { EventDocument } from './EventDocument';
7
7
  import { EventIndex } from './EventIndex';
8
8
  import { EventInput } from './EventInput';
9
+ import { TranslationConfig } from './TranslationConfig';
10
+ import { FieldConfig } from './FieldConfig';
11
+ import { WorkqueueConfig } from './WorkqueueConfig';
9
12
  import { FieldValue } from './FieldValue';
10
- export declare function generateActionInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | {
11
- type: string;
12
- filename: string;
13
- originalFilename: string;
14
- } | {
15
- country: string;
16
- district: string;
17
- province: string;
18
- urbanOrRural: "URBAN";
19
- number?: string | undefined;
20
- town?: string | undefined;
21
- residentialArea?: string | undefined;
22
- street?: string | undefined;
23
- zipCode?: string | undefined;
24
- } | {
25
- country: string;
26
- district: string;
27
- province: string;
28
- urbanOrRural: "RURAL";
29
- village?: string | undefined;
30
- } | {
31
- type: string;
32
- option: string;
33
- filename: string;
34
- originalFilename: string;
35
- }[]>;
36
- export declare const eventPayloadGenerator: {
13
+ import { z } from 'zod';
14
+ /**
15
+ * In real application, the roles are defined in the countryconfig.
16
+ * These are just for testing purposes to generate realistic mock data.
17
+ */
18
+ export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT"]>;
19
+ export type TestUserRole = z.infer<typeof TestUserRole>;
20
+ export declare function generateRandomName(rng: () => number): {
21
+ firstname: string;
22
+ surname: string;
23
+ };
24
+ /**
25
+ * Quick-and-dirty mock data generator for event actions.
26
+ */
27
+ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
28
+ export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
29
+ export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
30
+ export declare function eventPayloadGenerator(rng: () => number): {
37
31
  create: (input?: Partial<EventInput>) => {
38
32
  transactionId: string;
39
33
  type: string;
@@ -43,41 +37,21 @@ export declare const eventPayloadGenerator: {
43
37
  type: string;
44
38
  id: string;
45
39
  };
46
- draft: (eventId: string, input?: Partial<Draft>) => {
47
- id: import("../uuid").UUID;
48
- eventId: string;
49
- createdAt: string;
50
- transactionId: import("../uuid").UUID;
51
- action: {
52
- type: "REQUEST_CORRECTION";
53
- data: {
54
- 'applicant.firstname': string;
55
- 'applicant.surname': string;
56
- 'applicant.dob': string;
57
- 'recommender.none': boolean;
58
- };
59
- metadata: {
60
- 'correction.requester.relationship': string;
61
- 'correction.request.reason': string;
62
- };
63
- createdAt: string;
64
- createdBy: string;
65
- createdAtLocation: string;
66
- };
67
- } & Partial<{
68
- id: string;
69
- createdAt: string;
40
+ draft: ({ eventId, actionType }: {
70
41
  eventId: string;
71
- transactionId: string;
72
- action: {
73
- type: ActionType;
74
- data: Record<string, string | number | boolean | {
42
+ actionType: ActionType;
43
+ }, input?: Partial<Draft>) => Draft;
44
+ actions: {
45
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
46
+ transactionId: string;
47
+ declaration: Record<string, string | number | boolean | {
75
48
  type: string;
76
49
  filename: string;
77
50
  originalFilename: string;
78
51
  } | {
79
52
  country: string;
80
53
  district: string;
54
+ addressType: "DOMESTIC";
81
55
  province: string;
82
56
  urbanOrRural: "URBAN";
83
57
  number?: string | null | undefined;
@@ -85,60 +59,52 @@ export declare const eventPayloadGenerator: {
85
59
  residentialArea?: string | null | undefined;
86
60
  street?: string | null | undefined;
87
61
  zipCode?: string | null | undefined;
62
+ } | {
63
+ firstname: string;
64
+ surname: string;
65
+ middlename?: string | null | undefined;
88
66
  } | {
89
67
  country: string;
90
68
  district: string;
69
+ addressType: "DOMESTIC";
91
70
  province: string;
92
71
  urbanOrRural: "RURAL";
93
72
  village?: string | null | undefined;
94
- } | {
95
- type: string;
96
- option: string;
97
- filename: string;
98
- originalFilename: string;
99
- }[]>;
100
- createdAt: string;
101
- createdBy: string;
102
- createdAtLocation: string;
103
- metadata?: Record<string, string | number | boolean | {
104
- type: string;
105
- filename: string;
106
- originalFilename: string;
107
73
  } | {
108
74
  country: string;
109
- district: string;
110
- province: string;
111
- urbanOrRural: "URBAN";
112
- number?: string | null | undefined;
113
- town?: string | null | undefined;
114
- residentialArea?: string | null | undefined;
115
- street?: string | null | undefined;
116
- zipCode?: string | null | undefined;
117
- } | {
118
- country: string;
119
- district: string;
120
- province: string;
121
- urbanOrRural: "RURAL";
122
- village?: string | null | undefined;
75
+ state: string;
76
+ addressType: "INTERNATIONAL";
77
+ district2: string;
78
+ cityOrTown?: string | null | undefined;
79
+ addressLine1?: string | null | undefined;
80
+ addressLine2?: string | null | undefined;
81
+ addressLine3?: string | null | undefined;
82
+ postcodeOrZip?: string | null | undefined;
123
83
  } | {
124
84
  type: string;
125
85
  option: string;
126
86
  filename: string;
127
87
  originalFilename: string;
128
- }[]> | undefined;
129
- };
130
- }>;
131
- actions: {
132
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "data">>) => {
88
+ }[] | [string, string] | null | undefined>;
89
+ annotation: {};
90
+ keepAssignment?: boolean | undefined;
133
91
  type: "DECLARE";
92
+ eventId: string;
93
+ };
94
+ /**
95
+ * Notify allows sending incomplete data. Think it as 'partial declare' for now.
96
+ */
97
+ notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
98
+ type: "NOTIFY";
134
99
  transactionId: string;
135
- data: Record<string, string | number | boolean | {
100
+ declaration: Record<string, string | number | boolean | {
136
101
  type: string;
137
102
  filename: string;
138
103
  originalFilename: string;
139
104
  } | {
140
105
  country: string;
141
106
  district: string;
107
+ addressType: "DOMESTIC";
142
108
  province: string;
143
109
  urbanOrRural: "URBAN";
144
110
  number?: string | null | undefined;
@@ -146,30 +112,46 @@ export declare const eventPayloadGenerator: {
146
112
  residentialArea?: string | null | undefined;
147
113
  street?: string | null | undefined;
148
114
  zipCode?: string | null | undefined;
115
+ } | {
116
+ firstname: string;
117
+ surname: string;
118
+ middlename?: string | null | undefined;
149
119
  } | {
150
120
  country: string;
151
121
  district: string;
122
+ addressType: "DOMESTIC";
152
123
  province: string;
153
124
  urbanOrRural: "RURAL";
154
125
  village?: string | null | undefined;
126
+ } | {
127
+ country: string;
128
+ state: string;
129
+ addressType: "INTERNATIONAL";
130
+ district2: string;
131
+ cityOrTown?: string | null | undefined;
132
+ addressLine1?: string | null | undefined;
133
+ addressLine2?: string | null | undefined;
134
+ addressLine3?: string | null | undefined;
135
+ postcodeOrZip?: string | null | undefined;
155
136
  } | {
156
137
  type: string;
157
138
  option: string;
158
139
  filename: string;
159
140
  originalFilename: string;
160
- }[]>;
141
+ }[] | [string, string] | null | undefined>;
161
142
  eventId: string;
143
+ keepAssignment: boolean | undefined;
162
144
  };
163
- validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "data">>) => {
164
- type: "VALIDATE";
145
+ validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
165
146
  transactionId: string;
166
- data: Record<string, string | number | boolean | {
147
+ declaration: Record<string, string | number | boolean | {
167
148
  type: string;
168
149
  filename: string;
169
150
  originalFilename: string;
170
151
  } | {
171
152
  country: string;
172
153
  district: string;
154
+ addressType: "DOMESTIC";
173
155
  province: string;
174
156
  urbanOrRural: "URBAN";
175
157
  number?: string | null | undefined;
@@ -177,31 +159,63 @@ export declare const eventPayloadGenerator: {
177
159
  residentialArea?: string | null | undefined;
178
160
  street?: string | null | undefined;
179
161
  zipCode?: string | null | undefined;
162
+ } | {
163
+ firstname: string;
164
+ surname: string;
165
+ middlename?: string | null | undefined;
180
166
  } | {
181
167
  country: string;
182
168
  district: string;
169
+ addressType: "DOMESTIC";
183
170
  province: string;
184
171
  urbanOrRural: "RURAL";
185
172
  village?: string | null | undefined;
173
+ } | {
174
+ country: string;
175
+ state: string;
176
+ addressType: "INTERNATIONAL";
177
+ district2: string;
178
+ cityOrTown?: string | null | undefined;
179
+ addressLine1?: string | null | undefined;
180
+ addressLine2?: string | null | undefined;
181
+ addressLine3?: string | null | undefined;
182
+ postcodeOrZip?: string | null | undefined;
186
183
  } | {
187
184
  type: string;
188
185
  option: string;
189
186
  filename: string;
190
187
  originalFilename: string;
191
- }[]>;
188
+ }[] | [string, string] | null | undefined>;
189
+ annotation: {};
190
+ keepAssignment?: boolean | undefined;
191
+ type: "VALIDATE";
192
192
  duplicates: never[];
193
193
  eventId: string;
194
194
  };
195
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "data">>, isDuplicate?: boolean) => {
196
- type: "ARCHIVE";
195
+ assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
196
+ type: "ASSIGN";
197
+ transactionId: string;
198
+ declaration: {};
199
+ assignedTo: string;
200
+ eventId: string;
201
+ };
202
+ unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
203
+ type: "UNASSIGN";
197
204
  transactionId: string;
198
- data: Record<string, string | number | boolean | {
205
+ declaration: {};
206
+ assignedTo: null;
207
+ eventId: string;
208
+ };
209
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
210
+ transactionId: string;
211
+ declaration: Record<string, string | number | boolean | {
199
212
  type: string;
200
213
  filename: string;
201
214
  originalFilename: string;
202
215
  } | {
203
216
  country: string;
204
217
  district: string;
218
+ addressType: "DOMESTIC";
205
219
  province: string;
206
220
  urbanOrRural: "URBAN";
207
221
  number?: string | null | undefined;
@@ -209,66 +223,65 @@ export declare const eventPayloadGenerator: {
209
223
  residentialArea?: string | null | undefined;
210
224
  street?: string | null | undefined;
211
225
  zipCode?: string | null | undefined;
226
+ } | {
227
+ firstname: string;
228
+ surname: string;
229
+ middlename?: string | null | undefined;
212
230
  } | {
213
231
  country: string;
214
232
  district: string;
233
+ addressType: "DOMESTIC";
215
234
  province: string;
216
235
  urbanOrRural: "RURAL";
217
236
  village?: string | null | undefined;
237
+ } | {
238
+ country: string;
239
+ state: string;
240
+ addressType: "INTERNATIONAL";
241
+ district2: string;
242
+ cityOrTown?: string | null | undefined;
243
+ addressLine1?: string | null | undefined;
244
+ addressLine2?: string | null | undefined;
245
+ addressLine3?: string | null | undefined;
246
+ postcodeOrZip?: string | null | undefined;
218
247
  } | {
219
248
  type: string;
220
249
  option: string;
221
250
  filename: string;
222
251
  originalFilename: string;
223
- }[]>;
224
- metadata: {
225
- isDuplicate: boolean;
226
- };
252
+ }[] | [string, string] | null | undefined>;
253
+ keepAssignment?: boolean | undefined;
254
+ type: "ARCHIVE";
255
+ annotation: {};
227
256
  duplicates: never[];
228
257
  eventId: string;
258
+ reason: {
259
+ message: string;
260
+ isDuplicate: boolean;
261
+ };
229
262
  };
230
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "data">>) => {
231
- type: "REJECT";
263
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
232
264
  transactionId: string;
233
- data: Record<string, string | number | boolean | {
234
- type: string;
235
- filename: string;
236
- originalFilename: string;
237
- } | {
238
- country: string;
239
- district: string;
240
- province: string;
241
- urbanOrRural: "URBAN";
242
- number?: string | null | undefined;
243
- town?: string | null | undefined;
244
- residentialArea?: string | null | undefined;
245
- street?: string | null | undefined;
246
- zipCode?: string | null | undefined;
247
- } | {
248
- country: string;
249
- district: string;
250
- province: string;
251
- urbanOrRural: "RURAL";
252
- village?: string | null | undefined;
253
- } | {
254
- type: string;
255
- option: string;
256
- filename: string;
257
- originalFilename: string;
258
- }[]>;
265
+ annotation: {};
266
+ keepAssignment?: boolean | undefined;
267
+ type: "REJECT";
268
+ declaration: {};
259
269
  duplicates: never[];
260
270
  eventId: string;
271
+ reason: {
272
+ message: string;
273
+ };
261
274
  };
262
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "data">>) => {
263
- type: "REGISTER";
275
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
264
276
  transactionId: string;
265
- data: Record<string, string | number | boolean | {
277
+ declaration: Record<string, string | number | boolean | {
266
278
  type: string;
267
279
  filename: string;
268
280
  originalFilename: string;
269
281
  } | {
270
282
  country: string;
271
283
  district: string;
284
+ addressType: "DOMESTIC";
272
285
  province: string;
273
286
  urbanOrRural: "URBAN";
274
287
  number?: string | null | undefined;
@@ -276,62 +289,58 @@ export declare const eventPayloadGenerator: {
276
289
  residentialArea?: string | null | undefined;
277
290
  street?: string | null | undefined;
278
291
  zipCode?: string | null | undefined;
292
+ } | {
293
+ firstname: string;
294
+ surname: string;
295
+ middlename?: string | null | undefined;
279
296
  } | {
280
297
  country: string;
281
298
  district: string;
299
+ addressType: "DOMESTIC";
282
300
  province: string;
283
301
  urbanOrRural: "RURAL";
284
302
  village?: string | null | undefined;
303
+ } | {
304
+ country: string;
305
+ state: string;
306
+ addressType: "INTERNATIONAL";
307
+ district2: string;
308
+ cityOrTown?: string | null | undefined;
309
+ addressLine1?: string | null | undefined;
310
+ addressLine2?: string | null | undefined;
311
+ addressLine3?: string | null | undefined;
312
+ postcodeOrZip?: string | null | undefined;
285
313
  } | {
286
314
  type: string;
287
315
  option: string;
288
316
  filename: string;
289
317
  originalFilename: string;
290
- }[]>;
318
+ }[] | [string, string] | null | undefined>;
319
+ annotation: {};
320
+ keepAssignment?: boolean | undefined;
321
+ type: "REGISTER";
291
322
  eventId: string;
292
323
  };
293
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "data">>) => {
294
- type: "PRINT_CERTIFICATE";
324
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
295
325
  transactionId: string;
296
- data: Record<string, string | number | boolean | {
297
- type: string;
298
- filename: string;
299
- originalFilename: string;
300
- } | {
301
- country: string;
302
- district: string;
303
- province: string;
304
- urbanOrRural: "URBAN";
305
- number?: string | null | undefined;
306
- town?: string | null | undefined;
307
- residentialArea?: string | null | undefined;
308
- street?: string | null | undefined;
309
- zipCode?: string | null | undefined;
310
- } | {
311
- country: string;
312
- district: string;
313
- province: string;
314
- urbanOrRural: "RURAL";
315
- village?: string | null | undefined;
316
- } | {
317
- type: string;
318
- option: string;
319
- filename: string;
320
- originalFilename: string;
321
- }[]>;
326
+ annotation: {};
327
+ keepAssignment?: boolean | undefined;
328
+ type: "PRINT_CERTIFICATE";
329
+ declaration: {};
322
330
  eventId: string;
323
331
  };
324
332
  correction: {
325
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
333
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
326
334
  type: "REQUEST_CORRECTION";
327
335
  transactionId: string;
328
- data: Record<string, string | number | boolean | {
336
+ declaration: Record<string, string | number | boolean | {
329
337
  type: string;
330
338
  filename: string;
331
339
  originalFilename: string;
332
340
  } | {
333
341
  country: string;
334
342
  district: string;
343
+ addressType: "DOMESTIC";
335
344
  province: string;
336
345
  urbanOrRural: "URBAN";
337
346
  number?: string | null | undefined;
@@ -339,97 +348,97 @@ export declare const eventPayloadGenerator: {
339
348
  residentialArea?: string | null | undefined;
340
349
  street?: string | null | undefined;
341
350
  zipCode?: string | null | undefined;
351
+ } | {
352
+ firstname: string;
353
+ surname: string;
354
+ middlename?: string | null | undefined;
342
355
  } | {
343
356
  country: string;
344
357
  district: string;
358
+ addressType: "DOMESTIC";
345
359
  province: string;
346
360
  urbanOrRural: "RURAL";
347
361
  village?: string | null | undefined;
362
+ } | {
363
+ country: string;
364
+ state: string;
365
+ addressType: "INTERNATIONAL";
366
+ district2: string;
367
+ cityOrTown?: string | null | undefined;
368
+ addressLine1?: string | null | undefined;
369
+ addressLine2?: string | null | undefined;
370
+ addressLine3?: string | null | undefined;
371
+ postcodeOrZip?: string | null | undefined;
348
372
  } | {
349
373
  type: string;
350
374
  option: string;
351
375
  filename: string;
352
376
  originalFilename: string;
353
- }[]>;
354
- metadata: {};
377
+ }[] | [string, string] | null | undefined>;
378
+ annotation: {};
355
379
  eventId: string;
380
+ keepAssignment: boolean | undefined;
356
381
  };
357
- approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
382
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
358
383
  type: "APPROVE_CORRECTION";
359
384
  transactionId: string;
360
- data: Record<string, string | number | boolean | {
361
- type: string;
362
- filename: string;
363
- originalFilename: string;
364
- } | {
365
- country: string;
366
- district: string;
367
- province: string;
368
- urbanOrRural: "URBAN";
369
- number?: string | null | undefined;
370
- town?: string | null | undefined;
371
- residentialArea?: string | null | undefined;
372
- street?: string | null | undefined;
373
- zipCode?: string | null | undefined;
374
- } | {
375
- country: string;
376
- district: string;
377
- province: string;
378
- urbanOrRural: "RURAL";
379
- village?: string | null | undefined;
380
- } | {
381
- type: string;
382
- option: string;
383
- filename: string;
384
- originalFilename: string;
385
- }[]>;
385
+ declaration: {};
386
+ annotation: {};
386
387
  eventId: string;
387
388
  requestId: string;
389
+ keepAssignment: boolean | undefined;
388
390
  };
389
- reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
391
+ reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
390
392
  type: "REJECT_CORRECTION";
391
393
  transactionId: string;
392
- data: Record<string, string | number | boolean | {
393
- type: string;
394
- filename: string;
395
- originalFilename: string;
396
- } | {
397
- country: string;
398
- district: string;
399
- province: string;
400
- urbanOrRural: "URBAN";
401
- number?: string | null | undefined;
402
- town?: string | null | undefined;
403
- residentialArea?: string | null | undefined;
404
- street?: string | null | undefined;
405
- zipCode?: string | null | undefined;
406
- } | {
407
- country: string;
408
- district: string;
409
- province: string;
410
- urbanOrRural: "RURAL";
411
- village?: string | null | undefined;
412
- } | {
413
- type: string;
414
- option: string;
415
- filename: string;
416
- originalFilename: string;
417
- }[]>;
394
+ declaration: {};
395
+ annotation: {};
418
396
  eventId: string;
419
397
  requestId: string;
398
+ keepAssignment: boolean | undefined;
420
399
  };
421
400
  };
422
401
  };
423
402
  };
424
- export declare function generateActionDocument({ configuration, action, defaults }: {
403
+ export declare function generateActionDocument({ configuration, action, rng, defaults }: {
425
404
  configuration: EventConfig;
426
405
  action: ActionType;
406
+ rng?: () => number;
427
407
  defaults?: Partial<ActionDocument>;
408
+ user?: Partial<{
409
+ signature: string;
410
+ primaryOfficeId: string;
411
+ role: TestUserRole;
412
+ id: string;
413
+ }>;
428
414
  }): ActionDocument;
429
- export declare function generateEventDocument({ configuration, actions }: {
415
+ export declare function generateEventDocument({ configuration, actions, rng }: {
430
416
  configuration: EventConfig;
431
417
  actions: ActionType[];
418
+ rng?: () => number;
432
419
  }): EventDocument;
433
- export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, data?: Record<string, FieldValue>): Draft;
434
- export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex;
420
+ export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
421
+ eventId: string;
422
+ actionType: ActionType;
423
+ rng?: () => number;
424
+ declaration?: EventState;
425
+ }): Draft;
426
+ export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
427
+ export declare function getRandomDate(rng: () => number, start: string, end: string): string;
428
+ /**
429
+ * Useful for testing when we need deterministic outcome.
430
+ * @param seed - Seed value for the pseudo-random number generator
431
+ *
432
+ * @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
433
+ */
434
+ export declare function createPrng(seed: number): () => number;
435
+ export declare function generateRandomSignature(rng: () => number): string;
436
+ export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
437
+ export declare const generateTranslationConfig: (message: string) => TranslationConfig;
438
+ export declare const BearerTokenByUserType: {
439
+ fieldAgent: string;
440
+ registrationAgent: string;
441
+ localRegistrar: string;
442
+ };
443
+ export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
435
444
  //# sourceMappingURL=test.utils.d.ts.map