@opencrvs/toolkit 1.8.0-rc.ff62f9e → 1.8.0-rc.ffb4f66

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.
@@ -1,5 +1,5 @@
1
- import { ActionDocument } from './ActionDocument';
2
- import { ArchiveActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, ValidateActionInput } from './ActionInput';
1
+ import { ActionDocument, ActionUpdate } from './ActionDocument';
2
+ import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
3
3
  import { ActionType } from './ActionType';
4
4
  import { Draft } from './Draft';
5
5
  import { EventConfig } from './EventConfig';
@@ -8,7 +8,7 @@ import { EventIndex } from './EventIndex';
8
8
  import { EventInput } from './EventInput';
9
9
  import { FieldValue } from './FieldValue';
10
10
  import { TranslationConfig } from './TranslationConfig';
11
- export declare function generateActionInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | {
11
+ export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | {
12
12
  type: string;
13
13
  filename: string;
14
14
  originalFilename: string;
@@ -46,7 +46,7 @@ export declare function generateActionInput(configuration: EventConfig, action:
46
46
  filename: string;
47
47
  originalFilename: string;
48
48
  }[] | undefined>;
49
- export declare function generateActionMetadataInput(configuration: EventConfig, action: ActionType): {};
49
+ export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {};
50
50
  export declare const eventPayloadGenerator: {
51
51
  create: (input?: Partial<EventInput>) => {
52
52
  transactionId: string;
@@ -57,35 +57,15 @@ export declare const eventPayloadGenerator: {
57
57
  type: string;
58
58
  id: string;
59
59
  };
60
- draft: (eventId: string, input?: Partial<Draft>) => {
61
- id: import("../uuid").UUID;
60
+ draft: ({ eventId, actionType }: {
62
61
  eventId: string;
63
- createdAt: string;
64
- transactionId: import("../uuid").UUID;
65
- action: {
66
- type: "REQUEST_CORRECTION";
67
- data: {
68
- 'applicant.firstname': string;
69
- 'applicant.surname': string;
70
- 'applicant.dob': string;
71
- 'recommender.none': boolean;
72
- };
73
- metadata: {
74
- 'correction.requester.relationship': string;
75
- 'correction.request.reason': string;
76
- };
77
- createdAt: string;
78
- createdBy: string;
79
- createdAtLocation: string;
80
- };
81
- } & Partial<{
82
- id: string;
83
- createdAt: string;
84
- eventId: string;
85
- transactionId: string;
86
- action: {
87
- type: ActionType;
88
- data: Record<string, string | number | boolean | {
62
+ actionType: ActionType;
63
+ }, input?: Partial<Draft>) => Draft;
64
+ actions: {
65
+ declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "declaration" | "annotation">>) => {
66
+ type: "DECLARE";
67
+ transactionId: string;
68
+ declaration: Record<string, string | number | boolean | {
89
69
  type: string;
90
70
  filename: string;
91
71
  originalFilename: string;
@@ -123,54 +103,19 @@ export declare const eventPayloadGenerator: {
123
103
  filename: string;
124
104
  originalFilename: string;
125
105
  }[] | undefined>;
126
- createdAt: string;
127
- createdBy: string;
128
- createdAtLocation: string;
129
- metadata?: Record<string, string | number | boolean | {
130
- type: string;
131
- filename: string;
132
- originalFilename: string;
133
- } | {
134
- country: string;
135
- district: string;
136
- addressType: "DOMESTIC";
137
- province: string;
138
- urbanOrRural: "URBAN";
139
- number?: string | null | undefined;
140
- town?: string | null | undefined;
141
- residentialArea?: string | null | undefined;
142
- street?: string | null | undefined;
143
- zipCode?: string | null | undefined;
144
- } | {
145
- country: string;
146
- district: string;
147
- addressType: "DOMESTIC";
148
- province: string;
149
- urbanOrRural: "RURAL";
150
- village?: string | null | undefined;
151
- } | {
152
- country: string;
153
- state: string;
154
- addressType: "INTERNATIONAL";
155
- district2: string;
156
- cityOrTown?: string | null | undefined;
157
- addressLine1?: string | null | undefined;
158
- addressLine2?: string | null | undefined;
159
- addressLine3?: string | null | undefined;
160
- postcodeOrZip?: string | null | undefined;
161
- } | {
162
- type: string;
163
- option: string;
164
- filename: string;
165
- originalFilename: string;
166
- }[] | undefined> | undefined;
106
+ annotation: {};
107
+ eventId: string;
167
108
  };
168
- }>;
169
- actions: {
170
- declare: (eventId: string, input?: Partial<Pick<DeclareActionInput, "transactionId" | "data">>) => {
171
- type: "DECLARE";
109
+ /**
110
+ * Notify allows sending incomplete data. Think it as 'partial declare' for now.
111
+ */
112
+ notify: (eventId: string, input?: {
113
+ transactionId?: string;
114
+ declaration?: Partial<ActionUpdate>;
115
+ }) => {
116
+ type: "NOTIFY";
172
117
  transactionId: string;
173
- data: Record<string, string | number | boolean | {
118
+ declaration: Partial<Record<string, string | number | boolean | {
174
119
  type: string;
175
120
  filename: string;
176
121
  originalFilename: string;
@@ -207,13 +152,13 @@ export declare const eventPayloadGenerator: {
207
152
  option: string;
208
153
  filename: string;
209
154
  originalFilename: string;
210
- }[] | undefined>;
155
+ }[] | undefined>>;
211
156
  eventId: string;
212
157
  };
213
- validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "data">>) => {
158
+ validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation">>) => {
214
159
  type: "VALIDATE";
215
160
  transactionId: string;
216
- data: Record<string, string | number | boolean | {
161
+ declaration: Record<string, string | number | boolean | {
217
162
  type: string;
218
163
  filename: string;
219
164
  originalFilename: string;
@@ -251,104 +196,46 @@ export declare const eventPayloadGenerator: {
251
196
  filename: string;
252
197
  originalFilename: string;
253
198
  }[] | undefined>;
199
+ annotation: {};
254
200
  duplicates: never[];
255
201
  eventId: string;
256
202
  };
257
- archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "data">>, isDuplicate?: boolean) => {
203
+ assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
204
+ type: "ASSIGN";
205
+ transactionId: string;
206
+ declaration: {};
207
+ assignedTo: string;
208
+ eventId: string;
209
+ };
210
+ unassign: (eventId: string, input?: Partial<Pick<UnassignActionInput, "transactionId">>) => {
211
+ type: "UNASSIGN";
212
+ transactionId: string;
213
+ declaration: {};
214
+ assignedTo: null;
215
+ eventId: string;
216
+ };
217
+ archive: (eventId: string, input?: Partial<Pick<ArchiveActionInput, "transactionId" | "declaration">>, isDuplicate?: boolean) => {
258
218
  type: "ARCHIVE";
259
219
  transactionId: string;
260
- data: Record<string, string | number | boolean | {
261
- type: string;
262
- filename: string;
263
- originalFilename: string;
264
- } | {
265
- country: string;
266
- district: string;
267
- addressType: "DOMESTIC";
268
- province: string;
269
- urbanOrRural: "URBAN";
270
- number?: string | null | undefined;
271
- town?: string | null | undefined;
272
- residentialArea?: string | null | undefined;
273
- street?: string | null | undefined;
274
- zipCode?: string | null | undefined;
275
- } | {
276
- country: string;
277
- district: string;
278
- addressType: "DOMESTIC";
279
- province: string;
280
- urbanOrRural: "RURAL";
281
- village?: string | null | undefined;
282
- } | {
283
- country: string;
284
- state: string;
285
- addressType: "INTERNATIONAL";
286
- district2: string;
287
- cityOrTown?: string | null | undefined;
288
- addressLine1?: string | null | undefined;
289
- addressLine2?: string | null | undefined;
290
- addressLine3?: string | null | undefined;
291
- postcodeOrZip?: string | null | undefined;
292
- } | {
293
- type: string;
294
- option: string;
295
- filename: string;
296
- originalFilename: string;
297
- }[] | undefined>;
298
- metadata: {
220
+ declaration: {};
221
+ annotation: {
299
222
  isDuplicate: boolean;
300
223
  };
301
224
  duplicates: never[];
302
225
  eventId: string;
303
226
  };
304
- reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "data">>) => {
227
+ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => {
305
228
  type: "REJECT";
306
229
  transactionId: string;
307
- data: Record<string, string | number | boolean | {
308
- type: string;
309
- filename: string;
310
- originalFilename: string;
311
- } | {
312
- country: string;
313
- district: string;
314
- addressType: "DOMESTIC";
315
- province: string;
316
- urbanOrRural: "URBAN";
317
- number?: string | null | undefined;
318
- town?: string | null | undefined;
319
- residentialArea?: string | null | undefined;
320
- street?: string | null | undefined;
321
- zipCode?: string | null | undefined;
322
- } | {
323
- country: string;
324
- district: string;
325
- addressType: "DOMESTIC";
326
- province: string;
327
- urbanOrRural: "RURAL";
328
- village?: string | null | undefined;
329
- } | {
330
- country: string;
331
- state: string;
332
- addressType: "INTERNATIONAL";
333
- district2: string;
334
- cityOrTown?: string | null | undefined;
335
- addressLine1?: string | null | undefined;
336
- addressLine2?: string | null | undefined;
337
- addressLine3?: string | null | undefined;
338
- postcodeOrZip?: string | null | undefined;
339
- } | {
340
- type: string;
341
- option: string;
342
- filename: string;
343
- originalFilename: string;
344
- }[] | undefined>;
230
+ declaration: {};
231
+ annotation: {};
345
232
  duplicates: never[];
346
233
  eventId: string;
347
234
  };
348
- register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "data">>) => {
235
+ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => {
349
236
  type: "REGISTER";
350
237
  transactionId: string;
351
- data: Record<string, string | number | boolean | {
238
+ declaration: Record<string, string | number | boolean | {
352
239
  type: string;
353
240
  filename: string;
354
241
  originalFilename: string;
@@ -386,57 +273,21 @@ export declare const eventPayloadGenerator: {
386
273
  filename: string;
387
274
  originalFilename: string;
388
275
  }[] | undefined>;
276
+ annotation: {};
389
277
  eventId: string;
390
278
  };
391
- printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "data" | "metadata">>) => {
279
+ printCertificate: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "annotation">>) => {
392
280
  type: "PRINT_CERTIFICATE";
393
281
  transactionId: string;
394
- data: Record<string, string | number | boolean | {
395
- type: string;
396
- filename: string;
397
- originalFilename: string;
398
- } | {
399
- country: string;
400
- district: string;
401
- addressType: "DOMESTIC";
402
- province: string;
403
- urbanOrRural: "URBAN";
404
- number?: string | null | undefined;
405
- town?: string | null | undefined;
406
- residentialArea?: string | null | undefined;
407
- street?: string | null | undefined;
408
- zipCode?: string | null | undefined;
409
- } | {
410
- country: string;
411
- district: string;
412
- addressType: "DOMESTIC";
413
- province: string;
414
- urbanOrRural: "RURAL";
415
- village?: string | null | undefined;
416
- } | {
417
- country: string;
418
- state: string;
419
- addressType: "INTERNATIONAL";
420
- district2: string;
421
- cityOrTown?: string | null | undefined;
422
- addressLine1?: string | null | undefined;
423
- addressLine2?: string | null | undefined;
424
- addressLine3?: string | null | undefined;
425
- postcodeOrZip?: string | null | undefined;
426
- } | {
427
- type: string;
428
- option: string;
429
- filename: string;
430
- originalFilename: string;
431
- }[] | undefined>;
432
- metadata: {};
282
+ declaration: {};
283
+ annotation: {};
433
284
  eventId: string;
434
285
  };
435
286
  correction: {
436
- request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
287
+ request: (eventId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "declaration" | "annotation">>) => {
437
288
  type: "REQUEST_CORRECTION";
438
289
  transactionId: string;
439
- data: Record<string, string | number | boolean | {
290
+ declaration: Record<string, string | number | boolean | {
440
291
  type: string;
441
292
  filename: string;
442
293
  originalFilename: string;
@@ -474,94 +325,22 @@ export declare const eventPayloadGenerator: {
474
325
  filename: string;
475
326
  originalFilename: string;
476
327
  }[] | undefined>;
477
- metadata: {};
328
+ annotation: {};
478
329
  eventId: string;
479
330
  };
480
- approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
331
+ approve: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
481
332
  type: "APPROVE_CORRECTION";
482
333
  transactionId: string;
483
- data: Record<string, string | number | boolean | {
484
- type: string;
485
- filename: string;
486
- originalFilename: string;
487
- } | {
488
- country: string;
489
- district: string;
490
- addressType: "DOMESTIC";
491
- province: string;
492
- urbanOrRural: "URBAN";
493
- number?: string | null | undefined;
494
- town?: string | null | undefined;
495
- residentialArea?: string | null | undefined;
496
- street?: string | null | undefined;
497
- zipCode?: string | null | undefined;
498
- } | {
499
- country: string;
500
- district: string;
501
- addressType: "DOMESTIC";
502
- province: string;
503
- urbanOrRural: "RURAL";
504
- village?: string | null | undefined;
505
- } | {
506
- country: string;
507
- state: string;
508
- addressType: "INTERNATIONAL";
509
- district2: string;
510
- cityOrTown?: string | null | undefined;
511
- addressLine1?: string | null | undefined;
512
- addressLine2?: string | null | undefined;
513
- addressLine3?: string | null | undefined;
514
- postcodeOrZip?: string | null | undefined;
515
- } | {
516
- type: string;
517
- option: string;
518
- filename: string;
519
- originalFilename: string;
520
- }[] | undefined>;
334
+ declaration: {};
335
+ annotation: {};
521
336
  eventId: string;
522
337
  requestId: string;
523
338
  };
524
- reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "data">>) => {
339
+ reject: (eventId: string, requestId: string, input?: Partial<Pick<RequestCorrectionActionInput, "transactionId" | "annotation">>) => {
525
340
  type: "REJECT_CORRECTION";
526
341
  transactionId: string;
527
- data: Record<string, string | number | boolean | {
528
- type: string;
529
- filename: string;
530
- originalFilename: string;
531
- } | {
532
- country: string;
533
- district: string;
534
- addressType: "DOMESTIC";
535
- province: string;
536
- urbanOrRural: "URBAN";
537
- number?: string | null | undefined;
538
- town?: string | null | undefined;
539
- residentialArea?: string | null | undefined;
540
- street?: string | null | undefined;
541
- zipCode?: string | null | undefined;
542
- } | {
543
- country: string;
544
- district: string;
545
- addressType: "DOMESTIC";
546
- province: string;
547
- urbanOrRural: "RURAL";
548
- village?: string | null | undefined;
549
- } | {
550
- country: string;
551
- state: string;
552
- addressType: "INTERNATIONAL";
553
- district2: string;
554
- cityOrTown?: string | null | undefined;
555
- addressLine1?: string | null | undefined;
556
- addressLine2?: string | null | undefined;
557
- addressLine3?: string | null | undefined;
558
- postcodeOrZip?: string | null | undefined;
559
- } | {
560
- type: string;
561
- option: string;
562
- filename: string;
563
- originalFilename: string;
564
- }[] | undefined>;
342
+ declaration: {};
343
+ annotation: {};
565
344
  eventId: string;
566
345
  requestId: string;
567
346
  };
@@ -577,7 +356,7 @@ export declare function generateEventDocument({ configuration, actions }: {
577
356
  configuration: EventConfig;
578
357
  actions: ActionType[];
579
358
  }): EventDocument;
580
- export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, data?: Record<string, FieldValue>): Draft;
359
+ export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: Record<string, FieldValue>): Draft;
581
360
  export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex;
582
361
  export declare const generateTranslationConfig: (message: string) => TranslationConfig;
583
362
  //# sourceMappingURL=test.utils.d.ts.map