@opencrvs/toolkit 1.8.0-rc.ffe8c17 → 1.8.1-rc.020858b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commons/api/router.d.ts +8949 -10987
- package/dist/commons/conditionals/conditionals.d.ts +31 -12
- package/dist/commons/conditionals/validate.d.ts +82 -18
- package/dist/commons/events/ActionConfig.d.ts +120316 -3282
- package/dist/commons/events/ActionDocument.d.ts +14099 -797
- package/dist/commons/events/ActionInput.d.ts +8194 -1095
- package/dist/commons/events/ActionType.d.ts +35 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1300 -22
- package/dist/commons/events/CompositeFieldValue.d.ts +192 -11
- package/dist/commons/events/Conditional.d.ts +21 -5
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4132 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +608 -114
- package/dist/commons/events/EventConfig.d.ts +54502 -3192
- package/dist/commons/events/EventConfigInput.d.ts +6 -3
- package/dist/commons/events/EventDocument.d.ts +5847 -999
- package/dist/commons/events/EventIndex.d.ts +2350 -26
- package/dist/commons/events/EventMetadata.d.ts +347 -44
- package/dist/commons/events/FieldConfig.d.ts +7197 -1211
- package/dist/commons/events/FieldType.d.ts +8 -3
- package/dist/commons/events/FieldTypeMapping.d.ts +253 -268
- package/dist/commons/events/FieldValue.d.ts +159 -93
- package/dist/commons/events/FormConfig.d.ts +56618 -336
- package/dist/commons/events/PageConfig.d.ts +14169 -0
- package/dist/commons/events/SummaryConfig.d.ts +93 -42
- package/dist/commons/events/TemplateConfig.d.ts +5 -5
- package/dist/commons/events/User.d.ts +34 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +8240 -20
- package/dist/commons/events/defineConfig.d.ts +8634 -460
- package/dist/commons/events/event.d.ts +108 -0
- package/dist/commons/events/field.d.ts +108 -0
- package/dist/commons/events/index.d.ts +10 -1
- package/dist/commons/events/scopes.d.ts +45 -0
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +284 -237
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +15662 -168
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +211 -115
- package/dist/events/index.js +5422 -1875
- package/dist/scopes/index.d.ts +247 -1
- package/dist/scopes/index.js +231 -1
- package/package.json +4 -3
- package/tsconfig.json +1 -1
- package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
@@ -1,39 +1,39 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
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;
|
71
|
+
surname: string;
|
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
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
-
|
93
|
+
path: string;
|
127
94
|
originalFilename: string;
|
128
|
-
}[]
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
-
|
110
|
+
declaration: Record<string, string | number | boolean | {
|
136
111
|
type: string;
|
137
|
-
|
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;
|
127
|
+
surname: string;
|
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
|
-
|
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" | "
|
164
|
-
type: "VALIDATE";
|
158
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
165
159
|
transactionId: string;
|
166
|
-
|
160
|
+
declaration: Record<string, string | number | boolean | {
|
167
161
|
type: string;
|
168
|
-
|
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;
|
177
|
+
surname: string;
|
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
|
-
|
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
|
-
|
196
|
-
type: "
|
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
|
-
|
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
|
-
|
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;
|
244
|
+
surname: string;
|
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
|
-
|
266
|
+
path: string;
|
222
267
|
originalFilename: string;
|
223
|
-
}[]
|
224
|
-
|
225
|
-
|
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" | "
|
231
|
-
type: "REJECT";
|
282
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
232
283
|
transactionId: string;
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
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" | "
|
263
|
-
type: "REGISTER";
|
294
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
264
295
|
transactionId: string;
|
265
|
-
|
296
|
+
declaration: Record<string, string | number | boolean | {
|
266
297
|
type: string;
|
267
|
-
|
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;
|
313
|
+
surname: string;
|
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
|
-
|
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" | "
|
294
|
-
type: "PRINT_CERTIFICATE";
|
347
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
295
348
|
transactionId: string;
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
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" | "
|
356
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
326
357
|
type: "REQUEST_CORRECTION";
|
327
358
|
transactionId: string;
|
328
|
-
|
359
|
+
declaration: Record<string, string | number | boolean | {
|
329
360
|
type: string;
|
330
|
-
|
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,112 @@ 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;
|
376
|
+
surname: string;
|
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
|
-
|
398
|
+
path: string;
|
352
399
|
originalFilename: string;
|
353
|
-
}[]
|
354
|
-
|
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<
|
408
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<ApproveCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
358
409
|
type: "APPROVE_CORRECTION";
|
359
410
|
transactionId: string;
|
360
|
-
|
361
|
-
|
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
|
417
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "reason">>) => {
|
390
418
|
type: "REJECT_CORRECTION";
|
391
419
|
transactionId: string;
|
392
|
-
|
393
|
-
|
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;
|
425
|
+
reason: {
|
426
|
+
message: string;
|
427
|
+
isDuplicate?: boolean | undefined;
|
428
|
+
};
|
420
429
|
};
|
421
430
|
};
|
422
431
|
};
|
423
432
|
};
|
424
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
433
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
425
434
|
configuration: EventConfig;
|
426
435
|
action: ActionType;
|
436
|
+
rng?: () => number;
|
427
437
|
defaults?: Partial<ActionDocument>;
|
438
|
+
user?: Partial<{
|
439
|
+
signature: string;
|
440
|
+
primaryOfficeId: UUID;
|
441
|
+
role: TestUserRole;
|
442
|
+
id: string;
|
443
|
+
}>;
|
428
444
|
}): ActionDocument;
|
429
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
445
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
430
446
|
configuration: EventConfig;
|
431
447
|
actions: ActionType[];
|
448
|
+
rng?: () => number;
|
449
|
+
user?: Partial<{
|
450
|
+
signature: string;
|
451
|
+
primaryOfficeId: UUID;
|
452
|
+
role: TestUserRole;
|
453
|
+
id: string;
|
454
|
+
}>;
|
432
455
|
}): EventDocument;
|
433
|
-
export declare function generateEventDraftDocument(eventId
|
434
|
-
|
456
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
457
|
+
eventId: UUID;
|
458
|
+
actionType: ActionType;
|
459
|
+
rng?: () => number;
|
460
|
+
declaration?: EventState;
|
461
|
+
}): Draft;
|
462
|
+
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
463
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
464
|
+
/**
|
465
|
+
* Useful for testing when we need deterministic outcome.
|
466
|
+
* @param seed - Seed value for the pseudo-random number generator
|
467
|
+
*
|
468
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
469
|
+
*/
|
470
|
+
export declare function createPrng(seed: number): () => number;
|
471
|
+
export declare function generateUuid(rng?: () => number): UUID;
|
472
|
+
export declare function generateRegistrationNumber(rng: () => number): string;
|
473
|
+
export declare function generateRandomSignature(rng: () => number): string;
|
474
|
+
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
475
|
+
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
476
|
+
export declare const BearerTokenByUserType: {
|
477
|
+
fieldAgent: string;
|
478
|
+
registrationAgent: string;
|
479
|
+
localRegistrar: string;
|
480
|
+
};
|
481
|
+
export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
|
435
482
|
//# sourceMappingURL=test.utils.d.ts.map
|