@opencrvs/toolkit 1.8.0-rc.fb4793a → 1.8.0-rc.fb8e005
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/dist/commons/api/router.d.ts +6737 -8337
- package/dist/commons/conditionals/conditionals.d.ts +8 -3
- package/dist/commons/conditionals/validate.d.ts +6 -0
- package/dist/commons/events/ActionConfig.d.ts +35832 -12647
- package/dist/commons/events/ActionDocument.d.ts +2215 -525
- package/dist/commons/events/ActionInput.d.ts +1579 -307
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +279 -3
- package/dist/commons/events/CompositeFieldValue.d.ts +28 -0
- package/dist/commons/events/Constants.d.ts +3 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +3730 -0
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/Draft.d.ts +142 -36
- package/dist/commons/events/EventConfig.d.ts +23847 -12245
- package/dist/commons/events/EventDocument.d.ts +1454 -396
- package/dist/commons/events/EventIndex.d.ts +807 -549
- package/dist/commons/events/EventInput.d.ts +0 -13
- package/dist/commons/events/EventMetadata.d.ts +122 -87
- package/dist/commons/events/FieldConfig.d.ts +2261 -1191
- package/dist/commons/events/FieldType.d.ts +4 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +94 -52
- package/dist/commons/events/FieldValue.d.ts +43 -5
- package/dist/commons/events/FormConfig.d.ts +11459 -4769
- package/dist/commons/events/PageConfig.d.ts +3768 -2134
- package/dist/commons/events/SummaryConfig.d.ts +0 -5
- package/dist/commons/events/User.d.ts +31 -7
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +6278 -528
- package/dist/commons/events/defineConfig.d.ts +2747 -679
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +10 -10
- package/dist/commons/events/index.d.ts +5 -0
- package/dist/commons/events/scopes.d.ts +1 -2
- package/dist/commons/events/serializer.d.ts +2 -0
- package/dist/commons/events/test.utils.d.ts +171 -41
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +10474 -330
- package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
- package/dist/conditionals/index.js +65 -25
- package/dist/events/index.js +2876 -1213
- package/dist/scopes/index.d.ts +4 -1
- package/dist/scopes/index.js +67 -17
- package/package.json +3 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
-
import { EventMetadataKeys, EventMetadataParameter } from './EventMetadata';
|
3
2
|
import { SelectOption } from './FieldConfig';
|
3
|
+
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
4
|
/**
|
5
5
|
* Creates a function that acts like a callable + static method container.
|
6
6
|
*
|
@@ -47,7 +47,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
47
47
|
};
|
48
48
|
};
|
49
49
|
declare const event: typeof eventFn & {
|
50
|
-
field(field:
|
50
|
+
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
51
51
|
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
52
52
|
};
|
53
53
|
export { event };
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FieldConditional } from './Conditional';
|
2
2
|
import { TranslationConfig } from './TranslationConfig';
|
3
|
+
import { ValidationConfig } from './FieldConfig';
|
3
4
|
/**
|
4
5
|
* Entry point for defining conditional logic or configuration for a form field.
|
5
6
|
* @param fieldId - The ID of the field to define rules or config for.
|
@@ -7,10 +8,12 @@ import { TranslationConfig } from './TranslationConfig';
|
|
7
8
|
*/
|
8
9
|
export declare function field(fieldId: string, options?: {
|
9
10
|
conditionals?: FieldConditional[];
|
11
|
+
validations?: ValidationConfig[];
|
10
12
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
11
13
|
}): {
|
12
14
|
range: () => {
|
13
15
|
conditionals?: FieldConditional[];
|
16
|
+
validations?: ValidationConfig[];
|
14
17
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
15
18
|
fieldId: string;
|
16
19
|
fieldType: "field";
|
@@ -21,6 +24,7 @@ export declare function field(fieldId: string, options?: {
|
|
21
24
|
};
|
22
25
|
exact: () => {
|
23
26
|
conditionals?: FieldConditional[];
|
27
|
+
validations?: ValidationConfig[];
|
24
28
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
25
29
|
fieldId: string;
|
26
30
|
fieldType: "field";
|
@@ -31,6 +35,7 @@ export declare function field(fieldId: string, options?: {
|
|
31
35
|
};
|
32
36
|
fuzzy: () => {
|
33
37
|
conditionals?: FieldConditional[];
|
38
|
+
validations?: ValidationConfig[];
|
34
39
|
searchCriteriaLabelPrefix?: TranslationConfig;
|
35
40
|
fieldId: string;
|
36
41
|
fieldType: "field";
|
@@ -39,14 +44,14 @@ export declare function field(fieldId: string, options?: {
|
|
39
44
|
type: "fuzzy";
|
40
45
|
};
|
41
46
|
};
|
47
|
+
$$field: string;
|
42
48
|
isAfter: () => {
|
43
49
|
days: (days: number) => {
|
44
50
|
inPast: () => import("../conditionals/conditionals").JSONSchema;
|
45
51
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
46
52
|
};
|
47
53
|
date: (date: string | {
|
48
|
-
|
49
|
-
_fieldId: string;
|
54
|
+
$$field: string;
|
50
55
|
}) => import("../conditionals/conditionals").JSONSchema;
|
51
56
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
52
57
|
};
|
@@ -56,14 +61,12 @@ export declare function field(fieldId: string, options?: {
|
|
56
61
|
inFuture: () => import("../conditionals/conditionals").JSONSchema;
|
57
62
|
};
|
58
63
|
date: (date: string | {
|
59
|
-
|
60
|
-
_fieldId: string;
|
64
|
+
$$field: string;
|
61
65
|
}) => import("../conditionals/conditionals").JSONSchema;
|
62
66
|
now: () => import("../conditionals/conditionals").JSONSchema;
|
63
67
|
};
|
64
68
|
isEqualTo: (value: string | boolean | {
|
65
|
-
|
66
|
-
_fieldId: string;
|
69
|
+
$$field: string;
|
67
70
|
}) => import("../conditionals/conditionals").JSONSchema;
|
68
71
|
isFalsy: () => import("../conditionals/conditionals").JSONSchema;
|
69
72
|
isUndefined: () => import("../conditionals/conditionals").JSONSchema;
|
@@ -74,9 +77,6 @@ export declare function field(fieldId: string, options?: {
|
|
74
77
|
getId: () => {
|
75
78
|
fieldId: string;
|
76
79
|
};
|
77
|
-
|
78
|
-
* @private Internal property used for field reference tracking.
|
79
|
-
*/
|
80
|
-
_fieldId: string;
|
80
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
81
81
|
};
|
82
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,5 +1,4 @@
|
|
1
1
|
import { Scope } from '../scopes';
|
2
|
-
import { ActionType } from './ActionType';
|
3
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"];
|
4
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")[];
|
5
4
|
export declare const ACTION_ALLOWED_SCOPES: {
|
@@ -40,6 +39,6 @@ export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
|
40
39
|
UNASSIGN: never[];
|
41
40
|
DETECT_DUPLICATE: never[];
|
42
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
43
|
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
44
|
-
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
45
44
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
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';
|
@@ -7,9 +8,27 @@ import { EventDocument } from './EventDocument';
|
|
7
8
|
import { EventIndex } from './EventIndex';
|
8
9
|
import { EventInput } from './EventInput';
|
9
10
|
import { TranslationConfig } from './TranslationConfig';
|
10
|
-
|
11
|
-
|
12
|
-
|
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): {
|
13
32
|
create: (input?: Partial<EventInput>) => {
|
14
33
|
transactionId: string;
|
15
34
|
type: string;
|
@@ -20,12 +39,11 @@ export declare const eventPayloadGenerator: {
|
|
20
39
|
id: string;
|
21
40
|
};
|
22
41
|
draft: ({ eventId, actionType }: {
|
23
|
-
eventId:
|
42
|
+
eventId: UUID;
|
24
43
|
actionType: ActionType;
|
25
44
|
}, input?: Partial<Draft>) => Draft;
|
26
45
|
actions: {
|
27
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
28
|
-
type: "DECLARE";
|
46
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
29
47
|
transactionId: string;
|
30
48
|
declaration: Record<string, string | number | boolean | {
|
31
49
|
type: string;
|
@@ -42,6 +60,10 @@ export declare const eventPayloadGenerator: {
|
|
42
60
|
residentialArea?: string | null | undefined;
|
43
61
|
street?: string | null | undefined;
|
44
62
|
zipCode?: string | null | undefined;
|
63
|
+
} | {
|
64
|
+
firstname?: string | null | undefined;
|
65
|
+
surname?: string | null | undefined;
|
66
|
+
middlename?: string | null | undefined;
|
45
67
|
} | {
|
46
68
|
country: string;
|
47
69
|
district: string;
|
@@ -64,20 +86,19 @@ export declare const eventPayloadGenerator: {
|
|
64
86
|
option: string;
|
65
87
|
filename: string;
|
66
88
|
originalFilename: string;
|
67
|
-
}[] | [string, string] | undefined>;
|
89
|
+
}[] | [string, string] | null | undefined>;
|
68
90
|
annotation: {};
|
91
|
+
keepAssignment?: boolean | undefined;
|
92
|
+
type: "DECLARE";
|
69
93
|
eventId: string;
|
70
94
|
};
|
71
95
|
/**
|
72
96
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
73
97
|
*/
|
74
|
-
notify: (eventId: string, input?: {
|
75
|
-
transactionId?: string;
|
76
|
-
declaration?: Partial<ActionUpdate>;
|
77
|
-
}) => {
|
98
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
78
99
|
type: "NOTIFY";
|
79
100
|
transactionId: string;
|
80
|
-
declaration:
|
101
|
+
declaration: Record<string, string | number | boolean | {
|
81
102
|
type: string;
|
82
103
|
filename: string;
|
83
104
|
originalFilename: string;
|
@@ -92,6 +113,10 @@ export declare const eventPayloadGenerator: {
|
|
92
113
|
residentialArea?: string | null | undefined;
|
93
114
|
street?: string | null | undefined;
|
94
115
|
zipCode?: string | null | undefined;
|
116
|
+
} | {
|
117
|
+
firstname?: string | null | undefined;
|
118
|
+
surname?: string | null | undefined;
|
119
|
+
middlename?: string | null | undefined;
|
95
120
|
} | {
|
96
121
|
country: string;
|
97
122
|
district: string;
|
@@ -114,11 +139,11 @@ export declare const eventPayloadGenerator: {
|
|
114
139
|
option: string;
|
115
140
|
filename: string;
|
116
141
|
originalFilename: string;
|
117
|
-
}[] | [string, string] | undefined
|
142
|
+
}[] | [string, string] | null | undefined>;
|
118
143
|
eventId: string;
|
144
|
+
keepAssignment: boolean | undefined;
|
119
145
|
};
|
120
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
121
|
-
type: "VALIDATE";
|
146
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
122
147
|
transactionId: string;
|
123
148
|
declaration: Record<string, string | number | boolean | {
|
124
149
|
type: string;
|
@@ -135,6 +160,10 @@ export declare const eventPayloadGenerator: {
|
|
135
160
|
residentialArea?: string | null | undefined;
|
136
161
|
street?: string | null | undefined;
|
137
162
|
zipCode?: string | null | undefined;
|
163
|
+
} | {
|
164
|
+
firstname?: string | null | undefined;
|
165
|
+
surname?: string | null | undefined;
|
166
|
+
middlename?: string | null | undefined;
|
138
167
|
} | {
|
139
168
|
country: string;
|
140
169
|
district: string;
|
@@ -157,8 +186,10 @@ export declare const eventPayloadGenerator: {
|
|
157
186
|
option: string;
|
158
187
|
filename: string;
|
159
188
|
originalFilename: string;
|
160
|
-
}[] | [string, string] | undefined>;
|
189
|
+
}[] | [string, string] | null | undefined>;
|
161
190
|
annotation: {};
|
191
|
+
keepAssignment?: boolean | undefined;
|
192
|
+
type: "VALIDATE";
|
162
193
|
duplicates: never[];
|
163
194
|
eventId: string;
|
164
195
|
};
|
@@ -176,26 +207,73 @@ export declare const eventPayloadGenerator: {
|
|
176
207
|
assignedTo: null;
|
177
208
|
eventId: string;
|
178
209
|
};
|
179
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
180
|
-
type: "ARCHIVE";
|
210
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
181
211
|
transactionId: string;
|
182
|
-
declaration: {
|
183
|
-
|
184
|
-
|
185
|
-
|
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 | null | undefined;
|
229
|
+
surname?: string | null | undefined;
|
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: {};
|
186
257
|
duplicates: never[];
|
187
258
|
eventId: string;
|
259
|
+
reason: {
|
260
|
+
message: string;
|
261
|
+
isDuplicate: boolean;
|
262
|
+
};
|
188
263
|
};
|
189
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
190
|
-
type: "REJECT";
|
264
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
191
265
|
transactionId: string;
|
192
|
-
declaration: {};
|
193
266
|
annotation: {};
|
267
|
+
keepAssignment?: boolean | undefined;
|
268
|
+
type: "REJECT";
|
269
|
+
declaration: {};
|
194
270
|
duplicates: never[];
|
195
271
|
eventId: string;
|
272
|
+
reason: {
|
273
|
+
message: string;
|
274
|
+
};
|
196
275
|
};
|
197
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
198
|
-
type: "REGISTER";
|
276
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
199
277
|
transactionId: string;
|
200
278
|
declaration: Record<string, string | number | boolean | {
|
201
279
|
type: string;
|
@@ -212,6 +290,10 @@ export declare const eventPayloadGenerator: {
|
|
212
290
|
residentialArea?: string | null | undefined;
|
213
291
|
street?: string | null | undefined;
|
214
292
|
zipCode?: string | null | undefined;
|
293
|
+
} | {
|
294
|
+
firstname?: string | null | undefined;
|
295
|
+
surname?: string | null | undefined;
|
296
|
+
middlename?: string | null | undefined;
|
215
297
|
} | {
|
216
298
|
country: string;
|
217
299
|
district: string;
|
@@ -234,19 +316,23 @@ export declare const eventPayloadGenerator: {
|
|
234
316
|
option: string;
|
235
317
|
filename: string;
|
236
318
|
originalFilename: string;
|
237
|
-
}[] | [string, string] | undefined>;
|
319
|
+
}[] | [string, string] | null | undefined>;
|
238
320
|
annotation: {};
|
321
|
+
registrationNumber?: string | undefined;
|
322
|
+
keepAssignment?: boolean | undefined;
|
323
|
+
type: "REGISTER";
|
239
324
|
eventId: string;
|
240
325
|
};
|
241
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
242
|
-
type: "PRINT_CERTIFICATE";
|
326
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
243
327
|
transactionId: string;
|
244
|
-
declaration: {};
|
245
328
|
annotation: {};
|
329
|
+
keepAssignment?: boolean | undefined;
|
330
|
+
type: "PRINT_CERTIFICATE";
|
331
|
+
declaration: {};
|
246
332
|
eventId: string;
|
247
333
|
};
|
248
334
|
correction: {
|
249
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
335
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
250
336
|
type: "REQUEST_CORRECTION";
|
251
337
|
transactionId: string;
|
252
338
|
declaration: Record<string, string | number | boolean | {
|
@@ -264,6 +350,10 @@ export declare const eventPayloadGenerator: {
|
|
264
350
|
residentialArea?: string | null | undefined;
|
265
351
|
street?: string | null | undefined;
|
266
352
|
zipCode?: string | null | undefined;
|
353
|
+
} | {
|
354
|
+
firstname?: string | null | undefined;
|
355
|
+
surname?: string | null | undefined;
|
356
|
+
middlename?: string | null | undefined;
|
267
357
|
} | {
|
268
358
|
country: string;
|
269
359
|
district: string;
|
@@ -286,39 +376,79 @@ export declare const eventPayloadGenerator: {
|
|
286
376
|
option: string;
|
287
377
|
filename: string;
|
288
378
|
originalFilename: string;
|
289
|
-
}[] | [string, string] | undefined>;
|
379
|
+
}[] | [string, string] | null | undefined>;
|
290
380
|
annotation: {};
|
291
381
|
eventId: string;
|
382
|
+
keepAssignment: boolean | undefined;
|
292
383
|
};
|
293
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
384
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
294
385
|
type: "APPROVE_CORRECTION";
|
295
386
|
transactionId: string;
|
296
387
|
declaration: {};
|
297
388
|
annotation: {};
|
298
389
|
eventId: string;
|
299
390
|
requestId: string;
|
391
|
+
keepAssignment: boolean | undefined;
|
300
392
|
};
|
301
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
393
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
302
394
|
type: "REJECT_CORRECTION";
|
303
395
|
transactionId: string;
|
304
396
|
declaration: {};
|
305
397
|
annotation: {};
|
306
398
|
eventId: string;
|
307
399
|
requestId: string;
|
400
|
+
keepAssignment: boolean | undefined;
|
308
401
|
};
|
309
402
|
};
|
310
403
|
};
|
311
404
|
};
|
312
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
405
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
313
406
|
configuration: EventConfig;
|
314
407
|
action: ActionType;
|
408
|
+
rng?: () => number;
|
315
409
|
defaults?: Partial<ActionDocument>;
|
410
|
+
user?: Partial<{
|
411
|
+
signature: string;
|
412
|
+
primaryOfficeId: UUID;
|
413
|
+
role: TestUserRole;
|
414
|
+
id: string;
|
415
|
+
}>;
|
316
416
|
}): ActionDocument;
|
317
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
417
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
318
418
|
configuration: EventConfig;
|
319
419
|
actions: ActionType[];
|
420
|
+
rng?: () => number;
|
421
|
+
user?: Partial<{
|
422
|
+
signature: string;
|
423
|
+
primaryOfficeId: UUID;
|
424
|
+
role: TestUserRole;
|
425
|
+
id: string;
|
426
|
+
}>;
|
320
427
|
}): EventDocument;
|
321
|
-
export declare function generateEventDraftDocument(eventId
|
322
|
-
|
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;
|
323
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[];
|
324
454
|
//# sourceMappingURL=test.utils.d.ts.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare function generateTransactionId(): import("
|
1
|
+
export declare function generateTransactionId(): string & import("zod").BRAND<"UUID">;
|
2
2
|
//# sourceMappingURL=transactions.d.ts.map
|