@tstdl/base 0.92.142 → 0.92.143

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 (223) hide show
  1. package/ai/ai-file.service.js +1 -1
  2. package/ai/ai.service.js +3 -3
  3. package/ai/types.d.ts +1 -1
  4. package/api/client/client.d.ts +1 -1
  5. package/api/client/client.js +10 -4
  6. package/api/server/middlewares/content-type.middleware.js +8 -7
  7. package/api/types.js +1 -1
  8. package/authentication/client/authentication.service.js +3 -3
  9. package/authentication/server/authentication-ancillary.service.d.ts +11 -1
  10. package/authentication/server/authentication-ancillary.service.js +1 -1
  11. package/authentication/server/authentication-secret-requirements.validator.js +1 -1
  12. package/authentication/server/authentication.api-controller.js +22 -10
  13. package/authentication/server/authentication.service.d.ts +11 -5
  14. package/authentication/server/authentication.service.js +97 -49
  15. package/authentication/server/drizzle.config.js +2 -2
  16. package/authentication/server/module.js +1 -1
  17. package/cancellation/token.d.ts +2 -2
  18. package/cancellation/token.js +4 -4
  19. package/cookie/cookie.js +2 -2
  20. package/document-management/api/document-management.api.d.ts +122 -24
  21. package/document-management/api/document-management.api.js +17 -0
  22. package/document-management/{server/services → authorization}/document-management-authorization.service.d.ts +7 -7
  23. package/document-management/authorization/document-management-authorization.service.js +2 -0
  24. package/document-management/authorization/index.d.ts +2 -0
  25. package/document-management/authorization/index.js +2 -0
  26. package/document-management/authorization/policies.d.ts +38 -0
  27. package/document-management/authorization/policies.js +2 -0
  28. package/document-management/index.d.ts +1 -0
  29. package/document-management/index.js +1 -0
  30. package/document-management/models/document-assignment-scope.model.d.ts +1 -0
  31. package/document-management/models/document-assignment-scope.model.js +10 -3
  32. package/document-management/models/document-assignment-task.model.d.ts +1 -0
  33. package/document-management/models/document-assignment-task.model.js +8 -2
  34. package/document-management/models/document-category.model.d.ts +1 -0
  35. package/document-management/models/document-category.model.js +7 -1
  36. package/document-management/models/document-collection-assignment.model.d.ts +1 -0
  37. package/document-management/models/document-collection-assignment.model.js +12 -4
  38. package/document-management/models/document-collection.model.d.ts +2 -0
  39. package/document-management/models/document-collection.model.js +8 -2
  40. package/document-management/models/document-management-table.d.ts +3 -1
  41. package/document-management/models/document-management-table.js +2 -2
  42. package/document-management/models/document-property-value.model.d.ts +1 -0
  43. package/document-management/models/document-property-value.model.js +9 -3
  44. package/document-management/models/document-property.model.d.ts +1 -0
  45. package/document-management/models/document-property.model.js +8 -2
  46. package/document-management/models/document-request-collection-assignment.model.d.ts +1 -0
  47. package/document-management/models/document-request-collection-assignment.model.js +12 -4
  48. package/document-management/models/document-request-template.d.ts +1 -0
  49. package/document-management/models/document-request-template.js +6 -1
  50. package/document-management/models/document-request.model.d.ts +1 -0
  51. package/document-management/models/document-request.model.js +10 -1
  52. package/document-management/models/document-requests-template.d.ts +1 -0
  53. package/document-management/models/document-requests-template.js +7 -3
  54. package/document-management/models/document-tag-assignment.model.d.ts +8 -0
  55. package/document-management/models/document-tag-assignment.model.js +40 -0
  56. package/document-management/models/document-tag.model.d.ts +6 -0
  57. package/document-management/models/{document-request-submission.model.js → document-tag.model.js} +14 -18
  58. package/document-management/models/document-type-property.model.d.ts +1 -0
  59. package/document-management/models/document-type-property.model.js +7 -2
  60. package/document-management/models/document-type-validation.model.d.ts +1 -0
  61. package/document-management/models/document-type-validation.model.js +8 -2
  62. package/document-management/models/document-type.model.d.ts +1 -0
  63. package/document-management/models/document-type.model.js +7 -2
  64. package/document-management/models/document-validation-definition.model.d.ts +1 -0
  65. package/document-management/models/document-validation-definition.model.js +7 -2
  66. package/document-management/models/document-validation-execution-related-document.model.d.ts +1 -0
  67. package/document-management/models/document-validation-execution-related-document.model.js +10 -3
  68. package/document-management/models/document-validation-execution.model.d.ts +1 -0
  69. package/document-management/models/document-validation-execution.model.js +9 -3
  70. package/document-management/models/document-workflow.model.d.ts +4 -1
  71. package/document-management/models/document-workflow.model.js +16 -4
  72. package/document-management/models/document.model.d.ts +2 -2
  73. package/document-management/models/document.model.js +9 -8
  74. package/document-management/models/index.d.ts +2 -1
  75. package/document-management/models/index.js +2 -1
  76. package/document-management/server/api/document-management.api.d.ts +4 -1
  77. package/document-management/server/api/document-management.api.js +113 -22
  78. package/document-management/server/configure.d.ts +2 -2
  79. package/document-management/server/configure.js +7 -7
  80. package/document-management/server/drizzle/0000_parallel_mantis.sql +359 -0
  81. package/document-management/server/drizzle/meta/0000_snapshot.json +784 -260
  82. package/document-management/server/drizzle/meta/_journal.json +2 -2
  83. package/document-management/server/module.d.ts +2 -2
  84. package/document-management/server/module.js +2 -2
  85. package/document-management/server/schemas.d.ts +6 -5
  86. package/document-management/server/schemas.js +12 -11
  87. package/document-management/server/services/document-category-type.service.d.ts +19 -10
  88. package/document-management/server/services/document-category-type.service.js +34 -27
  89. package/document-management/server/services/document-collection.service.d.ts +13 -6
  90. package/document-management/server/services/document-collection.service.js +36 -12
  91. package/document-management/server/services/document-file.service.d.ts +8 -7
  92. package/document-management/server/services/document-file.service.js +28 -33
  93. package/document-management/server/services/document-management-ai.service.d.ts +5 -4
  94. package/document-management/server/services/document-management-ai.service.js +51 -28
  95. package/document-management/server/services/document-management-ancillary.service.d.ts +3 -21
  96. package/document-management/server/services/document-management-ancillary.service.js +0 -24
  97. package/document-management/server/services/document-management-observation.service.d.ts +15 -0
  98. package/document-management/server/services/document-management-observation.service.js +160 -0
  99. package/document-management/server/services/document-management.service.d.ts +6 -5
  100. package/document-management/server/services/document-management.service.js +112 -86
  101. package/document-management/server/services/document-property.service.d.ts +15 -7
  102. package/document-management/server/services/document-property.service.js +52 -20
  103. package/document-management/server/services/document-request.service.d.ts +13 -24
  104. package/document-management/server/services/document-request.service.js +39 -62
  105. package/document-management/server/services/document-tag.service.d.ts +10 -0
  106. package/document-management/server/services/document-tag.service.js +59 -0
  107. package/document-management/server/services/document-validation.service.d.ts +8 -8
  108. package/document-management/server/services/document-validation.service.js +41 -40
  109. package/document-management/server/services/document-workflow.service.d.ts +6 -5
  110. package/document-management/server/services/document-workflow.service.js +54 -43
  111. package/document-management/server/services/document.service.d.ts +12 -11
  112. package/document-management/server/services/document.service.js +64 -40
  113. package/document-management/server/services/index.d.ts +2 -1
  114. package/document-management/server/services/index.js +2 -1
  115. package/document-management/server/services/singleton.js +2 -2
  116. package/document-management/server/validators/ai-validation-executor.js +4 -4
  117. package/document-management/service-models/document-collection-metadata.service-model.d.ts +14 -0
  118. package/document-management/service-models/document-collection-metadata.service-model.js +1 -0
  119. package/document-management/service-models/document-folders.view-model.d.ts +1 -7
  120. package/document-management/service-models/document-folders.view-model.js +3 -15
  121. package/document-management/service-models/document-management.view-model.d.ts +20 -6
  122. package/document-management/service-models/document-management.view-model.js +62 -8
  123. package/document-management/service-models/document.service-model.d.ts +14 -11
  124. package/document-management/service-models/document.service-model.js +11 -2
  125. package/document-management/service-models/enriched/enriched-document-assignment.view.d.ts +1 -1
  126. package/document-management/service-models/enriched/enriched-document-assignment.view.js +0 -2
  127. package/document-management/service-models/enriched/enriched-document-category.view.d.ts +11 -1
  128. package/document-management/service-models/enriched/enriched-document-category.view.js +44 -1
  129. package/document-management/service-models/enriched/enriched-document-collection.view.d.ts +4 -2
  130. package/document-management/service-models/enriched/enriched-document-collection.view.js +13 -3
  131. package/document-management/service-models/enriched/enriched-document-management-data.view.d.ts +2 -0
  132. package/document-management/service-models/enriched/enriched-document-management-data.view.js +4 -2
  133. package/document-management/service-models/enriched/enriched-document-request.view.d.ts +1 -0
  134. package/document-management/service-models/enriched/enriched-document-request.view.js +2 -0
  135. package/document-management/service-models/enriched/enriched-document-type.view.d.ts +9 -1
  136. package/document-management/service-models/enriched/enriched-document-type.view.js +28 -1
  137. package/document-management/service-models/enriched/enriched-document.view.d.ts +7 -6
  138. package/document-management/service-models/enriched/enriched-document.view.js +29 -6
  139. package/document-management/service-models/{normalized-requests-template-data.model.d.ts → enriched/enriched-requests-template-data.model.d.ts} +6 -6
  140. package/document-management/service-models/{normalized-requests-template-data.model.js → enriched/enriched-requests-template-data.model.js} +1 -1
  141. package/document-management/service-models/enriched/index.d.ts +1 -0
  142. package/document-management/service-models/enriched/index.js +1 -0
  143. package/document-management/service-models/index.d.ts +2 -2
  144. package/document-management/service-models/index.js +2 -2
  145. package/examples/document-management/categories-and-types.d.ts +33 -31
  146. package/examples/document-management/categories-and-types.js +33 -0
  147. package/examples/document-management/main.d.ts +5 -4
  148. package/examples/document-management/main.js +13 -7
  149. package/function/log.js +2 -2
  150. package/http/server/node/module.d.ts +4 -1
  151. package/http/server/node/module.js +10 -1
  152. package/http/server/node/node-http-server.d.ts +3 -6
  153. package/http/server/node/node-http-server.js +68 -67
  154. package/injector/inject.js +6 -6
  155. package/injector/injector.js +3 -3
  156. package/jsx/is-component-class.js +1 -1
  157. package/key-value-store/key-value.store.d.ts +38 -7
  158. package/key-value-store/key-value.store.js +2 -1
  159. package/key-value-store/mongo/mongo-key-value.store.d.ts +1 -0
  160. package/key-value-store/mongo/mongo-key-value.store.js +14 -5
  161. package/key-value-store/postgres/drizzle/0000_shocking_slipstream.sql +12 -0
  162. package/key-value-store/postgres/drizzle/meta/0000_snapshot.json +97 -0
  163. package/key-value-store/postgres/drizzle/meta/_journal.json +13 -0
  164. package/key-value-store/postgres/drizzle.config.d.ts +2 -0
  165. package/key-value-store/postgres/drizzle.config.js +11 -0
  166. package/key-value-store/postgres/index.d.ts +2 -0
  167. package/key-value-store/postgres/index.js +2 -0
  168. package/key-value-store/postgres/key-value-store.service.d.ts +17 -0
  169. package/key-value-store/postgres/key-value-store.service.js +65 -0
  170. package/key-value-store/postgres/models/index.d.ts +2 -0
  171. package/key-value-store/postgres/models/index.js +2 -0
  172. package/key-value-store/postgres/models/key-value.model.d.ts +7 -0
  173. package/key-value-store/postgres/models/key-value.model.js +35 -0
  174. package/key-value-store/postgres/models/schemas.d.ts +3 -0
  175. package/key-value-store/postgres/models/schemas.js +4 -0
  176. package/key-value-store/postgres/module.d.ts +6 -0
  177. package/key-value-store/postgres/module.js +23 -0
  178. package/lock/web/web-lock.d.ts +0 -1
  179. package/lock/web/web-lock.js +6 -13
  180. package/orm/data-types/timestamp.js +1 -1
  181. package/orm/decorators.d.ts +37 -29
  182. package/orm/decorators.js +44 -24
  183. package/orm/entity.d.ts +1 -0
  184. package/orm/query.d.ts +10 -2
  185. package/orm/repository.types.d.ts +2 -1
  186. package/orm/schemas/json.d.ts +12 -6
  187. package/orm/schemas/json.js +12 -5
  188. package/orm/server/database.js +5 -2
  189. package/orm/server/drizzle/schema-converter.js +40 -11
  190. package/orm/server/query-converter.d.ts +2 -1
  191. package/orm/server/query-converter.js +57 -34
  192. package/orm/server/repository.d.ts +26 -43
  193. package/orm/server/repository.js +106 -39
  194. package/orm/server/transaction.d.ts +2 -1
  195. package/orm/server/transaction.js +3 -0
  196. package/orm/server/transactional.d.ts +5 -1
  197. package/orm/server/transactional.js +34 -4
  198. package/package.json +14 -11
  199. package/process/spawn.js +0 -1
  200. package/promise/deferred-promise.d.ts +4 -3
  201. package/promise/deferred-promise.js +13 -5
  202. package/queue/postgres/queue.js +8 -8
  203. package/reflection/utils.js +3 -3
  204. package/schema/decorators/class.js +0 -1
  205. package/schema/decorators/schema.js +1 -1
  206. package/schema/schemas/boolean.d.ts +1 -1
  207. package/schema/schemas/boolean.js +2 -2
  208. package/schema/schemas/number.js +3 -3
  209. package/schema/schemas/object.js +5 -6
  210. package/sse/server-sent-events-source.js +4 -1
  211. package/utils/compression.js +9 -9
  212. package/utils/date-time.d.ts +1 -0
  213. package/utils/date-time.js +18 -4
  214. package/utils/equals.d.ts +7 -0
  215. package/utils/equals.js +17 -2
  216. package/utils/function/memoize.js +10 -2
  217. package/utils/jwt.js +3 -3
  218. package/utils/object/property-name.d.ts +2 -2
  219. package/utils/timing.d.ts +2 -2
  220. package/utils/timing.js +12 -12
  221. package/document-management/models/document-request-submission.model.d.ts +0 -7
  222. package/document-management/server/drizzle/0000_moaning_luckman.sql +0 -305
  223. package/document-management/server/services/document-management-authorization.service.js +0 -28
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "f1876b8d-1096-498b-a610-396dcf0fee9d",
2
+ "id": "2917aa37-84ad-420d-a45e-3663498ac9d4",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
@@ -15,6 +15,12 @@
15
15
  "notNull": true,
16
16
  "default": "gen_random_uuid()"
17
17
  },
18
+ "tenant_id": {
19
+ "name": "tenant_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
18
24
  "type_id": {
19
25
  "name": "type_id",
20
26
  "type": "uuid",
@@ -51,12 +57,6 @@
51
57
  "primaryKey": false,
52
58
  "notNull": false
53
59
  },
54
- "tags": {
55
- "name": "tags",
56
- "type": "text[]",
57
- "primaryKey": false,
58
- "notNull": false
59
- },
60
60
  "approval": {
61
61
  "name": "approval",
62
62
  "type": "document_approval",
@@ -134,10 +134,10 @@
134
134
  },
135
135
  "indexes": {},
136
136
  "foreignKeys": {
137
- "document_type_id_document_type_id_fk": {
138
- "name": "document_type_id_document_type_id_fk",
137
+ "document_type_id_type_id_fk": {
138
+ "name": "document_type_id_type_id_fk",
139
139
  "tableFrom": "document",
140
- "tableTo": "document_type",
140
+ "tableTo": "type",
141
141
  "schemaTo": "document_management",
142
142
  "columnsFrom": [
143
143
  "type_id"
@@ -150,13 +150,22 @@
150
150
  }
151
151
  },
152
152
  "compositePrimaryKeys": {},
153
- "uniqueConstraints": {},
153
+ "uniqueConstraints": {
154
+ "document_tenant_id_id_unique": {
155
+ "name": "document_tenant_id_id_unique",
156
+ "nullsNotDistinct": false,
157
+ "columns": [
158
+ "tenant_id",
159
+ "id"
160
+ ]
161
+ }
162
+ },
154
163
  "policies": {},
155
164
  "checkConstraints": {},
156
165
  "isRLSEnabled": false
157
166
  },
158
- "document_management.document_assignment_scope": {
159
- "name": "document_assignment_scope",
167
+ "document_management.assignment_scope": {
168
+ "name": "assignment_scope",
160
169
  "schema": "document_management",
161
170
  "columns": {
162
171
  "id": {
@@ -166,6 +175,12 @@
166
175
  "notNull": true,
167
176
  "default": "gen_random_uuid()"
168
177
  },
178
+ "tenant_id": {
179
+ "name": "tenant_id",
180
+ "type": "uuid",
181
+ "primaryKey": false,
182
+ "notNull": true
183
+ },
169
184
  "task_id": {
170
185
  "name": "task_id",
171
186
  "type": "uuid",
@@ -212,10 +227,10 @@
212
227
  },
213
228
  "indexes": {},
214
229
  "foreignKeys": {
215
- "document_assignment_scope_task_id_document_assignment_task_id_fk": {
216
- "name": "document_assignment_scope_task_id_document_assignment_task_id_fk",
217
- "tableFrom": "document_assignment_scope",
218
- "tableTo": "document_assignment_task",
230
+ "assignment_scope_task_id_assignment_task_id_fk": {
231
+ "name": "assignment_scope_task_id_assignment_task_id_fk",
232
+ "tableFrom": "assignment_scope",
233
+ "tableTo": "assignment_task",
219
234
  "schemaTo": "document_management",
220
235
  "columnsFrom": [
221
236
  "task_id"
@@ -226,10 +241,10 @@
226
241
  "onDelete": "no action",
227
242
  "onUpdate": "no action"
228
243
  },
229
- "document_assignment_scope_collection_id_document_collection_id_fk": {
230
- "name": "document_assignment_scope_collection_id_document_collection_id_fk",
231
- "tableFrom": "document_assignment_scope",
232
- "tableTo": "document_collection",
244
+ "assignment_scope_collection_id_collection_id_fk": {
245
+ "name": "assignment_scope_collection_id_collection_id_fk",
246
+ "tableFrom": "assignment_scope",
247
+ "tableTo": "collection",
233
248
  "schemaTo": "document_management",
234
249
  "columnsFrom": [
235
250
  "collection_id"
@@ -239,12 +254,44 @@
239
254
  ],
240
255
  "onDelete": "no action",
241
256
  "onUpdate": "no action"
257
+ },
258
+ "assignment_scope_tenantId_collectionId_fkey": {
259
+ "name": "assignment_scope_tenantId_collectionId_fkey",
260
+ "tableFrom": "assignment_scope",
261
+ "tableTo": "collection",
262
+ "schemaTo": "document_management",
263
+ "columnsFrom": [
264
+ "tenant_id",
265
+ "collection_id"
266
+ ],
267
+ "columnsTo": [
268
+ "tenant_id",
269
+ "id"
270
+ ],
271
+ "onDelete": "no action",
272
+ "onUpdate": "no action"
273
+ },
274
+ "assignment_scope_tenantId_taskId_fkey": {
275
+ "name": "assignment_scope_tenantId_taskId_fkey",
276
+ "tableFrom": "assignment_scope",
277
+ "tableTo": "assignment_task",
278
+ "schemaTo": "document_management",
279
+ "columnsFrom": [
280
+ "tenant_id",
281
+ "task_id"
282
+ ],
283
+ "columnsTo": [
284
+ "tenant_id",
285
+ "id"
286
+ ],
287
+ "onDelete": "no action",
288
+ "onUpdate": "no action"
242
289
  }
243
290
  },
244
291
  "compositePrimaryKeys": {},
245
292
  "uniqueConstraints": {
246
- "das_task_id_collection_id_unique": {
247
- "name": "das_task_id_collection_id_unique",
293
+ "assignment_scope_task_id_collection_id_unique": {
294
+ "name": "assignment_scope_task_id_collection_id_unique",
248
295
  "nullsNotDistinct": false,
249
296
  "columns": [
250
297
  "task_id",
@@ -256,8 +303,8 @@
256
303
  "checkConstraints": {},
257
304
  "isRLSEnabled": false
258
305
  },
259
- "document_management.document_assignment_task": {
260
- "name": "document_assignment_task",
306
+ "document_management.assignment_task": {
307
+ "name": "assignment_task",
261
308
  "schema": "document_management",
262
309
  "columns": {
263
310
  "id": {
@@ -267,6 +314,12 @@
267
314
  "notNull": true,
268
315
  "default": "gen_random_uuid()"
269
316
  },
317
+ "tenant_id": {
318
+ "name": "tenant_id",
319
+ "type": "uuid",
320
+ "primaryKey": false,
321
+ "notNull": true
322
+ },
270
323
  "document_id": {
271
324
  "name": "document_id",
272
325
  "type": "uuid",
@@ -275,7 +328,7 @@
275
328
  },
276
329
  "target": {
277
330
  "name": "target",
278
- "type": "document_assignment_target",
331
+ "type": "assignment_target",
279
332
  "typeSchema": "document_management",
280
333
  "primaryKey": false,
281
334
  "notNull": true
@@ -314,15 +367,31 @@
314
367
  },
315
368
  "indexes": {},
316
369
  "foreignKeys": {
317
- "document_assignment_task_document_id_document_id_fk": {
318
- "name": "document_assignment_task_document_id_document_id_fk",
319
- "tableFrom": "document_assignment_task",
370
+ "assignment_task_document_id_document_id_fk": {
371
+ "name": "assignment_task_document_id_document_id_fk",
372
+ "tableFrom": "assignment_task",
373
+ "tableTo": "document",
374
+ "schemaTo": "document_management",
375
+ "columnsFrom": [
376
+ "document_id"
377
+ ],
378
+ "columnsTo": [
379
+ "id"
380
+ ],
381
+ "onDelete": "no action",
382
+ "onUpdate": "no action"
383
+ },
384
+ "assignment_task_tenantId_documentId_fkey": {
385
+ "name": "assignment_task_tenantId_documentId_fkey",
386
+ "tableFrom": "assignment_task",
320
387
  "tableTo": "document",
321
388
  "schemaTo": "document_management",
322
389
  "columnsFrom": [
390
+ "tenant_id",
323
391
  "document_id"
324
392
  ],
325
393
  "columnsTo": [
394
+ "tenant_id",
326
395
  "id"
327
396
  ],
328
397
  "onDelete": "no action",
@@ -331,8 +400,8 @@
331
400
  },
332
401
  "compositePrimaryKeys": {},
333
402
  "uniqueConstraints": {
334
- "document_assignment_task_document_id_unique": {
335
- "name": "document_assignment_task_document_id_unique",
403
+ "assignment_task_document_id_unique": {
404
+ "name": "assignment_task_document_id_unique",
336
405
  "nullsNotDistinct": false,
337
406
  "columns": [
338
407
  "document_id"
@@ -343,8 +412,8 @@
343
412
  "checkConstraints": {},
344
413
  "isRLSEnabled": false
345
414
  },
346
- "document_management.document_category": {
347
- "name": "document_category",
415
+ "document_management.category": {
416
+ "name": "category",
348
417
  "schema": "document_management",
349
418
  "columns": {
350
419
  "id": {
@@ -354,6 +423,12 @@
354
423
  "notNull": true,
355
424
  "default": "gen_random_uuid()"
356
425
  },
426
+ "tenant_id": {
427
+ "name": "tenant_id",
428
+ "type": "uuid",
429
+ "primaryKey": false,
430
+ "notNull": false
431
+ },
357
432
  "parent_id": {
358
433
  "name": "parent_id",
359
434
  "type": "uuid",
@@ -400,10 +475,10 @@
400
475
  },
401
476
  "indexes": {},
402
477
  "foreignKeys": {
403
- "document_category_parent_id_document_category_id_fk": {
404
- "name": "document_category_parent_id_document_category_id_fk",
405
- "tableFrom": "document_category",
406
- "tableTo": "document_category",
478
+ "category_parent_id_category_id_fk": {
479
+ "name": "category_parent_id_category_id_fk",
480
+ "tableFrom": "category",
481
+ "tableTo": "category",
407
482
  "schemaTo": "document_management",
408
483
  "columnsFrom": [
409
484
  "parent_id"
@@ -417,10 +492,19 @@
417
492
  },
418
493
  "compositePrimaryKeys": {},
419
494
  "uniqueConstraints": {
420
- "document_category_label_unique": {
421
- "name": "document_category_label_unique",
495
+ "category_label_unique": {
496
+ "name": "category_label_unique",
497
+ "nullsNotDistinct": false,
498
+ "columns": [
499
+ "label"
500
+ ]
501
+ },
502
+ "category_tenant_id_parent_id_label_unique": {
503
+ "name": "category_tenant_id_parent_id_label_unique",
422
504
  "nullsNotDistinct": false,
423
505
  "columns": [
506
+ "tenant_id",
507
+ "parent_id",
424
508
  "label"
425
509
  ]
426
510
  }
@@ -429,8 +513,8 @@
429
513
  "checkConstraints": {},
430
514
  "isRLSEnabled": false
431
515
  },
432
- "document_management.document_collection": {
433
- "name": "document_collection",
516
+ "document_management.collection": {
517
+ "name": "collection",
434
518
  "schema": "document_management",
435
519
  "columns": {
436
520
  "id": {
@@ -440,6 +524,12 @@
440
524
  "notNull": true,
441
525
  "default": "gen_random_uuid()"
442
526
  },
527
+ "tenant_id": {
528
+ "name": "tenant_id",
529
+ "type": "uuid",
530
+ "primaryKey": false,
531
+ "notNull": true
532
+ },
443
533
  "parent_id": {
444
534
  "name": "parent_id",
445
535
  "type": "uuid",
@@ -480,10 +570,10 @@
480
570
  },
481
571
  "indexes": {},
482
572
  "foreignKeys": {
483
- "document_collection_parent_id_document_collection_id_fk": {
484
- "name": "document_collection_parent_id_document_collection_id_fk",
485
- "tableFrom": "document_collection",
486
- "tableTo": "document_collection",
573
+ "collection_parent_id_collection_id_fk": {
574
+ "name": "collection_parent_id_collection_id_fk",
575
+ "tableFrom": "collection",
576
+ "tableTo": "collection",
487
577
  "schemaTo": "document_management",
488
578
  "columnsFrom": [
489
579
  "parent_id"
@@ -496,13 +586,22 @@
496
586
  }
497
587
  },
498
588
  "compositePrimaryKeys": {},
499
- "uniqueConstraints": {},
589
+ "uniqueConstraints": {
590
+ "collection_tenant_id_id_unique": {
591
+ "name": "collection_tenant_id_id_unique",
592
+ "nullsNotDistinct": false,
593
+ "columns": [
594
+ "tenant_id",
595
+ "id"
596
+ ]
597
+ }
598
+ },
500
599
  "policies": {},
501
600
  "checkConstraints": {},
502
601
  "isRLSEnabled": false
503
602
  },
504
- "document_management.document_collection_assignment": {
505
- "name": "document_collection_assignment",
603
+ "document_management.collection_assignment": {
604
+ "name": "collection_assignment",
506
605
  "schema": "document_management",
507
606
  "columns": {
508
607
  "id": {
@@ -512,6 +611,12 @@
512
611
  "notNull": true,
513
612
  "default": "gen_random_uuid()"
514
613
  },
614
+ "tenant_id": {
615
+ "name": "tenant_id",
616
+ "type": "uuid",
617
+ "primaryKey": false,
618
+ "notNull": true
619
+ },
515
620
  "collection_id": {
516
621
  "name": "collection_id",
517
622
  "type": "uuid",
@@ -562,12 +667,28 @@
562
667
  "default": "'{}'::jsonb"
563
668
  }
564
669
  },
565
- "indexes": {},
670
+ "indexes": {
671
+ "collection_assignment_collection_id_idx": {
672
+ "name": "collection_assignment_collection_id_idx",
673
+ "columns": [
674
+ {
675
+ "expression": "collection_id",
676
+ "isExpression": false,
677
+ "asc": true,
678
+ "nulls": "last"
679
+ }
680
+ ],
681
+ "isUnique": false,
682
+ "concurrently": false,
683
+ "method": "btree",
684
+ "with": {}
685
+ }
686
+ },
566
687
  "foreignKeys": {
567
- "document_collection_assignment_collection_id_document_collection_id_fk": {
568
- "name": "document_collection_assignment_collection_id_document_collection_id_fk",
569
- "tableFrom": "document_collection_assignment",
570
- "tableTo": "document_collection",
688
+ "collection_assignment_collection_id_collection_id_fk": {
689
+ "name": "collection_assignment_collection_id_collection_id_fk",
690
+ "tableFrom": "collection_assignment",
691
+ "tableTo": "collection",
571
692
  "schemaTo": "document_management",
572
693
  "columnsFrom": [
573
694
  "collection_id"
@@ -578,15 +699,47 @@
578
699
  "onDelete": "no action",
579
700
  "onUpdate": "no action"
580
701
  },
581
- "document_collection_assignment_document_id_document_id_fk": {
582
- "name": "document_collection_assignment_document_id_document_id_fk",
583
- "tableFrom": "document_collection_assignment",
702
+ "collection_assignment_document_id_document_id_fk": {
703
+ "name": "collection_assignment_document_id_document_id_fk",
704
+ "tableFrom": "collection_assignment",
705
+ "tableTo": "document",
706
+ "schemaTo": "document_management",
707
+ "columnsFrom": [
708
+ "document_id"
709
+ ],
710
+ "columnsTo": [
711
+ "id"
712
+ ],
713
+ "onDelete": "no action",
714
+ "onUpdate": "no action"
715
+ },
716
+ "collection_assignment_tenantId_documentId_fkey": {
717
+ "name": "collection_assignment_tenantId_documentId_fkey",
718
+ "tableFrom": "collection_assignment",
584
719
  "tableTo": "document",
585
720
  "schemaTo": "document_management",
586
721
  "columnsFrom": [
722
+ "tenant_id",
587
723
  "document_id"
588
724
  ],
589
725
  "columnsTo": [
726
+ "tenant_id",
727
+ "id"
728
+ ],
729
+ "onDelete": "no action",
730
+ "onUpdate": "no action"
731
+ },
732
+ "collection_assignment_tenantId_collectionId_fkey": {
733
+ "name": "collection_assignment_tenantId_collectionId_fkey",
734
+ "tableFrom": "collection_assignment",
735
+ "tableTo": "collection",
736
+ "schemaTo": "document_management",
737
+ "columnsFrom": [
738
+ "tenant_id",
739
+ "collection_id"
740
+ ],
741
+ "columnsTo": [
742
+ "tenant_id",
590
743
  "id"
591
744
  ],
592
745
  "onDelete": "no action",
@@ -595,10 +748,11 @@
595
748
  },
596
749
  "compositePrimaryKeys": {},
597
750
  "uniqueConstraints": {
598
- "document_collection_assignment_collection_id_document_id_unique": {
599
- "name": "document_collection_assignment_collection_id_document_id_unique",
751
+ "ca_tenant_id_collection_id_document_id_unique": {
752
+ "name": "ca_tenant_id_collection_id_document_id_unique",
600
753
  "nullsNotDistinct": false,
601
754
  "columns": [
755
+ "tenant_id",
602
756
  "collection_id",
603
757
  "document_id"
604
758
  ]
@@ -608,8 +762,8 @@
608
762
  "checkConstraints": {},
609
763
  "isRLSEnabled": false
610
764
  },
611
- "document_management.document_property": {
612
- "name": "document_property",
765
+ "document_management.property": {
766
+ "name": "property",
613
767
  "schema": "document_management",
614
768
  "columns": {
615
769
  "id": {
@@ -619,6 +773,12 @@
619
773
  "notNull": true,
620
774
  "default": "gen_random_uuid()"
621
775
  },
776
+ "tenant_id": {
777
+ "name": "tenant_id",
778
+ "type": "uuid",
779
+ "primaryKey": false,
780
+ "notNull": false
781
+ },
622
782
  "label": {
623
783
  "name": "label",
624
784
  "type": "text",
@@ -627,7 +787,7 @@
627
787
  },
628
788
  "data_type": {
629
789
  "name": "data_type",
630
- "type": "document_property_data_type",
790
+ "type": "property_data_type",
631
791
  "typeSchema": "document_management",
632
792
  "primaryKey": false,
633
793
  "notNull": true
@@ -668,20 +828,28 @@
668
828
  "foreignKeys": {},
669
829
  "compositePrimaryKeys": {},
670
830
  "uniqueConstraints": {
671
- "document_property_label_unique": {
672
- "name": "document_property_label_unique",
831
+ "property_label_unique": {
832
+ "name": "property_label_unique",
673
833
  "nullsNotDistinct": false,
674
834
  "columns": [
675
835
  "label"
676
836
  ]
837
+ },
838
+ "property_tenant_id_label_unique": {
839
+ "name": "property_tenant_id_label_unique",
840
+ "nullsNotDistinct": false,
841
+ "columns": [
842
+ "tenant_id",
843
+ "label"
844
+ ]
677
845
  }
678
846
  },
679
847
  "policies": {},
680
848
  "checkConstraints": {},
681
849
  "isRLSEnabled": false
682
850
  },
683
- "document_management.document_property_value": {
684
- "name": "document_property_value",
851
+ "document_management.property_value": {
852
+ "name": "property_value",
685
853
  "schema": "document_management",
686
854
  "columns": {
687
855
  "id": {
@@ -691,6 +859,12 @@
691
859
  "notNull": true,
692
860
  "default": "gen_random_uuid()"
693
861
  },
862
+ "tenant_id": {
863
+ "name": "tenant_id",
864
+ "type": "uuid",
865
+ "primaryKey": false,
866
+ "notNull": true
867
+ },
694
868
  "document_id": {
695
869
  "name": "document_id",
696
870
  "type": "uuid",
@@ -767,9 +941,9 @@
767
941
  },
768
942
  "indexes": {},
769
943
  "foreignKeys": {
770
- "document_property_value_document_id_document_id_fk": {
771
- "name": "document_property_value_document_id_document_id_fk",
772
- "tableFrom": "document_property_value",
944
+ "property_value_document_id_document_id_fk": {
945
+ "name": "property_value_document_id_document_id_fk",
946
+ "tableFrom": "property_value",
773
947
  "tableTo": "document",
774
948
  "schemaTo": "document_management",
775
949
  "columnsFrom": [
@@ -781,10 +955,10 @@
781
955
  "onDelete": "no action",
782
956
  "onUpdate": "no action"
783
957
  },
784
- "document_property_value_property_id_document_property_id_fk": {
785
- "name": "document_property_value_property_id_document_property_id_fk",
786
- "tableFrom": "document_property_value",
787
- "tableTo": "document_property",
958
+ "property_value_property_id_property_id_fk": {
959
+ "name": "property_value_property_id_property_id_fk",
960
+ "tableFrom": "property_value",
961
+ "tableTo": "property",
788
962
  "schemaTo": "document_management",
789
963
  "columnsFrom": [
790
964
  "property_id"
@@ -794,14 +968,31 @@
794
968
  ],
795
969
  "onDelete": "no action",
796
970
  "onUpdate": "no action"
971
+ },
972
+ "property_value_tenantId_documentId_fkey": {
973
+ "name": "property_value_tenantId_documentId_fkey",
974
+ "tableFrom": "property_value",
975
+ "tableTo": "document",
976
+ "schemaTo": "document_management",
977
+ "columnsFrom": [
978
+ "tenant_id",
979
+ "document_id"
980
+ ],
981
+ "columnsTo": [
982
+ "tenant_id",
983
+ "id"
984
+ ],
985
+ "onDelete": "no action",
986
+ "onUpdate": "no action"
797
987
  }
798
988
  },
799
989
  "compositePrimaryKeys": {},
800
990
  "uniqueConstraints": {
801
- "document_property_value_document_id_property_id_unique": {
802
- "name": "document_property_value_document_id_property_id_unique",
991
+ "property_value_tenant_id_document_id_property_id_unique": {
992
+ "name": "property_value_tenant_id_document_id_property_id_unique",
803
993
  "nullsNotDistinct": false,
804
994
  "columns": [
995
+ "tenant_id",
805
996
  "document_id",
806
997
  "property_id"
807
998
  ]
@@ -811,13 +1002,13 @@
811
1002
  "checkConstraints": {
812
1003
  "only_one_value": {
813
1004
  "name": "only_one_value",
814
- "value": "num_nonnulls(\"document_management\".\"document_property_value\".\"text\", \"document_management\".\"document_property_value\".\"integer\", \"document_management\".\"document_property_value\".\"decimal\", \"document_management\".\"document_property_value\".\"boolean\", \"document_management\".\"document_property_value\".\"date\") = 1"
1005
+ "value": "num_nonnulls(\"document_management\".\"property_value\".\"text\", \"document_management\".\"property_value\".\"integer\", \"document_management\".\"property_value\".\"decimal\", \"document_management\".\"property_value\".\"boolean\", \"document_management\".\"property_value\".\"date\") = 1"
815
1006
  }
816
1007
  },
817
1008
  "isRLSEnabled": false
818
1009
  },
819
- "document_management.document_request": {
820
- "name": "document_request",
1010
+ "document_management.request": {
1011
+ "name": "request",
821
1012
  "schema": "document_management",
822
1013
  "columns": {
823
1014
  "id": {
@@ -827,6 +1018,12 @@
827
1018
  "notNull": true,
828
1019
  "default": "gen_random_uuid()"
829
1020
  },
1021
+ "tenant_id": {
1022
+ "name": "tenant_id",
1023
+ "type": "uuid",
1024
+ "primaryKey": false,
1025
+ "notNull": true
1026
+ },
830
1027
  "type_id": {
831
1028
  "name": "type_id",
832
1029
  "type": "uuid",
@@ -847,7 +1044,7 @@
847
1044
  },
848
1045
  "state": {
849
1046
  "name": "state",
850
- "type": "document_request_state",
1047
+ "type": "request_state",
851
1048
  "typeSchema": "document_management",
852
1049
  "primaryKey": false,
853
1050
  "notNull": true
@@ -885,8 +1082,23 @@
885
1082
  }
886
1083
  },
887
1084
  "indexes": {
888
- "document_request_state_idx": {
889
- "name": "document_request_state_idx",
1085
+ "request_type_id_idx": {
1086
+ "name": "request_type_id_idx",
1087
+ "columns": [
1088
+ {
1089
+ "expression": "type_id",
1090
+ "isExpression": false,
1091
+ "asc": true,
1092
+ "nulls": "last"
1093
+ }
1094
+ ],
1095
+ "isUnique": false,
1096
+ "concurrently": false,
1097
+ "method": "btree",
1098
+ "with": {}
1099
+ },
1100
+ "request_state_idx": {
1101
+ "name": "request_state_idx",
890
1102
  "columns": [
891
1103
  {
892
1104
  "expression": "state",
@@ -902,10 +1114,10 @@
902
1114
  }
903
1115
  },
904
1116
  "foreignKeys": {
905
- "document_request_type_id_document_type_id_fk": {
906
- "name": "document_request_type_id_document_type_id_fk",
907
- "tableFrom": "document_request",
908
- "tableTo": "document_type",
1117
+ "request_type_id_type_id_fk": {
1118
+ "name": "request_type_id_type_id_fk",
1119
+ "tableFrom": "request",
1120
+ "tableTo": "type",
909
1121
  "schemaTo": "document_management",
910
1122
  "columnsFrom": [
911
1123
  "type_id"
@@ -916,15 +1128,31 @@
916
1128
  "onDelete": "no action",
917
1129
  "onUpdate": "no action"
918
1130
  },
919
- "document_request_document_id_document_id_fk": {
920
- "name": "document_request_document_id_document_id_fk",
921
- "tableFrom": "document_request",
1131
+ "request_document_id_document_id_fk": {
1132
+ "name": "request_document_id_document_id_fk",
1133
+ "tableFrom": "request",
1134
+ "tableTo": "document",
1135
+ "schemaTo": "document_management",
1136
+ "columnsFrom": [
1137
+ "document_id"
1138
+ ],
1139
+ "columnsTo": [
1140
+ "id"
1141
+ ],
1142
+ "onDelete": "no action",
1143
+ "onUpdate": "no action"
1144
+ },
1145
+ "request_tenantId_documentId_fkey": {
1146
+ "name": "request_tenantId_documentId_fkey",
1147
+ "tableFrom": "request",
922
1148
  "tableTo": "document",
923
1149
  "schemaTo": "document_management",
924
1150
  "columnsFrom": [
1151
+ "tenant_id",
925
1152
  "document_id"
926
1153
  ],
927
1154
  "columnsTo": [
1155
+ "tenant_id",
928
1156
  "id"
929
1157
  ],
930
1158
  "onDelete": "no action",
@@ -933,20 +1161,28 @@
933
1161
  },
934
1162
  "compositePrimaryKeys": {},
935
1163
  "uniqueConstraints": {
936
- "document_request_document_id_unique": {
937
- "name": "document_request_document_id_unique",
1164
+ "request_document_id_unique": {
1165
+ "name": "request_document_id_unique",
938
1166
  "nullsNotDistinct": false,
939
1167
  "columns": [
940
1168
  "document_id"
941
1169
  ]
1170
+ },
1171
+ "request_tenant_id_id_unique": {
1172
+ "name": "request_tenant_id_id_unique",
1173
+ "nullsNotDistinct": false,
1174
+ "columns": [
1175
+ "tenant_id",
1176
+ "id"
1177
+ ]
942
1178
  }
943
1179
  },
944
1180
  "policies": {},
945
1181
  "checkConstraints": {},
946
1182
  "isRLSEnabled": false
947
1183
  },
948
- "document_management.document_request_collection_assignment": {
949
- "name": "document_request_collection_assignment",
1184
+ "document_management.request_collection_assignment": {
1185
+ "name": "request_collection_assignment",
950
1186
  "schema": "document_management",
951
1187
  "columns": {
952
1188
  "id": {
@@ -956,6 +1192,12 @@
956
1192
  "notNull": true,
957
1193
  "default": "gen_random_uuid()"
958
1194
  },
1195
+ "tenant_id": {
1196
+ "name": "tenant_id",
1197
+ "type": "uuid",
1198
+ "primaryKey": false,
1199
+ "notNull": true
1200
+ },
959
1201
  "request_id": {
960
1202
  "name": "request_id",
961
1203
  "type": "uuid",
@@ -1000,12 +1242,28 @@
1000
1242
  "default": "'{}'::jsonb"
1001
1243
  }
1002
1244
  },
1003
- "indexes": {},
1245
+ "indexes": {
1246
+ "request_collection_assignment_collection_id_idx": {
1247
+ "name": "request_collection_assignment_collection_id_idx",
1248
+ "columns": [
1249
+ {
1250
+ "expression": "collection_id",
1251
+ "isExpression": false,
1252
+ "asc": true,
1253
+ "nulls": "last"
1254
+ }
1255
+ ],
1256
+ "isUnique": false,
1257
+ "concurrently": false,
1258
+ "method": "btree",
1259
+ "with": {}
1260
+ }
1261
+ },
1004
1262
  "foreignKeys": {
1005
- "document_request_collection_assignment_request_id_document_request_id_fk": {
1006
- "name": "document_request_collection_assignment_request_id_document_request_id_fk",
1007
- "tableFrom": "document_request_collection_assignment",
1008
- "tableTo": "document_request",
1263
+ "request_collection_assignment_request_id_request_id_fk": {
1264
+ "name": "request_collection_assignment_request_id_request_id_fk",
1265
+ "tableFrom": "request_collection_assignment",
1266
+ "tableTo": "request",
1009
1267
  "schemaTo": "document_management",
1010
1268
  "columnsFrom": [
1011
1269
  "request_id"
@@ -1016,15 +1274,47 @@
1016
1274
  "onDelete": "no action",
1017
1275
  "onUpdate": "no action"
1018
1276
  },
1019
- "document_request_collection_assignment_collection_id_document_collection_id_fk": {
1020
- "name": "document_request_collection_assignment_collection_id_document_collection_id_fk",
1021
- "tableFrom": "document_request_collection_assignment",
1022
- "tableTo": "document_collection",
1277
+ "request_collection_assignment_collection_id_collection_id_fk": {
1278
+ "name": "request_collection_assignment_collection_id_collection_id_fk",
1279
+ "tableFrom": "request_collection_assignment",
1280
+ "tableTo": "collection",
1281
+ "schemaTo": "document_management",
1282
+ "columnsFrom": [
1283
+ "collection_id"
1284
+ ],
1285
+ "columnsTo": [
1286
+ "id"
1287
+ ],
1288
+ "onDelete": "no action",
1289
+ "onUpdate": "no action"
1290
+ },
1291
+ "request_collection_assignment_tenantId_collectionId_fkey": {
1292
+ "name": "request_collection_assignment_tenantId_collectionId_fkey",
1293
+ "tableFrom": "request_collection_assignment",
1294
+ "tableTo": "collection",
1023
1295
  "schemaTo": "document_management",
1024
1296
  "columnsFrom": [
1297
+ "tenant_id",
1025
1298
  "collection_id"
1026
1299
  ],
1027
1300
  "columnsTo": [
1301
+ "tenant_id",
1302
+ "id"
1303
+ ],
1304
+ "onDelete": "no action",
1305
+ "onUpdate": "no action"
1306
+ },
1307
+ "request_collection_assignment_tenantId_requestId_fkey": {
1308
+ "name": "request_collection_assignment_tenantId_requestId_fkey",
1309
+ "tableFrom": "request_collection_assignment",
1310
+ "tableTo": "request",
1311
+ "schemaTo": "document_management",
1312
+ "columnsFrom": [
1313
+ "tenant_id",
1314
+ "request_id"
1315
+ ],
1316
+ "columnsTo": [
1317
+ "tenant_id",
1028
1318
  "id"
1029
1319
  ],
1030
1320
  "onDelete": "no action",
@@ -1033,10 +1323,11 @@
1033
1323
  },
1034
1324
  "compositePrimaryKeys": {},
1035
1325
  "uniqueConstraints": {
1036
- "document_request_collection_assignment_request_id_collection_id_unique": {
1037
- "name": "document_request_collection_assignment_request_id_collection_id_unique",
1326
+ "rca_tenant_id_request_id_collection_id_unique": {
1327
+ "name": "rca_tenant_id_request_id_collection_id_unique",
1038
1328
  "nullsNotDistinct": false,
1039
1329
  "columns": [
1330
+ "tenant_id",
1040
1331
  "request_id",
1041
1332
  "collection_id"
1042
1333
  ]
@@ -1046,8 +1337,8 @@
1046
1337
  "checkConstraints": {},
1047
1338
  "isRLSEnabled": false
1048
1339
  },
1049
- "document_management.document_request_submission": {
1050
- "name": "document_request_submission",
1340
+ "document_management.request_template": {
1341
+ "name": "request_template",
1051
1342
  "schema": "document_management",
1052
1343
  "columns": {
1053
1344
  "id": {
@@ -1057,18 +1348,30 @@
1057
1348
  "notNull": true,
1058
1349
  "default": "gen_random_uuid()"
1059
1350
  },
1060
- "request_id": {
1061
- "name": "request_id",
1351
+ "tenant_id": {
1352
+ "name": "tenant_id",
1353
+ "type": "uuid",
1354
+ "primaryKey": false,
1355
+ "notNull": false
1356
+ },
1357
+ "requests_template_id": {
1358
+ "name": "requests_template_id",
1062
1359
  "type": "uuid",
1063
1360
  "primaryKey": false,
1064
1361
  "notNull": true
1065
1362
  },
1066
- "document_id": {
1067
- "name": "document_id",
1363
+ "type_id": {
1364
+ "name": "type_id",
1068
1365
  "type": "uuid",
1069
1366
  "primaryKey": false,
1070
1367
  "notNull": true
1071
1368
  },
1369
+ "comment": {
1370
+ "name": "comment",
1371
+ "type": "text",
1372
+ "primaryKey": false,
1373
+ "notNull": false
1374
+ },
1072
1375
  "revision": {
1073
1376
  "name": "revision",
1074
1377
  "type": "integer",
@@ -1103,13 +1406,13 @@
1103
1406
  },
1104
1407
  "indexes": {},
1105
1408
  "foreignKeys": {
1106
- "document_request_submission_request_id_document_request_id_fk": {
1107
- "name": "document_request_submission_request_id_document_request_id_fk",
1108
- "tableFrom": "document_request_submission",
1109
- "tableTo": "document_request",
1409
+ "request_template_requests_template_id_requests_template_id_fk": {
1410
+ "name": "request_template_requests_template_id_requests_template_id_fk",
1411
+ "tableFrom": "request_template",
1412
+ "tableTo": "requests_template",
1110
1413
  "schemaTo": "document_management",
1111
1414
  "columnsFrom": [
1112
- "request_id"
1415
+ "requests_template_id"
1113
1416
  ],
1114
1417
  "columnsTo": [
1115
1418
  "id"
@@ -1117,13 +1420,13 @@
1117
1420
  "onDelete": "no action",
1118
1421
  "onUpdate": "no action"
1119
1422
  },
1120
- "document_request_submission_document_id_document_id_fk": {
1121
- "name": "document_request_submission_document_id_document_id_fk",
1122
- "tableFrom": "document_request_submission",
1123
- "tableTo": "document",
1423
+ "request_template_type_id_type_id_fk": {
1424
+ "name": "request_template_type_id_type_id_fk",
1425
+ "tableFrom": "request_template",
1426
+ "tableTo": "type",
1124
1427
  "schemaTo": "document_management",
1125
1428
  "columnsFrom": [
1126
- "document_id"
1429
+ "type_id"
1127
1430
  ],
1128
1431
  "columnsTo": [
1129
1432
  "id"
@@ -1133,22 +1436,13 @@
1133
1436
  }
1134
1437
  },
1135
1438
  "compositePrimaryKeys": {},
1136
- "uniqueConstraints": {
1137
- "document_request_submission_request_id_document_id_unique": {
1138
- "name": "document_request_submission_request_id_document_id_unique",
1139
- "nullsNotDistinct": false,
1140
- "columns": [
1141
- "request_id",
1142
- "document_id"
1143
- ]
1144
- }
1145
- },
1439
+ "uniqueConstraints": {},
1146
1440
  "policies": {},
1147
1441
  "checkConstraints": {},
1148
1442
  "isRLSEnabled": false
1149
1443
  },
1150
- "document_management.document_request_template": {
1151
- "name": "document_request_template",
1444
+ "document_management.requests_template": {
1445
+ "name": "requests_template",
1152
1446
  "schema": "document_management",
1153
1447
  "columns": {
1154
1448
  "id": {
@@ -1158,20 +1452,20 @@
1158
1452
  "notNull": true,
1159
1453
  "default": "gen_random_uuid()"
1160
1454
  },
1161
- "requests_template_id": {
1162
- "name": "requests_template_id",
1455
+ "tenant_id": {
1456
+ "name": "tenant_id",
1163
1457
  "type": "uuid",
1164
1458
  "primaryKey": false,
1165
- "notNull": true
1459
+ "notNull": false
1166
1460
  },
1167
- "type_id": {
1168
- "name": "type_id",
1169
- "type": "uuid",
1461
+ "label": {
1462
+ "name": "label",
1463
+ "type": "text",
1170
1464
  "primaryKey": false,
1171
1465
  "notNull": true
1172
1466
  },
1173
- "comment": {
1174
- "name": "comment",
1467
+ "description": {
1468
+ "name": "description",
1175
1469
  "type": "text",
1176
1470
  "primaryKey": false,
1177
1471
  "notNull": false
@@ -1209,44 +1503,15 @@
1209
1503
  }
1210
1504
  },
1211
1505
  "indexes": {},
1212
- "foreignKeys": {
1213
- "document_request_template_requests_template_id_document_requests_template_id_fk": {
1214
- "name": "document_request_template_requests_template_id_document_requests_template_id_fk",
1215
- "tableFrom": "document_request_template",
1216
- "tableTo": "document_requests_template",
1217
- "schemaTo": "document_management",
1218
- "columnsFrom": [
1219
- "requests_template_id"
1220
- ],
1221
- "columnsTo": [
1222
- "id"
1223
- ],
1224
- "onDelete": "no action",
1225
- "onUpdate": "no action"
1226
- },
1227
- "document_request_template_type_id_document_type_id_fk": {
1228
- "name": "document_request_template_type_id_document_type_id_fk",
1229
- "tableFrom": "document_request_template",
1230
- "tableTo": "document_type",
1231
- "schemaTo": "document_management",
1232
- "columnsFrom": [
1233
- "type_id"
1234
- ],
1235
- "columnsTo": [
1236
- "id"
1237
- ],
1238
- "onDelete": "no action",
1239
- "onUpdate": "no action"
1240
- }
1241
- },
1506
+ "foreignKeys": {},
1242
1507
  "compositePrimaryKeys": {},
1243
1508
  "uniqueConstraints": {},
1244
1509
  "policies": {},
1245
1510
  "checkConstraints": {},
1246
1511
  "isRLSEnabled": false
1247
1512
  },
1248
- "document_management.document_requests_template": {
1249
- "name": "document_requests_template",
1513
+ "document_management.tag": {
1514
+ "name": "tag",
1250
1515
  "schema": "document_management",
1251
1516
  "columns": {
1252
1517
  "id": {
@@ -1256,18 +1521,96 @@
1256
1521
  "notNull": true,
1257
1522
  "default": "gen_random_uuid()"
1258
1523
  },
1524
+ "tenant_id": {
1525
+ "name": "tenant_id",
1526
+ "type": "uuid",
1527
+ "primaryKey": false,
1528
+ "notNull": false
1529
+ },
1259
1530
  "label": {
1260
1531
  "name": "label",
1261
1532
  "type": "text",
1262
1533
  "primaryKey": false,
1263
1534
  "notNull": true
1264
1535
  },
1265
- "description": {
1266
- "name": "description",
1267
- "type": "text",
1536
+ "revision": {
1537
+ "name": "revision",
1538
+ "type": "integer",
1539
+ "primaryKey": false,
1540
+ "notNull": true
1541
+ },
1542
+ "revision_timestamp": {
1543
+ "name": "revision_timestamp",
1544
+ "type": "timestamp with time zone",
1545
+ "primaryKey": false,
1546
+ "notNull": true
1547
+ },
1548
+ "create_timestamp": {
1549
+ "name": "create_timestamp",
1550
+ "type": "timestamp with time zone",
1551
+ "primaryKey": false,
1552
+ "notNull": true
1553
+ },
1554
+ "delete_timestamp": {
1555
+ "name": "delete_timestamp",
1556
+ "type": "timestamp with time zone",
1268
1557
  "primaryKey": false,
1269
1558
  "notNull": false
1270
1559
  },
1560
+ "attributes": {
1561
+ "name": "attributes",
1562
+ "type": "jsonb",
1563
+ "primaryKey": false,
1564
+ "notNull": true,
1565
+ "default": "'{}'::jsonb"
1566
+ }
1567
+ },
1568
+ "indexes": {},
1569
+ "foreignKeys": {},
1570
+ "compositePrimaryKeys": {},
1571
+ "uniqueConstraints": {
1572
+ "tag_tenant_id_label_unique": {
1573
+ "name": "tag_tenant_id_label_unique",
1574
+ "nullsNotDistinct": false,
1575
+ "columns": [
1576
+ "tenant_id",
1577
+ "label"
1578
+ ]
1579
+ }
1580
+ },
1581
+ "policies": {},
1582
+ "checkConstraints": {},
1583
+ "isRLSEnabled": false
1584
+ },
1585
+ "document_management.tag_assignment": {
1586
+ "name": "tag_assignment",
1587
+ "schema": "document_management",
1588
+ "columns": {
1589
+ "id": {
1590
+ "name": "id",
1591
+ "type": "uuid",
1592
+ "primaryKey": true,
1593
+ "notNull": true,
1594
+ "default": "gen_random_uuid()"
1595
+ },
1596
+ "tenant_id": {
1597
+ "name": "tenant_id",
1598
+ "type": "uuid",
1599
+ "primaryKey": false,
1600
+ "notNull": true
1601
+ },
1602
+ "document_id": {
1603
+ "name": "document_id",
1604
+ "type": "uuid",
1605
+ "primaryKey": false,
1606
+ "notNull": true
1607
+ },
1608
+ "tag_id": {
1609
+ "name": "tag_id",
1610
+ "type": "uuid",
1611
+ "primaryKey": false,
1612
+ "notNull": true
1613
+ },
1271
1614
  "revision": {
1272
1615
  "name": "revision",
1273
1616
  "type": "integer",
@@ -1301,14 +1644,61 @@
1301
1644
  }
1302
1645
  },
1303
1646
  "indexes": {},
1304
- "foreignKeys": {},
1647
+ "foreignKeys": {
1648
+ "tag_assignment_document_id_document_id_fk": {
1649
+ "name": "tag_assignment_document_id_document_id_fk",
1650
+ "tableFrom": "tag_assignment",
1651
+ "tableTo": "document",
1652
+ "schemaTo": "document_management",
1653
+ "columnsFrom": [
1654
+ "document_id"
1655
+ ],
1656
+ "columnsTo": [
1657
+ "id"
1658
+ ],
1659
+ "onDelete": "no action",
1660
+ "onUpdate": "no action"
1661
+ },
1662
+ "tag_assignment_tag_id_tag_id_fk": {
1663
+ "name": "tag_assignment_tag_id_tag_id_fk",
1664
+ "tableFrom": "tag_assignment",
1665
+ "tableTo": "tag",
1666
+ "schemaTo": "document_management",
1667
+ "columnsFrom": [
1668
+ "tag_id"
1669
+ ],
1670
+ "columnsTo": [
1671
+ "id"
1672
+ ],
1673
+ "onDelete": "no action",
1674
+ "onUpdate": "no action"
1675
+ },
1676
+ "tag_assignment_tenantId_documentId_fkey": {
1677
+ "name": "tag_assignment_tenantId_documentId_fkey",
1678
+ "tableFrom": "tag_assignment",
1679
+ "tableTo": "document",
1680
+ "schemaTo": "document_management",
1681
+ "columnsFrom": [
1682
+ "tenant_id",
1683
+ "document_id"
1684
+ ],
1685
+ "columnsTo": [
1686
+ "tenant_id",
1687
+ "id"
1688
+ ],
1689
+ "onDelete": "no action",
1690
+ "onUpdate": "no action"
1691
+ }
1692
+ },
1305
1693
  "compositePrimaryKeys": {},
1306
1694
  "uniqueConstraints": {
1307
- "document_requests_template_label_unique": {
1308
- "name": "document_requests_template_label_unique",
1695
+ "tag_assignment_tenant_id_document_id_tag_id_unique": {
1696
+ "name": "tag_assignment_tenant_id_document_id_tag_id_unique",
1309
1697
  "nullsNotDistinct": false,
1310
1698
  "columns": [
1311
- "label"
1699
+ "tenant_id",
1700
+ "document_id",
1701
+ "tag_id"
1312
1702
  ]
1313
1703
  }
1314
1704
  },
@@ -1316,8 +1706,8 @@
1316
1706
  "checkConstraints": {},
1317
1707
  "isRLSEnabled": false
1318
1708
  },
1319
- "document_management.document_type": {
1320
- "name": "document_type",
1709
+ "document_management.type": {
1710
+ "name": "type",
1321
1711
  "schema": "document_management",
1322
1712
  "columns": {
1323
1713
  "id": {
@@ -1327,6 +1717,12 @@
1327
1717
  "notNull": true,
1328
1718
  "default": "gen_random_uuid()"
1329
1719
  },
1720
+ "tenant_id": {
1721
+ "name": "tenant_id",
1722
+ "type": "uuid",
1723
+ "primaryKey": false,
1724
+ "notNull": false
1725
+ },
1330
1726
  "category_id": {
1331
1727
  "name": "category_id",
1332
1728
  "type": "uuid",
@@ -1373,10 +1769,10 @@
1373
1769
  },
1374
1770
  "indexes": {},
1375
1771
  "foreignKeys": {
1376
- "document_type_category_id_document_category_id_fk": {
1377
- "name": "document_type_category_id_document_category_id_fk",
1378
- "tableFrom": "document_type",
1379
- "tableTo": "document_category",
1772
+ "type_category_id_category_id_fk": {
1773
+ "name": "type_category_id_category_id_fk",
1774
+ "tableFrom": "type",
1775
+ "tableTo": "category",
1380
1776
  "schemaTo": "document_management",
1381
1777
  "columnsFrom": [
1382
1778
  "category_id"
@@ -1390,10 +1786,11 @@
1390
1786
  },
1391
1787
  "compositePrimaryKeys": {},
1392
1788
  "uniqueConstraints": {
1393
- "document_type_category_id_label_unique": {
1394
- "name": "document_type_category_id_label_unique",
1789
+ "type_tenant_id_category_id_label_unique": {
1790
+ "name": "type_tenant_id_category_id_label_unique",
1395
1791
  "nullsNotDistinct": false,
1396
1792
  "columns": [
1793
+ "tenant_id",
1397
1794
  "category_id",
1398
1795
  "label"
1399
1796
  ]
@@ -1403,8 +1800,8 @@
1403
1800
  "checkConstraints": {},
1404
1801
  "isRLSEnabled": false
1405
1802
  },
1406
- "document_management.document_type_property": {
1407
- "name": "document_type_property",
1803
+ "document_management.type_property": {
1804
+ "name": "type_property",
1408
1805
  "schema": "document_management",
1409
1806
  "columns": {
1410
1807
  "id": {
@@ -1414,6 +1811,12 @@
1414
1811
  "notNull": true,
1415
1812
  "default": "gen_random_uuid()"
1416
1813
  },
1814
+ "tenant_id": {
1815
+ "name": "tenant_id",
1816
+ "type": "uuid",
1817
+ "primaryKey": false,
1818
+ "notNull": false
1819
+ },
1417
1820
  "type_id": {
1418
1821
  "name": "type_id",
1419
1822
  "type": "uuid",
@@ -1460,10 +1863,10 @@
1460
1863
  },
1461
1864
  "indexes": {},
1462
1865
  "foreignKeys": {
1463
- "document_type_property_type_id_document_type_id_fk": {
1464
- "name": "document_type_property_type_id_document_type_id_fk",
1465
- "tableFrom": "document_type_property",
1466
- "tableTo": "document_type",
1866
+ "type_property_type_id_type_id_fk": {
1867
+ "name": "type_property_type_id_type_id_fk",
1868
+ "tableFrom": "type_property",
1869
+ "tableTo": "type",
1467
1870
  "schemaTo": "document_management",
1468
1871
  "columnsFrom": [
1469
1872
  "type_id"
@@ -1474,10 +1877,10 @@
1474
1877
  "onDelete": "no action",
1475
1878
  "onUpdate": "no action"
1476
1879
  },
1477
- "document_type_property_property_id_document_property_id_fk": {
1478
- "name": "document_type_property_property_id_document_property_id_fk",
1479
- "tableFrom": "document_type_property",
1480
- "tableTo": "document_property",
1880
+ "type_property_property_id_property_id_fk": {
1881
+ "name": "type_property_property_id_property_id_fk",
1882
+ "tableFrom": "type_property",
1883
+ "tableTo": "property",
1481
1884
  "schemaTo": "document_management",
1482
1885
  "columnsFrom": [
1483
1886
  "property_id"
@@ -1491,10 +1894,11 @@
1491
1894
  },
1492
1895
  "compositePrimaryKeys": {},
1493
1896
  "uniqueConstraints": {
1494
- "document_type_property_type_id_property_id_unique": {
1495
- "name": "document_type_property_type_id_property_id_unique",
1897
+ "type_property_tenant_id_type_id_property_id_unique": {
1898
+ "name": "type_property_tenant_id_type_id_property_id_unique",
1496
1899
  "nullsNotDistinct": false,
1497
1900
  "columns": [
1901
+ "tenant_id",
1498
1902
  "type_id",
1499
1903
  "property_id"
1500
1904
  ]
@@ -1515,6 +1919,12 @@
1515
1919
  "notNull": true,
1516
1920
  "default": "gen_random_uuid()"
1517
1921
  },
1922
+ "tenant_id": {
1923
+ "name": "tenant_id",
1924
+ "type": "uuid",
1925
+ "primaryKey": false,
1926
+ "notNull": false
1927
+ },
1518
1928
  "type_id": {
1519
1929
  "name": "type_id",
1520
1930
  "type": "uuid",
@@ -1559,12 +1969,28 @@
1559
1969
  "default": "'{}'::jsonb"
1560
1970
  }
1561
1971
  },
1562
- "indexes": {},
1972
+ "indexes": {
1973
+ "document_type_validation_type_id_idx": {
1974
+ "name": "document_type_validation_type_id_idx",
1975
+ "columns": [
1976
+ {
1977
+ "expression": "type_id",
1978
+ "isExpression": false,
1979
+ "asc": true,
1980
+ "nulls": "last"
1981
+ }
1982
+ ],
1983
+ "isUnique": false,
1984
+ "concurrently": false,
1985
+ "method": "btree",
1986
+ "with": {}
1987
+ }
1988
+ },
1563
1989
  "foreignKeys": {
1564
- "document_type_validation_type_id_document_type_id_fk": {
1565
- "name": "document_type_validation_type_id_document_type_id_fk",
1990
+ "document_type_validation_type_id_type_id_fk": {
1991
+ "name": "document_type_validation_type_id_type_id_fk",
1566
1992
  "tableFrom": "document_type_validation",
1567
- "tableTo": "document_type",
1993
+ "tableTo": "type",
1568
1994
  "schemaTo": "document_management",
1569
1995
  "columnsFrom": [
1570
1996
  "type_id"
@@ -1575,10 +2001,10 @@
1575
2001
  "onDelete": "no action",
1576
2002
  "onUpdate": "no action"
1577
2003
  },
1578
- "document_type_validation_validation_id_document_validation_definition_id_fk": {
1579
- "name": "document_type_validation_validation_id_document_validation_definition_id_fk",
2004
+ "document_type_validation_validation_id_validation_definition_id_fk": {
2005
+ "name": "document_type_validation_validation_id_validation_definition_id_fk",
1580
2006
  "tableFrom": "document_type_validation",
1581
- "tableTo": "document_validation_definition",
2007
+ "tableTo": "validation_definition",
1582
2008
  "schemaTo": "document_management",
1583
2009
  "columnsFrom": [
1584
2010
  "validation_id"
@@ -1592,10 +2018,11 @@
1592
2018
  },
1593
2019
  "compositePrimaryKeys": {},
1594
2020
  "uniqueConstraints": {
1595
- "document_type_validation_type_id_validation_id_unique": {
1596
- "name": "document_type_validation_type_id_validation_id_unique",
2021
+ "document_type_validation_tenant_id_type_id_validation_id_unique": {
2022
+ "name": "document_type_validation_tenant_id_type_id_validation_id_unique",
1597
2023
  "nullsNotDistinct": false,
1598
2024
  "columns": [
2025
+ "tenant_id",
1599
2026
  "type_id",
1600
2027
  "validation_id"
1601
2028
  ]
@@ -1605,8 +2032,8 @@
1605
2032
  "checkConstraints": {},
1606
2033
  "isRLSEnabled": false
1607
2034
  },
1608
- "document_management.document_validation_definition": {
1609
- "name": "document_validation_definition",
2035
+ "document_management.validation_definition": {
2036
+ "name": "validation_definition",
1610
2037
  "schema": "document_management",
1611
2038
  "columns": {
1612
2039
  "id": {
@@ -1616,6 +2043,12 @@
1616
2043
  "notNull": true,
1617
2044
  "default": "gen_random_uuid()"
1618
2045
  },
2046
+ "tenant_id": {
2047
+ "name": "tenant_id",
2048
+ "type": "uuid",
2049
+ "primaryKey": false,
2050
+ "notNull": false
2051
+ },
1619
2052
  "identifier": {
1620
2053
  "name": "identifier",
1621
2054
  "type": "text",
@@ -1680,8 +2113,8 @@
1680
2113
  "checkConstraints": {},
1681
2114
  "isRLSEnabled": false
1682
2115
  },
1683
- "document_management.document_validation_execution": {
1684
- "name": "document_validation_execution",
2116
+ "document_management.validation_execution": {
2117
+ "name": "validation_execution",
1685
2118
  "schema": "document_management",
1686
2119
  "columns": {
1687
2120
  "id": {
@@ -1691,6 +2124,12 @@
1691
2124
  "notNull": true,
1692
2125
  "default": "gen_random_uuid()"
1693
2126
  },
2127
+ "tenant_id": {
2128
+ "name": "tenant_id",
2129
+ "type": "uuid",
2130
+ "primaryKey": false,
2131
+ "notNull": true
2132
+ },
1694
2133
  "workflow_id": {
1695
2134
  "name": "workflow_id",
1696
2135
  "type": "uuid",
@@ -1705,14 +2144,14 @@
1705
2144
  },
1706
2145
  "state": {
1707
2146
  "name": "state",
1708
- "type": "document_validation_execution_state",
2147
+ "type": "validation_execution_state",
1709
2148
  "typeSchema": "document_management",
1710
2149
  "primaryKey": false,
1711
2150
  "notNull": true
1712
2151
  },
1713
2152
  "result_status": {
1714
2153
  "name": "result_status",
1715
- "type": "document_validation_result_status",
2154
+ "type": "validation_result_status",
1716
2155
  "typeSchema": "document_management",
1717
2156
  "primaryKey": false,
1718
2157
  "notNull": false
@@ -1769,10 +2208,10 @@
1769
2208
  },
1770
2209
  "indexes": {},
1771
2210
  "foreignKeys": {
1772
- "document_validation_execution_workflow_id_document_workflow_id_fk": {
1773
- "name": "document_validation_execution_workflow_id_document_workflow_id_fk",
1774
- "tableFrom": "document_validation_execution",
1775
- "tableTo": "document_workflow",
2211
+ "validation_execution_workflow_id_workflow_id_fk": {
2212
+ "name": "validation_execution_workflow_id_workflow_id_fk",
2213
+ "tableFrom": "validation_execution",
2214
+ "tableTo": "workflow",
1776
2215
  "schemaTo": "document_management",
1777
2216
  "columnsFrom": [
1778
2217
  "workflow_id"
@@ -1783,10 +2222,10 @@
1783
2222
  "onDelete": "no action",
1784
2223
  "onUpdate": "no action"
1785
2224
  },
1786
- "document_validation_execution_definition_id_document_validation_definition_id_fk": {
1787
- "name": "document_validation_execution_definition_id_document_validation_definition_id_fk",
1788
- "tableFrom": "document_validation_execution",
1789
- "tableTo": "document_validation_definition",
2225
+ "validation_execution_definition_id_validation_definition_id_fk": {
2226
+ "name": "validation_execution_definition_id_validation_definition_id_fk",
2227
+ "tableFrom": "validation_execution",
2228
+ "tableTo": "validation_definition",
1790
2229
  "schemaTo": "document_management",
1791
2230
  "columnsFrom": [
1792
2231
  "definition_id"
@@ -1796,14 +2235,31 @@
1796
2235
  ],
1797
2236
  "onDelete": "no action",
1798
2237
  "onUpdate": "no action"
2238
+ },
2239
+ "validation_execution_tenantId_workflowId_fkey": {
2240
+ "name": "validation_execution_tenantId_workflowId_fkey",
2241
+ "tableFrom": "validation_execution",
2242
+ "tableTo": "workflow",
2243
+ "schemaTo": "document_management",
2244
+ "columnsFrom": [
2245
+ "tenant_id",
2246
+ "workflow_id"
2247
+ ],
2248
+ "columnsTo": [
2249
+ "tenant_id",
2250
+ "id"
2251
+ ],
2252
+ "onDelete": "no action",
2253
+ "onUpdate": "no action"
1799
2254
  }
1800
2255
  },
1801
2256
  "compositePrimaryKeys": {},
1802
2257
  "uniqueConstraints": {
1803
- "document_validation_execution_workflow_id_definition_id_unique": {
1804
- "name": "document_validation_execution_workflow_id_definition_id_unique",
2258
+ "validation_execution_tenant_id_workflow_id_definition_id_unique": {
2259
+ "name": "validation_execution_tenant_id_workflow_id_definition_id_unique",
1805
2260
  "nullsNotDistinct": false,
1806
2261
  "columns": [
2262
+ "tenant_id",
1807
2263
  "workflow_id",
1808
2264
  "definition_id"
1809
2265
  ]
@@ -1813,8 +2269,8 @@
1813
2269
  "checkConstraints": {},
1814
2270
  "isRLSEnabled": false
1815
2271
  },
1816
- "document_management.document_validation_execution_related_document": {
1817
- "name": "document_validation_execution_related_document",
2272
+ "document_management.validation_execution_related_document": {
2273
+ "name": "validation_execution_related_document",
1818
2274
  "schema": "document_management",
1819
2275
  "columns": {
1820
2276
  "id": {
@@ -1824,6 +2280,12 @@
1824
2280
  "notNull": true,
1825
2281
  "default": "gen_random_uuid()"
1826
2282
  },
2283
+ "tenant_id": {
2284
+ "name": "tenant_id",
2285
+ "type": "uuid",
2286
+ "primaryKey": false,
2287
+ "notNull": true
2288
+ },
1827
2289
  "execution_id": {
1828
2290
  "name": "execution_id",
1829
2291
  "type": "uuid",
@@ -1870,10 +2332,10 @@
1870
2332
  },
1871
2333
  "indexes": {},
1872
2334
  "foreignKeys": {
1873
- "document_validation_execution_related_document_execution_id_document_validation_execution_id_fk": {
1874
- "name": "document_validation_execution_related_document_execution_id_document_validation_execution_id_fk",
1875
- "tableFrom": "document_validation_execution_related_document",
1876
- "tableTo": "document_validation_execution",
2335
+ "validation_execution_related_document_execution_id_validation_execution_id_fk": {
2336
+ "name": "validation_execution_related_document_execution_id_validation_execution_id_fk",
2337
+ "tableFrom": "validation_execution_related_document",
2338
+ "tableTo": "validation_execution",
1877
2339
  "schemaTo": "document_management",
1878
2340
  "columnsFrom": [
1879
2341
  "execution_id"
@@ -1884,15 +2346,47 @@
1884
2346
  "onDelete": "no action",
1885
2347
  "onUpdate": "no action"
1886
2348
  },
1887
- "document_validation_execution_related_document_document_id_document_id_fk": {
1888
- "name": "document_validation_execution_related_document_document_id_document_id_fk",
1889
- "tableFrom": "document_validation_execution_related_document",
2349
+ "validation_execution_related_document_document_id_document_id_fk": {
2350
+ "name": "validation_execution_related_document_document_id_document_id_fk",
2351
+ "tableFrom": "validation_execution_related_document",
2352
+ "tableTo": "document",
2353
+ "schemaTo": "document_management",
2354
+ "columnsFrom": [
2355
+ "document_id"
2356
+ ],
2357
+ "columnsTo": [
2358
+ "id"
2359
+ ],
2360
+ "onDelete": "no action",
2361
+ "onUpdate": "no action"
2362
+ },
2363
+ "validation_execution_related_document_tenantId_documentId_fkey": {
2364
+ "name": "validation_execution_related_document_tenantId_documentId_fkey",
2365
+ "tableFrom": "validation_execution_related_document",
1890
2366
  "tableTo": "document",
1891
2367
  "schemaTo": "document_management",
1892
2368
  "columnsFrom": [
2369
+ "tenant_id",
1893
2370
  "document_id"
1894
2371
  ],
1895
2372
  "columnsTo": [
2373
+ "tenant_id",
2374
+ "id"
2375
+ ],
2376
+ "onDelete": "no action",
2377
+ "onUpdate": "no action"
2378
+ },
2379
+ "validation_execution_related_document_tenantId_executionId_fkey": {
2380
+ "name": "validation_execution_related_document_tenantId_executionId_fkey",
2381
+ "tableFrom": "validation_execution_related_document",
2382
+ "tableTo": "validation_execution",
2383
+ "schemaTo": "document_management",
2384
+ "columnsFrom": [
2385
+ "tenant_id",
2386
+ "execution_id"
2387
+ ],
2388
+ "columnsTo": [
2389
+ "tenant_id",
1896
2390
  "id"
1897
2391
  ],
1898
2392
  "onDelete": "no action",
@@ -1901,10 +2395,11 @@
1901
2395
  },
1902
2396
  "compositePrimaryKeys": {},
1903
2397
  "uniqueConstraints": {
1904
- "dverd_execution_id_document_id_unique": {
1905
- "name": "dverd_execution_id_document_id_unique",
2398
+ "verd_tenant_id_execution_id_document_id_unique": {
2399
+ "name": "verd_tenant_id_execution_id_document_id_unique",
1906
2400
  "nullsNotDistinct": false,
1907
2401
  "columns": [
2402
+ "tenant_id",
1908
2403
  "execution_id",
1909
2404
  "document_id"
1910
2405
  ]
@@ -1914,8 +2409,8 @@
1914
2409
  "checkConstraints": {},
1915
2410
  "isRLSEnabled": false
1916
2411
  },
1917
- "document_management.document_workflow": {
1918
- "name": "document_workflow",
2412
+ "document_management.workflow": {
2413
+ "name": "workflow",
1919
2414
  "schema": "document_management",
1920
2415
  "columns": {
1921
2416
  "id": {
@@ -1925,6 +2420,12 @@
1925
2420
  "notNull": true,
1926
2421
  "default": "gen_random_uuid()"
1927
2422
  },
2423
+ "tenant_id": {
2424
+ "name": "tenant_id",
2425
+ "type": "uuid",
2426
+ "primaryKey": false,
2427
+ "notNull": true
2428
+ },
1928
2429
  "document_id": {
1929
2430
  "name": "document_id",
1930
2431
  "type": "uuid",
@@ -1933,25 +2434,31 @@
1933
2434
  },
1934
2435
  "step": {
1935
2436
  "name": "step",
1936
- "type": "document_workflow_step",
2437
+ "type": "workflow_step",
1937
2438
  "typeSchema": "document_management",
1938
2439
  "primaryKey": false,
1939
2440
  "notNull": true
1940
2441
  },
1941
2442
  "state": {
1942
2443
  "name": "state",
1943
- "type": "document_workflow_state",
2444
+ "type": "workflow_state",
1944
2445
  "typeSchema": "document_management",
1945
2446
  "primaryKey": false,
1946
2447
  "notNull": true
1947
2448
  },
1948
2449
  "fail_reason": {
1949
2450
  "name": "fail_reason",
1950
- "type": "document_workflow_fail_reason",
2451
+ "type": "workflow_fail_reason",
1951
2452
  "typeSchema": "document_management",
1952
2453
  "primaryKey": false,
1953
2454
  "notNull": false
1954
2455
  },
2456
+ "complete_timestamp": {
2457
+ "name": "complete_timestamp",
2458
+ "type": "timestamp with time zone",
2459
+ "primaryKey": false,
2460
+ "notNull": false
2461
+ },
1955
2462
  "complete_user_id": {
1956
2463
  "name": "complete_user_id",
1957
2464
  "type": "uuid",
@@ -1991,8 +2498,8 @@
1991
2498
  }
1992
2499
  },
1993
2500
  "indexes": {
1994
- "document_workflow_document_id_idx": {
1995
- "name": "document_workflow_document_id_idx",
2501
+ "workflow_document_id_idx": {
2502
+ "name": "workflow_document_id_idx",
1996
2503
  "columns": [
1997
2504
  {
1998
2505
  "expression": "document_id",
@@ -2002,22 +2509,38 @@
2002
2509
  }
2003
2510
  ],
2004
2511
  "isUnique": true,
2005
- "where": "\"document_management\".\"document_workflow\".\"state\" <> 'completed'",
2512
+ "where": "\"document_management\".\"workflow\".\"state\" <> 'completed'",
2006
2513
  "concurrently": false,
2007
2514
  "method": "btree",
2008
2515
  "with": {}
2009
2516
  }
2010
2517
  },
2011
2518
  "foreignKeys": {
2012
- "document_workflow_document_id_document_id_fk": {
2013
- "name": "document_workflow_document_id_document_id_fk",
2014
- "tableFrom": "document_workflow",
2519
+ "workflow_document_id_document_id_fk": {
2520
+ "name": "workflow_document_id_document_id_fk",
2521
+ "tableFrom": "workflow",
2522
+ "tableTo": "document",
2523
+ "schemaTo": "document_management",
2524
+ "columnsFrom": [
2525
+ "document_id"
2526
+ ],
2527
+ "columnsTo": [
2528
+ "id"
2529
+ ],
2530
+ "onDelete": "no action",
2531
+ "onUpdate": "no action"
2532
+ },
2533
+ "workflow_tenantId_documentId_fkey": {
2534
+ "name": "workflow_tenantId_documentId_fkey",
2535
+ "tableFrom": "workflow",
2015
2536
  "tableTo": "document",
2016
2537
  "schemaTo": "document_management",
2017
2538
  "columnsFrom": [
2539
+ "tenant_id",
2018
2540
  "document_id"
2019
2541
  ],
2020
2542
  "columnsTo": [
2543
+ "tenant_id",
2021
2544
  "id"
2022
2545
  ],
2023
2546
  "onDelete": "no action",
@@ -2041,16 +2564,16 @@
2041
2564
  "rejected"
2042
2565
  ]
2043
2566
  },
2044
- "document_management.document_assignment_target": {
2045
- "name": "document_assignment_target",
2567
+ "document_management.assignment_target": {
2568
+ "name": "assignment_target",
2046
2569
  "schema": "document_management",
2047
2570
  "values": [
2048
2571
  "collection",
2049
2572
  "request"
2050
2573
  ]
2051
2574
  },
2052
- "document_management.document_property_data_type": {
2053
- "name": "document_property_data_type",
2575
+ "document_management.property_data_type": {
2576
+ "name": "property_data_type",
2054
2577
  "schema": "document_management",
2055
2578
  "values": [
2056
2579
  "text",
@@ -2060,8 +2583,8 @@
2060
2583
  "date"
2061
2584
  ]
2062
2585
  },
2063
- "document_management.document_request_state": {
2064
- "name": "document_request_state",
2586
+ "document_management.request_state": {
2587
+ "name": "request_state",
2065
2588
  "schema": "document_management",
2066
2589
  "values": [
2067
2590
  "open",
@@ -2069,8 +2592,8 @@
2069
2592
  "closed"
2070
2593
  ]
2071
2594
  },
2072
- "document_management.document_validation_execution_state": {
2073
- "name": "document_validation_execution_state",
2595
+ "document_management.validation_execution_state": {
2596
+ "name": "validation_execution_state",
2074
2597
  "schema": "document_management",
2075
2598
  "values": [
2076
2599
  "pending",
@@ -2079,8 +2602,8 @@
2079
2602
  "error"
2080
2603
  ]
2081
2604
  },
2082
- "document_management.document_validation_result_status": {
2083
- "name": "document_validation_result_status",
2605
+ "document_management.validation_result_status": {
2606
+ "name": "validation_result_status",
2084
2607
  "schema": "document_management",
2085
2608
  "values": [
2086
2609
  "passed",
@@ -2088,27 +2611,28 @@
2088
2611
  "warning"
2089
2612
  ]
2090
2613
  },
2091
- "document_management.document_workflow_fail_reason": {
2092
- "name": "document_workflow_fail_reason",
2614
+ "document_management.workflow_fail_reason": {
2615
+ "name": "workflow_fail_reason",
2093
2616
  "schema": "document_management",
2094
2617
  "values": [
2095
2618
  "no-suitable-collection",
2096
2619
  "no-suitable-request"
2097
2620
  ]
2098
2621
  },
2099
- "document_management.document_workflow_state": {
2100
- "name": "document_workflow_state",
2622
+ "document_management.workflow_state": {
2623
+ "name": "workflow_state",
2101
2624
  "schema": "document_management",
2102
2625
  "values": [
2103
2626
  "pending",
2104
2627
  "running",
2628
+ "review",
2105
2629
  "completed",
2106
2630
  "error",
2107
2631
  "failed"
2108
2632
  ]
2109
2633
  },
2110
- "document_management.document_workflow_step": {
2111
- "name": "document_workflow_step",
2634
+ "document_management.workflow_step": {
2635
+ "name": "workflow_step",
2112
2636
  "schema": "document_management",
2113
2637
  "values": [
2114
2638
  "classification",