@tstdl/base 0.93.77 → 0.93.78

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 (101) hide show
  1. package/authentication/client/http-client.middleware.js +2 -2
  2. package/authentication/models/authentication-credentials.model.d.ts +2 -2
  3. package/authentication/models/authentication-credentials.model.js +5 -3
  4. package/authentication/models/authentication-session.model.d.ts +2 -2
  5. package/authentication/models/authentication-session.model.js +5 -3
  6. package/authentication/models/index.d.ts +4 -0
  7. package/authentication/models/index.js +4 -0
  8. package/authentication/models/service-account.model.d.ts +7 -0
  9. package/authentication/models/service-account.model.js +31 -0
  10. package/authentication/models/subject.model.d.ts +16 -0
  11. package/authentication/models/subject.model.js +59 -0
  12. package/authentication/models/system-account.model.d.ts +5 -0
  13. package/authentication/models/system-account.model.js +25 -0
  14. package/authentication/models/user.model.d.ts +15 -0
  15. package/authentication/models/user.model.js +47 -0
  16. package/authentication/server/drizzle/0001_condemned_pretty_boy.sql +70 -0
  17. package/authentication/server/drizzle/meta/0001_snapshot.json +651 -0
  18. package/authentication/server/drizzle/meta/_journal.json +7 -0
  19. package/authentication/server/index.d.ts +1 -0
  20. package/authentication/server/index.js +1 -0
  21. package/authentication/server/schemas.d.ts +16 -1
  22. package/authentication/server/schemas.js +7 -1
  23. package/authentication/server/subject.service.d.ts +6 -0
  24. package/authentication/server/subject.service.js +44 -0
  25. package/circuit-breaker/circuit-breaker.d.ts +32 -0
  26. package/circuit-breaker/circuit-breaker.js +9 -0
  27. package/circuit-breaker/index.d.ts +2 -0
  28. package/circuit-breaker/index.js +2 -0
  29. package/circuit-breaker/postgres/circuit-breaker.d.ts +7 -0
  30. package/circuit-breaker/postgres/circuit-breaker.js +78 -0
  31. package/circuit-breaker/postgres/drizzle/0000_hard_shocker.sql +9 -0
  32. package/circuit-breaker/postgres/drizzle/meta/0000_snapshot.json +82 -0
  33. package/circuit-breaker/postgres/drizzle/meta/_journal.json +13 -0
  34. package/circuit-breaker/postgres/drizzle.config.d.ts +2 -0
  35. package/circuit-breaker/postgres/drizzle.config.js +11 -0
  36. package/circuit-breaker/postgres/index.d.ts +5 -0
  37. package/circuit-breaker/postgres/index.js +5 -0
  38. package/circuit-breaker/postgres/model.d.ts +9 -0
  39. package/circuit-breaker/postgres/model.js +40 -0
  40. package/circuit-breaker/postgres/module.d.ts +6 -0
  41. package/circuit-breaker/postgres/module.js +25 -0
  42. package/circuit-breaker/postgres/provider.d.ts +6 -0
  43. package/circuit-breaker/postgres/provider.js +21 -0
  44. package/circuit-breaker/postgres/schemas.d.ts +8 -0
  45. package/circuit-breaker/postgres/schemas.js +6 -0
  46. package/circuit-breaker/provider.d.ts +4 -0
  47. package/circuit-breaker/provider.js +2 -0
  48. package/circuit-breaker/tests/circuit-breaker.test.js +113 -0
  49. package/document-management/models/document.model.d.ts +0 -1
  50. package/document-management/models/document.model.js +0 -5
  51. package/document-management/server/api/document-management.api.js +1 -2
  52. package/document-management/server/drizzle/0002_round_warbird.sql +1 -0
  53. package/document-management/server/drizzle/meta/0002_snapshot.json +2722 -0
  54. package/document-management/server/drizzle/meta/_journal.json +7 -0
  55. package/document-management/server/services/document-collection.service.js +3 -3
  56. package/document-management/server/services/document-management-ancillary.service.d.ts +1 -1
  57. package/document-management/server/services/document-management.service.js +1 -1
  58. package/document-management/server/services/document-workflow.service.js +5 -5
  59. package/document-management/server/services/document.service.d.ts +0 -2
  60. package/document-management/server/services/document.service.js +1 -2
  61. package/document-management/service-models/enriched/enriched-document.view.d.ts +1 -1
  62. package/examples/document-management/main.d.ts +1 -1
  63. package/examples/document-management/main.js +1 -1
  64. package/logger/transports/console.d.ts +1 -1
  65. package/logger/transports/console.js +4 -1
  66. package/message-bus/message-bus-base.js +1 -1
  67. package/package.json +6 -3
  68. package/queue/enqueue-batch.d.ts +11 -11
  69. package/queue/enqueue-batch.js +2 -3
  70. package/queue/index.d.ts +1 -0
  71. package/queue/index.js +1 -0
  72. package/queue/postgres/drizzle/0003_tricky_venom.sql +30 -0
  73. package/queue/postgres/drizzle/meta/0003_snapshot.json +288 -0
  74. package/queue/postgres/drizzle/meta/_journal.json +7 -0
  75. package/queue/postgres/drizzle.config.js +2 -2
  76. package/queue/postgres/index.d.ts +1 -1
  77. package/queue/postgres/index.js +1 -1
  78. package/queue/postgres/module.d.ts +1 -1
  79. package/queue/postgres/module.js +1 -1
  80. package/queue/postgres/queue.d.ts +52 -23
  81. package/queue/postgres/queue.js +582 -64
  82. package/queue/postgres/queue.provider.d.ts +1 -1
  83. package/queue/postgres/schemas.d.ts +13 -2
  84. package/queue/postgres/schemas.js +4 -2
  85. package/queue/postgres/task.model.d.ts +24 -0
  86. package/queue/postgres/task.model.js +115 -0
  87. package/queue/provider.d.ts +1 -1
  88. package/queue/queue.d.ts +158 -37
  89. package/queue/queue.js +97 -19
  90. package/queue/task-context.d.ts +38 -0
  91. package/queue/task-context.js +102 -0
  92. package/queue/tests/queue.test.d.ts +1 -0
  93. package/queue/tests/queue.test.js +623 -0
  94. package/test4.d.ts +1 -1
  95. package/test4.js +1 -1
  96. package/utils/format-error.d.ts +17 -20
  97. package/utils/format-error.js +105 -47
  98. package/queue/postgres/job.model.d.ts +0 -12
  99. package/queue/postgres/job.model.js +0 -53
  100. package/test6.js +0 -33
  101. /package/{test6.d.ts → circuit-breaker/tests/circuit-breaker.test.d.ts} +0 -0
@@ -0,0 +1,2722 @@
1
+ {
2
+ "id": "b4f33d15-e7d0-43d6-a307-a2279b679223",
3
+ "prevId": "511a820f-2767-4bce-8f31-03d2c770ef6e",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "document_management.document": {
8
+ "name": "document",
9
+ "schema": "document_management",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": false,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "tenant_id": {
19
+ "name": "tenant_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "type_id": {
25
+ "name": "type_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": false
29
+ },
30
+ "title": {
31
+ "name": "title",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "subtitle": {
37
+ "name": "subtitle",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "pages": {
43
+ "name": "pages",
44
+ "type": "integer",
45
+ "primaryKey": false,
46
+ "notNull": false
47
+ },
48
+ "date": {
49
+ "name": "date",
50
+ "type": "date",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "summary": {
55
+ "name": "summary",
56
+ "type": "text",
57
+ "primaryKey": false,
58
+ "notNull": false
59
+ },
60
+ "approval": {
61
+ "name": "approval",
62
+ "type": "document_approval",
63
+ "typeSchema": "document_management",
64
+ "primaryKey": false,
65
+ "notNull": true
66
+ },
67
+ "comment": {
68
+ "name": "comment",
69
+ "type": "text",
70
+ "primaryKey": false,
71
+ "notNull": false
72
+ },
73
+ "original_file_name": {
74
+ "name": "original_file_name",
75
+ "type": "text",
76
+ "primaryKey": false,
77
+ "notNull": false
78
+ },
79
+ "mime_type": {
80
+ "name": "mime_type",
81
+ "type": "text",
82
+ "primaryKey": false,
83
+ "notNull": true
84
+ },
85
+ "hash": {
86
+ "name": "hash",
87
+ "type": "text",
88
+ "primaryKey": false,
89
+ "notNull": true
90
+ },
91
+ "size": {
92
+ "name": "size",
93
+ "type": "integer",
94
+ "primaryKey": false,
95
+ "notNull": true
96
+ },
97
+ "revision": {
98
+ "name": "revision",
99
+ "type": "integer",
100
+ "primaryKey": false,
101
+ "notNull": true
102
+ },
103
+ "revision_timestamp": {
104
+ "name": "revision_timestamp",
105
+ "type": "timestamp with time zone",
106
+ "primaryKey": false,
107
+ "notNull": true
108
+ },
109
+ "create_timestamp": {
110
+ "name": "create_timestamp",
111
+ "type": "timestamp with time zone",
112
+ "primaryKey": false,
113
+ "notNull": true
114
+ },
115
+ "delete_timestamp": {
116
+ "name": "delete_timestamp",
117
+ "type": "timestamp with time zone",
118
+ "primaryKey": false,
119
+ "notNull": false
120
+ },
121
+ "attributes": {
122
+ "name": "attributes",
123
+ "type": "jsonb",
124
+ "primaryKey": false,
125
+ "notNull": true,
126
+ "default": "'{}'::jsonb"
127
+ }
128
+ },
129
+ "indexes": {},
130
+ "foreignKeys": {
131
+ "document_id_fkey": {
132
+ "name": "document_id_fkey",
133
+ "tableFrom": "document",
134
+ "tableTo": "type",
135
+ "schemaTo": "document_management",
136
+ "columnsFrom": [
137
+ "tenant_id",
138
+ "type_id"
139
+ ],
140
+ "columnsTo": [
141
+ "tenant_id",
142
+ "id"
143
+ ],
144
+ "onDelete": "no action",
145
+ "onUpdate": "no action"
146
+ }
147
+ },
148
+ "compositePrimaryKeys": {
149
+ "document_tenant_id_id_pk": {
150
+ "name": "document_tenant_id_id_pk",
151
+ "columns": [
152
+ "tenant_id",
153
+ "id"
154
+ ]
155
+ }
156
+ },
157
+ "uniqueConstraints": {
158
+ "document_tenant_id_id_unique": {
159
+ "name": "document_tenant_id_id_unique",
160
+ "nullsNotDistinct": false,
161
+ "columns": [
162
+ "tenant_id",
163
+ "id"
164
+ ]
165
+ }
166
+ },
167
+ "policies": {},
168
+ "checkConstraints": {},
169
+ "isRLSEnabled": false
170
+ },
171
+ "document_management.assignment_scope": {
172
+ "name": "assignment_scope",
173
+ "schema": "document_management",
174
+ "columns": {
175
+ "id": {
176
+ "name": "id",
177
+ "type": "uuid",
178
+ "primaryKey": false,
179
+ "notNull": true,
180
+ "default": "gen_random_uuid()"
181
+ },
182
+ "tenant_id": {
183
+ "name": "tenant_id",
184
+ "type": "uuid",
185
+ "primaryKey": false,
186
+ "notNull": true
187
+ },
188
+ "task_id": {
189
+ "name": "task_id",
190
+ "type": "uuid",
191
+ "primaryKey": false,
192
+ "notNull": true
193
+ },
194
+ "collection_id": {
195
+ "name": "collection_id",
196
+ "type": "uuid",
197
+ "primaryKey": false,
198
+ "notNull": true
199
+ },
200
+ "revision": {
201
+ "name": "revision",
202
+ "type": "integer",
203
+ "primaryKey": false,
204
+ "notNull": true
205
+ },
206
+ "revision_timestamp": {
207
+ "name": "revision_timestamp",
208
+ "type": "timestamp with time zone",
209
+ "primaryKey": false,
210
+ "notNull": true
211
+ },
212
+ "create_timestamp": {
213
+ "name": "create_timestamp",
214
+ "type": "timestamp with time zone",
215
+ "primaryKey": false,
216
+ "notNull": true
217
+ },
218
+ "delete_timestamp": {
219
+ "name": "delete_timestamp",
220
+ "type": "timestamp with time zone",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "attributes": {
225
+ "name": "attributes",
226
+ "type": "jsonb",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "'{}'::jsonb"
230
+ }
231
+ },
232
+ "indexes": {},
233
+ "foreignKeys": {
234
+ "assignment_scope_id_fkey": {
235
+ "name": "assignment_scope_id_fkey",
236
+ "tableFrom": "assignment_scope",
237
+ "tableTo": "collection",
238
+ "schemaTo": "document_management",
239
+ "columnsFrom": [
240
+ "tenant_id",
241
+ "collection_id"
242
+ ],
243
+ "columnsTo": [
244
+ "tenant_id",
245
+ "id"
246
+ ],
247
+ "onDelete": "no action",
248
+ "onUpdate": "no action"
249
+ },
250
+ "assignment_scope_tenantId_collectionId_fkey": {
251
+ "name": "assignment_scope_tenantId_collectionId_fkey",
252
+ "tableFrom": "assignment_scope",
253
+ "tableTo": "collection",
254
+ "schemaTo": "document_management",
255
+ "columnsFrom": [
256
+ "tenant_id",
257
+ "collection_id"
258
+ ],
259
+ "columnsTo": [
260
+ "tenant_id",
261
+ "id"
262
+ ],
263
+ "onDelete": "no action",
264
+ "onUpdate": "no action"
265
+ },
266
+ "assignment_scope_tenantId_taskId_fkey": {
267
+ "name": "assignment_scope_tenantId_taskId_fkey",
268
+ "tableFrom": "assignment_scope",
269
+ "tableTo": "assignment_task",
270
+ "schemaTo": "document_management",
271
+ "columnsFrom": [
272
+ "tenant_id",
273
+ "task_id"
274
+ ],
275
+ "columnsTo": [
276
+ "tenant_id",
277
+ "id"
278
+ ],
279
+ "onDelete": "no action",
280
+ "onUpdate": "no action"
281
+ }
282
+ },
283
+ "compositePrimaryKeys": {
284
+ "assignment_scope_tenant_id_id_pk": {
285
+ "name": "assignment_scope_tenant_id_id_pk",
286
+ "columns": [
287
+ "tenant_id",
288
+ "id"
289
+ ]
290
+ }
291
+ },
292
+ "uniqueConstraints": {
293
+ "assignment_scope_task_id_collection_id_unique": {
294
+ "name": "assignment_scope_task_id_collection_id_unique",
295
+ "nullsNotDistinct": false,
296
+ "columns": [
297
+ "task_id",
298
+ "collection_id"
299
+ ]
300
+ }
301
+ },
302
+ "policies": {},
303
+ "checkConstraints": {},
304
+ "isRLSEnabled": false
305
+ },
306
+ "document_management.assignment_task": {
307
+ "name": "assignment_task",
308
+ "schema": "document_management",
309
+ "columns": {
310
+ "id": {
311
+ "name": "id",
312
+ "type": "uuid",
313
+ "primaryKey": false,
314
+ "notNull": true,
315
+ "default": "gen_random_uuid()"
316
+ },
317
+ "tenant_id": {
318
+ "name": "tenant_id",
319
+ "type": "uuid",
320
+ "primaryKey": false,
321
+ "notNull": true
322
+ },
323
+ "document_id": {
324
+ "name": "document_id",
325
+ "type": "uuid",
326
+ "primaryKey": false,
327
+ "notNull": true
328
+ },
329
+ "target": {
330
+ "name": "target",
331
+ "type": "assignment_target",
332
+ "typeSchema": "document_management",
333
+ "primaryKey": false,
334
+ "notNull": true
335
+ },
336
+ "revision": {
337
+ "name": "revision",
338
+ "type": "integer",
339
+ "primaryKey": false,
340
+ "notNull": true
341
+ },
342
+ "revision_timestamp": {
343
+ "name": "revision_timestamp",
344
+ "type": "timestamp with time zone",
345
+ "primaryKey": false,
346
+ "notNull": true
347
+ },
348
+ "create_timestamp": {
349
+ "name": "create_timestamp",
350
+ "type": "timestamp with time zone",
351
+ "primaryKey": false,
352
+ "notNull": true
353
+ },
354
+ "delete_timestamp": {
355
+ "name": "delete_timestamp",
356
+ "type": "timestamp with time zone",
357
+ "primaryKey": false,
358
+ "notNull": false
359
+ },
360
+ "attributes": {
361
+ "name": "attributes",
362
+ "type": "jsonb",
363
+ "primaryKey": false,
364
+ "notNull": true,
365
+ "default": "'{}'::jsonb"
366
+ }
367
+ },
368
+ "indexes": {},
369
+ "foreignKeys": {
370
+ "assignment_task_id_fkey": {
371
+ "name": "assignment_task_id_fkey",
372
+ "tableFrom": "assignment_task",
373
+ "tableTo": "document",
374
+ "schemaTo": "document_management",
375
+ "columnsFrom": [
376
+ "tenant_id",
377
+ "document_id"
378
+ ],
379
+ "columnsTo": [
380
+ "tenant_id",
381
+ "id"
382
+ ],
383
+ "onDelete": "no action",
384
+ "onUpdate": "no action"
385
+ },
386
+ "assignment_task_tenantId_documentId_fkey": {
387
+ "name": "assignment_task_tenantId_documentId_fkey",
388
+ "tableFrom": "assignment_task",
389
+ "tableTo": "document",
390
+ "schemaTo": "document_management",
391
+ "columnsFrom": [
392
+ "tenant_id",
393
+ "document_id"
394
+ ],
395
+ "columnsTo": [
396
+ "tenant_id",
397
+ "id"
398
+ ],
399
+ "onDelete": "no action",
400
+ "onUpdate": "no action"
401
+ }
402
+ },
403
+ "compositePrimaryKeys": {
404
+ "assignment_task_tenant_id_id_pk": {
405
+ "name": "assignment_task_tenant_id_id_pk",
406
+ "columns": [
407
+ "tenant_id",
408
+ "id"
409
+ ]
410
+ }
411
+ },
412
+ "uniqueConstraints": {
413
+ "assignment_task_document_id_unique": {
414
+ "name": "assignment_task_document_id_unique",
415
+ "nullsNotDistinct": false,
416
+ "columns": [
417
+ "document_id"
418
+ ]
419
+ },
420
+ "assignment_task_tenant_id_id_unique": {
421
+ "name": "assignment_task_tenant_id_id_unique",
422
+ "nullsNotDistinct": false,
423
+ "columns": [
424
+ "tenant_id",
425
+ "id"
426
+ ]
427
+ }
428
+ },
429
+ "policies": {},
430
+ "checkConstraints": {},
431
+ "isRLSEnabled": false
432
+ },
433
+ "document_management.category": {
434
+ "name": "category",
435
+ "schema": "document_management",
436
+ "columns": {
437
+ "id": {
438
+ "name": "id",
439
+ "type": "uuid",
440
+ "primaryKey": false,
441
+ "notNull": true,
442
+ "default": "gen_random_uuid()"
443
+ },
444
+ "tenant_id": {
445
+ "name": "tenant_id",
446
+ "type": "uuid",
447
+ "primaryKey": false,
448
+ "notNull": true
449
+ },
450
+ "parent_id": {
451
+ "name": "parent_id",
452
+ "type": "uuid",
453
+ "primaryKey": false,
454
+ "notNull": false
455
+ },
456
+ "label": {
457
+ "name": "label",
458
+ "type": "text",
459
+ "primaryKey": false,
460
+ "notNull": true
461
+ },
462
+ "revision": {
463
+ "name": "revision",
464
+ "type": "integer",
465
+ "primaryKey": false,
466
+ "notNull": true
467
+ },
468
+ "revision_timestamp": {
469
+ "name": "revision_timestamp",
470
+ "type": "timestamp with time zone",
471
+ "primaryKey": false,
472
+ "notNull": true
473
+ },
474
+ "create_timestamp": {
475
+ "name": "create_timestamp",
476
+ "type": "timestamp with time zone",
477
+ "primaryKey": false,
478
+ "notNull": true
479
+ },
480
+ "delete_timestamp": {
481
+ "name": "delete_timestamp",
482
+ "type": "timestamp with time zone",
483
+ "primaryKey": false,
484
+ "notNull": false
485
+ },
486
+ "attributes": {
487
+ "name": "attributes",
488
+ "type": "jsonb",
489
+ "primaryKey": false,
490
+ "notNull": true,
491
+ "default": "'{}'::jsonb"
492
+ }
493
+ },
494
+ "indexes": {},
495
+ "foreignKeys": {
496
+ "category_id_fkey": {
497
+ "name": "category_id_fkey",
498
+ "tableFrom": "category",
499
+ "tableTo": "category",
500
+ "schemaTo": "document_management",
501
+ "columnsFrom": [
502
+ "tenant_id",
503
+ "parent_id"
504
+ ],
505
+ "columnsTo": [
506
+ "tenant_id",
507
+ "id"
508
+ ],
509
+ "onDelete": "no action",
510
+ "onUpdate": "no action"
511
+ }
512
+ },
513
+ "compositePrimaryKeys": {
514
+ "category_tenant_id_id_pk": {
515
+ "name": "category_tenant_id_id_pk",
516
+ "columns": [
517
+ "tenant_id",
518
+ "id"
519
+ ]
520
+ }
521
+ },
522
+ "uniqueConstraints": {
523
+ "category_label_unique": {
524
+ "name": "category_label_unique",
525
+ "nullsNotDistinct": false,
526
+ "columns": [
527
+ "label"
528
+ ]
529
+ },
530
+ "category_tenant_id_parent_id_label_unique": {
531
+ "name": "category_tenant_id_parent_id_label_unique",
532
+ "nullsNotDistinct": false,
533
+ "columns": [
534
+ "tenant_id",
535
+ "parent_id",
536
+ "label"
537
+ ]
538
+ }
539
+ },
540
+ "policies": {},
541
+ "checkConstraints": {},
542
+ "isRLSEnabled": false
543
+ },
544
+ "document_management.collection": {
545
+ "name": "collection",
546
+ "schema": "document_management",
547
+ "columns": {
548
+ "id": {
549
+ "name": "id",
550
+ "type": "uuid",
551
+ "primaryKey": false,
552
+ "notNull": true,
553
+ "default": "gen_random_uuid()"
554
+ },
555
+ "tenant_id": {
556
+ "name": "tenant_id",
557
+ "type": "uuid",
558
+ "primaryKey": false,
559
+ "notNull": true
560
+ },
561
+ "parent_id": {
562
+ "name": "parent_id",
563
+ "type": "uuid",
564
+ "primaryKey": false,
565
+ "notNull": false
566
+ },
567
+ "revision": {
568
+ "name": "revision",
569
+ "type": "integer",
570
+ "primaryKey": false,
571
+ "notNull": true
572
+ },
573
+ "revision_timestamp": {
574
+ "name": "revision_timestamp",
575
+ "type": "timestamp with time zone",
576
+ "primaryKey": false,
577
+ "notNull": true
578
+ },
579
+ "create_timestamp": {
580
+ "name": "create_timestamp",
581
+ "type": "timestamp with time zone",
582
+ "primaryKey": false,
583
+ "notNull": true
584
+ },
585
+ "delete_timestamp": {
586
+ "name": "delete_timestamp",
587
+ "type": "timestamp with time zone",
588
+ "primaryKey": false,
589
+ "notNull": false
590
+ },
591
+ "attributes": {
592
+ "name": "attributes",
593
+ "type": "jsonb",
594
+ "primaryKey": false,
595
+ "notNull": true,
596
+ "default": "'{}'::jsonb"
597
+ }
598
+ },
599
+ "indexes": {},
600
+ "foreignKeys": {
601
+ "collection_id_fkey": {
602
+ "name": "collection_id_fkey",
603
+ "tableFrom": "collection",
604
+ "tableTo": "collection",
605
+ "schemaTo": "document_management",
606
+ "columnsFrom": [
607
+ "tenant_id",
608
+ "parent_id"
609
+ ],
610
+ "columnsTo": [
611
+ "tenant_id",
612
+ "id"
613
+ ],
614
+ "onDelete": "no action",
615
+ "onUpdate": "no action"
616
+ }
617
+ },
618
+ "compositePrimaryKeys": {
619
+ "collection_tenant_id_id_pk": {
620
+ "name": "collection_tenant_id_id_pk",
621
+ "columns": [
622
+ "tenant_id",
623
+ "id"
624
+ ]
625
+ }
626
+ },
627
+ "uniqueConstraints": {
628
+ "collection_tenant_id_id_unique": {
629
+ "name": "collection_tenant_id_id_unique",
630
+ "nullsNotDistinct": false,
631
+ "columns": [
632
+ "tenant_id",
633
+ "id"
634
+ ]
635
+ }
636
+ },
637
+ "policies": {},
638
+ "checkConstraints": {},
639
+ "isRLSEnabled": false
640
+ },
641
+ "document_management.collection_assignment": {
642
+ "name": "collection_assignment",
643
+ "schema": "document_management",
644
+ "columns": {
645
+ "id": {
646
+ "name": "id",
647
+ "type": "uuid",
648
+ "primaryKey": false,
649
+ "notNull": true,
650
+ "default": "gen_random_uuid()"
651
+ },
652
+ "tenant_id": {
653
+ "name": "tenant_id",
654
+ "type": "uuid",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "collection_id": {
659
+ "name": "collection_id",
660
+ "type": "uuid",
661
+ "primaryKey": false,
662
+ "notNull": true
663
+ },
664
+ "document_id": {
665
+ "name": "document_id",
666
+ "type": "uuid",
667
+ "primaryKey": false,
668
+ "notNull": true
669
+ },
670
+ "archive_timestamp": {
671
+ "name": "archive_timestamp",
672
+ "type": "timestamp with time zone",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "revision": {
677
+ "name": "revision",
678
+ "type": "integer",
679
+ "primaryKey": false,
680
+ "notNull": true
681
+ },
682
+ "revision_timestamp": {
683
+ "name": "revision_timestamp",
684
+ "type": "timestamp with time zone",
685
+ "primaryKey": false,
686
+ "notNull": true
687
+ },
688
+ "create_timestamp": {
689
+ "name": "create_timestamp",
690
+ "type": "timestamp with time zone",
691
+ "primaryKey": false,
692
+ "notNull": true
693
+ },
694
+ "delete_timestamp": {
695
+ "name": "delete_timestamp",
696
+ "type": "timestamp with time zone",
697
+ "primaryKey": false,
698
+ "notNull": false
699
+ },
700
+ "attributes": {
701
+ "name": "attributes",
702
+ "type": "jsonb",
703
+ "primaryKey": false,
704
+ "notNull": true,
705
+ "default": "'{}'::jsonb"
706
+ }
707
+ },
708
+ "indexes": {
709
+ "collection_assignment_collection_id_idx": {
710
+ "name": "collection_assignment_collection_id_idx",
711
+ "columns": [
712
+ {
713
+ "expression": "collection_id",
714
+ "isExpression": false,
715
+ "asc": true,
716
+ "nulls": "last"
717
+ }
718
+ ],
719
+ "isUnique": false,
720
+ "concurrently": false,
721
+ "method": "btree",
722
+ "with": {}
723
+ }
724
+ },
725
+ "foreignKeys": {
726
+ "collection_assignment_id_fkey": {
727
+ "name": "collection_assignment_id_fkey",
728
+ "tableFrom": "collection_assignment",
729
+ "tableTo": "document",
730
+ "schemaTo": "document_management",
731
+ "columnsFrom": [
732
+ "tenant_id",
733
+ "document_id"
734
+ ],
735
+ "columnsTo": [
736
+ "tenant_id",
737
+ "id"
738
+ ],
739
+ "onDelete": "no action",
740
+ "onUpdate": "no action"
741
+ },
742
+ "collection_assignment_tenantId_documentId_fkey": {
743
+ "name": "collection_assignment_tenantId_documentId_fkey",
744
+ "tableFrom": "collection_assignment",
745
+ "tableTo": "document",
746
+ "schemaTo": "document_management",
747
+ "columnsFrom": [
748
+ "tenant_id",
749
+ "document_id"
750
+ ],
751
+ "columnsTo": [
752
+ "tenant_id",
753
+ "id"
754
+ ],
755
+ "onDelete": "no action",
756
+ "onUpdate": "no action"
757
+ },
758
+ "collection_assignment_tenantId_collectionId_fkey": {
759
+ "name": "collection_assignment_tenantId_collectionId_fkey",
760
+ "tableFrom": "collection_assignment",
761
+ "tableTo": "collection",
762
+ "schemaTo": "document_management",
763
+ "columnsFrom": [
764
+ "tenant_id",
765
+ "collection_id"
766
+ ],
767
+ "columnsTo": [
768
+ "tenant_id",
769
+ "id"
770
+ ],
771
+ "onDelete": "no action",
772
+ "onUpdate": "no action"
773
+ }
774
+ },
775
+ "compositePrimaryKeys": {
776
+ "collection_assignment_tenant_id_id_pk": {
777
+ "name": "collection_assignment_tenant_id_id_pk",
778
+ "columns": [
779
+ "tenant_id",
780
+ "id"
781
+ ]
782
+ }
783
+ },
784
+ "uniqueConstraints": {
785
+ "ca_tenant_id_collection_id_document_id_unique": {
786
+ "name": "ca_tenant_id_collection_id_document_id_unique",
787
+ "nullsNotDistinct": false,
788
+ "columns": [
789
+ "tenant_id",
790
+ "collection_id",
791
+ "document_id"
792
+ ]
793
+ }
794
+ },
795
+ "policies": {},
796
+ "checkConstraints": {},
797
+ "isRLSEnabled": false
798
+ },
799
+ "document_management.property": {
800
+ "name": "property",
801
+ "schema": "document_management",
802
+ "columns": {
803
+ "id": {
804
+ "name": "id",
805
+ "type": "uuid",
806
+ "primaryKey": false,
807
+ "notNull": true,
808
+ "default": "gen_random_uuid()"
809
+ },
810
+ "tenant_id": {
811
+ "name": "tenant_id",
812
+ "type": "uuid",
813
+ "primaryKey": false,
814
+ "notNull": true
815
+ },
816
+ "label": {
817
+ "name": "label",
818
+ "type": "text",
819
+ "primaryKey": false,
820
+ "notNull": true
821
+ },
822
+ "data_type": {
823
+ "name": "data_type",
824
+ "type": "property_data_type",
825
+ "typeSchema": "document_management",
826
+ "primaryKey": false,
827
+ "notNull": true
828
+ },
829
+ "revision": {
830
+ "name": "revision",
831
+ "type": "integer",
832
+ "primaryKey": false,
833
+ "notNull": true
834
+ },
835
+ "revision_timestamp": {
836
+ "name": "revision_timestamp",
837
+ "type": "timestamp with time zone",
838
+ "primaryKey": false,
839
+ "notNull": true
840
+ },
841
+ "create_timestamp": {
842
+ "name": "create_timestamp",
843
+ "type": "timestamp with time zone",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "delete_timestamp": {
848
+ "name": "delete_timestamp",
849
+ "type": "timestamp with time zone",
850
+ "primaryKey": false,
851
+ "notNull": false
852
+ },
853
+ "attributes": {
854
+ "name": "attributes",
855
+ "type": "jsonb",
856
+ "primaryKey": false,
857
+ "notNull": true,
858
+ "default": "'{}'::jsonb"
859
+ }
860
+ },
861
+ "indexes": {},
862
+ "foreignKeys": {},
863
+ "compositePrimaryKeys": {
864
+ "property_tenant_id_id_pk": {
865
+ "name": "property_tenant_id_id_pk",
866
+ "columns": [
867
+ "tenant_id",
868
+ "id"
869
+ ]
870
+ }
871
+ },
872
+ "uniqueConstraints": {
873
+ "property_label_unique": {
874
+ "name": "property_label_unique",
875
+ "nullsNotDistinct": false,
876
+ "columns": [
877
+ "label"
878
+ ]
879
+ },
880
+ "property_tenant_id_label_unique": {
881
+ "name": "property_tenant_id_label_unique",
882
+ "nullsNotDistinct": false,
883
+ "columns": [
884
+ "tenant_id",
885
+ "label"
886
+ ]
887
+ }
888
+ },
889
+ "policies": {},
890
+ "checkConstraints": {},
891
+ "isRLSEnabled": false
892
+ },
893
+ "document_management.property_value": {
894
+ "name": "property_value",
895
+ "schema": "document_management",
896
+ "columns": {
897
+ "id": {
898
+ "name": "id",
899
+ "type": "uuid",
900
+ "primaryKey": false,
901
+ "notNull": true,
902
+ "default": "gen_random_uuid()"
903
+ },
904
+ "tenant_id": {
905
+ "name": "tenant_id",
906
+ "type": "uuid",
907
+ "primaryKey": false,
908
+ "notNull": true
909
+ },
910
+ "document_id": {
911
+ "name": "document_id",
912
+ "type": "uuid",
913
+ "primaryKey": false,
914
+ "notNull": true
915
+ },
916
+ "property_id": {
917
+ "name": "property_id",
918
+ "type": "uuid",
919
+ "primaryKey": false,
920
+ "notNull": true
921
+ },
922
+ "text": {
923
+ "name": "text",
924
+ "type": "text",
925
+ "primaryKey": false,
926
+ "notNull": false
927
+ },
928
+ "integer": {
929
+ "name": "integer",
930
+ "type": "integer",
931
+ "primaryKey": false,
932
+ "notNull": false
933
+ },
934
+ "decimal": {
935
+ "name": "decimal",
936
+ "type": "double precision",
937
+ "primaryKey": false,
938
+ "notNull": false
939
+ },
940
+ "boolean": {
941
+ "name": "boolean",
942
+ "type": "boolean",
943
+ "primaryKey": false,
944
+ "notNull": false
945
+ },
946
+ "date": {
947
+ "name": "date",
948
+ "type": "date",
949
+ "primaryKey": false,
950
+ "notNull": false
951
+ },
952
+ "revision": {
953
+ "name": "revision",
954
+ "type": "integer",
955
+ "primaryKey": false,
956
+ "notNull": true
957
+ },
958
+ "revision_timestamp": {
959
+ "name": "revision_timestamp",
960
+ "type": "timestamp with time zone",
961
+ "primaryKey": false,
962
+ "notNull": true
963
+ },
964
+ "create_timestamp": {
965
+ "name": "create_timestamp",
966
+ "type": "timestamp with time zone",
967
+ "primaryKey": false,
968
+ "notNull": true
969
+ },
970
+ "delete_timestamp": {
971
+ "name": "delete_timestamp",
972
+ "type": "timestamp with time zone",
973
+ "primaryKey": false,
974
+ "notNull": false
975
+ },
976
+ "attributes": {
977
+ "name": "attributes",
978
+ "type": "jsonb",
979
+ "primaryKey": false,
980
+ "notNull": true,
981
+ "default": "'{}'::jsonb"
982
+ }
983
+ },
984
+ "indexes": {},
985
+ "foreignKeys": {
986
+ "property_value_id_fkey": {
987
+ "name": "property_value_id_fkey",
988
+ "tableFrom": "property_value",
989
+ "tableTo": "property",
990
+ "schemaTo": "document_management",
991
+ "columnsFrom": [
992
+ "tenant_id",
993
+ "property_id"
994
+ ],
995
+ "columnsTo": [
996
+ "tenant_id",
997
+ "id"
998
+ ],
999
+ "onDelete": "no action",
1000
+ "onUpdate": "no action"
1001
+ },
1002
+ "property_value_tenantId_documentId_fkey": {
1003
+ "name": "property_value_tenantId_documentId_fkey",
1004
+ "tableFrom": "property_value",
1005
+ "tableTo": "document",
1006
+ "schemaTo": "document_management",
1007
+ "columnsFrom": [
1008
+ "tenant_id",
1009
+ "document_id"
1010
+ ],
1011
+ "columnsTo": [
1012
+ "tenant_id",
1013
+ "id"
1014
+ ],
1015
+ "onDelete": "no action",
1016
+ "onUpdate": "no action"
1017
+ }
1018
+ },
1019
+ "compositePrimaryKeys": {
1020
+ "property_value_tenant_id_id_pk": {
1021
+ "name": "property_value_tenant_id_id_pk",
1022
+ "columns": [
1023
+ "tenant_id",
1024
+ "id"
1025
+ ]
1026
+ }
1027
+ },
1028
+ "uniqueConstraints": {
1029
+ "property_value_tenant_id_document_id_property_id_unique": {
1030
+ "name": "property_value_tenant_id_document_id_property_id_unique",
1031
+ "nullsNotDistinct": false,
1032
+ "columns": [
1033
+ "tenant_id",
1034
+ "document_id",
1035
+ "property_id"
1036
+ ]
1037
+ }
1038
+ },
1039
+ "policies": {},
1040
+ "checkConstraints": {
1041
+ "only_one_value": {
1042
+ "name": "only_one_value",
1043
+ "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"
1044
+ }
1045
+ },
1046
+ "isRLSEnabled": false
1047
+ },
1048
+ "document_management.request": {
1049
+ "name": "request",
1050
+ "schema": "document_management",
1051
+ "columns": {
1052
+ "id": {
1053
+ "name": "id",
1054
+ "type": "uuid",
1055
+ "primaryKey": false,
1056
+ "notNull": true,
1057
+ "default": "gen_random_uuid()"
1058
+ },
1059
+ "tenant_id": {
1060
+ "name": "tenant_id",
1061
+ "type": "uuid",
1062
+ "primaryKey": false,
1063
+ "notNull": true
1064
+ },
1065
+ "type_id": {
1066
+ "name": "type_id",
1067
+ "type": "uuid",
1068
+ "primaryKey": false,
1069
+ "notNull": false
1070
+ },
1071
+ "document_id": {
1072
+ "name": "document_id",
1073
+ "type": "uuid",
1074
+ "primaryKey": false,
1075
+ "notNull": false
1076
+ },
1077
+ "comment": {
1078
+ "name": "comment",
1079
+ "type": "text",
1080
+ "primaryKey": false,
1081
+ "notNull": false
1082
+ },
1083
+ "state": {
1084
+ "name": "state",
1085
+ "type": "request_state",
1086
+ "typeSchema": "document_management",
1087
+ "primaryKey": false,
1088
+ "notNull": true
1089
+ },
1090
+ "revision": {
1091
+ "name": "revision",
1092
+ "type": "integer",
1093
+ "primaryKey": false,
1094
+ "notNull": true
1095
+ },
1096
+ "revision_timestamp": {
1097
+ "name": "revision_timestamp",
1098
+ "type": "timestamp with time zone",
1099
+ "primaryKey": false,
1100
+ "notNull": true
1101
+ },
1102
+ "create_timestamp": {
1103
+ "name": "create_timestamp",
1104
+ "type": "timestamp with time zone",
1105
+ "primaryKey": false,
1106
+ "notNull": true
1107
+ },
1108
+ "delete_timestamp": {
1109
+ "name": "delete_timestamp",
1110
+ "type": "timestamp with time zone",
1111
+ "primaryKey": false,
1112
+ "notNull": false
1113
+ },
1114
+ "attributes": {
1115
+ "name": "attributes",
1116
+ "type": "jsonb",
1117
+ "primaryKey": false,
1118
+ "notNull": true,
1119
+ "default": "'{}'::jsonb"
1120
+ }
1121
+ },
1122
+ "indexes": {
1123
+ "request_type_id_idx": {
1124
+ "name": "request_type_id_idx",
1125
+ "columns": [
1126
+ {
1127
+ "expression": "type_id",
1128
+ "isExpression": false,
1129
+ "asc": true,
1130
+ "nulls": "last"
1131
+ }
1132
+ ],
1133
+ "isUnique": false,
1134
+ "concurrently": false,
1135
+ "method": "btree",
1136
+ "with": {}
1137
+ },
1138
+ "request_state_idx": {
1139
+ "name": "request_state_idx",
1140
+ "columns": [
1141
+ {
1142
+ "expression": "state",
1143
+ "isExpression": false,
1144
+ "asc": true,
1145
+ "nulls": "last"
1146
+ }
1147
+ ],
1148
+ "isUnique": false,
1149
+ "concurrently": false,
1150
+ "method": "btree",
1151
+ "with": {}
1152
+ }
1153
+ },
1154
+ "foreignKeys": {
1155
+ "request_id_fkey": {
1156
+ "name": "request_id_fkey",
1157
+ "tableFrom": "request",
1158
+ "tableTo": "document",
1159
+ "schemaTo": "document_management",
1160
+ "columnsFrom": [
1161
+ "tenant_id",
1162
+ "document_id"
1163
+ ],
1164
+ "columnsTo": [
1165
+ "tenant_id",
1166
+ "id"
1167
+ ],
1168
+ "onDelete": "no action",
1169
+ "onUpdate": "no action"
1170
+ },
1171
+ "request_tenantId_documentId_fkey": {
1172
+ "name": "request_tenantId_documentId_fkey",
1173
+ "tableFrom": "request",
1174
+ "tableTo": "document",
1175
+ "schemaTo": "document_management",
1176
+ "columnsFrom": [
1177
+ "tenant_id",
1178
+ "document_id"
1179
+ ],
1180
+ "columnsTo": [
1181
+ "tenant_id",
1182
+ "id"
1183
+ ],
1184
+ "onDelete": "no action",
1185
+ "onUpdate": "no action"
1186
+ }
1187
+ },
1188
+ "compositePrimaryKeys": {
1189
+ "request_tenant_id_id_pk": {
1190
+ "name": "request_tenant_id_id_pk",
1191
+ "columns": [
1192
+ "tenant_id",
1193
+ "id"
1194
+ ]
1195
+ }
1196
+ },
1197
+ "uniqueConstraints": {
1198
+ "request_document_id_unique": {
1199
+ "name": "request_document_id_unique",
1200
+ "nullsNotDistinct": false,
1201
+ "columns": [
1202
+ "document_id"
1203
+ ]
1204
+ },
1205
+ "request_tenant_id_id_unique": {
1206
+ "name": "request_tenant_id_id_unique",
1207
+ "nullsNotDistinct": false,
1208
+ "columns": [
1209
+ "tenant_id",
1210
+ "id"
1211
+ ]
1212
+ }
1213
+ },
1214
+ "policies": {},
1215
+ "checkConstraints": {},
1216
+ "isRLSEnabled": false
1217
+ },
1218
+ "document_management.request_collection_assignment": {
1219
+ "name": "request_collection_assignment",
1220
+ "schema": "document_management",
1221
+ "columns": {
1222
+ "id": {
1223
+ "name": "id",
1224
+ "type": "uuid",
1225
+ "primaryKey": false,
1226
+ "notNull": true,
1227
+ "default": "gen_random_uuid()"
1228
+ },
1229
+ "tenant_id": {
1230
+ "name": "tenant_id",
1231
+ "type": "uuid",
1232
+ "primaryKey": false,
1233
+ "notNull": true
1234
+ },
1235
+ "request_id": {
1236
+ "name": "request_id",
1237
+ "type": "uuid",
1238
+ "primaryKey": false,
1239
+ "notNull": true
1240
+ },
1241
+ "collection_id": {
1242
+ "name": "collection_id",
1243
+ "type": "uuid",
1244
+ "primaryKey": false,
1245
+ "notNull": true
1246
+ },
1247
+ "revision": {
1248
+ "name": "revision",
1249
+ "type": "integer",
1250
+ "primaryKey": false,
1251
+ "notNull": true
1252
+ },
1253
+ "revision_timestamp": {
1254
+ "name": "revision_timestamp",
1255
+ "type": "timestamp with time zone",
1256
+ "primaryKey": false,
1257
+ "notNull": true
1258
+ },
1259
+ "create_timestamp": {
1260
+ "name": "create_timestamp",
1261
+ "type": "timestamp with time zone",
1262
+ "primaryKey": false,
1263
+ "notNull": true
1264
+ },
1265
+ "delete_timestamp": {
1266
+ "name": "delete_timestamp",
1267
+ "type": "timestamp with time zone",
1268
+ "primaryKey": false,
1269
+ "notNull": false
1270
+ },
1271
+ "attributes": {
1272
+ "name": "attributes",
1273
+ "type": "jsonb",
1274
+ "primaryKey": false,
1275
+ "notNull": true,
1276
+ "default": "'{}'::jsonb"
1277
+ }
1278
+ },
1279
+ "indexes": {
1280
+ "request_collection_assignment_collection_id_idx": {
1281
+ "name": "request_collection_assignment_collection_id_idx",
1282
+ "columns": [
1283
+ {
1284
+ "expression": "collection_id",
1285
+ "isExpression": false,
1286
+ "asc": true,
1287
+ "nulls": "last"
1288
+ }
1289
+ ],
1290
+ "isUnique": false,
1291
+ "concurrently": false,
1292
+ "method": "btree",
1293
+ "with": {}
1294
+ }
1295
+ },
1296
+ "foreignKeys": {
1297
+ "request_collection_assignment_id_fkey": {
1298
+ "name": "request_collection_assignment_id_fkey",
1299
+ "tableFrom": "request_collection_assignment",
1300
+ "tableTo": "collection",
1301
+ "schemaTo": "document_management",
1302
+ "columnsFrom": [
1303
+ "tenant_id",
1304
+ "collection_id"
1305
+ ],
1306
+ "columnsTo": [
1307
+ "tenant_id",
1308
+ "id"
1309
+ ],
1310
+ "onDelete": "no action",
1311
+ "onUpdate": "no action"
1312
+ },
1313
+ "request_collection_assignment_tenantId_collectionId_fkey": {
1314
+ "name": "request_collection_assignment_tenantId_collectionId_fkey",
1315
+ "tableFrom": "request_collection_assignment",
1316
+ "tableTo": "collection",
1317
+ "schemaTo": "document_management",
1318
+ "columnsFrom": [
1319
+ "tenant_id",
1320
+ "collection_id"
1321
+ ],
1322
+ "columnsTo": [
1323
+ "tenant_id",
1324
+ "id"
1325
+ ],
1326
+ "onDelete": "no action",
1327
+ "onUpdate": "no action"
1328
+ },
1329
+ "request_collection_assignment_tenantId_requestId_fkey": {
1330
+ "name": "request_collection_assignment_tenantId_requestId_fkey",
1331
+ "tableFrom": "request_collection_assignment",
1332
+ "tableTo": "request",
1333
+ "schemaTo": "document_management",
1334
+ "columnsFrom": [
1335
+ "tenant_id",
1336
+ "request_id"
1337
+ ],
1338
+ "columnsTo": [
1339
+ "tenant_id",
1340
+ "id"
1341
+ ],
1342
+ "onDelete": "no action",
1343
+ "onUpdate": "no action"
1344
+ }
1345
+ },
1346
+ "compositePrimaryKeys": {
1347
+ "request_collection_assignment_tenant_id_id_pk": {
1348
+ "name": "request_collection_assignment_tenant_id_id_pk",
1349
+ "columns": [
1350
+ "tenant_id",
1351
+ "id"
1352
+ ]
1353
+ }
1354
+ },
1355
+ "uniqueConstraints": {
1356
+ "rca_tenant_id_request_id_collection_id_unique": {
1357
+ "name": "rca_tenant_id_request_id_collection_id_unique",
1358
+ "nullsNotDistinct": false,
1359
+ "columns": [
1360
+ "tenant_id",
1361
+ "request_id",
1362
+ "collection_id"
1363
+ ]
1364
+ }
1365
+ },
1366
+ "policies": {},
1367
+ "checkConstraints": {},
1368
+ "isRLSEnabled": false
1369
+ },
1370
+ "document_management.request_template": {
1371
+ "name": "request_template",
1372
+ "schema": "document_management",
1373
+ "columns": {
1374
+ "id": {
1375
+ "name": "id",
1376
+ "type": "uuid",
1377
+ "primaryKey": false,
1378
+ "notNull": true,
1379
+ "default": "gen_random_uuid()"
1380
+ },
1381
+ "tenant_id": {
1382
+ "name": "tenant_id",
1383
+ "type": "uuid",
1384
+ "primaryKey": false,
1385
+ "notNull": true
1386
+ },
1387
+ "requests_template_id": {
1388
+ "name": "requests_template_id",
1389
+ "type": "uuid",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "type_id": {
1394
+ "name": "type_id",
1395
+ "type": "uuid",
1396
+ "primaryKey": false,
1397
+ "notNull": true
1398
+ },
1399
+ "comment": {
1400
+ "name": "comment",
1401
+ "type": "text",
1402
+ "primaryKey": false,
1403
+ "notNull": false
1404
+ },
1405
+ "revision": {
1406
+ "name": "revision",
1407
+ "type": "integer",
1408
+ "primaryKey": false,
1409
+ "notNull": true
1410
+ },
1411
+ "revision_timestamp": {
1412
+ "name": "revision_timestamp",
1413
+ "type": "timestamp with time zone",
1414
+ "primaryKey": false,
1415
+ "notNull": true
1416
+ },
1417
+ "create_timestamp": {
1418
+ "name": "create_timestamp",
1419
+ "type": "timestamp with time zone",
1420
+ "primaryKey": false,
1421
+ "notNull": true
1422
+ },
1423
+ "delete_timestamp": {
1424
+ "name": "delete_timestamp",
1425
+ "type": "timestamp with time zone",
1426
+ "primaryKey": false,
1427
+ "notNull": false
1428
+ },
1429
+ "attributes": {
1430
+ "name": "attributes",
1431
+ "type": "jsonb",
1432
+ "primaryKey": false,
1433
+ "notNull": true,
1434
+ "default": "'{}'::jsonb"
1435
+ }
1436
+ },
1437
+ "indexes": {},
1438
+ "foreignKeys": {
1439
+ "request_template_id_fkey": {
1440
+ "name": "request_template_id_fkey",
1441
+ "tableFrom": "request_template",
1442
+ "tableTo": "type",
1443
+ "schemaTo": "document_management",
1444
+ "columnsFrom": [
1445
+ "tenant_id",
1446
+ "type_id"
1447
+ ],
1448
+ "columnsTo": [
1449
+ "tenant_id",
1450
+ "id"
1451
+ ],
1452
+ "onDelete": "no action",
1453
+ "onUpdate": "no action"
1454
+ }
1455
+ },
1456
+ "compositePrimaryKeys": {
1457
+ "request_template_tenant_id_id_pk": {
1458
+ "name": "request_template_tenant_id_id_pk",
1459
+ "columns": [
1460
+ "tenant_id",
1461
+ "id"
1462
+ ]
1463
+ }
1464
+ },
1465
+ "uniqueConstraints": {},
1466
+ "policies": {},
1467
+ "checkConstraints": {},
1468
+ "isRLSEnabled": false
1469
+ },
1470
+ "document_management.requests_template": {
1471
+ "name": "requests_template",
1472
+ "schema": "document_management",
1473
+ "columns": {
1474
+ "id": {
1475
+ "name": "id",
1476
+ "type": "uuid",
1477
+ "primaryKey": false,
1478
+ "notNull": true,
1479
+ "default": "gen_random_uuid()"
1480
+ },
1481
+ "tenant_id": {
1482
+ "name": "tenant_id",
1483
+ "type": "uuid",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "label": {
1488
+ "name": "label",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": true
1492
+ },
1493
+ "description": {
1494
+ "name": "description",
1495
+ "type": "text",
1496
+ "primaryKey": false,
1497
+ "notNull": false
1498
+ },
1499
+ "revision": {
1500
+ "name": "revision",
1501
+ "type": "integer",
1502
+ "primaryKey": false,
1503
+ "notNull": true
1504
+ },
1505
+ "revision_timestamp": {
1506
+ "name": "revision_timestamp",
1507
+ "type": "timestamp with time zone",
1508
+ "primaryKey": false,
1509
+ "notNull": true
1510
+ },
1511
+ "create_timestamp": {
1512
+ "name": "create_timestamp",
1513
+ "type": "timestamp with time zone",
1514
+ "primaryKey": false,
1515
+ "notNull": true
1516
+ },
1517
+ "delete_timestamp": {
1518
+ "name": "delete_timestamp",
1519
+ "type": "timestamp with time zone",
1520
+ "primaryKey": false,
1521
+ "notNull": false
1522
+ },
1523
+ "attributes": {
1524
+ "name": "attributes",
1525
+ "type": "jsonb",
1526
+ "primaryKey": false,
1527
+ "notNull": true,
1528
+ "default": "'{}'::jsonb"
1529
+ }
1530
+ },
1531
+ "indexes": {},
1532
+ "foreignKeys": {},
1533
+ "compositePrimaryKeys": {
1534
+ "requests_template_tenant_id_id_pk": {
1535
+ "name": "requests_template_tenant_id_id_pk",
1536
+ "columns": [
1537
+ "tenant_id",
1538
+ "id"
1539
+ ]
1540
+ }
1541
+ },
1542
+ "uniqueConstraints": {},
1543
+ "policies": {},
1544
+ "checkConstraints": {},
1545
+ "isRLSEnabled": false
1546
+ },
1547
+ "document_management.tag": {
1548
+ "name": "tag",
1549
+ "schema": "document_management",
1550
+ "columns": {
1551
+ "id": {
1552
+ "name": "id",
1553
+ "type": "uuid",
1554
+ "primaryKey": false,
1555
+ "notNull": true,
1556
+ "default": "gen_random_uuid()"
1557
+ },
1558
+ "tenant_id": {
1559
+ "name": "tenant_id",
1560
+ "type": "uuid",
1561
+ "primaryKey": false,
1562
+ "notNull": true
1563
+ },
1564
+ "label": {
1565
+ "name": "label",
1566
+ "type": "text",
1567
+ "primaryKey": false,
1568
+ "notNull": true
1569
+ },
1570
+ "revision": {
1571
+ "name": "revision",
1572
+ "type": "integer",
1573
+ "primaryKey": false,
1574
+ "notNull": true
1575
+ },
1576
+ "revision_timestamp": {
1577
+ "name": "revision_timestamp",
1578
+ "type": "timestamp with time zone",
1579
+ "primaryKey": false,
1580
+ "notNull": true
1581
+ },
1582
+ "create_timestamp": {
1583
+ "name": "create_timestamp",
1584
+ "type": "timestamp with time zone",
1585
+ "primaryKey": false,
1586
+ "notNull": true
1587
+ },
1588
+ "delete_timestamp": {
1589
+ "name": "delete_timestamp",
1590
+ "type": "timestamp with time zone",
1591
+ "primaryKey": false,
1592
+ "notNull": false
1593
+ },
1594
+ "attributes": {
1595
+ "name": "attributes",
1596
+ "type": "jsonb",
1597
+ "primaryKey": false,
1598
+ "notNull": true,
1599
+ "default": "'{}'::jsonb"
1600
+ }
1601
+ },
1602
+ "indexes": {},
1603
+ "foreignKeys": {},
1604
+ "compositePrimaryKeys": {
1605
+ "tag_tenant_id_id_pk": {
1606
+ "name": "tag_tenant_id_id_pk",
1607
+ "columns": [
1608
+ "tenant_id",
1609
+ "id"
1610
+ ]
1611
+ }
1612
+ },
1613
+ "uniqueConstraints": {
1614
+ "tag_tenant_id_label_unique": {
1615
+ "name": "tag_tenant_id_label_unique",
1616
+ "nullsNotDistinct": false,
1617
+ "columns": [
1618
+ "tenant_id",
1619
+ "label"
1620
+ ]
1621
+ }
1622
+ },
1623
+ "policies": {},
1624
+ "checkConstraints": {},
1625
+ "isRLSEnabled": false
1626
+ },
1627
+ "document_management.tag_assignment": {
1628
+ "name": "tag_assignment",
1629
+ "schema": "document_management",
1630
+ "columns": {
1631
+ "id": {
1632
+ "name": "id",
1633
+ "type": "uuid",
1634
+ "primaryKey": false,
1635
+ "notNull": true,
1636
+ "default": "gen_random_uuid()"
1637
+ },
1638
+ "tenant_id": {
1639
+ "name": "tenant_id",
1640
+ "type": "uuid",
1641
+ "primaryKey": false,
1642
+ "notNull": true
1643
+ },
1644
+ "document_id": {
1645
+ "name": "document_id",
1646
+ "type": "uuid",
1647
+ "primaryKey": false,
1648
+ "notNull": true
1649
+ },
1650
+ "tag_id": {
1651
+ "name": "tag_id",
1652
+ "type": "uuid",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "revision": {
1657
+ "name": "revision",
1658
+ "type": "integer",
1659
+ "primaryKey": false,
1660
+ "notNull": true
1661
+ },
1662
+ "revision_timestamp": {
1663
+ "name": "revision_timestamp",
1664
+ "type": "timestamp with time zone",
1665
+ "primaryKey": false,
1666
+ "notNull": true
1667
+ },
1668
+ "create_timestamp": {
1669
+ "name": "create_timestamp",
1670
+ "type": "timestamp with time zone",
1671
+ "primaryKey": false,
1672
+ "notNull": true
1673
+ },
1674
+ "delete_timestamp": {
1675
+ "name": "delete_timestamp",
1676
+ "type": "timestamp with time zone",
1677
+ "primaryKey": false,
1678
+ "notNull": false
1679
+ },
1680
+ "attributes": {
1681
+ "name": "attributes",
1682
+ "type": "jsonb",
1683
+ "primaryKey": false,
1684
+ "notNull": true,
1685
+ "default": "'{}'::jsonb"
1686
+ }
1687
+ },
1688
+ "indexes": {},
1689
+ "foreignKeys": {
1690
+ "tag_assignment_id_fkey": {
1691
+ "name": "tag_assignment_id_fkey",
1692
+ "tableFrom": "tag_assignment",
1693
+ "tableTo": "tag",
1694
+ "schemaTo": "document_management",
1695
+ "columnsFrom": [
1696
+ "tenant_id",
1697
+ "tag_id"
1698
+ ],
1699
+ "columnsTo": [
1700
+ "tenant_id",
1701
+ "id"
1702
+ ],
1703
+ "onDelete": "no action",
1704
+ "onUpdate": "no action"
1705
+ },
1706
+ "tag_assignment_tenantId_documentId_fkey": {
1707
+ "name": "tag_assignment_tenantId_documentId_fkey",
1708
+ "tableFrom": "tag_assignment",
1709
+ "tableTo": "document",
1710
+ "schemaTo": "document_management",
1711
+ "columnsFrom": [
1712
+ "tenant_id",
1713
+ "document_id"
1714
+ ],
1715
+ "columnsTo": [
1716
+ "tenant_id",
1717
+ "id"
1718
+ ],
1719
+ "onDelete": "no action",
1720
+ "onUpdate": "no action"
1721
+ }
1722
+ },
1723
+ "compositePrimaryKeys": {
1724
+ "tag_assignment_tenant_id_id_pk": {
1725
+ "name": "tag_assignment_tenant_id_id_pk",
1726
+ "columns": [
1727
+ "tenant_id",
1728
+ "id"
1729
+ ]
1730
+ }
1731
+ },
1732
+ "uniqueConstraints": {
1733
+ "tag_assignment_tenant_id_document_id_tag_id_unique": {
1734
+ "name": "tag_assignment_tenant_id_document_id_tag_id_unique",
1735
+ "nullsNotDistinct": false,
1736
+ "columns": [
1737
+ "tenant_id",
1738
+ "document_id",
1739
+ "tag_id"
1740
+ ]
1741
+ }
1742
+ },
1743
+ "policies": {},
1744
+ "checkConstraints": {},
1745
+ "isRLSEnabled": false
1746
+ },
1747
+ "document_management.type": {
1748
+ "name": "type",
1749
+ "schema": "document_management",
1750
+ "columns": {
1751
+ "id": {
1752
+ "name": "id",
1753
+ "type": "uuid",
1754
+ "primaryKey": false,
1755
+ "notNull": true,
1756
+ "default": "gen_random_uuid()"
1757
+ },
1758
+ "tenant_id": {
1759
+ "name": "tenant_id",
1760
+ "type": "uuid",
1761
+ "primaryKey": false,
1762
+ "notNull": true
1763
+ },
1764
+ "category_id": {
1765
+ "name": "category_id",
1766
+ "type": "uuid",
1767
+ "primaryKey": false,
1768
+ "notNull": true
1769
+ },
1770
+ "label": {
1771
+ "name": "label",
1772
+ "type": "text",
1773
+ "primaryKey": false,
1774
+ "notNull": true
1775
+ },
1776
+ "revision": {
1777
+ "name": "revision",
1778
+ "type": "integer",
1779
+ "primaryKey": false,
1780
+ "notNull": true
1781
+ },
1782
+ "revision_timestamp": {
1783
+ "name": "revision_timestamp",
1784
+ "type": "timestamp with time zone",
1785
+ "primaryKey": false,
1786
+ "notNull": true
1787
+ },
1788
+ "create_timestamp": {
1789
+ "name": "create_timestamp",
1790
+ "type": "timestamp with time zone",
1791
+ "primaryKey": false,
1792
+ "notNull": true
1793
+ },
1794
+ "delete_timestamp": {
1795
+ "name": "delete_timestamp",
1796
+ "type": "timestamp with time zone",
1797
+ "primaryKey": false,
1798
+ "notNull": false
1799
+ },
1800
+ "attributes": {
1801
+ "name": "attributes",
1802
+ "type": "jsonb",
1803
+ "primaryKey": false,
1804
+ "notNull": true,
1805
+ "default": "'{}'::jsonb"
1806
+ }
1807
+ },
1808
+ "indexes": {},
1809
+ "foreignKeys": {
1810
+ "type_id_fkey": {
1811
+ "name": "type_id_fkey",
1812
+ "tableFrom": "type",
1813
+ "tableTo": "category",
1814
+ "schemaTo": "document_management",
1815
+ "columnsFrom": [
1816
+ "tenant_id",
1817
+ "category_id"
1818
+ ],
1819
+ "columnsTo": [
1820
+ "tenant_id",
1821
+ "id"
1822
+ ],
1823
+ "onDelete": "no action",
1824
+ "onUpdate": "no action"
1825
+ }
1826
+ },
1827
+ "compositePrimaryKeys": {
1828
+ "type_tenant_id_id_pk": {
1829
+ "name": "type_tenant_id_id_pk",
1830
+ "columns": [
1831
+ "tenant_id",
1832
+ "id"
1833
+ ]
1834
+ }
1835
+ },
1836
+ "uniqueConstraints": {
1837
+ "type_tenant_id_category_id_label_unique": {
1838
+ "name": "type_tenant_id_category_id_label_unique",
1839
+ "nullsNotDistinct": false,
1840
+ "columns": [
1841
+ "tenant_id",
1842
+ "category_id",
1843
+ "label"
1844
+ ]
1845
+ }
1846
+ },
1847
+ "policies": {},
1848
+ "checkConstraints": {},
1849
+ "isRLSEnabled": false
1850
+ },
1851
+ "document_management.type_property": {
1852
+ "name": "type_property",
1853
+ "schema": "document_management",
1854
+ "columns": {
1855
+ "id": {
1856
+ "name": "id",
1857
+ "type": "uuid",
1858
+ "primaryKey": false,
1859
+ "notNull": true,
1860
+ "default": "gen_random_uuid()"
1861
+ },
1862
+ "tenant_id": {
1863
+ "name": "tenant_id",
1864
+ "type": "uuid",
1865
+ "primaryKey": false,
1866
+ "notNull": true
1867
+ },
1868
+ "type_id": {
1869
+ "name": "type_id",
1870
+ "type": "uuid",
1871
+ "primaryKey": false,
1872
+ "notNull": true
1873
+ },
1874
+ "property_id": {
1875
+ "name": "property_id",
1876
+ "type": "uuid",
1877
+ "primaryKey": false,
1878
+ "notNull": true
1879
+ },
1880
+ "revision": {
1881
+ "name": "revision",
1882
+ "type": "integer",
1883
+ "primaryKey": false,
1884
+ "notNull": true
1885
+ },
1886
+ "revision_timestamp": {
1887
+ "name": "revision_timestamp",
1888
+ "type": "timestamp with time zone",
1889
+ "primaryKey": false,
1890
+ "notNull": true
1891
+ },
1892
+ "create_timestamp": {
1893
+ "name": "create_timestamp",
1894
+ "type": "timestamp with time zone",
1895
+ "primaryKey": false,
1896
+ "notNull": true
1897
+ },
1898
+ "delete_timestamp": {
1899
+ "name": "delete_timestamp",
1900
+ "type": "timestamp with time zone",
1901
+ "primaryKey": false,
1902
+ "notNull": false
1903
+ },
1904
+ "attributes": {
1905
+ "name": "attributes",
1906
+ "type": "jsonb",
1907
+ "primaryKey": false,
1908
+ "notNull": true,
1909
+ "default": "'{}'::jsonb"
1910
+ }
1911
+ },
1912
+ "indexes": {},
1913
+ "foreignKeys": {
1914
+ "type_property_id_fkey": {
1915
+ "name": "type_property_id_fkey",
1916
+ "tableFrom": "type_property",
1917
+ "tableTo": "property",
1918
+ "schemaTo": "document_management",
1919
+ "columnsFrom": [
1920
+ "tenant_id",
1921
+ "property_id"
1922
+ ],
1923
+ "columnsTo": [
1924
+ "tenant_id",
1925
+ "id"
1926
+ ],
1927
+ "onDelete": "no action",
1928
+ "onUpdate": "no action"
1929
+ }
1930
+ },
1931
+ "compositePrimaryKeys": {
1932
+ "type_property_tenant_id_id_pk": {
1933
+ "name": "type_property_tenant_id_id_pk",
1934
+ "columns": [
1935
+ "tenant_id",
1936
+ "id"
1937
+ ]
1938
+ }
1939
+ },
1940
+ "uniqueConstraints": {
1941
+ "type_property_tenant_id_type_id_property_id_unique": {
1942
+ "name": "type_property_tenant_id_type_id_property_id_unique",
1943
+ "nullsNotDistinct": false,
1944
+ "columns": [
1945
+ "tenant_id",
1946
+ "type_id",
1947
+ "property_id"
1948
+ ]
1949
+ }
1950
+ },
1951
+ "policies": {},
1952
+ "checkConstraints": {},
1953
+ "isRLSEnabled": false
1954
+ },
1955
+ "document_management.document_type_validation": {
1956
+ "name": "document_type_validation",
1957
+ "schema": "document_management",
1958
+ "columns": {
1959
+ "id": {
1960
+ "name": "id",
1961
+ "type": "uuid",
1962
+ "primaryKey": false,
1963
+ "notNull": true,
1964
+ "default": "gen_random_uuid()"
1965
+ },
1966
+ "tenant_id": {
1967
+ "name": "tenant_id",
1968
+ "type": "uuid",
1969
+ "primaryKey": false,
1970
+ "notNull": true
1971
+ },
1972
+ "type_id": {
1973
+ "name": "type_id",
1974
+ "type": "uuid",
1975
+ "primaryKey": false,
1976
+ "notNull": true
1977
+ },
1978
+ "validation_id": {
1979
+ "name": "validation_id",
1980
+ "type": "uuid",
1981
+ "primaryKey": false,
1982
+ "notNull": true
1983
+ },
1984
+ "revision": {
1985
+ "name": "revision",
1986
+ "type": "integer",
1987
+ "primaryKey": false,
1988
+ "notNull": true
1989
+ },
1990
+ "revision_timestamp": {
1991
+ "name": "revision_timestamp",
1992
+ "type": "timestamp with time zone",
1993
+ "primaryKey": false,
1994
+ "notNull": true
1995
+ },
1996
+ "create_timestamp": {
1997
+ "name": "create_timestamp",
1998
+ "type": "timestamp with time zone",
1999
+ "primaryKey": false,
2000
+ "notNull": true
2001
+ },
2002
+ "delete_timestamp": {
2003
+ "name": "delete_timestamp",
2004
+ "type": "timestamp with time zone",
2005
+ "primaryKey": false,
2006
+ "notNull": false
2007
+ },
2008
+ "attributes": {
2009
+ "name": "attributes",
2010
+ "type": "jsonb",
2011
+ "primaryKey": false,
2012
+ "notNull": true,
2013
+ "default": "'{}'::jsonb"
2014
+ }
2015
+ },
2016
+ "indexes": {
2017
+ "document_type_validation_type_id_idx": {
2018
+ "name": "document_type_validation_type_id_idx",
2019
+ "columns": [
2020
+ {
2021
+ "expression": "type_id",
2022
+ "isExpression": false,
2023
+ "asc": true,
2024
+ "nulls": "last"
2025
+ }
2026
+ ],
2027
+ "isUnique": false,
2028
+ "concurrently": false,
2029
+ "method": "btree",
2030
+ "with": {}
2031
+ }
2032
+ },
2033
+ "foreignKeys": {
2034
+ "document_type_validation_id_fkey": {
2035
+ "name": "document_type_validation_id_fkey",
2036
+ "tableFrom": "document_type_validation",
2037
+ "tableTo": "validation_definition",
2038
+ "schemaTo": "document_management",
2039
+ "columnsFrom": [
2040
+ "tenant_id",
2041
+ "validation_id"
2042
+ ],
2043
+ "columnsTo": [
2044
+ "tenant_id",
2045
+ "id"
2046
+ ],
2047
+ "onDelete": "no action",
2048
+ "onUpdate": "no action"
2049
+ }
2050
+ },
2051
+ "compositePrimaryKeys": {
2052
+ "document_type_validation_tenant_id_id_pk": {
2053
+ "name": "document_type_validation_tenant_id_id_pk",
2054
+ "columns": [
2055
+ "tenant_id",
2056
+ "id"
2057
+ ]
2058
+ }
2059
+ },
2060
+ "uniqueConstraints": {
2061
+ "document_type_validation_tenant_id_type_id_validation_id_unique": {
2062
+ "name": "document_type_validation_tenant_id_type_id_validation_id_unique",
2063
+ "nullsNotDistinct": false,
2064
+ "columns": [
2065
+ "tenant_id",
2066
+ "type_id",
2067
+ "validation_id"
2068
+ ]
2069
+ }
2070
+ },
2071
+ "policies": {},
2072
+ "checkConstraints": {},
2073
+ "isRLSEnabled": false
2074
+ },
2075
+ "document_management.validation_definition": {
2076
+ "name": "validation_definition",
2077
+ "schema": "document_management",
2078
+ "columns": {
2079
+ "id": {
2080
+ "name": "id",
2081
+ "type": "uuid",
2082
+ "primaryKey": false,
2083
+ "notNull": true,
2084
+ "default": "gen_random_uuid()"
2085
+ },
2086
+ "tenant_id": {
2087
+ "name": "tenant_id",
2088
+ "type": "uuid",
2089
+ "primaryKey": false,
2090
+ "notNull": true
2091
+ },
2092
+ "identifier": {
2093
+ "name": "identifier",
2094
+ "type": "text",
2095
+ "primaryKey": false,
2096
+ "notNull": true
2097
+ },
2098
+ "label": {
2099
+ "name": "label",
2100
+ "type": "text",
2101
+ "primaryKey": false,
2102
+ "notNull": true
2103
+ },
2104
+ "description": {
2105
+ "name": "description",
2106
+ "type": "text",
2107
+ "primaryKey": false,
2108
+ "notNull": false
2109
+ },
2110
+ "configuration": {
2111
+ "name": "configuration",
2112
+ "type": "jsonb",
2113
+ "primaryKey": false,
2114
+ "notNull": true
2115
+ },
2116
+ "revision": {
2117
+ "name": "revision",
2118
+ "type": "integer",
2119
+ "primaryKey": false,
2120
+ "notNull": true
2121
+ },
2122
+ "revision_timestamp": {
2123
+ "name": "revision_timestamp",
2124
+ "type": "timestamp with time zone",
2125
+ "primaryKey": false,
2126
+ "notNull": true
2127
+ },
2128
+ "create_timestamp": {
2129
+ "name": "create_timestamp",
2130
+ "type": "timestamp with time zone",
2131
+ "primaryKey": false,
2132
+ "notNull": true
2133
+ },
2134
+ "delete_timestamp": {
2135
+ "name": "delete_timestamp",
2136
+ "type": "timestamp with time zone",
2137
+ "primaryKey": false,
2138
+ "notNull": false
2139
+ },
2140
+ "attributes": {
2141
+ "name": "attributes",
2142
+ "type": "jsonb",
2143
+ "primaryKey": false,
2144
+ "notNull": true,
2145
+ "default": "'{}'::jsonb"
2146
+ }
2147
+ },
2148
+ "indexes": {},
2149
+ "foreignKeys": {},
2150
+ "compositePrimaryKeys": {
2151
+ "validation_definition_tenant_id_id_pk": {
2152
+ "name": "validation_definition_tenant_id_id_pk",
2153
+ "columns": [
2154
+ "tenant_id",
2155
+ "id"
2156
+ ]
2157
+ }
2158
+ },
2159
+ "uniqueConstraints": {},
2160
+ "policies": {},
2161
+ "checkConstraints": {},
2162
+ "isRLSEnabled": false
2163
+ },
2164
+ "document_management.validation_execution": {
2165
+ "name": "validation_execution",
2166
+ "schema": "document_management",
2167
+ "columns": {
2168
+ "id": {
2169
+ "name": "id",
2170
+ "type": "uuid",
2171
+ "primaryKey": false,
2172
+ "notNull": true,
2173
+ "default": "gen_random_uuid()"
2174
+ },
2175
+ "tenant_id": {
2176
+ "name": "tenant_id",
2177
+ "type": "uuid",
2178
+ "primaryKey": false,
2179
+ "notNull": true
2180
+ },
2181
+ "workflow_id": {
2182
+ "name": "workflow_id",
2183
+ "type": "uuid",
2184
+ "primaryKey": false,
2185
+ "notNull": true
2186
+ },
2187
+ "definition_id": {
2188
+ "name": "definition_id",
2189
+ "type": "uuid",
2190
+ "primaryKey": false,
2191
+ "notNull": true
2192
+ },
2193
+ "state": {
2194
+ "name": "state",
2195
+ "type": "validation_execution_state",
2196
+ "typeSchema": "document_management",
2197
+ "primaryKey": false,
2198
+ "notNull": true
2199
+ },
2200
+ "result_status": {
2201
+ "name": "result_status",
2202
+ "type": "validation_result_status",
2203
+ "typeSchema": "document_management",
2204
+ "primaryKey": false,
2205
+ "notNull": false
2206
+ },
2207
+ "result_message": {
2208
+ "name": "result_message",
2209
+ "type": "text",
2210
+ "primaryKey": false,
2211
+ "notNull": false
2212
+ },
2213
+ "started_at": {
2214
+ "name": "started_at",
2215
+ "type": "timestamp with time zone",
2216
+ "primaryKey": false,
2217
+ "notNull": false
2218
+ },
2219
+ "completed_at": {
2220
+ "name": "completed_at",
2221
+ "type": "timestamp with time zone",
2222
+ "primaryKey": false,
2223
+ "notNull": false
2224
+ },
2225
+ "revision": {
2226
+ "name": "revision",
2227
+ "type": "integer",
2228
+ "primaryKey": false,
2229
+ "notNull": true
2230
+ },
2231
+ "revision_timestamp": {
2232
+ "name": "revision_timestamp",
2233
+ "type": "timestamp with time zone",
2234
+ "primaryKey": false,
2235
+ "notNull": true
2236
+ },
2237
+ "create_timestamp": {
2238
+ "name": "create_timestamp",
2239
+ "type": "timestamp with time zone",
2240
+ "primaryKey": false,
2241
+ "notNull": true
2242
+ },
2243
+ "delete_timestamp": {
2244
+ "name": "delete_timestamp",
2245
+ "type": "timestamp with time zone",
2246
+ "primaryKey": false,
2247
+ "notNull": false
2248
+ },
2249
+ "attributes": {
2250
+ "name": "attributes",
2251
+ "type": "jsonb",
2252
+ "primaryKey": false,
2253
+ "notNull": true,
2254
+ "default": "'{}'::jsonb"
2255
+ }
2256
+ },
2257
+ "indexes": {},
2258
+ "foreignKeys": {
2259
+ "validation_execution_id_fkey": {
2260
+ "name": "validation_execution_id_fkey",
2261
+ "tableFrom": "validation_execution",
2262
+ "tableTo": "validation_definition",
2263
+ "schemaTo": "document_management",
2264
+ "columnsFrom": [
2265
+ "tenant_id",
2266
+ "definition_id"
2267
+ ],
2268
+ "columnsTo": [
2269
+ "tenant_id",
2270
+ "id"
2271
+ ],
2272
+ "onDelete": "no action",
2273
+ "onUpdate": "no action"
2274
+ },
2275
+ "validation_execution_tenantId_workflowId_fkey": {
2276
+ "name": "validation_execution_tenantId_workflowId_fkey",
2277
+ "tableFrom": "validation_execution",
2278
+ "tableTo": "workflow",
2279
+ "schemaTo": "document_management",
2280
+ "columnsFrom": [
2281
+ "tenant_id",
2282
+ "workflow_id"
2283
+ ],
2284
+ "columnsTo": [
2285
+ "tenant_id",
2286
+ "id"
2287
+ ],
2288
+ "onDelete": "no action",
2289
+ "onUpdate": "no action"
2290
+ }
2291
+ },
2292
+ "compositePrimaryKeys": {
2293
+ "validation_execution_tenant_id_id_pk": {
2294
+ "name": "validation_execution_tenant_id_id_pk",
2295
+ "columns": [
2296
+ "tenant_id",
2297
+ "id"
2298
+ ]
2299
+ }
2300
+ },
2301
+ "uniqueConstraints": {
2302
+ "validation_execution_tenant_id_workflow_id_definition_id_unique": {
2303
+ "name": "validation_execution_tenant_id_workflow_id_definition_id_unique",
2304
+ "nullsNotDistinct": false,
2305
+ "columns": [
2306
+ "tenant_id",
2307
+ "workflow_id",
2308
+ "definition_id"
2309
+ ]
2310
+ },
2311
+ "validation_execution_tenant_id_id_unique": {
2312
+ "name": "validation_execution_tenant_id_id_unique",
2313
+ "nullsNotDistinct": false,
2314
+ "columns": [
2315
+ "tenant_id",
2316
+ "id"
2317
+ ]
2318
+ }
2319
+ },
2320
+ "policies": {},
2321
+ "checkConstraints": {},
2322
+ "isRLSEnabled": false
2323
+ },
2324
+ "document_management.validation_execution_related_document": {
2325
+ "name": "validation_execution_related_document",
2326
+ "schema": "document_management",
2327
+ "columns": {
2328
+ "id": {
2329
+ "name": "id",
2330
+ "type": "uuid",
2331
+ "primaryKey": false,
2332
+ "notNull": true,
2333
+ "default": "gen_random_uuid()"
2334
+ },
2335
+ "tenant_id": {
2336
+ "name": "tenant_id",
2337
+ "type": "uuid",
2338
+ "primaryKey": false,
2339
+ "notNull": true
2340
+ },
2341
+ "execution_id": {
2342
+ "name": "execution_id",
2343
+ "type": "uuid",
2344
+ "primaryKey": false,
2345
+ "notNull": true
2346
+ },
2347
+ "document_id": {
2348
+ "name": "document_id",
2349
+ "type": "uuid",
2350
+ "primaryKey": false,
2351
+ "notNull": true
2352
+ },
2353
+ "revision": {
2354
+ "name": "revision",
2355
+ "type": "integer",
2356
+ "primaryKey": false,
2357
+ "notNull": true
2358
+ },
2359
+ "revision_timestamp": {
2360
+ "name": "revision_timestamp",
2361
+ "type": "timestamp with time zone",
2362
+ "primaryKey": false,
2363
+ "notNull": true
2364
+ },
2365
+ "create_timestamp": {
2366
+ "name": "create_timestamp",
2367
+ "type": "timestamp with time zone",
2368
+ "primaryKey": false,
2369
+ "notNull": true
2370
+ },
2371
+ "delete_timestamp": {
2372
+ "name": "delete_timestamp",
2373
+ "type": "timestamp with time zone",
2374
+ "primaryKey": false,
2375
+ "notNull": false
2376
+ },
2377
+ "attributes": {
2378
+ "name": "attributes",
2379
+ "type": "jsonb",
2380
+ "primaryKey": false,
2381
+ "notNull": true,
2382
+ "default": "'{}'::jsonb"
2383
+ }
2384
+ },
2385
+ "indexes": {},
2386
+ "foreignKeys": {
2387
+ "validation_execution_related_document_id_fkey": {
2388
+ "name": "validation_execution_related_document_id_fkey",
2389
+ "tableFrom": "validation_execution_related_document",
2390
+ "tableTo": "document",
2391
+ "schemaTo": "document_management",
2392
+ "columnsFrom": [
2393
+ "tenant_id",
2394
+ "document_id"
2395
+ ],
2396
+ "columnsTo": [
2397
+ "tenant_id",
2398
+ "id"
2399
+ ],
2400
+ "onDelete": "no action",
2401
+ "onUpdate": "no action"
2402
+ },
2403
+ "validation_execution_related_document_tenantId_documentId_fkey": {
2404
+ "name": "validation_execution_related_document_tenantId_documentId_fkey",
2405
+ "tableFrom": "validation_execution_related_document",
2406
+ "tableTo": "document",
2407
+ "schemaTo": "document_management",
2408
+ "columnsFrom": [
2409
+ "tenant_id",
2410
+ "document_id"
2411
+ ],
2412
+ "columnsTo": [
2413
+ "tenant_id",
2414
+ "id"
2415
+ ],
2416
+ "onDelete": "no action",
2417
+ "onUpdate": "no action"
2418
+ },
2419
+ "validation_execution_related_document_tenantId_executionId_fkey": {
2420
+ "name": "validation_execution_related_document_tenantId_executionId_fkey",
2421
+ "tableFrom": "validation_execution_related_document",
2422
+ "tableTo": "validation_execution",
2423
+ "schemaTo": "document_management",
2424
+ "columnsFrom": [
2425
+ "tenant_id",
2426
+ "execution_id"
2427
+ ],
2428
+ "columnsTo": [
2429
+ "tenant_id",
2430
+ "id"
2431
+ ],
2432
+ "onDelete": "no action",
2433
+ "onUpdate": "no action"
2434
+ }
2435
+ },
2436
+ "compositePrimaryKeys": {
2437
+ "validation_execution_related_document_tenant_id_id_pk": {
2438
+ "name": "validation_execution_related_document_tenant_id_id_pk",
2439
+ "columns": [
2440
+ "tenant_id",
2441
+ "id"
2442
+ ]
2443
+ }
2444
+ },
2445
+ "uniqueConstraints": {
2446
+ "verd_tenant_id_execution_id_document_id_unique": {
2447
+ "name": "verd_tenant_id_execution_id_document_id_unique",
2448
+ "nullsNotDistinct": false,
2449
+ "columns": [
2450
+ "tenant_id",
2451
+ "execution_id",
2452
+ "document_id"
2453
+ ]
2454
+ }
2455
+ },
2456
+ "policies": {},
2457
+ "checkConstraints": {},
2458
+ "isRLSEnabled": false
2459
+ },
2460
+ "document_management.workflow": {
2461
+ "name": "workflow",
2462
+ "schema": "document_management",
2463
+ "columns": {
2464
+ "id": {
2465
+ "name": "id",
2466
+ "type": "uuid",
2467
+ "primaryKey": false,
2468
+ "notNull": true,
2469
+ "default": "gen_random_uuid()"
2470
+ },
2471
+ "tenant_id": {
2472
+ "name": "tenant_id",
2473
+ "type": "uuid",
2474
+ "primaryKey": false,
2475
+ "notNull": true
2476
+ },
2477
+ "document_id": {
2478
+ "name": "document_id",
2479
+ "type": "uuid",
2480
+ "primaryKey": false,
2481
+ "notNull": true
2482
+ },
2483
+ "step": {
2484
+ "name": "step",
2485
+ "type": "workflow_step",
2486
+ "typeSchema": "document_management",
2487
+ "primaryKey": false,
2488
+ "notNull": true
2489
+ },
2490
+ "state": {
2491
+ "name": "state",
2492
+ "type": "workflow_state",
2493
+ "typeSchema": "document_management",
2494
+ "primaryKey": false,
2495
+ "notNull": true
2496
+ },
2497
+ "fail_reason": {
2498
+ "name": "fail_reason",
2499
+ "type": "workflow_fail_reason",
2500
+ "typeSchema": "document_management",
2501
+ "primaryKey": false,
2502
+ "notNull": false
2503
+ },
2504
+ "complete_timestamp": {
2505
+ "name": "complete_timestamp",
2506
+ "type": "timestamp with time zone",
2507
+ "primaryKey": false,
2508
+ "notNull": false
2509
+ },
2510
+ "complete_user_id": {
2511
+ "name": "complete_user_id",
2512
+ "type": "uuid",
2513
+ "primaryKey": false,
2514
+ "notNull": false
2515
+ },
2516
+ "revision": {
2517
+ "name": "revision",
2518
+ "type": "integer",
2519
+ "primaryKey": false,
2520
+ "notNull": true
2521
+ },
2522
+ "revision_timestamp": {
2523
+ "name": "revision_timestamp",
2524
+ "type": "timestamp with time zone",
2525
+ "primaryKey": false,
2526
+ "notNull": true
2527
+ },
2528
+ "create_timestamp": {
2529
+ "name": "create_timestamp",
2530
+ "type": "timestamp with time zone",
2531
+ "primaryKey": false,
2532
+ "notNull": true
2533
+ },
2534
+ "delete_timestamp": {
2535
+ "name": "delete_timestamp",
2536
+ "type": "timestamp with time zone",
2537
+ "primaryKey": false,
2538
+ "notNull": false
2539
+ },
2540
+ "attributes": {
2541
+ "name": "attributes",
2542
+ "type": "jsonb",
2543
+ "primaryKey": false,
2544
+ "notNull": true,
2545
+ "default": "'{}'::jsonb"
2546
+ }
2547
+ },
2548
+ "indexes": {
2549
+ "workflow_document_id_idx": {
2550
+ "name": "workflow_document_id_idx",
2551
+ "columns": [
2552
+ {
2553
+ "expression": "document_id",
2554
+ "isExpression": false,
2555
+ "asc": true,
2556
+ "nulls": "last"
2557
+ }
2558
+ ],
2559
+ "isUnique": true,
2560
+ "where": "\"document_management\".\"workflow\".\"state\" <> 'completed'",
2561
+ "concurrently": false,
2562
+ "method": "btree",
2563
+ "with": {}
2564
+ }
2565
+ },
2566
+ "foreignKeys": {
2567
+ "workflow_id_fkey": {
2568
+ "name": "workflow_id_fkey",
2569
+ "tableFrom": "workflow",
2570
+ "tableTo": "document",
2571
+ "schemaTo": "document_management",
2572
+ "columnsFrom": [
2573
+ "tenant_id",
2574
+ "document_id"
2575
+ ],
2576
+ "columnsTo": [
2577
+ "tenant_id",
2578
+ "id"
2579
+ ],
2580
+ "onDelete": "no action",
2581
+ "onUpdate": "no action"
2582
+ },
2583
+ "workflow_tenantId_documentId_fkey": {
2584
+ "name": "workflow_tenantId_documentId_fkey",
2585
+ "tableFrom": "workflow",
2586
+ "tableTo": "document",
2587
+ "schemaTo": "document_management",
2588
+ "columnsFrom": [
2589
+ "tenant_id",
2590
+ "document_id"
2591
+ ],
2592
+ "columnsTo": [
2593
+ "tenant_id",
2594
+ "id"
2595
+ ],
2596
+ "onDelete": "no action",
2597
+ "onUpdate": "no action"
2598
+ }
2599
+ },
2600
+ "compositePrimaryKeys": {
2601
+ "workflow_tenant_id_id_pk": {
2602
+ "name": "workflow_tenant_id_id_pk",
2603
+ "columns": [
2604
+ "tenant_id",
2605
+ "id"
2606
+ ]
2607
+ }
2608
+ },
2609
+ "uniqueConstraints": {
2610
+ "workflow_tenant_id_id_unique": {
2611
+ "name": "workflow_tenant_id_id_unique",
2612
+ "nullsNotDistinct": false,
2613
+ "columns": [
2614
+ "tenant_id",
2615
+ "id"
2616
+ ]
2617
+ }
2618
+ },
2619
+ "policies": {},
2620
+ "checkConstraints": {},
2621
+ "isRLSEnabled": false
2622
+ }
2623
+ },
2624
+ "enums": {
2625
+ "document_management.document_approval": {
2626
+ "name": "document_approval",
2627
+ "schema": "document_management",
2628
+ "values": [
2629
+ "pending",
2630
+ "approved",
2631
+ "rejected"
2632
+ ]
2633
+ },
2634
+ "document_management.assignment_target": {
2635
+ "name": "assignment_target",
2636
+ "schema": "document_management",
2637
+ "values": [
2638
+ "collection",
2639
+ "request"
2640
+ ]
2641
+ },
2642
+ "document_management.property_data_type": {
2643
+ "name": "property_data_type",
2644
+ "schema": "document_management",
2645
+ "values": [
2646
+ "text",
2647
+ "integer",
2648
+ "decimal",
2649
+ "boolean",
2650
+ "date"
2651
+ ]
2652
+ },
2653
+ "document_management.request_state": {
2654
+ "name": "request_state",
2655
+ "schema": "document_management",
2656
+ "values": [
2657
+ "open",
2658
+ "fulfilled",
2659
+ "closed"
2660
+ ]
2661
+ },
2662
+ "document_management.validation_execution_state": {
2663
+ "name": "validation_execution_state",
2664
+ "schema": "document_management",
2665
+ "values": [
2666
+ "pending",
2667
+ "running",
2668
+ "completed",
2669
+ "error"
2670
+ ]
2671
+ },
2672
+ "document_management.validation_result_status": {
2673
+ "name": "validation_result_status",
2674
+ "schema": "document_management",
2675
+ "values": [
2676
+ "passed",
2677
+ "failed",
2678
+ "warning"
2679
+ ]
2680
+ },
2681
+ "document_management.workflow_fail_reason": {
2682
+ "name": "workflow_fail_reason",
2683
+ "schema": "document_management",
2684
+ "values": [
2685
+ "no-suitable-collection",
2686
+ "no-suitable-request"
2687
+ ]
2688
+ },
2689
+ "document_management.workflow_state": {
2690
+ "name": "workflow_state",
2691
+ "schema": "document_management",
2692
+ "values": [
2693
+ "pending",
2694
+ "running",
2695
+ "review",
2696
+ "completed",
2697
+ "error",
2698
+ "failed"
2699
+ ]
2700
+ },
2701
+ "document_management.workflow_step": {
2702
+ "name": "workflow_step",
2703
+ "schema": "document_management",
2704
+ "values": [
2705
+ "classification",
2706
+ "extraction",
2707
+ "assignment",
2708
+ "validation"
2709
+ ]
2710
+ }
2711
+ },
2712
+ "schemas": {},
2713
+ "sequences": {},
2714
+ "roles": {},
2715
+ "policies": {},
2716
+ "views": {},
2717
+ "_meta": {
2718
+ "columns": {},
2719
+ "schemas": {},
2720
+ "tables": {}
2721
+ }
2722
+ }