@opencrvs/toolkit 1.8.0-rc.ffe8c17 → 1.8.1-rc.1e3e9b5

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