@opencrvs/toolkit 1.9.13-rc.fc5374d → 2.0.0-rc.e0918cb

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.
Files changed (130) hide show
  1. package/build.sh +13 -0
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/application-config/index.d.ts +2 -0
  4. package/dist/application-config/index.d.ts.map +1 -0
  5. package/dist/application-config/index.js +2128 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +3633 -0
  9. package/dist/commons/api/router.d.ts +3438 -2300
  10. package/dist/commons/application-config/index.d.ts +84 -0
  11. package/dist/commons/conditionals/conditionals.d.ts +27 -3
  12. package/dist/commons/conditionals/validate.d.ts +13 -3
  13. package/dist/commons/events/ActionConfig.d.ts +415 -1555
  14. package/dist/commons/events/ActionDocument.d.ts +888 -1941
  15. package/dist/commons/events/ActionInput.d.ts +277 -1073
  16. package/dist/commons/events/ActionType.d.ts +91 -11
  17. package/dist/commons/events/AdvancedSearchConfig.d.ts +294 -1496
  18. package/dist/commons/events/AuditLog.d.ts +405 -0
  19. package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
  20. package/dist/commons/events/Conditional.d.ts +26 -38
  21. package/dist/commons/events/Constants.d.ts +1 -1
  22. package/dist/commons/events/CountryConfigQueryInput.d.ts +1592 -4471
  23. package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
  24. package/dist/commons/events/Draft.d.ts +72 -107
  25. package/dist/commons/events/DynamicFieldValue.d.ts +12 -78
  26. package/dist/commons/events/EventConfig.d.ts +37 -2420
  27. package/dist/commons/events/EventConfigInput.d.ts +0 -3
  28. package/dist/commons/events/EventDocument.d.ts +354 -1366
  29. package/dist/commons/events/EventIndex.d.ts +212 -1010
  30. package/dist/commons/events/EventInput.d.ts +3 -8
  31. package/dist/commons/events/EventMetadata.d.ts +130 -357
  32. package/dist/commons/events/FieldConfig.d.ts +2892 -12892
  33. package/dist/commons/events/FieldType.d.ts +26 -4
  34. package/dist/commons/events/FieldTypeMapping.d.ts +314 -906
  35. package/dist/commons/events/FieldValue.d.ts +149 -527
  36. package/dist/commons/events/FileUtils.d.ts +2 -2
  37. package/dist/commons/events/Flag.d.ts +67 -0
  38. package/dist/commons/events/FormConfig.d.ts +54 -721
  39. package/dist/commons/events/PageConfig.d.ts +58 -320
  40. package/dist/commons/events/PlainDate.d.ts +1 -1
  41. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  42. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  43. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  44. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  45. package/dist/commons/events/WorkqueueConfig.d.ts +2208 -7553
  46. package/dist/commons/events/deduplication.d.ts +3 -3
  47. package/dist/commons/events/defineConfig.d.ts +2 -247
  48. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  49. package/dist/commons/events/index.d.ts +3 -0
  50. package/dist/commons/events/locations.d.ts +57 -20
  51. package/dist/commons/events/scopes.d.ts +36 -35
  52. package/dist/commons/events/state/availableActions.d.ts +7 -2
  53. package/dist/commons/events/state/flags.d.ts +21 -3
  54. package/dist/commons/events/state/index.d.ts +30 -27
  55. package/dist/commons/events/state/utils.d.ts +190 -172
  56. package/dist/commons/events/test.utils.d.ts +52 -11
  57. package/dist/commons/events/transactions.d.ts +1 -1
  58. package/dist/commons/events/utils.d.ts +373 -273
  59. package/dist/commons/notification/UserNotifications.d.ts +61 -637
  60. package/dist/conditionals/index.d.ts.map +1 -1
  61. package/dist/conditionals/index.js +302 -14
  62. package/dist/events/deduplication.d.ts +3 -3
  63. package/dist/events/index.js +2860 -2115
  64. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
  65. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
  66. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
  67. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +3 -0
  68. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -0
  69. package/dist/migrations/v2.0/checkout-upstream-files.js +143 -0
  70. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
  71. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
  72. package/dist/migrations/v2.0/convert-config-files-to-ts.js +829 -0
  73. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
  74. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
  75. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
  76. package/dist/migrations/v2.0/create-events-index.d.ts +3 -0
  77. package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -0
  78. package/dist/migrations/v2.0/create-events-index.js +326 -0
  79. package/dist/migrations/v2.0/index.d.ts +7 -0
  80. package/dist/migrations/v2.0/index.d.ts.map +1 -0
  81. package/dist/migrations/v2.0/index.js +3572 -0
  82. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
  83. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
  84. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
  85. package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
  86. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
  87. package/dist/migrations/v2.0/migrate-scopes.js +282 -0
  88. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
  89. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
  90. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
  91. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
  92. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
  93. package/dist/migrations/v2.0/migrate-workqueue-configs.js +237 -0
  94. package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
  95. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
  96. package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
  97. package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
  98. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
  99. package/dist/migrations/v2.0/remove-demo-scope.js +75 -0
  100. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
  101. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
  102. package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
  103. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
  104. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
  105. package/dist/migrations/v2.0/remove-hearth-migrations.js +78 -0
  106. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
  107. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
  108. package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
  109. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
  110. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
  111. package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
  112. package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
  113. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
  114. package/dist/migrations/v2.0/rename-api-paths.js +188 -0
  115. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
  116. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
  117. package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
  118. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +3 -0
  119. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -0
  120. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +196 -0
  121. package/dist/notification/index.d.ts.map +1 -1
  122. package/dist/notification/index.js +2076 -1767
  123. package/dist/scopes/index.d.ts +640 -353
  124. package/dist/scopes/index.d.ts.map +1 -1
  125. package/dist/scopes/index.js +340 -300
  126. package/opencrvs-toolkit-2.0.0-rc.e0918cb.tgz +0 -0
  127. package/package.json +18 -8
  128. package/tsconfig.json +12 -2
  129. package/tsconfig.tsbuildinfo +1 -1
  130. package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
@@ -7,280 +7,298 @@ import { Action } from '../ActionDocument';
7
7
  *
8
8
  * */
9
9
  export declare function getActionUpdateMetadata(actions: Action[]): Partial<{
10
- type: "ASSIGN";
11
- id: string & import("zod").BRAND<"UUID">;
12
- status: "Rejected" | "Requested" | "Accepted";
10
+ id: string & import("zod").$brand<"UUID">;
13
11
  transactionId: string;
14
- createdByUserType: "system" | "user";
12
+ createdByUserType: "user" | "system";
15
13
  createdAt: string;
16
14
  createdBy: string;
17
- createdByRole: string;
18
15
  declaration: Record<string, import("..").FieldUpdateValue>;
19
- assignedTo: string;
20
- createdBySignature?: string | null | undefined;
21
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
16
+ status: "Requested" | "Accepted" | "Rejected";
17
+ type: "REGISTER";
18
+ createdByRole?: string | undefined;
19
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
20
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
22
21
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
23
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
22
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
23
+ registrationNumber?: string | undefined;
24
24
  } | {
25
- type: "UNASSIGN";
26
- id: string & import("zod").BRAND<"UUID">;
27
- status: "Rejected" | "Requested" | "Accepted";
25
+ id: string & import("zod").$brand<"UUID">;
28
26
  transactionId: string;
29
- createdByUserType: "system" | "user";
27
+ createdByUserType: "user" | "system";
30
28
  createdAt: string;
31
29
  createdBy: string;
32
- createdByRole: string;
33
30
  declaration: Record<string, import("..").FieldUpdateValue>;
34
- createdBySignature?: string | null | undefined;
35
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
31
+ status: "Requested" | "Accepted" | "Rejected";
32
+ type: "DUPLICATE_DETECTED";
33
+ content: {
34
+ duplicates: {
35
+ id: string & import("zod").$brand<"UUID">;
36
+ trackingId: string;
37
+ }[];
38
+ };
39
+ createdByRole?: string | undefined;
40
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
41
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
36
42
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
37
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
43
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
38
44
  } | {
39
- type: "REGISTER";
40
- id: string & import("zod").BRAND<"UUID">;
41
- status: "Rejected" | "Requested" | "Accepted";
45
+ id: string & import("zod").$brand<"UUID">;
42
46
  transactionId: string;
43
- createdByUserType: "system" | "user";
47
+ createdByUserType: "user" | "system";
44
48
  createdAt: string;
45
49
  createdBy: string;
46
- createdByRole: string;
47
50
  declaration: Record<string, import("..").FieldUpdateValue>;
48
- createdBySignature?: string | null | undefined;
49
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
51
+ status: "Requested" | "Accepted" | "Rejected";
52
+ type: "EDIT";
53
+ content: {
54
+ comment?: string | undefined;
55
+ };
56
+ createdByRole?: string | undefined;
57
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
58
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
50
59
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
51
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
52
- registrationNumber?: string | undefined;
60
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
53
61
  } | {
54
- type: "DECLARE";
55
- id: string & import("zod").BRAND<"UUID">;
56
- status: "Rejected" | "Requested" | "Accepted";
62
+ id: string & import("zod").$brand<"UUID">;
57
63
  transactionId: string;
58
- createdByUserType: "system" | "user";
64
+ createdByUserType: "user" | "system";
59
65
  createdAt: string;
60
66
  createdBy: string;
61
- createdByRole: string;
62
67
  declaration: Record<string, import("..").FieldUpdateValue>;
63
- createdBySignature?: string | null | undefined;
64
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
68
+ status: "Requested" | "Accepted" | "Rejected";
69
+ type: "PRINT_CERTIFICATE";
70
+ createdByRole?: string | undefined;
71
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
72
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
65
73
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
66
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
74
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
75
+ content?: {
76
+ templateId?: string | undefined;
77
+ } | null | undefined;
67
78
  } | {
68
- type: "VALIDATE";
69
- id: string & import("zod").BRAND<"UUID">;
70
- status: "Rejected" | "Requested" | "Accepted";
79
+ id: string & import("zod").$brand<"UUID">;
71
80
  transactionId: string;
72
- createdByUserType: "system" | "user";
81
+ createdByUserType: "user" | "system";
73
82
  createdAt: string;
74
83
  createdBy: string;
75
- createdByRole: string;
76
84
  declaration: Record<string, import("..").FieldUpdateValue>;
77
- createdBySignature?: string | null | undefined;
78
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
85
+ status: "Requested" | "Accepted" | "Rejected";
86
+ type: "REQUEST_CORRECTION";
87
+ createdByRole?: string | undefined;
88
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
89
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
79
90
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
80
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
91
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
81
92
  } | {
82
- type: "REJECT";
83
- id: string & import("zod").BRAND<"UUID">;
84
- status: "Rejected" | "Requested" | "Accepted";
85
- content: {
86
- reason: string;
87
- };
93
+ id: string & import("zod").$brand<"UUID">;
88
94
  transactionId: string;
89
- createdByUserType: "system" | "user";
95
+ createdByUserType: "user" | "system";
90
96
  createdAt: string;
91
97
  createdBy: string;
92
- createdByRole: string;
93
98
  declaration: Record<string, import("..").FieldUpdateValue>;
94
- createdBySignature?: string | null | undefined;
95
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
99
+ status: "Requested" | "Accepted" | "Rejected";
100
+ type: "CUSTOM";
101
+ customActionType: string;
102
+ createdByRole?: string | undefined;
103
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
104
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
96
105
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
97
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
106
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
98
107
  } | {
99
- type: "DUPLICATE_DETECTED";
100
- id: string & import("zod").BRAND<"UUID">;
101
- status: "Rejected" | "Requested" | "Accepted";
102
- content: {
103
- duplicates: {
104
- id: string & import("zod").BRAND<"UUID">;
105
- trackingId: string;
106
- }[];
107
- };
108
+ id: string & import("zod").$brand<"UUID">;
108
109
  transactionId: string;
109
- createdByUserType: "system" | "user";
110
+ createdByUserType: "user" | "system";
110
111
  createdAt: string;
111
112
  createdBy: string;
112
- createdByRole: string;
113
113
  declaration: Record<string, import("..").FieldUpdateValue>;
114
- createdBySignature?: string | null | undefined;
115
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
114
+ status: "Requested" | "Accepted" | "Rejected";
115
+ type: "CREATE";
116
+ createdByRole?: string | undefined;
117
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
118
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
116
119
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
117
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
120
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
118
121
  } | {
119
- type: "MARK_AS_NOT_DUPLICATE";
120
- id: string & import("zod").BRAND<"UUID">;
121
- status: "Rejected" | "Requested" | "Accepted";
122
+ id: string & import("zod").$brand<"UUID">;
122
123
  transactionId: string;
123
- createdByUserType: "system" | "user";
124
+ createdByUserType: "user" | "system";
124
125
  createdAt: string;
125
126
  createdBy: string;
126
- createdByRole: string;
127
127
  declaration: Record<string, import("..").FieldUpdateValue>;
128
- createdBySignature?: string | null | undefined;
129
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
128
+ status: "Requested" | "Accepted" | "Rejected";
129
+ type: "REJECT";
130
+ content: {
131
+ reason: string;
132
+ };
133
+ createdByRole?: string | undefined;
134
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
135
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
130
136
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
131
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
137
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
132
138
  } | {
133
- type: "MARK_AS_DUPLICATE";
134
- id: string & import("zod").BRAND<"UUID">;
135
- status: "Rejected" | "Requested" | "Accepted";
139
+ id: string & import("zod").$brand<"UUID">;
136
140
  transactionId: string;
137
- createdByUserType: "system" | "user";
141
+ createdByUserType: "user" | "system";
138
142
  createdAt: string;
139
143
  createdBy: string;
140
- createdByRole: string;
141
144
  declaration: Record<string, import("..").FieldUpdateValue>;
142
- content?: {
143
- duplicateOf: string & import("zod").BRAND<"UUID">;
144
- } | undefined;
145
- createdBySignature?: string | null | undefined;
146
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
145
+ status: "Requested" | "Accepted" | "Rejected";
146
+ type: "MARK_AS_NOT_DUPLICATE";
147
+ createdByRole?: string | undefined;
148
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
149
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
147
150
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
148
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
151
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
149
152
  } | {
150
- type: "ARCHIVE";
151
- id: string & import("zod").BRAND<"UUID">;
152
- status: "Rejected" | "Requested" | "Accepted";
153
- content: {
154
- reason: string;
155
- };
153
+ id: string & import("zod").$brand<"UUID">;
156
154
  transactionId: string;
157
- createdByUserType: "system" | "user";
155
+ createdByUserType: "user" | "system";
158
156
  createdAt: string;
159
157
  createdBy: string;
160
- createdByRole: string;
161
158
  declaration: Record<string, import("..").FieldUpdateValue>;
162
- createdBySignature?: string | null | undefined;
163
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
159
+ status: "Requested" | "Accepted" | "Rejected";
160
+ type: "MARK_AS_DUPLICATE";
161
+ createdByRole?: string | undefined;
162
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
163
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
164
164
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
165
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
165
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
166
+ content?: {
167
+ duplicateOf: string & import("zod").$brand<"UUID">;
168
+ } | undefined;
166
169
  } | {
167
- type: "CREATE";
168
- id: string & import("zod").BRAND<"UUID">;
169
- status: "Rejected" | "Requested" | "Accepted";
170
+ id: string & import("zod").$brand<"UUID">;
170
171
  transactionId: string;
171
- createdByUserType: "system" | "user";
172
+ createdByUserType: "user" | "system";
172
173
  createdAt: string;
173
174
  createdBy: string;
174
- createdByRole: string;
175
175
  declaration: Record<string, import("..").FieldUpdateValue>;
176
- createdBySignature?: string | null | undefined;
177
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
176
+ status: "Requested" | "Accepted" | "Rejected";
177
+ type: "ARCHIVE";
178
+ content: {
179
+ reason: string;
180
+ };
181
+ createdByRole?: string | undefined;
182
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
183
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
178
184
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
179
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
185
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
180
186
  } | {
181
- type: "NOTIFY";
182
- id: string & import("zod").BRAND<"UUID">;
183
- status: "Rejected" | "Requested" | "Accepted";
187
+ id: string & import("zod").$brand<"UUID">;
184
188
  transactionId: string;
185
- createdByUserType: "system" | "user";
189
+ createdByUserType: "user" | "system";
186
190
  createdAt: string;
187
191
  createdBy: string;
188
- createdByRole: string;
189
192
  declaration: Record<string, import("..").FieldUpdateValue>;
190
- createdBySignature?: string | null | undefined;
191
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
193
+ status: "Requested" | "Accepted" | "Rejected";
194
+ type: "NOTIFY";
195
+ createdByRole?: string | undefined;
196
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
197
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
192
198
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
193
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
199
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
194
200
  } | {
195
- type: "PRINT_CERTIFICATE";
196
- id: string & import("zod").BRAND<"UUID">;
197
- status: "Rejected" | "Requested" | "Accepted";
201
+ id: string & import("zod").$brand<"UUID">;
198
202
  transactionId: string;
199
- createdByUserType: "system" | "user";
203
+ createdByUserType: "user" | "system";
200
204
  createdAt: string;
201
205
  createdBy: string;
202
- createdByRole: string;
203
206
  declaration: Record<string, import("..").FieldUpdateValue>;
204
- content?: {
205
- templateId?: string | undefined;
206
- } | null | undefined;
207
- createdBySignature?: string | null | undefined;
208
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
207
+ status: "Requested" | "Accepted" | "Rejected";
208
+ type: "DECLARE";
209
+ createdByRole?: string | undefined;
210
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
211
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
209
212
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
210
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
213
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
211
214
  } | {
212
- type: "REQUEST_CORRECTION";
213
- id: string & import("zod").BRAND<"UUID">;
214
- status: "Rejected" | "Requested" | "Accepted";
215
+ id: string & import("zod").$brand<"UUID">;
215
216
  transactionId: string;
216
- createdByUserType: "system" | "user";
217
+ createdByUserType: "user" | "system";
217
218
  createdAt: string;
218
219
  createdBy: string;
219
- createdByRole: string;
220
220
  declaration: Record<string, import("..").FieldUpdateValue>;
221
- createdBySignature?: string | null | undefined;
222
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
221
+ status: "Requested" | "Accepted" | "Rejected";
222
+ type: "ASSIGN";
223
+ assignedTo: string;
224
+ createdByRole?: string | undefined;
225
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
226
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
223
227
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
224
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
228
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
225
229
  } | {
226
- type: "APPROVE_CORRECTION";
227
- id: string & import("zod").BRAND<"UUID">;
228
- status: "Rejected" | "Requested" | "Accepted";
230
+ id: string & import("zod").$brand<"UUID">;
229
231
  transactionId: string;
230
- createdByUserType: "system" | "user";
232
+ createdByUserType: "user" | "system";
231
233
  createdAt: string;
232
234
  createdBy: string;
233
- createdByRole: string;
234
235
  declaration: Record<string, import("..").FieldUpdateValue>;
236
+ status: "Requested" | "Accepted" | "Rejected";
237
+ type: "APPROVE_CORRECTION";
235
238
  requestId: string;
236
- createdBySignature?: string | null | undefined;
237
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
239
+ createdByRole?: string | undefined;
240
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
241
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
238
242
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
239
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
243
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
240
244
  } | {
245
+ id: string & import("zod").$brand<"UUID">;
246
+ transactionId: string;
247
+ createdByUserType: "user" | "system";
248
+ createdAt: string;
249
+ createdBy: string;
250
+ declaration: Record<string, import("..").FieldUpdateValue>;
251
+ status: "Requested" | "Accepted" | "Rejected";
241
252
  type: "REJECT_CORRECTION";
242
- id: string & import("zod").BRAND<"UUID">;
243
- status: "Rejected" | "Requested" | "Accepted";
253
+ requestId: string;
244
254
  content: {
245
255
  reason: string;
246
256
  };
257
+ createdByRole?: string | undefined;
258
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
259
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
260
+ annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
261
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
262
+ } | {
263
+ id: string & import("zod").$brand<"UUID">;
247
264
  transactionId: string;
248
- createdByUserType: "system" | "user";
265
+ createdByUserType: "user" | "system";
249
266
  createdAt: string;
250
267
  createdBy: string;
251
- createdByRole: string;
252
268
  declaration: Record<string, import("..").FieldUpdateValue>;
253
- requestId: string;
254
- createdBySignature?: string | null | undefined;
255
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
269
+ status: "Requested" | "Accepted" | "Rejected";
270
+ type: "UNASSIGN";
271
+ createdByRole?: string | undefined;
272
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
273
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
256
274
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
257
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
275
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
258
276
  } | {
259
- type: "READ";
260
- id: string & import("zod").BRAND<"UUID">;
261
- status: "Rejected" | "Requested" | "Accepted";
277
+ id: string & import("zod").$brand<"UUID">;
262
278
  transactionId: string;
263
- createdByUserType: "system" | "user";
279
+ createdByUserType: "user" | "system";
264
280
  createdAt: string;
265
281
  createdBy: string;
266
- createdByRole: string;
267
282
  declaration: Record<string, import("..").FieldUpdateValue>;
268
- createdBySignature?: string | null | undefined;
269
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
283
+ status: "Requested" | "Accepted" | "Rejected";
284
+ type: "READ";
285
+ createdByRole?: string | undefined;
286
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
287
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
270
288
  annotation?: Record<string, import("..").FieldUpdateValue> | null | undefined;
271
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
289
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
272
290
  } | {
273
- type: "NOTIFY" | "DECLARE" | "VALIDATE" | "REGISTER" | "REJECT" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION";
274
- id: string & import("zod").BRAND<"UUID">;
275
- status: "Rejected";
291
+ id: string & import("zod").$brand<"UUID">;
276
292
  transactionId: string;
277
- createdByUserType: "system" | "user";
293
+ createdByUserType: "user" | "system";
278
294
  createdAt: string;
279
295
  createdBy: string;
280
- createdByRole: string;
281
- createdBySignature?: string | null | undefined;
282
- createdAtLocation?: (string & import("zod").BRAND<"UUID">) | null | undefined;
283
- originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
296
+ type: "CUSTOM" | "NOTIFY" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION";
297
+ status: "Rejected";
298
+ createdByRole?: string | undefined;
299
+ createdBySignature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
300
+ createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
301
+ originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
284
302
  }>;
285
303
  /**
286
304
  * @returns the legal statuses of the event. Event is considered legal if it has been accepted.
@@ -290,21 +308,21 @@ export declare function getLegalStatuses(actions: Action[]): {
290
308
  DECLARED: {
291
309
  createdAt: string;
292
310
  createdBy: string;
293
- createdByUserType: "system" | "user";
294
- createdAtLocation: (string & import("zod").BRAND<"UUID">) | null | undefined;
311
+ createdByUserType: "user" | "system";
312
+ createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
295
313
  acceptedAt: string;
296
- createdByRole: string;
297
- createdBySignature: string | null | undefined;
314
+ createdByRole: string | undefined;
315
+ createdBySignature: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
298
316
  registrationNumber: string | null | undefined;
299
317
  } | null;
300
318
  REGISTERED: {
301
319
  createdAt: string;
302
320
  createdBy: string;
303
- createdByUserType: "system" | "user";
304
- createdAtLocation: (string & import("zod").BRAND<"UUID">) | null | undefined;
321
+ createdByUserType: "user" | "system";
322
+ createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
305
323
  acceptedAt: string;
306
- createdByRole: string;
307
- createdBySignature: string | null | undefined;
324
+ createdByRole: string | undefined;
325
+ createdBySignature: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
308
326
  registrationNumber: string | null | undefined;
309
327
  } | null;
310
328
  };
@@ -1,6 +1,6 @@
1
1
  import { UUID } from '../uuid';
2
2
  import { ActionDocument, ActionUpdate } from './ActionDocument';
3
- import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput';
3
+ import { ApproveCorrectionActionInput, ArchiveActionInput, AssignActionInput, DeclareActionInput, EditActionInput, MarkAsDuplicateActionInput, MarkNotDuplicateActionInput, NotifyActionInput, RegisterActionInput, RejectCorrectionActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput } from './ActionInput';
4
4
  import { ActionType } from './ActionType';
5
5
  import { Draft } from './Draft';
6
6
  import { EventConfig } from './EventConfig';
@@ -9,8 +9,10 @@ import { EventIndex } from './EventIndex';
9
9
  import { EventInput } from './EventInput';
10
10
  import { TranslationConfig } from './TranslationConfig';
11
11
  import { FieldConfig } from './FieldConfig';
12
+ import { Location, AdministrativeArea } from './locations';
12
13
  import { WorkqueueConfig } from './WorkqueueConfig';
13
- import { z } from 'zod';
14
+ import * as z from 'zod/v4';
15
+ import { DocumentPath } from '../documents';
14
16
  /**
15
17
  * IANA timezone used in testing. Used for queries that expect similar results independent of the users location (e.g. when event was registered.)
16
18
  * Since we query by range, providing UTC offset will result to different results when DST changes during the range.
@@ -20,8 +22,19 @@ export declare const TEST_SYSTEM_IANA_TIMEZONE = "Asia/Dhaka";
20
22
  * In real application, the roles are defined in the countryconfig.
21
23
  * These are just for testing purposes to generate realistic mock data.
22
24
  */
23
- export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT", "NATIONAL_SYSTEM_ADMIN", "SOCIAL_WORKER"]>;
25
+ export declare const TestUserRole: z.ZodEnum<{
26
+ FIELD_AGENT: "FIELD_AGENT";
27
+ LOCAL_REGISTRAR: "LOCAL_REGISTRAR";
28
+ LOCAL_SYSTEM_ADMIN: "LOCAL_SYSTEM_ADMIN";
29
+ NATIONAL_REGISTRAR: "NATIONAL_REGISTRAR";
30
+ REGISTRATION_AGENT: "REGISTRATION_AGENT";
31
+ NATIONAL_SYSTEM_ADMIN: "NATIONAL_SYSTEM_ADMIN";
32
+ SOCIAL_WORKER: "SOCIAL_WORKER";
33
+ COMMUNITY_LEADER: "COMMUNITY_LEADER";
34
+ PROVINCIAL_REGISTRAR: "PROVINCIAL_REGISTRAR";
35
+ }>;
24
36
  export type TestUserRole = z.infer<typeof TestUserRole>;
37
+ export declare function pickRandom<T>(rng: () => number, items: T[]): T;
25
38
  export declare function generateRandomName(rng: () => number): {
26
39
  firstname: string;
27
40
  surname: string;
@@ -29,9 +42,23 @@ export declare function generateRandomName(rng: () => number): {
29
42
  export declare function generateUuid(rng?: () => number): UUID;
30
43
  export declare function generateTrackingId(rng: () => number): string;
31
44
  export declare function generateRegistrationNumber(rng: () => number): string;
32
- export declare function generateRandomSignature(rng: () => number): string;
33
- export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng: () => number): ActionUpdate;
34
- export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: ActionUpdate): ActionUpdate;
45
+ export declare function generateRandomSignature(rng: () => number): DocumentPath;
46
+ export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng: () => number,
47
+ /**
48
+ * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
49
+ */
50
+ administrativeHierarchy?: {
51
+ administrativeAreas: AdministrativeArea[];
52
+ locations: Location[];
53
+ }): ActionUpdate;
54
+ export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: ActionUpdate,
55
+ /**
56
+ * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
57
+ */
58
+ administrativeHierarchy?: {
59
+ administrativeAreas: AdministrativeArea[];
60
+ locations: Location[];
61
+ }): ActionUpdate;
35
62
  export declare function generateActionDuplicateDeclarationInput(...args: Parameters<typeof generateActionDeclarationInput>): ReturnType<typeof generateActionDeclarationInput>;
36
63
  export declare function eventPayloadGenerator(rng: () => number, configuration?: EventConfig): {
37
64
  create: (input?: Partial<EventInput>) => {
@@ -68,13 +95,15 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
68
95
  eventId: string;
69
96
  keepAssignment: boolean | undefined;
70
97
  };
71
- validate: (eventId: string, input?: Partial<Pick<ValidateActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
98
+ edit: (eventId: string, input?: Partial<Pick<EditActionInput, "transactionId" | "declaration" | "annotation" | "keepAssignment">>) => {
72
99
  transactionId: string;
73
100
  declaration: Record<string, import("./FieldValue").FieldUpdateValue>;
74
101
  annotation: {};
75
102
  keepAssignment?: boolean | undefined;
76
- type: "VALIDATE";
77
- duplicates: never[];
103
+ type: "EDIT";
104
+ content: {
105
+ comment: string;
106
+ };
78
107
  eventId: string;
79
108
  };
80
109
  assign: (eventId: string, input?: Partial<Pick<AssignActionInput, "transactionId" | "assignedTo">>) => {
@@ -97,7 +126,6 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
97
126
  keepAssignment?: boolean | undefined;
98
127
  type: "ARCHIVE";
99
128
  annotation: {};
100
- duplicates: never[];
101
129
  eventId: string;
102
130
  content: {
103
131
  reason: string;
@@ -109,7 +137,6 @@ export declare function eventPayloadGenerator(rng: () => number, configuration?:
109
137
  keepAssignment?: boolean | undefined;
110
138
  type: "REJECT";
111
139
  declaration: {};
112
- duplicates: never[];
113
140
  eventId: string;
114
141
  content: {
115
142
  reason: string;
@@ -245,4 +272,18 @@ export declare const BearerTokenByUserType: {
245
272
  localRegistrar: string;
246
273
  };
247
274
  export declare const generateWorkqueues: (slug?: string) => WorkqueueConfig[];
275
+ /**
276
+ * Backend focused event config generator for testing fields in a lightweight way.
277
+ *
278
+ * @param id - The unique identifier for the event.
279
+ * @param fields - Field configurations to include in the event declaration. Everything in a single page.
280
+ * @param placeOfEventId - Optional place of event field id.
281
+ * @param dateOfEventId - Optional date of event field id.
282
+ */
283
+ export declare const generateEventConfig: ({ id, fields, placeOfEventId, dateOfEventId }: {
284
+ id: string;
285
+ fields: FieldConfig[];
286
+ placeOfEventId?: string;
287
+ dateOfEventId?: string;
288
+ }) => EventConfig;
248
289
  //# sourceMappingURL=test.utils.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare function generateTransactionId(): string & import("zod").BRAND<"UUID">;
1
+ export declare function generateTransactionId(): string & import("zod").$brand<"UUID">;
2
2
  //# sourceMappingURL=transactions.d.ts.map