@opencrvs/toolkit 1.8.0-rc.fb5b9fe → 1.8.0-rc.fb5f1af
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 +7226 -9201
- package/dist/commons/conditionals/conditionals.d.ts +4 -12
- package/dist/commons/conditionals/validate.d.ts +6 -0
- package/dist/commons/events/ActionConfig.d.ts +42985 -22929
- package/dist/commons/events/ActionDocument.d.ts +3599 -1052
- package/dist/commons/events/ActionInput.d.ts +2942 -842
- package/dist/commons/events/ActionType.d.ts +4 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +339 -36
- package/dist/commons/events/CompositeFieldValue.d.ts +37 -9
- package/dist/commons/events/Constants.d.ts +1 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1891 -741
- package/dist/commons/events/Draft.d.ts +248 -75
- package/dist/commons/events/EventConfig.d.ts +17983 -8266
- package/dist/commons/events/EventDocument.d.ts +2260 -673
- package/dist/commons/events/EventIndex.d.ts +1069 -196
- package/dist/commons/events/EventMetadata.d.ts +52 -40
- package/dist/commons/events/FieldConfig.d.ts +2303 -926
- package/dist/commons/events/FieldType.d.ts +5 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +144 -73
- package/dist/commons/events/FieldValue.d.ts +85 -20
- package/dist/commons/events/FormConfig.d.ts +23361 -14925
- package/dist/commons/events/PageConfig.d.ts +3730 -1662
- package/dist/commons/events/SummaryConfig.d.ts +0 -5
- package/dist/commons/events/User.d.ts +6 -3
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +11 -11
- package/dist/commons/events/WorkqueueConfig.d.ts +5509 -1918
- package/dist/commons/events/defineConfig.d.ts +1762 -126
- package/dist/commons/events/event.d.ts +10 -18
- package/dist/commons/events/field.d.ts +9 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/scopes.d.ts +1 -2
- package/dist/commons/events/test.utils.d.ts +181 -49
- package/dist/commons/events/utils.d.ts +13653 -1222
- package/dist/conditionals/index.js +40 -52
- package/dist/events/index.js +2274 -1491
- package/dist/scopes/index.d.ts +96 -7
- package/dist/scopes/index.js +105 -26
- package/package.json +3 -3
@@ -1,5 +1,5 @@
|
|
1
|
+
import { ActionType } from './ActionType';
|
1
2
|
import { EventFieldId } from './AdvancedSearchConfig';
|
2
|
-
import { SelectOption } from './FieldConfig';
|
3
3
|
import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConfig';
|
4
4
|
/**
|
5
5
|
* Creates a function that acts like a callable + static method container.
|
@@ -8,13 +8,9 @@ import { WorkqueueColumnKeys, WorkqueueColumnValue } from './WorkqueueColumnConf
|
|
8
8
|
* event('status') // → returns search config
|
9
9
|
* event.hasAction('CLICKED') // → returns conditional
|
10
10
|
*/
|
11
|
-
declare function eventFn(fieldId: EventFieldId
|
11
|
+
declare function eventFn(fieldId: EventFieldId): {
|
12
12
|
range: () => {
|
13
|
-
fieldId: "status" | "updatedAt" | "trackingId" | "
|
14
|
-
options: {
|
15
|
-
value: string;
|
16
|
-
label: import("./TranslationConfig").TranslationConfig;
|
17
|
-
}[] | undefined;
|
13
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
|
18
14
|
fieldType: "event";
|
19
15
|
} & {
|
20
16
|
config: {
|
@@ -22,11 +18,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
22
18
|
};
|
23
19
|
};
|
24
20
|
exact: () => {
|
25
|
-
fieldId: "status" | "updatedAt" | "trackingId" | "
|
26
|
-
options: {
|
27
|
-
value: string;
|
28
|
-
label: import("./TranslationConfig").TranslationConfig;
|
29
|
-
}[] | undefined;
|
21
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
|
30
22
|
fieldType: "event";
|
31
23
|
} & {
|
32
24
|
config: {
|
@@ -34,11 +26,7 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
34
26
|
};
|
35
27
|
};
|
36
28
|
fuzzy: () => {
|
37
|
-
fieldId: "status" | "updatedAt" | "trackingId" | "
|
38
|
-
options: {
|
39
|
-
value: string;
|
40
|
-
label: import("./TranslationConfig").TranslationConfig;
|
41
|
-
}[] | undefined;
|
29
|
+
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
|
42
30
|
fieldType: "event";
|
43
31
|
} & {
|
44
32
|
config: {
|
@@ -47,8 +35,12 @@ declare function eventFn(fieldId: EventFieldId, options?: SelectOption[]): {
|
|
47
35
|
};
|
48
36
|
};
|
49
37
|
declare const event: typeof eventFn & {
|
38
|
+
/**
|
39
|
+
* Checks if the event contains a specific action type.
|
40
|
+
* @param action - The action type to check for.
|
41
|
+
*/
|
42
|
+
hasAction: (action: ActionType) => import("../conditionals/conditionals").JSONSchema;
|
50
43
|
field(field: WorkqueueColumnKeys): WorkqueueColumnValue;
|
51
|
-
hasAction: (action: import("./ActionType").ActionType) => import("../conditionals/conditionals").JSONSchema;
|
52
44
|
};
|
53
45
|
export { event };
|
54
46
|
//# sourceMappingURL=event.d.ts.map
|
@@ -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";
|
@@ -69,5 +74,9 @@ export declare function field(fieldId: string, options?: {
|
|
69
74
|
isValidEnglishName: () => import("../conditionals/conditionals").JSONSchema;
|
70
75
|
matches: (pattern: string) => import("../conditionals/conditionals").JSONSchema;
|
71
76
|
isBetween: (min: number, max: number) => import("../conditionals/conditionals").JSONSchema;
|
77
|
+
getId: () => {
|
78
|
+
fieldId: string;
|
79
|
+
};
|
80
|
+
object: (options: Record<string, any>) => import("../conditionals/conditionals").JSONSchema;
|
72
81
|
};
|
73
82
|
//# sourceMappingURL=field.d.ts.map
|
@@ -35,6 +35,7 @@ export * from './test.utils';
|
|
35
35
|
export * from './TemplateConfig';
|
36
36
|
export * from './scopes';
|
37
37
|
export * from './serializer';
|
38
|
+
export * from './state/availableActions';
|
38
39
|
export * from '../conditionals/conditionals';
|
39
40
|
export * from '../conditionals/validate';
|
40
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,6 +1,6 @@
|
|
1
1
|
import { UUID } from '../uuid';
|
2
|
-
import { ActionDocument,
|
3
|
-
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
2
|
+
import { ActionDocument, EventState } from './ActionDocument';
|
3
|
+
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, NotifyActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
|
4
4
|
import { ActionType } from './ActionType';
|
5
5
|
import { Draft } from './Draft';
|
6
6
|
import { EventConfig } from './EventConfig';
|
@@ -8,10 +8,32 @@ import { EventDocument } from './EventDocument';
|
|
8
8
|
import { EventIndex } from './EventIndex';
|
9
9
|
import { EventInput } from './EventInput';
|
10
10
|
import { TranslationConfig } from './TranslationConfig';
|
11
|
+
import { FieldConfig } from './FieldConfig';
|
11
12
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
import { FieldValue } from './FieldValue';
|
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): {
|
15
37
|
create: (input?: Partial<EventInput>) => {
|
16
38
|
transactionId: string;
|
17
39
|
type: string;
|
@@ -21,17 +43,17 @@ export declare const eventPayloadGenerator: {
|
|
21
43
|
type: string;
|
22
44
|
id: string;
|
23
45
|
};
|
24
|
-
draft: ({ eventId, actionType }: {
|
46
|
+
draft: ({ eventId, actionType, annotation }: {
|
25
47
|
eventId: UUID;
|
26
48
|
actionType: ActionType;
|
49
|
+
annotation?: Record<string, any>;
|
27
50
|
}, input?: Partial<Draft>) => Draft;
|
28
51
|
actions: {
|
29
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
30
|
-
type: "DECLARE";
|
52
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
31
53
|
transactionId: string;
|
32
54
|
declaration: Record<string, string | number | boolean | {
|
33
55
|
type: string;
|
34
|
-
|
56
|
+
path: string;
|
35
57
|
originalFilename: string;
|
36
58
|
} | {
|
37
59
|
country: string;
|
@@ -44,6 +66,10 @@ export declare const eventPayloadGenerator: {
|
|
44
66
|
residentialArea?: string | null | undefined;
|
45
67
|
street?: string | null | undefined;
|
46
68
|
zipCode?: string | null | undefined;
|
69
|
+
} | {
|
70
|
+
firstname?: string | null | undefined;
|
71
|
+
surname?: string | null | undefined;
|
72
|
+
middlename?: string | null | undefined;
|
47
73
|
} | {
|
48
74
|
country: string;
|
49
75
|
district: string;
|
@@ -64,24 +90,26 @@ export declare const eventPayloadGenerator: {
|
|
64
90
|
} | {
|
65
91
|
type: string;
|
66
92
|
option: string;
|
67
|
-
|
93
|
+
path: string;
|
68
94
|
originalFilename: string;
|
69
|
-
}[] |
|
95
|
+
}[] | {
|
96
|
+
start: string;
|
97
|
+
end: string;
|
98
|
+
} | null | undefined>;
|
70
99
|
annotation: {};
|
100
|
+
keepAssignment?: boolean | undefined;
|
101
|
+
type: "DECLARE";
|
71
102
|
eventId: string;
|
72
103
|
};
|
73
104
|
/**
|
74
105
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
75
106
|
*/
|
76
|
-
notify: (eventId: string, input?: {
|
77
|
-
transactionId?: string;
|
78
|
-
declaration?: Partial<ActionUpdate>;
|
79
|
-
}) => {
|
107
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
80
108
|
type: "NOTIFY";
|
81
109
|
transactionId: string;
|
82
|
-
declaration:
|
110
|
+
declaration: Record<string, string | number | boolean | {
|
83
111
|
type: string;
|
84
|
-
|
112
|
+
path: string;
|
85
113
|
originalFilename: string;
|
86
114
|
} | {
|
87
115
|
country: string;
|
@@ -94,6 +122,10 @@ export declare const eventPayloadGenerator: {
|
|
94
122
|
residentialArea?: string | null | undefined;
|
95
123
|
street?: string | null | undefined;
|
96
124
|
zipCode?: string | null | undefined;
|
125
|
+
} | {
|
126
|
+
firstname?: string | null | undefined;
|
127
|
+
surname?: string | null | undefined;
|
128
|
+
middlename?: string | null | undefined;
|
97
129
|
} | {
|
98
130
|
country: string;
|
99
131
|
district: string;
|
@@ -114,17 +146,20 @@ export declare const eventPayloadGenerator: {
|
|
114
146
|
} | {
|
115
147
|
type: string;
|
116
148
|
option: string;
|
117
|
-
|
149
|
+
path: string;
|
118
150
|
originalFilename: string;
|
119
|
-
}[] |
|
151
|
+
}[] | {
|
152
|
+
start: string;
|
153
|
+
end: string;
|
154
|
+
} | null | undefined>;
|
120
155
|
eventId: string;
|
156
|
+
keepAssignment: boolean | undefined;
|
121
157
|
};
|
122
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
123
|
-
type: "VALIDATE";
|
158
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
124
159
|
transactionId: string;
|
125
160
|
declaration: Record<string, string | number | boolean | {
|
126
161
|
type: string;
|
127
|
-
|
162
|
+
path: string;
|
128
163
|
originalFilename: string;
|
129
164
|
} | {
|
130
165
|
country: string;
|
@@ -137,6 +172,10 @@ export declare const eventPayloadGenerator: {
|
|
137
172
|
residentialArea?: string | null | undefined;
|
138
173
|
street?: string | null | undefined;
|
139
174
|
zipCode?: string | null | undefined;
|
175
|
+
} | {
|
176
|
+
firstname?: string | null | undefined;
|
177
|
+
surname?: string | null | undefined;
|
178
|
+
middlename?: string | null | undefined;
|
140
179
|
} | {
|
141
180
|
country: string;
|
142
181
|
district: string;
|
@@ -157,10 +196,15 @@ export declare const eventPayloadGenerator: {
|
|
157
196
|
} | {
|
158
197
|
type: string;
|
159
198
|
option: string;
|
160
|
-
|
199
|
+
path: string;
|
161
200
|
originalFilename: string;
|
162
|
-
}[] |
|
201
|
+
}[] | {
|
202
|
+
start: string;
|
203
|
+
end: string;
|
204
|
+
} | null | undefined>;
|
163
205
|
annotation: {};
|
206
|
+
keepAssignment?: boolean | undefined;
|
207
|
+
type: "VALIDATE";
|
164
208
|
duplicates: never[];
|
165
209
|
eventId: string;
|
166
210
|
};
|
@@ -178,10 +222,55 @@ export declare const eventPayloadGenerator: {
|
|
178
222
|
assignedTo: null;
|
179
223
|
eventId: string;
|
180
224
|
};
|
181
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
182
|
-
type: "ARCHIVE";
|
225
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
183
226
|
transactionId: string;
|
184
|
-
declaration: {
|
227
|
+
declaration: Record<string, string | number | boolean | {
|
228
|
+
type: string;
|
229
|
+
path: string;
|
230
|
+
originalFilename: string;
|
231
|
+
} | {
|
232
|
+
country: string;
|
233
|
+
district: string;
|
234
|
+
addressType: "DOMESTIC";
|
235
|
+
province: string;
|
236
|
+
urbanOrRural: "URBAN";
|
237
|
+
number?: string | null | undefined;
|
238
|
+
town?: string | null | undefined;
|
239
|
+
residentialArea?: string | null | undefined;
|
240
|
+
street?: string | null | undefined;
|
241
|
+
zipCode?: string | null | undefined;
|
242
|
+
} | {
|
243
|
+
firstname?: string | null | undefined;
|
244
|
+
surname?: string | null | undefined;
|
245
|
+
middlename?: string | null | undefined;
|
246
|
+
} | {
|
247
|
+
country: string;
|
248
|
+
district: string;
|
249
|
+
addressType: "DOMESTIC";
|
250
|
+
province: string;
|
251
|
+
urbanOrRural: "RURAL";
|
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;
|
263
|
+
} | {
|
264
|
+
type: string;
|
265
|
+
option: string;
|
266
|
+
path: string;
|
267
|
+
originalFilename: string;
|
268
|
+
}[] | {
|
269
|
+
start: string;
|
270
|
+
end: string;
|
271
|
+
} | null | undefined>;
|
272
|
+
keepAssignment?: boolean | undefined;
|
273
|
+
type: "ARCHIVE";
|
185
274
|
annotation: {};
|
186
275
|
duplicates: never[];
|
187
276
|
eventId: string;
|
@@ -190,23 +279,23 @@ export declare const eventPayloadGenerator: {
|
|
190
279
|
isDuplicate: boolean;
|
191
280
|
};
|
192
281
|
};
|
193
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
194
|
-
type: "REJECT";
|
282
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
195
283
|
transactionId: string;
|
196
|
-
declaration: {};
|
197
284
|
annotation: {};
|
285
|
+
keepAssignment?: boolean | undefined;
|
286
|
+
type: "REJECT";
|
287
|
+
declaration: {};
|
198
288
|
duplicates: never[];
|
199
289
|
eventId: string;
|
200
290
|
reason: {
|
201
291
|
message: string;
|
202
292
|
};
|
203
293
|
};
|
204
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
205
|
-
type: "REGISTER";
|
294
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
206
295
|
transactionId: string;
|
207
296
|
declaration: Record<string, string | number | boolean | {
|
208
297
|
type: string;
|
209
|
-
|
298
|
+
path: string;
|
210
299
|
originalFilename: string;
|
211
300
|
} | {
|
212
301
|
country: string;
|
@@ -219,6 +308,10 @@ export declare const eventPayloadGenerator: {
|
|
219
308
|
residentialArea?: string | null | undefined;
|
220
309
|
street?: string | null | undefined;
|
221
310
|
zipCode?: string | null | undefined;
|
311
|
+
} | {
|
312
|
+
firstname?: string | null | undefined;
|
313
|
+
surname?: string | null | undefined;
|
314
|
+
middlename?: string | null | undefined;
|
222
315
|
} | {
|
223
316
|
country: string;
|
224
317
|
district: string;
|
@@ -239,26 +332,33 @@ export declare const eventPayloadGenerator: {
|
|
239
332
|
} | {
|
240
333
|
type: string;
|
241
334
|
option: string;
|
242
|
-
|
335
|
+
path: string;
|
243
336
|
originalFilename: string;
|
244
|
-
}[] |
|
337
|
+
}[] | {
|
338
|
+
start: string;
|
339
|
+
end: string;
|
340
|
+
} | null | undefined>;
|
245
341
|
annotation: {};
|
342
|
+
registrationNumber?: string | undefined;
|
343
|
+
keepAssignment?: boolean | undefined;
|
344
|
+
type: "REGISTER";
|
246
345
|
eventId: string;
|
247
346
|
};
|
248
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
249
|
-
type: "PRINT_CERTIFICATE";
|
347
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
250
348
|
transactionId: string;
|
251
|
-
declaration: {};
|
252
349
|
annotation: {};
|
350
|
+
keepAssignment?: boolean | undefined;
|
351
|
+
type: "PRINT_CERTIFICATE";
|
352
|
+
declaration: {};
|
253
353
|
eventId: string;
|
254
354
|
};
|
255
355
|
correction: {
|
256
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
356
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
257
357
|
type: "REQUEST_CORRECTION";
|
258
358
|
transactionId: string;
|
259
359
|
declaration: Record<string, string | number | boolean | {
|
260
360
|
type: string;
|
261
|
-
|
361
|
+
path: string;
|
262
362
|
originalFilename: string;
|
263
363
|
} | {
|
264
364
|
country: string;
|
@@ -271,6 +371,10 @@ export declare const eventPayloadGenerator: {
|
|
271
371
|
residentialArea?: string | null | undefined;
|
272
372
|
street?: string | null | undefined;
|
273
373
|
zipCode?: string | null | undefined;
|
374
|
+
} | {
|
375
|
+
firstname?: string | null | undefined;
|
376
|
+
surname?: string | null | undefined;
|
377
|
+
middlename?: string | null | undefined;
|
274
378
|
} | {
|
275
379
|
country: string;
|
276
380
|
district: string;
|
@@ -291,49 +395,77 @@ export declare const eventPayloadGenerator: {
|
|
291
395
|
} | {
|
292
396
|
type: string;
|
293
397
|
option: string;
|
294
|
-
|
398
|
+
path: string;
|
295
399
|
originalFilename: string;
|
296
|
-
}[] |
|
400
|
+
}[] | {
|
401
|
+
start: string;
|
402
|
+
end: string;
|
403
|
+
} | null | undefined>;
|
297
404
|
annotation: {};
|
298
405
|
eventId: string;
|
406
|
+
keepAssignment: boolean | undefined;
|
299
407
|
};
|
300
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
408
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
301
409
|
type: "APPROVE_CORRECTION";
|
302
410
|
transactionId: string;
|
303
411
|
declaration: {};
|
304
412
|
annotation: {};
|
305
413
|
eventId: string;
|
306
414
|
requestId: string;
|
415
|
+
keepAssignment: boolean | undefined;
|
307
416
|
};
|
308
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
417
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
309
418
|
type: "REJECT_CORRECTION";
|
310
419
|
transactionId: string;
|
311
420
|
declaration: {};
|
312
421
|
annotation: {};
|
313
422
|
eventId: string;
|
314
423
|
requestId: string;
|
424
|
+
keepAssignment: boolean | undefined;
|
315
425
|
};
|
316
426
|
};
|
317
427
|
};
|
318
428
|
};
|
319
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
429
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
320
430
|
configuration: EventConfig;
|
321
431
|
action: ActionType;
|
432
|
+
rng?: () => number;
|
322
433
|
defaults?: Partial<ActionDocument>;
|
434
|
+
user?: Partial<{
|
435
|
+
signature: string;
|
436
|
+
primaryOfficeId: UUID;
|
437
|
+
role: TestUserRole;
|
438
|
+
id: string;
|
439
|
+
}>;
|
323
440
|
}): ActionDocument;
|
324
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
441
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
325
442
|
configuration: EventConfig;
|
326
443
|
actions: ActionType[];
|
444
|
+
rng?: () => number;
|
445
|
+
user?: Partial<{
|
446
|
+
signature: string;
|
447
|
+
primaryOfficeId: UUID;
|
448
|
+
role: TestUserRole;
|
449
|
+
id: string;
|
450
|
+
}>;
|
327
451
|
}): EventDocument;
|
328
|
-
export declare function generateEventDraftDocument(eventId
|
452
|
+
export declare function generateEventDraftDocument({ eventId, actionType, rng, declaration }: {
|
453
|
+
eventId: UUID;
|
454
|
+
actionType: ActionType;
|
455
|
+
rng?: () => number;
|
456
|
+
declaration?: EventState;
|
457
|
+
}): Draft;
|
329
458
|
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
459
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
330
460
|
/**
|
331
461
|
* Useful for testing when we need deterministic outcome.
|
332
462
|
* @param seed - Seed value for the pseudo-random number generator
|
333
463
|
*
|
334
|
-
* @returns A function that generates pseudo-random numbers between 0 and 1
|
464
|
+
* @returns A function that generates pseudo-random numbers between 0 and 1 [0, 1)
|
335
465
|
*/
|
336
|
-
export declare function
|
466
|
+
export declare function createPrng(seed: number): () => number;
|
467
|
+
export declare function generateUuid(rng?: () => number): UUID;
|
468
|
+
export declare function generateRegistrationNumber(rng: () => number): string;
|
337
469
|
export declare function generateRandomSignature(rng: () => number): string;
|
338
470
|
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
339
471
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|