@opencrvs/toolkit 1.8.0-rc.facf9d6 → 1.8.0-rc.fafdecd
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 +7446 -7966
- 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 +59626 -28798
- package/dist/commons/events/ActionDocument.d.ts +3774 -1227
- package/dist/commons/events/ActionInput.d.ts +3066 -966
- 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/CreatedAtLocation.d.ts +1 -2
- package/dist/commons/events/Draft.d.ts +264 -91
- package/dist/commons/events/EventConfig.d.ts +34730 -17420
- package/dist/commons/events/EventDocument.d.ts +2390 -803
- package/dist/commons/events/EventIndex.d.ts +1130 -257
- package/dist/commons/events/EventMetadata.d.ts +76 -64
- package/dist/commons/events/FieldConfig.d.ts +2300 -960
- 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 -14991
- package/dist/commons/events/PageConfig.d.ts +3730 -1680
- 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 +4553 -1462
- 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 +2 -3
- package/dist/commons/events/test.utils.d.ts +183 -50
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +13648 -1221
- package/dist/conditionals/index.js +40 -52
- package/dist/events/index.js +2527 -1749
- 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: {
|
@@ -11,7 +10,7 @@ export declare const ACTION_ALLOWED_SCOPES: {
|
|
11
10
|
VALIDATE: ["record.declaration-submit-for-approval", "record.register"];
|
12
11
|
REGISTER: ["record.register"];
|
13
12
|
PRINT_CERTIFICATE: ["record.registration-print&issue-certified-copies"];
|
14
|
-
REQUEST_CORRECTION: ["record.registration-request-correction"
|
13
|
+
REQUEST_CORRECTION: ["record.registration-request-correction"];
|
15
14
|
REJECT_CORRECTION: ["record.registration-correct"];
|
16
15
|
APPROVE_CORRECTION: ["record.registration-correct"];
|
17
16
|
MARKED_AS_DUPLICATE: ["record.declaration-archive"];
|
@@ -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,10 +8,32 @@ import { EventDocument } from './EventDocument';
|
|
7
8
|
import { EventIndex } from './EventIndex';
|
8
9
|
import { EventInput } from './EventInput';
|
9
10
|
import { TranslationConfig } from './TranslationConfig';
|
11
|
+
import { FieldConfig } from './FieldConfig';
|
10
12
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
11
|
-
|
12
|
-
|
13
|
-
|
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): {
|
14
37
|
create: (input?: Partial<EventInput>) => {
|
15
38
|
transactionId: string;
|
16
39
|
type: string;
|
@@ -20,17 +43,17 @@ export declare const eventPayloadGenerator: {
|
|
20
43
|
type: string;
|
21
44
|
id: string;
|
22
45
|
};
|
23
|
-
draft: ({ eventId, actionType }: {
|
24
|
-
eventId:
|
46
|
+
draft: ({ eventId, actionType, annotation }: {
|
47
|
+
eventId: UUID;
|
25
48
|
actionType: ActionType;
|
49
|
+
annotation?: Record<string, any>;
|
26
50
|
}, input?: Partial<Draft>) => Draft;
|
27
51
|
actions: {
|
28
|
-
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
29
|
-
type: "DECLARE";
|
52
|
+
declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
30
53
|
transactionId: string;
|
31
54
|
declaration: Record<string, string | number | boolean | {
|
32
55
|
type: string;
|
33
|
-
|
56
|
+
path: string;
|
34
57
|
originalFilename: string;
|
35
58
|
} | {
|
36
59
|
country: string;
|
@@ -43,6 +66,10 @@ export declare const eventPayloadGenerator: {
|
|
43
66
|
residentialArea?: string | null | undefined;
|
44
67
|
street?: string | null | undefined;
|
45
68
|
zipCode?: string | null | undefined;
|
69
|
+
} | {
|
70
|
+
firstname?: string | null | undefined;
|
71
|
+
surname?: string | null | undefined;
|
72
|
+
middlename?: string | null | undefined;
|
46
73
|
} | {
|
47
74
|
country: string;
|
48
75
|
district: string;
|
@@ -63,24 +90,26 @@ export declare const eventPayloadGenerator: {
|
|
63
90
|
} | {
|
64
91
|
type: string;
|
65
92
|
option: string;
|
66
|
-
|
93
|
+
path: string;
|
67
94
|
originalFilename: string;
|
68
|
-
}[] |
|
95
|
+
}[] | {
|
96
|
+
start: string;
|
97
|
+
end: string;
|
98
|
+
} | null | undefined>;
|
69
99
|
annotation: {};
|
100
|
+
keepAssignment?: boolean | undefined;
|
101
|
+
type: "DECLARE";
|
70
102
|
eventId: string;
|
71
103
|
};
|
72
104
|
/**
|
73
105
|
* Notify allows sending incomplete data. Think it as 'partial declare' for now.
|
74
106
|
*/
|
75
|
-
notify: (eventId: string, input?: {
|
76
|
-
transactionId?: string;
|
77
|
-
declaration?: Partial<ActionUpdate>;
|
78
|
-
}) => {
|
107
|
+
notify: (eventId: string, input?: Partial<Pick<NotifyActionInput, "transactionId" | "declaration" | "keepAssignment">>) => {
|
79
108
|
type: "NOTIFY";
|
80
109
|
transactionId: string;
|
81
|
-
declaration:
|
110
|
+
declaration: Record<string, string | number | boolean | {
|
82
111
|
type: string;
|
83
|
-
|
112
|
+
path: string;
|
84
113
|
originalFilename: string;
|
85
114
|
} | {
|
86
115
|
country: string;
|
@@ -93,6 +122,10 @@ export declare const eventPayloadGenerator: {
|
|
93
122
|
residentialArea?: string | null | undefined;
|
94
123
|
street?: string | null | undefined;
|
95
124
|
zipCode?: string | null | undefined;
|
125
|
+
} | {
|
126
|
+
firstname?: string | null | undefined;
|
127
|
+
surname?: string | null | undefined;
|
128
|
+
middlename?: string | null | undefined;
|
96
129
|
} | {
|
97
130
|
country: string;
|
98
131
|
district: string;
|
@@ -113,17 +146,20 @@ export declare const eventPayloadGenerator: {
|
|
113
146
|
} | {
|
114
147
|
type: string;
|
115
148
|
option: string;
|
116
|
-
|
149
|
+
path: string;
|
117
150
|
originalFilename: string;
|
118
|
-
}[] |
|
151
|
+
}[] | {
|
152
|
+
start: string;
|
153
|
+
end: string;
|
154
|
+
} | null | undefined>;
|
119
155
|
eventId: string;
|
156
|
+
keepAssignment: boolean | undefined;
|
120
157
|
};
|
121
|
-
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
122
|
-
type: "VALIDATE";
|
158
|
+
validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
123
159
|
transactionId: string;
|
124
160
|
declaration: Record<string, string | number | boolean | {
|
125
161
|
type: string;
|
126
|
-
|
162
|
+
path: string;
|
127
163
|
originalFilename: string;
|
128
164
|
} | {
|
129
165
|
country: string;
|
@@ -136,6 +172,10 @@ export declare const eventPayloadGenerator: {
|
|
136
172
|
residentialArea?: string | null | undefined;
|
137
173
|
street?: string | null | undefined;
|
138
174
|
zipCode?: string | null | undefined;
|
175
|
+
} | {
|
176
|
+
firstname?: string | null | undefined;
|
177
|
+
surname?: string | null | undefined;
|
178
|
+
middlename?: string | null | undefined;
|
139
179
|
} | {
|
140
180
|
country: string;
|
141
181
|
district: string;
|
@@ -156,10 +196,15 @@ export declare const eventPayloadGenerator: {
|
|
156
196
|
} | {
|
157
197
|
type: string;
|
158
198
|
option: string;
|
159
|
-
|
199
|
+
path: string;
|
160
200
|
originalFilename: string;
|
161
|
-
}[] |
|
201
|
+
}[] | {
|
202
|
+
start: string;
|
203
|
+
end: string;
|
204
|
+
} | null | undefined>;
|
162
205
|
annotation: {};
|
206
|
+
keepAssignment?: boolean | undefined;
|
207
|
+
type: "VALIDATE";
|
163
208
|
duplicates: never[];
|
164
209
|
eventId: string;
|
165
210
|
};
|
@@ -177,10 +222,55 @@ export declare const eventPayloadGenerator: {
|
|
177
222
|
assignedTo: null;
|
178
223
|
eventId: string;
|
179
224
|
};
|
180
|
-
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
|
181
|
-
type: "ARCHIVE";
|
225
|
+
archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration" | "keepAssignment">>, isDuplicate?: boolean) => {
|
182
226
|
transactionId: string;
|
183
|
-
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";
|
184
274
|
annotation: {};
|
185
275
|
duplicates: never[];
|
186
276
|
eventId: string;
|
@@ -189,23 +279,23 @@ export declare const eventPayloadGenerator: {
|
|
189
279
|
isDuplicate: boolean;
|
190
280
|
};
|
191
281
|
};
|
192
|
-
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
|
193
|
-
type: "REJECT";
|
282
|
+
reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
194
283
|
transactionId: string;
|
195
|
-
declaration: {};
|
196
284
|
annotation: {};
|
285
|
+
keepAssignment?: boolean | undefined;
|
286
|
+
type: "REJECT";
|
287
|
+
declaration: {};
|
197
288
|
duplicates: never[];
|
198
289
|
eventId: string;
|
199
290
|
reason: {
|
200
291
|
message: string;
|
201
292
|
};
|
202
293
|
};
|
203
|
-
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
204
|
-
type: "REGISTER";
|
294
|
+
register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment" | "registrationNumber">>) => {
|
205
295
|
transactionId: string;
|
206
296
|
declaration: Record<string, string | number | boolean | {
|
207
297
|
type: string;
|
208
|
-
|
298
|
+
path: string;
|
209
299
|
originalFilename: string;
|
210
300
|
} | {
|
211
301
|
country: string;
|
@@ -218,6 +308,10 @@ export declare const eventPayloadGenerator: {
|
|
218
308
|
residentialArea?: string | null | undefined;
|
219
309
|
street?: string | null | undefined;
|
220
310
|
zipCode?: string | null | undefined;
|
311
|
+
} | {
|
312
|
+
firstname?: string | null | undefined;
|
313
|
+
surname?: string | null | undefined;
|
314
|
+
middlename?: string | null | undefined;
|
221
315
|
} | {
|
222
316
|
country: string;
|
223
317
|
district: string;
|
@@ -238,26 +332,33 @@ export declare const eventPayloadGenerator: {
|
|
238
332
|
} | {
|
239
333
|
type: string;
|
240
334
|
option: string;
|
241
|
-
|
335
|
+
path: string;
|
242
336
|
originalFilename: string;
|
243
|
-
}[] |
|
337
|
+
}[] | {
|
338
|
+
start: string;
|
339
|
+
end: string;
|
340
|
+
} | null | undefined>;
|
244
341
|
annotation: {};
|
342
|
+
registrationNumber?: string | undefined;
|
343
|
+
keepAssignment?: boolean | undefined;
|
344
|
+
type: "REGISTER";
|
245
345
|
eventId: string;
|
246
346
|
};
|
247
|
-
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
|
248
|
-
type: "PRINT_CERTIFICATE";
|
347
|
+
printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
249
348
|
transactionId: string;
|
250
|
-
declaration: {};
|
251
349
|
annotation: {};
|
350
|
+
keepAssignment?: boolean | undefined;
|
351
|
+
type: "PRINT_CERTIFICATE";
|
352
|
+
declaration: {};
|
252
353
|
eventId: string;
|
253
354
|
};
|
254
355
|
correction: {
|
255
|
-
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
|
356
|
+
request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
|
256
357
|
type: "REQUEST_CORRECTION";
|
257
358
|
transactionId: string;
|
258
359
|
declaration: Record<string, string | number | boolean | {
|
259
360
|
type: string;
|
260
|
-
|
361
|
+
path: string;
|
261
362
|
originalFilename: string;
|
262
363
|
} | {
|
263
364
|
country: string;
|
@@ -270,6 +371,10 @@ export declare const eventPayloadGenerator: {
|
|
270
371
|
residentialArea?: string | null | undefined;
|
271
372
|
street?: string | null | undefined;
|
272
373
|
zipCode?: string | null | undefined;
|
374
|
+
} | {
|
375
|
+
firstname?: string | null | undefined;
|
376
|
+
surname?: string | null | undefined;
|
377
|
+
middlename?: string | null | undefined;
|
273
378
|
} | {
|
274
379
|
country: string;
|
275
380
|
district: string;
|
@@ -290,49 +395,77 @@ export declare const eventPayloadGenerator: {
|
|
290
395
|
} | {
|
291
396
|
type: string;
|
292
397
|
option: string;
|
293
|
-
|
398
|
+
path: string;
|
294
399
|
originalFilename: string;
|
295
|
-
}[] |
|
400
|
+
}[] | {
|
401
|
+
start: string;
|
402
|
+
end: string;
|
403
|
+
} | null | undefined>;
|
296
404
|
annotation: {};
|
297
405
|
eventId: string;
|
406
|
+
keepAssignment: boolean | undefined;
|
298
407
|
};
|
299
|
-
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
408
|
+
approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
300
409
|
type: "APPROVE_CORRECTION";
|
301
410
|
transactionId: string;
|
302
411
|
declaration: {};
|
303
412
|
annotation: {};
|
304
413
|
eventId: string;
|
305
414
|
requestId: string;
|
415
|
+
keepAssignment: boolean | undefined;
|
306
416
|
};
|
307
|
-
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
|
417
|
+
reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
|
308
418
|
type: "REJECT_CORRECTION";
|
309
419
|
transactionId: string;
|
310
420
|
declaration: {};
|
311
421
|
annotation: {};
|
312
422
|
eventId: string;
|
313
423
|
requestId: string;
|
424
|
+
keepAssignment: boolean | undefined;
|
314
425
|
};
|
315
426
|
};
|
316
427
|
};
|
317
428
|
};
|
318
|
-
export declare function generateActionDocument({ configuration, action, defaults }: {
|
429
|
+
export declare function generateActionDocument({ configuration, action, rng, defaults, user }: {
|
319
430
|
configuration: EventConfig;
|
320
431
|
action: ActionType;
|
432
|
+
rng?: () => number;
|
321
433
|
defaults?: Partial<ActionDocument>;
|
434
|
+
user?: Partial<{
|
435
|
+
signature: string;
|
436
|
+
primaryOfficeId: UUID;
|
437
|
+
role: TestUserRole;
|
438
|
+
id: string;
|
439
|
+
}>;
|
322
440
|
}): ActionDocument;
|
323
|
-
export declare function generateEventDocument({ configuration, actions }: {
|
441
|
+
export declare function generateEventDocument({ configuration, actions, rng, user }: {
|
324
442
|
configuration: EventConfig;
|
325
443
|
actions: ActionType[];
|
444
|
+
rng?: () => number;
|
445
|
+
user?: Partial<{
|
446
|
+
signature: string;
|
447
|
+
primaryOfficeId: UUID;
|
448
|
+
role: TestUserRole;
|
449
|
+
id: string;
|
450
|
+
}>;
|
326
451
|
}): EventDocument;
|
327
|
-
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;
|
328
458
|
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string;
|
459
|
+
export declare function getRandomDate(rng: () => number, start: string, end: string): string;
|
329
460
|
/**
|
330
461
|
* Useful for testing when we need deterministic outcome.
|
331
462
|
* @param seed - Seed value for the pseudo-random number generator
|
332
463
|
*
|
333
|
-
* @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)
|
334
465
|
*/
|
335
|
-
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;
|
336
469
|
export declare function generateRandomSignature(rng: () => number): string;
|
337
470
|
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex;
|
338
471
|
export declare const generateTranslationConfig: (message: string) => TranslationConfig;
|
@@ -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
|