@opencrvs/toolkit 1.8.0-rc.fd936ab → 1.8.0-rc.fe4d9d5

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 (41) hide show
  1. package/dist/commons/api/router.d.ts +14404 -468
  2. package/dist/commons/conditionals/conditionals.d.ts +14 -6
  3. package/dist/commons/conditionals/validate.d.ts +10 -6
  4. package/dist/commons/events/ActionConfig.d.ts +117418 -1729
  5. package/dist/commons/events/ActionDocument.d.ts +2410 -383
  6. package/dist/commons/events/ActionInput.d.ts +1583 -303
  7. package/dist/commons/events/ActionType.d.ts +6 -0
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +1029 -22
  9. package/dist/commons/events/CompositeFieldValue.d.ts +31 -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 +3 -0
  13. package/dist/commons/events/Draft.d.ts +148 -29
  14. package/dist/commons/events/EventConfig.d.ts +56369 -1354
  15. package/dist/commons/events/EventDocument.d.ts +1508 -264
  16. package/dist/commons/events/EventIndex.d.ts +2026 -25
  17. package/dist/commons/events/EventMetadata.d.ts +332 -43
  18. package/dist/commons/events/FieldConfig.d.ts +5436 -1038
  19. package/dist/commons/events/FieldType.d.ts +6 -3
  20. package/dist/commons/events/FieldTypeMapping.d.ts +103 -54
  21. package/dist/commons/events/FieldValue.d.ts +49 -8
  22. package/dist/commons/events/FormConfig.d.ts +49156 -514
  23. package/dist/commons/events/PageConfig.d.ts +12206 -204
  24. package/dist/commons/events/SummaryConfig.d.ts +93 -42
  25. package/dist/commons/events/User.d.ts +31 -2
  26. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  27. package/dist/commons/events/WorkqueueConfig.d.ts +6290 -20
  28. package/dist/commons/events/defineConfig.d.ts +8993 -58
  29. package/dist/commons/events/event.d.ts +54 -0
  30. package/dist/commons/events/field.d.ts +77 -0
  31. package/dist/commons/events/index.d.ts +8 -0
  32. package/dist/commons/events/scopes.d.ts +44 -0
  33. package/dist/commons/events/serializer.d.ts +2 -0
  34. package/dist/commons/events/test.utils.d.ts +160 -78
  35. package/dist/commons/events/utils.d.ts +13353 -68
  36. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  37. package/dist/conditionals/index.js +76 -36
  38. package/dist/events/index.js +4097 -1530
  39. package/dist/scopes/index.d.ts +97 -6
  40. package/dist/scopes/index.js +109 -38
  41. package/package.json +3 -2
@@ -0,0 +1,54 @@
1
+ import { EventFieldId } from './AdvancedSearchConfig';
2
+ import { SelectOption } from './FieldConfig';
3
+ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
4
+ /**
5
+ * Creates a function that acts like a callable + static method container.
6
+ *
7
+ * @example
8
+ * event('status') // → returns search config
9
+ * event.hasAction('CLICKED') // → returns conditional
10
+ */
11
+ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
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
+ };
47
+ };
48
+ };
49
+ declare const event: typeof eventFn & {
50
+ field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
51
+ hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
52
+ };
53
+ export { event };
54
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1,77 @@
1
+ import { FieldConditional } from './Conditional';
2
+ import { TranslationConfig } from './TranslationConfig';
3
+ /**
4
+ * Entry point for defining conditional logic or configuration for a form field.
5
+ * @param fieldId - The ID of the field to define rules or config for.
6
+ * @returns An object combining conditional methods and configuration builders.
7
+ */
8
+ export declare function field(fieldId: string, options?: {
9
+ conditionals?: FieldConditional[];
10
+ searchCriteriaLabelPrefix?: TranslationConfig;
11
+ }): {
12
+ range: () => {
13
+ conditionals?: FieldConditional[];
14
+ searchCriteriaLabelPrefix?: TranslationConfig;
15
+ fieldId: string;
16
+ fieldType: "field";
17
+ } & {
18
+ config: {
19
+ type: "range";
20
+ };
21
+ };
22
+ exact: () => {
23
+ conditionals?: FieldConditional[];
24
+ searchCriteriaLabelPrefix?: TranslationConfig;
25
+ fieldId: string;
26
+ fieldType: "field";
27
+ } & {
28
+ config: {
29
+ type: "exact";
30
+ };
31
+ };
32
+ fuzzy: () => {
33
+ conditionals?: FieldConditional[];
34
+ searchCriteriaLabelPrefix?: TranslationConfig;
35
+ fieldId: string;
36
+ fieldType: "field";
37
+ } & {
38
+ config: {
39
+ type: "fuzzy";
40
+ };
41
+ };
42
+ $$field: string;
43
+ isAfter: () => {
44
+ days: (days: number) => {
45
+ inPast: () => import("../conditionals/conditionals").JSONSchema;
46
+ inFuture: () => import("../conditionals/conditionals").JSONSchema;
47
+ };
48
+ date: (date: string | {
49
+ $$field: string;
50
+ }) => import("../conditionals/conditionals").JSONSchema;
51
+ now: () => import("../conditionals/conditionals").JSONSchema;
52
+ };
53
+ isBefore: () => {
54
+ days: (days: number) => {
55
+ inPast: () => import("../conditionals/conditionals").JSONSchema;
56
+ inFuture: () => import("../conditionals/conditionals").JSONSchema;
57
+ };
58
+ date: (date: string | {
59
+ $$field: string;
60
+ }) => import("../conditionals/conditionals").JSONSchema;
61
+ now: () => import("../conditionals/conditionals").JSONSchema;
62
+ };
63
+ isEqualTo: (value: string | boolean | {
64
+ $$field: string;
65
+ }) => import("../conditionals/conditionals").JSONSchema;
66
+ isFalsy: () => import("../conditionals/conditionals").JSONSchema;
67
+ isUndefined: () => import("../conditionals/conditionals").JSONSchema;
68
+ inArray: (values: string[]) => import("../conditionals/conditionals").JSONSchema;
69
+ isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
70
+ matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
71
+ isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
72
+ getId: () => {
73
+ fieldId: string;
74
+ };
75
+ object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
76
+ };
77
+ //# 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';
@@ -30,6 +33,11 @@ export * from './Conditional';
30
33
  export * from './AdvancedSearchConfig';
31
34
  export * from './test.utils';
32
35
  export * from './TemplateConfig';
36
+ export * from './scopes';
37
+ export * from './serializer';
38
+ export * from './state/availableActions';
33
39
  export * from '../conditionals/conditionals';
34
40
  export * from '../conditionals/validate';
41
+ export * from './field';
42
+ export * from './event';
35
43
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { Scope } from '../scopes';
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"];
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")[];
4
+ export declare const ACTION_ALLOWED_SCOPES: {
5
+ READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"];
6
+ CREATE: ["record.declare-birth", "record.declaration-submit-incomplete", "record.declaration-submit-for-review"];
7
+ NOTIFY: ["record.declaration-submit-incomplete"];
8
+ DECLARE: ["record.declare-birth", "record.declaration-submit-for-approval", "record.register"];
9
+ DELETE: ["record.declare-birth"];
10
+ VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
11
+ REGISTER: ["record.register"];
12
+ PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
13
+ REQUEST_CORRECTION: ["record.registration-request-correction"];
14
+ REJECT_CORRECTION: ["record.registration-correct"];
15
+ APPROVE_CORRECTION: ["record.registration-correct"];
16
+ MARKED_AS_DUPLICATE: ["record.declaration-archive"];
17
+ ARCHIVE: ["record.declaration-archive"];
18
+ REJECT: ["record.declaration-submit-for-updates"];
19
+ ASSIGN: null;
20
+ UNASSIGN: null;
21
+ DETECT_DUPLICATE: [];
22
+ };
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;
44
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { deserializeQuery } from './serializers/user/deserializer';
2
+ //# sourceMappingURL=serializer.d.ts.map
@@ -1,53 +1,33 @@
1
- import { ActionDocument, ActionUpdate } from './ActionDocument';
2
- import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, 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 { FieldValue } from './FieldValue';
10
9
  import { TranslationConfig } from './TranslationConfig';
11
- export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | {
12
- type: string;
13
- filename: string;
14
- originalFilename: string;
15
- } | {
16
- country: string;
17
- district: string;
18
- addressType: "DOMESTIC";
19
- province: string;
20
- urbanOrRural: "URBAN";
21
- number?: string | undefined;
22
- town?: string | undefined;
23
- residentialArea?: string | undefined;
24
- street?: string | undefined;
25
- zipCode?: string | undefined;
26
- } | {
27
- country: string;
28
- district: string;
29
- addressType: "DOMESTIC";
30
- province: string;
31
- urbanOrRural: "RURAL";
32
- village?: string | undefined;
33
- } | {
34
- country: string;
35
- state: string;
36
- addressType: "INTERNATIONAL";
37
- district2: string;
38
- cityOrTown?: string | undefined;
39
- addressLine1?: string | undefined;
40
- addressLine2?: string | undefined;
41
- addressLine3?: string | undefined;
42
- postcodeOrZip?: string | undefined;
43
- } | {
44
- type: string;
45
- option: string;
46
- filename: string;
47
- originalFilename: string;
48
- }[] | undefined>;
49
- export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
50
- export declare const eventPayloadGenerator: {
10
+ import { FieldConfig } from './FieldConfig';
11
+ import { WorkqueueConfig } from './WorkqueueConfig';
12
+ import { FieldValue } from './FieldValue';
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): {
51
31
  create: (input?: Partial<EventInput>) => {
52
32
  transactionId: string;
53
33
  type: string;
@@ -62,8 +42,7 @@ export declare const eventPayloadGenerator: {
62
42
  actionType: ActionType;
63
43
  }, input?: Partial<Draft>) => Draft;
64
44
  actions: {
65
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
66
- type: "DECLARE";
45
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
67
46
  transactionId: string;
68
47
  declaration: Record<string, string | number | boolean | {
69
48
  type: string;
@@ -80,6 +59,10 @@ export declare const eventPayloadGenerator: {
80
59
  residentialArea?: string | null | undefined;
81
60
  street?: string | null | undefined;
82
61
  zipCode?: string | null | undefined;
62
+ } | {
63
+ firstname: string;
64
+ surname: string;
65
+ middlename?: string | null | undefined;
83
66
  } | {
84
67
  country: string;
85
68
  district: string;
@@ -102,20 +85,19 @@ export declare const eventPayloadGenerator: {
102
85
  option: string;
103
86
  filename: string;
104
87
  originalFilename: string;
105
- }[] | undefined>;
88
+ }[] | [string, string] | null | undefined>;
106
89
  annotation: {};
90
+ keepAssignment?: boolean | undefined;
91
+ type: "DECLARE";
107
92
  eventId: string;
108
93
  };
109
94
  /**
110
95
  * Notify allows sending incomplete data. Think it as 'partial declare' for now.
111
96
  */
112
- notify: (eventId: string, input?: {
113
- transactionId?: string;
114
- declaration?: Partial<ActionUpdate>;
115
- }) => {
97
+ notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
116
98
  type: "NOTIFY";
117
99
  transactionId: string;
118
- declaration: Partial<Record<string, string | number | boolean | {
100
+ declaration: Record<string, string | number | boolean | {
119
101
  type: string;
120
102
  filename: string;
121
103
  originalFilename: string;
@@ -130,6 +112,10 @@ export declare const eventPayloadGenerator: {
130
112
  residentialArea?: string | null | undefined;
131
113
  street?: string | null | undefined;
132
114
  zipCode?: string | null | undefined;
115
+ } | {
116
+ firstname: string;
117
+ surname: string;
118
+ middlename?: string | null | undefined;
133
119
  } | {
134
120
  country: string;
135
121
  district: string;
@@ -152,11 +138,11 @@ export declare const eventPayloadGenerator: {
152
138
  option: string;
153
139
  filename: string;
154
140
  originalFilename: string;
155
- }[] | undefined>>;
141
+ }[] | [string, string] | null | undefined>;
156
142
  eventId: string;
143
+ keepAssignment: boolean | undefined;
157
144
  };
158
- validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
159
- type: "VALIDATE";
145
+ validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
160
146
  transactionId: string;
161
147
  declaration: Record<string, string | number | boolean | {
162
148
  type: string;
@@ -173,6 +159,10 @@ export declare const eventPayloadGenerator: {
173
159
  residentialArea?: string | null | undefined;
174
160
  street?: string | null | undefined;
175
161
  zipCode?: string | null | undefined;
162
+ } | {
163
+ firstname: string;
164
+ surname: string;
165
+ middlename?: string | null | undefined;
176
166
  } | {
177
167
  country: string;
178
168
  district: string;
@@ -195,8 +185,10 @@ export declare const eventPayloadGenerator: {
195
185
  option: string;
196
186
  filename: string;
197
187
  originalFilename: string;
198
- }[] | undefined>;
188
+ }[] | [string, string] | null | undefined>;
199
189
  annotation: {};
190
+ keepAssignment?: boolean | undefined;
191
+ type: "VALIDATE";
200
192
  duplicates: never[];
201
193
  eventId: string;
202
194
  };
@@ -214,26 +206,73 @@ export declare const eventPayloadGenerator: {
214
206
  assignedTo: null;
215
207
  eventId: string;
216
208
  };
217
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
218
- type: "ARCHIVE";
209
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
219
210
  transactionId: string;
220
- declaration: {};
221
- annotation: {
222
- isDuplicate: boolean;
223
- };
211
+ declaration: Record<string, string | number | boolean | {
212
+ type: string;
213
+ filename: string;
214
+ originalFilename: string;
215
+ } | {
216
+ country: string;
217
+ district: string;
218
+ addressType: "DOMESTIC";
219
+ province: string;
220
+ urbanOrRural: "URBAN";
221
+ number?: string | null | undefined;
222
+ town?: string | null | undefined;
223
+ residentialArea?: string | null | undefined;
224
+ street?: string | null | undefined;
225
+ zipCode?: string | null | undefined;
226
+ } | {
227
+ firstname: string;
228
+ surname: string;
229
+ middlename?: string | null | undefined;
230
+ } | {
231
+ country: string;
232
+ district: string;
233
+ addressType: "DOMESTIC";
234
+ province: string;
235
+ urbanOrRural: "RURAL";
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;
247
+ } | {
248
+ type: string;
249
+ option: string;
250
+ filename: string;
251
+ originalFilename: string;
252
+ }[] | [string, string] | null | undefined>;
253
+ keepAssignment?: boolean | undefined;
254
+ type: "ARCHIVE";
255
+ annotation: {};
224
256
  duplicates: never[];
225
257
  eventId: string;
258
+ reason: {
259
+ message: string;
260
+ isDuplicate: boolean;
261
+ };
226
262
  };
227
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
228
- type: "REJECT";
263
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
229
264
  transactionId: string;
230
- declaration: {};
231
265
  annotation: {};
266
+ keepAssignment?: boolean | undefined;
267
+ type: "REJECT";
268
+ declaration: {};
232
269
  duplicates: never[];
233
270
  eventId: string;
271
+ reason: {
272
+ message: string;
273
+ };
234
274
  };
235
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
236
- type: "REGISTER";
275
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
237
276
  transactionId: string;
238
277
  declaration: Record<string, string | number | boolean | {
239
278
  type: string;
@@ -250,6 +289,10 @@ export declare const eventPayloadGenerator: {
250
289
  residentialArea?: string | null | undefined;
251
290
  street?: string | null | undefined;
252
291
  zipCode?: string | null | undefined;
292
+ } | {
293
+ firstname: string;
294
+ surname: string;
295
+ middlename?: string | null | undefined;
253
296
  } | {
254
297
  country: string;
255
298
  district: string;
@@ -272,19 +315,22 @@ export declare const eventPayloadGenerator: {
272
315
  option: string;
273
316
  filename: string;
274
317
  originalFilename: string;
275
- }[] | undefined>;
318
+ }[] | [string, string] | null | undefined>;
276
319
  annotation: {};
320
+ keepAssignment?: boolean | undefined;
321
+ type: "REGISTER";
277
322
  eventId: string;
278
323
  };
279
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
280
- type: "PRINT_CERTIFICATE";
324
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
281
325
  transactionId: string;
282
- declaration: {};
283
326
  annotation: {};
327
+ keepAssignment?: boolean | undefined;
328
+ type: "PRINT_CERTIFICATE";
329
+ declaration: {};
284
330
  eventId: string;
285
331
  };
286
332
  correction: {
287
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
333
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
288
334
  type: "REQUEST_CORRECTION";
289
335
  transactionId: string;
290
336
  declaration: Record<string, string | number | boolean | {
@@ -302,6 +348,10 @@ export declare const eventPayloadGenerator: {
302
348
  residentialArea?: string | null | undefined;
303
349
  street?: string | null | undefined;
304
350
  zipCode?: string | null | undefined;
351
+ } | {
352
+ firstname: string;
353
+ surname: string;
354
+ middlename?: string | null | undefined;
305
355
  } | {
306
356
  country: string;
307
357
  district: string;
@@ -324,39 +374,71 @@ export declare const eventPayloadGenerator: {
324
374
  option: string;
325
375
  filename: string;
326
376
  originalFilename: string;
327
- }[] | undefined>;
377
+ }[] | [string, string] | null | undefined>;
328
378
  annotation: {};
329
379
  eventId: string;
380
+ keepAssignment: boolean | undefined;
330
381
  };
331
- approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
382
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
332
383
  type: "APPROVE_CORRECTION";
333
384
  transactionId: string;
334
385
  declaration: {};
335
386
  annotation: {};
336
387
  eventId: string;
337
388
  requestId: string;
389
+ keepAssignment: boolean | undefined;
338
390
  };
339
- reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
391
+ reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
340
392
  type: "REJECT_CORRECTION";
341
393
  transactionId: string;
342
394
  declaration: {};
343
395
  annotation: {};
344
396
  eventId: string;
345
397
  requestId: string;
398
+ keepAssignment: boolean | undefined;
346
399
  };
347
400
  };
348
401
  };
349
402
  };
350
- export declare function generateActionDocument({ configuration, action, defaults }: {
403
+ export declare function generateActionDocument({ configuration, action, rng, defaults }: {
351
404
  configuration: EventConfig;
352
405
  action: ActionType;
406
+ rng?: () => number;
353
407
  defaults?: Partial<ActionDocument>;
408
+ user?: Partial<{
409
+ signature: string;
410
+ primaryOfficeId: string;
411
+ role: TestUserRole;
412
+ id: string;
413
+ }>;
354
414
  }): ActionDocument;
355
- export declare function generateEventDocument({ configuration, actions }: {
415
+ export declare function generateEventDocument({ configuration, actions, rng }: {
356
416
  configuration: EventConfig;
357
417
  actions: ActionType[];
418
+ rng?: () => number;
358
419
  }): EventDocument;
359
- export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: Record<string, FieldValue>): Draft;
360
- 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;
361
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[];
362
444
  //# sourceMappingURL=test.utils.d.ts.map