@opencrvs/toolkit 1.8.0-rc.feef45c → 1.8.0-rc.fef0fdd

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 (43) hide show
  1. package/dist/commons/api/router.d.ts +9340 -7709
  2. package/dist/commons/conditionals/conditionals.d.ts +8 -3
  3. package/dist/commons/conditionals/validate.d.ts +6 -0
  4. package/dist/commons/events/ActionConfig.d.ts +72517 -38926
  5. package/dist/commons/events/ActionDocument.d.ts +2375 -665
  6. package/dist/commons/events/ActionInput.d.ts +1639 -367
  7. package/dist/commons/events/ActionType.d.ts +6 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +913 -48
  9. package/dist/commons/events/CompositeFieldValue.d.ts +28 -0
  10. package/dist/commons/events/Constants.d.ts +3 -0
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +3068 -0
  12. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  13. package/dist/commons/events/Draft.d.ts +148 -44
  14. package/dist/commons/events/EventConfig.d.ts +28287 -11538
  15. package/dist/commons/events/EventDocument.d.ts +1479 -492
  16. package/dist/commons/events/EventIndex.d.ts +1433 -343
  17. package/dist/commons/events/EventInput.d.ts +0 -13
  18. package/dist/commons/events/EventMetadata.d.ts +325 -46
  19. package/dist/commons/events/FieldConfig.d.ts +2962 -1131
  20. package/dist/commons/events/FieldType.d.ts +6 -2
  21. package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
  22. package/dist/commons/events/FieldValue.d.ts +48 -7
  23. package/dist/commons/events/FormConfig.d.ts +20532 -9126
  24. package/dist/commons/events/PageConfig.d.ts +4906 -2112
  25. package/dist/commons/events/SummaryConfig.d.ts +17 -5
  26. package/dist/commons/events/User.d.ts +31 -7
  27. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  28. package/dist/commons/events/WorkqueueConfig.d.ts +6262 -16
  29. package/dist/commons/events/defineConfig.d.ts +3204 -625
  30. package/dist/commons/events/event.d.ts +37 -8
  31. package/dist/commons/events/field.d.ts +34 -20
  32. package/dist/commons/events/index.d.ts +5 -0
  33. package/dist/commons/events/scopes.d.ts +21 -3
  34. package/dist/commons/events/serializer.d.ts +2 -0
  35. package/dist/commons/events/test.utils.d.ts +171 -42
  36. package/dist/commons/events/transactions.d.ts +1 -1
  37. package/dist/commons/events/utils.d.ts +10720 -321
  38. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  39. package/dist/conditionals/index.js +45 -8
  40. package/dist/events/index.js +4184 -1930
  41. package/dist/scopes/index.d.ts +161 -1
  42. package/dist/scopes/index.js +202 -1
  43. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import { EventFieldId } from './AdvancedSearchConfig';
2
2
  import { SelectOption } from './FieldConfig';
3
+ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
3
4
  /**
4
5
  * Creates a function that acts like a callable + static method container.
5
6
  *
@@ -8,17 +9,45 @@ import { SelectOption } from './FieldConfig';
8
9
  * event.hasAction('CLICKED') // → returns conditional
9
10
  */
10
11
  declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
11
- fieldId: "status" | "trackingId";
12
- options: {
13
- value: string;
14
- label: import("./TranslationConfig").TranslationConfig;
15
- }[] | undefined;
16
- config: {
17
- type: "EXACT";
12
+ range: () => {
13
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
14
+ options: {
15
+ value: string;
16
+ label: import("./TranslationConfig").TranslationConfig;
17
+ }[] | undefined;
18
+ fieldType: "event";
19
+ } & {
20
+ config: {
21
+ type: "range";
22
+ };
23
+ };
24
+ exact: () => {
25
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
26
+ options: {
27
+ value: string;
28
+ label: import("./TranslationConfig").TranslationConfig;
29
+ }[] | undefined;
30
+ fieldType: "event";
31
+ } & {
32
+ config: {
33
+ type: "exact";
34
+ };
35
+ };
36
+ fuzzy: () => {
37
+ fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation";
38
+ options: {
39
+ value: string;
40
+ label: import("./TranslationConfig").TranslationConfig;
41
+ }[] | undefined;
42
+ fieldType: "event";
43
+ } & {
44
+ config: {
45
+ type: "fuzzy";
46
+ };
18
47
  };
19
- fieldType: "event";
20
48
  };
21
49
  declare const event: typeof eventFn & {
50
+ field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
22
51
  hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
23
52
  };
24
53
  export { event };
@@ -1,38 +1,57 @@
1
+ import { FieldConditional } from './Conditional';
2
+ import { TranslationConfig } from './TranslationConfig';
3
+ import { ValidationConfig } from './FieldConfig';
1
4
  /**
2
5
  * Entry point for defining conditional logic or configuration for a form field.
3
6
  * @param fieldId - The ID of the field to define rules or config for.
4
7
  * @returns An object combining conditional methods and configuration builders.
5
8
  */
6
- export declare function field(fieldId: string): {
9
+ export declare function field(fieldId: string, options?: {
10
+ conditionals?: FieldConditional[];
11
+ validations?: ValidationConfig[];
12
+ searchCriteriaLabelPrefix?: TranslationConfig;
13
+ }): {
7
14
  range: () => {
8
- config: {
9
- type: "RANGE";
10
- };
15
+ conditionals?: FieldConditional[];
16
+ validations?: ValidationConfig[];
17
+ searchCriteriaLabelPrefix?: TranslationConfig;
11
18
  fieldId: string;
12
19
  fieldType: "field";
13
- };
14
- exact: () => {
20
+ } & {
15
21
  config: {
16
- type: "EXACT";
22
+ type: "range";
17
23
  };
24
+ };
25
+ exact: () => {
26
+ conditionals?: FieldConditional[];
27
+ validations?: ValidationConfig[];
28
+ searchCriteriaLabelPrefix?: TranslationConfig;
18
29
  fieldId: string;
19
30
  fieldType: "field";
20
- };
21
- fuzzy: () => {
31
+ } & {
22
32
  config: {
23
- type: "FUZZY";
33
+ type: "exact";
24
34
  };
35
+ };
36
+ fuzzy: () => {
37
+ conditionals?: FieldConditional[];
38
+ validations?: ValidationConfig[];
39
+ searchCriteriaLabelPrefix?: TranslationConfig;
25
40
  fieldId: string;
26
41
  fieldType: "field";
42
+ } & {
43
+ config: {
44
+ type: "fuzzy";
45
+ };
27
46
  };
47
+ $$field: string;
28
48
  isAfter: () => {
29
49
  days: (days: number) => {
30
50
  inPast: () => import("../conditionals/conditionals").JSONSchema;
31
51
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
32
52
  };
33
53
  date: (date: string | {
34
- [key: string]: unknown;
35
- _fieldId: string;
54
+ $$field: string;
36
55
  }) => import("../conditionals/conditionals").JSONSchema;
37
56
  now: () => import("../conditionals/conditionals").JSONSchema;
38
57
  };
@@ -42,14 +61,12 @@ export declare function field(fieldId: string): {
42
61
  inFuture: () => import("../conditionals/conditionals").JSONSchema;
43
62
  };
44
63
  date: (date: string | {
45
- [key: string]: unknown;
46
- _fieldId: string;
64
+ $$field: string;
47
65
  }) => import("../conditionals/conditionals").JSONSchema;
48
66
  now: () => import("../conditionals/conditionals").JSONSchema;
49
67
  };
50
68
  isEqualTo: (value: string | boolean | {
51
- [key: string]: unknown;
52
- _fieldId: string;
69
+ $$field: string;
53
70
  }) => import("../conditionals/conditionals").JSONSchema;
54
71
  isFalsy: () => import("../conditionals/conditionals").JSONSchema;
55
72
  isUndefined: () => import("../conditionals/conditionals").JSONSchema;
@@ -60,9 +77,6 @@ export declare function field(fieldId: string): {
60
77
  getId: () => {
61
78
  fieldId: string;
62
79
  };
63
- /**
64
- * @private Internal property used for field reference tracking.
65
- */
66
- _fieldId: string;
80
+ object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
67
81
  };
68
82
  //# sourceMappingURL=field.d.ts.map
@@ -1,3 +1,4 @@
1
+ export * from './Constants';
1
2
  export * from './ActionConfig';
2
3
  export * from './offline';
3
4
  export * from './EventConfig';
@@ -6,6 +7,8 @@ export * from './FieldConfig';
6
7
  export * from './PageConfig';
7
8
  export * from './SummaryConfig';
8
9
  export * from './WorkqueueConfig';
10
+ export * from './WorkqueueColumnConfig';
11
+ export * from './workqueueDefaultColumns';
9
12
  export * from './Draft';
10
13
  export * from './EventMetadata';
11
14
  export * from './EventInput';
@@ -31,6 +34,8 @@ export * from './AdvancedSearchConfig';
31
34
  export * from './test.utils';
32
35
  export * from './TemplateConfig';
33
36
  export * from './scopes';
37
+ export * from './serializer';
38
+ export * from './state/availableActions';
34
39
  export * from '../conditionals/conditionals';
35
40
  export * from '../conditionals/validate';
36
41
  export * from './field';
@@ -1,6 +1,4 @@
1
1
  import { Scope } from '../scopes';
2
- import { ActionType } from './ActionType';
3
- export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
4
2
  export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"];
5
3
  export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[];
6
4
  export declare const ACTION_ALLOWED_SCOPES: {
@@ -22,5 +20,25 @@ export declare const ACTION_ALLOWED_SCOPES: {
22
20
  UNASSIGN: null;
23
21
  DETECT_DUPLICATE: [];
24
22
  };
25
- export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
23
+ export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
24
+ READ: never[];
25
+ CREATE: "record.notify"[];
26
+ NOTIFY: "record.notify"[];
27
+ DECLARE: never[];
28
+ DELETE: never[];
29
+ VALIDATE: never[];
30
+ REGISTER: never[];
31
+ PRINT_CERTIFICATE: never[];
32
+ REQUEST_CORRECTION: never[];
33
+ REJECT_CORRECTION: never[];
34
+ APPROVE_CORRECTION: never[];
35
+ MARKED_AS_DUPLICATE: never[];
36
+ ARCHIVE: never[];
37
+ REJECT: never[];
38
+ ASSIGN: never[];
39
+ UNASSIGN: never[];
40
+ DETECT_DUPLICATE: never[];
41
+ };
42
+ export declare const WRITE_ACTION_SCOPES: ("record.declare-birth" | "record.declaration-submit-for-approval" | "record.register" | "record.registration-print&issue-certified-copies")[];
43
+ export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
26
44
  //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { deserializeQuery } from './serializers/user/deserializer';
2
+ //# sourceMappingURL=serializer.d.ts.map
@@ -1,16 +1,34 @@
1
- import { ActionDocument, ActionUpdate } from './ActionDocument';
2
- import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
1
+ import { UUID } from '../uuid';
2
+ import { ActionDocument, EventState } from './ActionDocument';
3
+ import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, 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';
9
- import { FieldValue } from './FieldValue';
10
10
  import { TranslationConfig } from './TranslationConfig';
11
- export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): Partial<import("./ActionDocument").EventState>;
12
- export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
13
- export declare const eventPayloadGenerator: {
11
+ import { FieldConfig } from './FieldConfig';
12
+ import { WorkqueueConfig } from './WorkqueueConfig';
13
+ import { FieldValue } from './FieldValue';
14
+ import { z } from 'zod';
15
+ /**
16
+ * In real application, the roles are defined in the countryconfig.
17
+ * These are just for testing purposes to generate realistic mock data.
18
+ */
19
+ export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT"]>;
20
+ export type TestUserRole = z.infer<typeof TestUserRole>;
21
+ export declare function generateRandomName(rng: () => number): {
22
+ firstname: string;
23
+ surname: string;
24
+ };
25
+ /**
26
+ * Quick-and-dirty mock data generator for event actions.
27
+ */
28
+ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number, rng: () => number): FieldValue;
29
+ export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number): EventState;
30
+ export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType, rng: () => number): {};
31
+ export declare function eventPayloadGenerator(rng: () => number): {
14
32
  create: (input?: Partial<EventInput>) => {
15
33
  transactionId: string;
16
34
  type: string;
@@ -21,12 +39,11 @@ export declare const eventPayloadGenerator: {
21
39
  id: string;
22
40
  };
23
41
  draft: ({ eventId, actionType }: {
24
- eventId: string;
42
+ eventId: UUID;
25
43
  actionType: ActionType;
26
44
  }, input?: Partial<Draft>) => Draft;
27
45
  actions: {
28
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
29
- type: "DECLARE";
46
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
30
47
  transactionId: string;
31
48
  declaration: Record<string, string | number | boolean | {
32
49
  type: string;
@@ -43,6 +60,10 @@ export declare const eventPayloadGenerator: {
43
60
  residentialArea?: string | null | undefined;
44
61
  street?: string | null | undefined;
45
62
  zipCode?: string | null | undefined;
63
+ } | {
64
+ firstname: string;
65
+ surname: string;
66
+ middlename?: string | null | undefined;
46
67
  } | {
47
68
  country: string;
48
69
  district: string;
@@ -65,20 +86,19 @@ export declare const eventPayloadGenerator: {
65
86
  option: string;
66
87
  filename: string;
67
88
  originalFilename: string;
68
- }[] | undefined>;
89
+ }[] | [string, string] | null | undefined>;
69
90
  annotation: {};
91
+ keepAssignment?: boolean | undefined;
92
+ type: "DECLARE";
70
93
  eventId: string;
71
94
  };
72
95
  /**
73
96
  * Notify allows sending incomplete data. Think it as 'partial declare' for now.
74
97
  */
75
- notify: (eventId: string, input?: {
76
- transactionId?: string;
77
- declaration?: Partial<ActionUpdate>;
78
- }) => {
98
+ notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
79
99
  type: "NOTIFY";
80
100
  transactionId: string;
81
- declaration: Partial<Record<string, string | number | boolean | {
101
+ declaration: Record<string, string | number | boolean | {
82
102
  type: string;
83
103
  filename: string;
84
104
  originalFilename: string;
@@ -93,6 +113,10 @@ export declare const eventPayloadGenerator: {
93
113
  residentialArea?: string | null | undefined;
94
114
  street?: string | null | undefined;
95
115
  zipCode?: string | null | undefined;
116
+ } | {
117
+ firstname: string;
118
+ surname: string;
119
+ middlename?: string | null | undefined;
96
120
  } | {
97
121
  country: string;
98
122
  district: string;
@@ -115,11 +139,11 @@ export declare const eventPayloadGenerator: {
115
139
  option: string;
116
140
  filename: string;
117
141
  originalFilename: string;
118
- }[] | undefined>>;
142
+ }[] | [string, string] | null | undefined>;
119
143
  eventId: string;
144
+ keepAssignment: boolean | undefined;
120
145
  };
121
- validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
122
- type: "VALIDATE";
146
+ validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
123
147
  transactionId: string;
124
148
  declaration: Record<string, string | number | boolean | {
125
149
  type: string;
@@ -136,6 +160,10 @@ export declare const eventPayloadGenerator: {
136
160
  residentialArea?: string | null | undefined;
137
161
  street?: string | null | undefined;
138
162
  zipCode?: string | null | undefined;
163
+ } | {
164
+ firstname: string;
165
+ surname: string;
166
+ middlename?: string | null | undefined;
139
167
  } | {
140
168
  country: string;
141
169
  district: string;
@@ -158,8 +186,10 @@ export declare const eventPayloadGenerator: {
158
186
  option: string;
159
187
  filename: string;
160
188
  originalFilename: string;
161
- }[] | undefined>;
189
+ }[] | [string, string] | null | undefined>;
162
190
  annotation: {};
191
+ keepAssignment?: boolean | undefined;
192
+ type: "VALIDATE";
163
193
  duplicates: never[];
164
194
  eventId: string;
165
195
  };
@@ -177,26 +207,73 @@ export declare const eventPayloadGenerator: {
177
207
  assignedTo: null;
178
208
  eventId: string;
179
209
  };
180
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
181
- type: "ARCHIVE";
210
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
182
211
  transactionId: string;
183
- declaration: {};
184
- annotation: {
185
- isDuplicate: boolean;
186
- };
212
+ declaration: Record<string, string | number | boolean | {
213
+ type: string;
214
+ filename: string;
215
+ originalFilename: string;
216
+ } | {
217
+ country: string;
218
+ district: string;
219
+ addressType: "DOMESTIC";
220
+ province: string;
221
+ urbanOrRural: "URBAN";
222
+ number?: string | null | undefined;
223
+ town?: string | null | undefined;
224
+ residentialArea?: string | null | undefined;
225
+ street?: string | null | undefined;
226
+ zipCode?: string | null | undefined;
227
+ } | {
228
+ firstname: string;
229
+ surname: string;
230
+ middlename?: string | null | undefined;
231
+ } | {
232
+ country: string;
233
+ district: string;
234
+ addressType: "DOMESTIC";
235
+ province: string;
236
+ urbanOrRural: "RURAL";
237
+ village?: string | null | undefined;
238
+ } | {
239
+ country: string;
240
+ state: string;
241
+ addressType: "INTERNATIONAL";
242
+ district2: string;
243
+ cityOrTown?: string | null | undefined;
244
+ addressLine1?: string | null | undefined;
245
+ addressLine2?: string | null | undefined;
246
+ addressLine3?: string | null | undefined;
247
+ postcodeOrZip?: string | null | undefined;
248
+ } | {
249
+ type: string;
250
+ option: string;
251
+ filename: string;
252
+ originalFilename: string;
253
+ }[] | [string, string] | null | undefined>;
254
+ keepAssignment?: boolean | undefined;
255
+ type: "ARCHIVE";
256
+ annotation: {};
187
257
  duplicates: never[];
188
258
  eventId: string;
259
+ reason: {
260
+ message: string;
261
+ isDuplicate: boolean;
262
+ };
189
263
  };
190
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
191
- type: "REJECT";
264
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
192
265
  transactionId: string;
193
- declaration: {};
194
266
  annotation: {};
267
+ keepAssignment?: boolean | undefined;
268
+ type: "REJECT";
269
+ declaration: {};
195
270
  duplicates: never[];
196
271
  eventId: string;
272
+ reason: {
273
+ message: string;
274
+ };
197
275
  };
198
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
199
- type: "REGISTER";
276
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
200
277
  transactionId: string;
201
278
  declaration: Record<string, string | number | boolean | {
202
279
  type: string;
@@ -213,6 +290,10 @@ export declare const eventPayloadGenerator: {
213
290
  residentialArea?: string | null | undefined;
214
291
  street?: string | null | undefined;
215
292
  zipCode?: string | null | undefined;
293
+ } | {
294
+ firstname: string;
295
+ surname: string;
296
+ middlename?: string | null | undefined;
216
297
  } | {
217
298
  country: string;
218
299
  district: string;
@@ -235,19 +316,23 @@ export declare const eventPayloadGenerator: {
235
316
  option: string;
236
317
  filename: string;
237
318
  originalFilename: string;
238
- }[] | undefined>;
319
+ }[] | [string, string] | null | undefined>;
239
320
  annotation: {};
321
+ registrationNumber?: string | undefined;
322
+ keepAssignment?: boolean | undefined;
323
+ type: "REGISTER";
240
324
  eventId: string;
241
325
  };
242
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
243
- type: "PRINT_CERTIFICATE";
326
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
244
327
  transactionId: string;
245
- declaration: {};
246
328
  annotation: {};
329
+ keepAssignment?: boolean | undefined;
330
+ type: "PRINT_CERTIFICATE";
331
+ declaration: {};
247
332
  eventId: string;
248
333
  };
249
334
  correction: {
250
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
335
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
251
336
  type: "REQUEST_CORRECTION";
252
337
  transactionId: string;
253
338
  declaration: Record<string, string | number | boolean | {
@@ -265,6 +350,10 @@ export declare const eventPayloadGenerator: {
265
350
  residentialArea?: string | null | undefined;
266
351
  street?: string | null | undefined;
267
352
  zipCode?: string | null | undefined;
353
+ } | {
354
+ firstname: string;
355
+ surname: string;
356
+ middlename?: string | null | undefined;
268
357
  } | {
269
358
  country: string;
270
359
  district: string;
@@ -287,39 +376,79 @@ export declare const eventPayloadGenerator: {
287
376
  option: string;
288
377
  filename: string;
289
378
  originalFilename: string;
290
- }[] | undefined>;
379
+ }[] | [string, string] | null | undefined>;
291
380
  annotation: {};
292
381
  eventId: string;
382
+ keepAssignment: boolean | undefined;
293
383
  };
294
- approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
384
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
295
385
  type: "APPROVE_CORRECTION";
296
386
  transactionId: string;
297
387
  declaration: {};
298
388
  annotation: {};
299
389
  eventId: string;
300
390
  requestId: string;
391
+ keepAssignment: boolean | undefined;
301
392
  };
302
- reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
393
+ reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
303
394
  type: "REJECT_CORRECTION";
304
395
  transactionId: string;
305
396
  declaration: {};
306
397
  annotation: {};
307
398
  eventId: string;
308
399
  requestId: string;
400
+ keepAssignment: boolean | undefined;
309
401
  };
310
402
  };
311
403
  };
312
404
  };
313
- export declare function generateActionDocument({ configuration, action, defaults }: {
405
+ export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
314
406
  configuration: EventConfig;
315
407
  action: ActionType;
408
+ rng?: () => number;
316
409
  defaults?: Partial<ActionDocument>;
410
+ user?: Partial<{
411
+ signature: string;
412
+ primaryOfficeId: UUID;
413
+ role: TestUserRole;
414
+ id: string;
415
+ }>;
317
416
  }): ActionDocument;
318
- export declare function generateEventDocument({ configuration, actions }: {
417
+ export declare function generateEventDocument({ configuration, actions, rng, user }: {
319
418
  configuration: EventConfig;
320
419
  actions: ActionType[];
420
+ rng?: () => number;
421
+ user?: Partial<{
422
+ signature: string;
423
+ primaryOfficeId: UUID;
424
+ role: TestUserRole;
425
+ id: string;
426
+ }>;
321
427
  }): EventDocument;
322
- export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: Record<string, FieldValue>): Draft;
323
- export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex;
428
+ export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
429
+ eventId: UUID;
430
+ actionType: ActionType;
431
+ rng?: () => number;
432
+ declaration?: EventState;
433
+ }): Draft;
434
+ export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
435
+ export declare function getRandomDate(rng: () => number, start: string, end: string): string;
436
+ /**
437
+ * Useful for testing when we need deterministic outcome.
438
+ * @param seed - Seed value for the pseudo-random number generator
439
+ *
440
+ * @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
441
+ */
442
+ export declare function createPrng(seed: number): () => number;
443
+ export declare function generateUuid(rng?: () => number): UUID;
444
+ export declare function generateRegistrationNumber(rng: () => number): string;
445
+ export declare function generateRandomSignature(rng: () => number): string;
446
+ export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
324
447
  export declare const generateTranslationConfig: (message: string) => TranslationConfig;
448
+ export declare const BearerTokenByUserType: {
449
+ fieldAgent: string;
450
+ registrationAgent: string;
451
+ localRegistrar: string;
452
+ };
453
+ export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
325
454
  //# sourceMappingURL=test.utils.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare function generateTransactionId(): import("../uuid").UUID;
1
+ export declare function generateTransactionId(): string & import("zod").BRAND<"UUID">;
2
2
  //# sourceMappingURL=transactions.d.ts.map