@open-mercato/core 0.6.7-develop.6842.1.8cd8a8883c → 0.6.7-develop.6859.1.e4727b568a

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 (115) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/dist/bootstrap.js +16 -1
  3. package/dist/bootstrap.js.map +2 -2
  4. package/dist/generated/entities/attachment_quota_reservation/index.js +33 -0
  5. package/dist/generated/entities/attachment_quota_reservation/index.js.map +7 -0
  6. package/dist/generated/entities.ids.generated.js +2 -1
  7. package/dist/generated/entities.ids.generated.js.map +2 -2
  8. package/dist/generated/entity-fields-registry.js +17 -0
  9. package/dist/generated/entity-fields-registry.js.map +2 -2
  10. package/dist/modules/attachments/api/route.js +104 -8
  11. package/dist/modules/attachments/api/route.js.map +2 -2
  12. package/dist/modules/attachments/data/entities.js +67 -1
  13. package/dist/modules/attachments/data/entities.js.map +2 -2
  14. package/dist/modules/attachments/di.js +7 -1
  15. package/dist/modules/attachments/di.js.map +2 -2
  16. package/dist/modules/attachments/lib/drivers/index.js.map +1 -1
  17. package/dist/modules/attachments/lib/drivers/localDriver.js +19 -6
  18. package/dist/modules/attachments/lib/drivers/localDriver.js.map +2 -2
  19. package/dist/modules/attachments/lib/quota-recovery-queue.js +9 -0
  20. package/dist/modules/attachments/lib/quota-recovery-queue.js.map +7 -0
  21. package/dist/modules/attachments/lib/quota-service.js +224 -0
  22. package/dist/modules/attachments/lib/quota-service.js.map +7 -0
  23. package/dist/modules/attachments/migrations/Migration20260709234741_attachments.js +13 -0
  24. package/dist/modules/attachments/migrations/Migration20260709234741_attachments.js.map +7 -0
  25. package/dist/modules/attachments/workers/quota-recovery.js +45 -0
  26. package/dist/modules/attachments/workers/quota-recovery.js.map +7 -0
  27. package/dist/modules/auth/lib/setup-app.js +16 -2
  28. package/dist/modules/auth/lib/setup-app.js.map +2 -2
  29. package/dist/modules/dashboards/services/widgetDataService.js +3 -4
  30. package/dist/modules/dashboards/services/widgetDataService.js.map +2 -2
  31. package/dist/modules/entities/api/definitions.js +2 -0
  32. package/dist/modules/entities/api/definitions.js.map +2 -2
  33. package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js +18 -3
  34. package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js.map +2 -2
  35. package/dist/modules/entities/cli.js +193 -19
  36. package/dist/modules/entities/cli.js.map +2 -2
  37. package/dist/modules/entities/components/RecordListRelationCell.js +63 -0
  38. package/dist/modules/entities/components/RecordListRelationCell.js.map +7 -0
  39. package/dist/modules/entities/components/recordListRelationDisplays.js +80 -0
  40. package/dist/modules/entities/components/recordListRelationDisplays.js.map +7 -0
  41. package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js +14 -1
  42. package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js.map +2 -2
  43. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js +22 -17
  44. package/dist/modules/inbox_ops/components/proposals/EditActionDialog.js.map +2 -2
  45. package/dist/modules/messages/api/[id]/route.js +15 -0
  46. package/dist/modules/messages/api/[id]/route.js.map +2 -2
  47. package/dist/modules/query_index/api/reindex.js +10 -0
  48. package/dist/modules/query_index/api/reindex.js.map +2 -2
  49. package/dist/modules/query_index/cli.js +125 -1
  50. package/dist/modules/query_index/cli.js.map +2 -2
  51. package/dist/modules/query_index/lib/coverage.js +19 -7
  52. package/dist/modules/query_index/lib/coverage.js.map +2 -2
  53. package/dist/modules/query_index/lib/reindexer.js +43 -37
  54. package/dist/modules/query_index/lib/reindexer.js.map +2 -2
  55. package/dist/modules/query_index/lib/subscriber-scope.js +2 -3
  56. package/dist/modules/query_index/lib/subscriber-scope.js.map +2 -2
  57. package/dist/modules/sales/commands/documents.js +137 -22
  58. package/dist/modules/sales/commands/documents.js.map +2 -2
  59. package/dist/modules/sales/data/validators.js +2 -0
  60. package/dist/modules/sales/data/validators.js.map +2 -2
  61. package/dist/modules/sales/workflows.js +10 -7
  62. package/dist/modules/sales/workflows.js.map +2 -2
  63. package/dist/modules/workflows/lib/activity-executor.js +27 -0
  64. package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
  65. package/dist/modules/workflows/widgets/injection/order-approval/context-keys.js +10 -0
  66. package/dist/modules/workflows/widgets/injection/order-approval/context-keys.js.map +7 -0
  67. package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js +10 -6
  68. package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js.map +2 -2
  69. package/generated/entities/attachment_quota_reservation/index.ts +15 -0
  70. package/generated/entities.ids.generated.ts +2 -1
  71. package/generated/entity-fields-registry.ts +17 -0
  72. package/package.json +7 -7
  73. package/src/bootstrap.ts +17 -2
  74. package/src/modules/attachments/api/route.ts +114 -7
  75. package/src/modules/attachments/data/entities.ts +59 -0
  76. package/src/modules/attachments/di.ts +9 -1
  77. package/src/modules/attachments/i18n/de.json +3 -0
  78. package/src/modules/attachments/i18n/en.json +3 -0
  79. package/src/modules/attachments/i18n/es.json +3 -0
  80. package/src/modules/attachments/i18n/pl.json +3 -0
  81. package/src/modules/attachments/lib/drivers/index.ts +1 -1
  82. package/src/modules/attachments/lib/drivers/localDriver.ts +23 -8
  83. package/src/modules/attachments/lib/drivers/types.ts +5 -0
  84. package/src/modules/attachments/lib/quota-recovery-queue.ts +16 -0
  85. package/src/modules/attachments/lib/quota-service.ts +442 -0
  86. package/src/modules/attachments/migrations/.snapshot-open-mercato.json +648 -120
  87. package/src/modules/attachments/migrations/Migration20260709234741_attachments.ts +12 -0
  88. package/src/modules/attachments/workers/quota-recovery.ts +68 -0
  89. package/src/modules/auth/lib/setup-app.ts +20 -2
  90. package/src/modules/dashboards/services/widgetDataService.ts +3 -6
  91. package/src/modules/entities/api/definitions.ts +4 -0
  92. package/src/modules/entities/backend/entities/user/[entityId]/records/page.tsx +94 -77
  93. package/src/modules/entities/cli.ts +238 -21
  94. package/src/modules/entities/components/RecordListRelationCell.tsx +90 -0
  95. package/src/modules/entities/components/recordListRelationDisplays.ts +109 -0
  96. package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.ts +17 -1
  97. package/src/modules/inbox_ops/components/proposals/EditActionDialog.tsx +21 -16
  98. package/src/modules/inbox_ops/components/proposals/types.ts +1 -0
  99. package/src/modules/messages/api/[id]/route.ts +21 -0
  100. package/src/modules/query_index/api/reindex.ts +15 -0
  101. package/src/modules/query_index/cli.ts +180 -1
  102. package/src/modules/query_index/lib/coverage.ts +38 -8
  103. package/src/modules/query_index/lib/reindexer.ts +62 -40
  104. package/src/modules/query_index/lib/subscriber-scope.ts +2 -7
  105. package/src/modules/sales/commands/documents.ts +237 -29
  106. package/src/modules/sales/data/validators.ts +2 -0
  107. package/src/modules/sales/workflows.ts +10 -7
  108. package/src/modules/workflows/i18n/de.json +1 -0
  109. package/src/modules/workflows/i18n/en.json +1 -0
  110. package/src/modules/workflows/i18n/es.json +1 -0
  111. package/src/modules/workflows/i18n/ko.json +1 -0
  112. package/src/modules/workflows/i18n/pl.json +1 -0
  113. package/src/modules/workflows/lib/activity-executor.ts +40 -1
  114. package/src/modules/workflows/widgets/injection/order-approval/context-keys.ts +18 -0
  115. package/src/modules/workflows/widgets/injection/order-approval/widget.client.tsx +15 -6
@@ -1,37 +1,130 @@
1
1
  {
2
+ "name": "public",
2
3
  "namespaces": [
3
4
  "public"
4
5
  ],
5
- "name": "public",
6
6
  "tables": [
7
7
  {
8
+ "name": "attachment_partitions",
9
+ "schema": "public",
8
10
  "columns": {
11
+ "code": {
12
+ "name": "code",
13
+ "type": "text",
14
+ "unsigned": false,
15
+ "autoincrement": false,
16
+ "primary": false,
17
+ "nullable": false,
18
+ "unique": true,
19
+ "length": null,
20
+ "precision": null,
21
+ "scale": null,
22
+ "default": null,
23
+ "comment": null,
24
+ "collation": null,
25
+ "enumItems": [],
26
+ "mappedType": "text"
27
+ },
28
+ "config_json": {
29
+ "name": "config_json",
30
+ "type": "jsonb",
31
+ "unsigned": false,
32
+ "autoincrement": false,
33
+ "primary": false,
34
+ "nullable": true,
35
+ "unique": false,
36
+ "length": null,
37
+ "precision": null,
38
+ "scale": null,
39
+ "default": null,
40
+ "comment": null,
41
+ "collation": null,
42
+ "enumItems": [],
43
+ "mappedType": "json"
44
+ },
45
+ "created_at": {
46
+ "name": "created_at",
47
+ "type": "timestamptz(6)",
48
+ "unsigned": false,
49
+ "autoincrement": false,
50
+ "primary": false,
51
+ "nullable": false,
52
+ "unique": false,
53
+ "length": 6,
54
+ "precision": null,
55
+ "scale": null,
56
+ "default": null,
57
+ "comment": null,
58
+ "collation": null,
59
+ "enumItems": [],
60
+ "mappedType": "datetime"
61
+ },
62
+ "description": {
63
+ "name": "description",
64
+ "type": "text",
65
+ "unsigned": false,
66
+ "autoincrement": false,
67
+ "primary": false,
68
+ "nullable": true,
69
+ "unique": false,
70
+ "length": null,
71
+ "precision": null,
72
+ "scale": null,
73
+ "default": null,
74
+ "comment": null,
75
+ "collation": null,
76
+ "enumItems": [],
77
+ "mappedType": "text"
78
+ },
9
79
  "id": {
10
80
  "name": "id",
11
81
  "type": "uuid",
12
82
  "unsigned": false,
13
83
  "autoincrement": false,
14
- "primary": false,
84
+ "primary": true,
15
85
  "nullable": false,
86
+ "unique": false,
87
+ "length": null,
88
+ "precision": null,
89
+ "scale": null,
16
90
  "default": "gen_random_uuid()",
91
+ "comment": null,
92
+ "collation": null,
93
+ "enumItems": [],
17
94
  "mappedType": "uuid"
18
95
  },
19
- "entity_id": {
20
- "name": "entity_id",
21
- "type": "text",
96
+ "is_public": {
97
+ "name": "is_public",
98
+ "type": "boolean",
22
99
  "unsigned": false,
23
100
  "autoincrement": false,
24
101
  "primary": false,
25
102
  "nullable": false,
26
- "mappedType": "text"
103
+ "unique": false,
104
+ "length": null,
105
+ "precision": null,
106
+ "scale": null,
107
+ "default": "false",
108
+ "comment": null,
109
+ "collation": null,
110
+ "enumItems": [],
111
+ "mappedType": "boolean"
27
112
  },
28
- "record_id": {
29
- "name": "record_id",
113
+ "ocr_model": {
114
+ "name": "ocr_model",
30
115
  "type": "text",
31
116
  "unsigned": false,
32
117
  "autoincrement": false,
33
118
  "primary": false,
34
- "nullable": false,
119
+ "nullable": true,
120
+ "unique": false,
121
+ "length": null,
122
+ "precision": null,
123
+ "scale": null,
124
+ "default": null,
125
+ "comment": null,
126
+ "collation": null,
127
+ "enumItems": [],
35
128
  "mappedType": "text"
36
129
  },
37
130
  "organization_id": {
@@ -41,8 +134,50 @@
41
134
  "autoincrement": false,
42
135
  "primary": false,
43
136
  "nullable": true,
137
+ "unique": false,
138
+ "length": null,
139
+ "precision": null,
140
+ "scale": null,
141
+ "default": null,
142
+ "comment": null,
143
+ "collation": null,
144
+ "enumItems": [],
44
145
  "mappedType": "uuid"
45
146
  },
147
+ "requires_ocr": {
148
+ "name": "requires_ocr",
149
+ "type": "boolean",
150
+ "unsigned": false,
151
+ "autoincrement": false,
152
+ "primary": false,
153
+ "nullable": false,
154
+ "unique": false,
155
+ "length": null,
156
+ "precision": null,
157
+ "scale": null,
158
+ "default": "true",
159
+ "comment": null,
160
+ "collation": null,
161
+ "enumItems": [],
162
+ "mappedType": "boolean"
163
+ },
164
+ "storage_driver": {
165
+ "name": "storage_driver",
166
+ "type": "text",
167
+ "unsigned": false,
168
+ "autoincrement": false,
169
+ "primary": false,
170
+ "nullable": false,
171
+ "unique": false,
172
+ "length": null,
173
+ "precision": null,
174
+ "scale": null,
175
+ "default": "'local'",
176
+ "comment": null,
177
+ "collation": null,
178
+ "enumItems": [],
179
+ "mappedType": "text"
180
+ },
46
181
  "tenant_id": {
47
182
  "name": "tenant_id",
48
183
  "type": "uuid",
@@ -50,234 +185,622 @@
50
185
  "autoincrement": false,
51
186
  "primary": false,
52
187
  "nullable": true,
188
+ "unique": false,
189
+ "length": null,
190
+ "precision": null,
191
+ "scale": null,
192
+ "default": null,
193
+ "comment": null,
194
+ "collation": null,
195
+ "enumItems": [],
53
196
  "mappedType": "uuid"
54
197
  },
55
- "partition_code": {
56
- "name": "partition_code",
198
+ "title": {
199
+ "name": "title",
57
200
  "type": "text",
58
201
  "unsigned": false,
59
202
  "autoincrement": false,
60
203
  "primary": false,
61
204
  "nullable": false,
205
+ "unique": false,
206
+ "length": null,
207
+ "precision": null,
208
+ "scale": null,
209
+ "default": null,
210
+ "comment": null,
211
+ "collation": null,
212
+ "enumItems": [],
62
213
  "mappedType": "text"
63
214
  },
64
- "file_name": {
65
- "name": "file_name",
66
- "type": "text",
215
+ "updated_at": {
216
+ "name": "updated_at",
217
+ "type": "timestamptz(6)",
67
218
  "unsigned": false,
68
219
  "autoincrement": false,
69
220
  "primary": false,
70
221
  "nullable": false,
71
- "mappedType": "text"
222
+ "unique": false,
223
+ "length": 6,
224
+ "precision": null,
225
+ "scale": null,
226
+ "default": null,
227
+ "comment": null,
228
+ "collation": null,
229
+ "enumItems": [],
230
+ "mappedType": "datetime"
231
+ }
232
+ },
233
+ "indexes": [
234
+ {
235
+ "columnNames": [
236
+ "code"
237
+ ],
238
+ "composite": false,
239
+ "constraint": true,
240
+ "keyName": "attachment_partitions_code_unique",
241
+ "primary": false,
242
+ "unique": true
72
243
  },
73
- "mime_type": {
74
- "name": "mime_type",
75
- "type": "text",
244
+ {
245
+ "columnNames": [
246
+ "id"
247
+ ],
248
+ "composite": false,
249
+ "constraint": true,
250
+ "keyName": "attachment_partitions_pkey",
251
+ "primary": true,
252
+ "unique": true
253
+ },
254
+ {
255
+ "columnNames": [
256
+ "tenant_id"
257
+ ],
258
+ "composite": false,
259
+ "constraint": false,
260
+ "keyName": "attachment_partitions_tenant_idx",
261
+ "primary": false,
262
+ "unique": false
263
+ }
264
+ ],
265
+ "checks": [],
266
+ "triggers": [],
267
+ "foreignKeys": {},
268
+ "comment": null
269
+ },
270
+ {
271
+ "name": "attachment_quota_reservations",
272
+ "schema": "public",
273
+ "columns": {
274
+ "actual_bytes": {
275
+ "name": "actual_bytes",
276
+ "type": "bigint",
277
+ "unsigned": false,
278
+ "autoincrement": false,
279
+ "primary": false,
280
+ "nullable": true,
281
+ "unique": false,
282
+ "length": null,
283
+ "precision": null,
284
+ "scale": null,
285
+ "default": null,
286
+ "comment": null,
287
+ "collation": null,
288
+ "enumItems": [],
289
+ "mappedType": "bigint"
290
+ },
291
+ "created_at": {
292
+ "name": "created_at",
293
+ "type": "timestamptz(6)",
76
294
  "unsigned": false,
77
295
  "autoincrement": false,
78
296
  "primary": false,
79
297
  "nullable": false,
80
- "mappedType": "text"
298
+ "unique": false,
299
+ "length": 6,
300
+ "precision": null,
301
+ "scale": null,
302
+ "default": null,
303
+ "comment": null,
304
+ "collation": null,
305
+ "enumItems": [],
306
+ "mappedType": "datetime"
81
307
  },
82
- "file_size": {
83
- "name": "file_size",
84
- "type": "int",
308
+ "expires_at": {
309
+ "name": "expires_at",
310
+ "type": "timestamptz(6)",
311
+ "unsigned": false,
312
+ "autoincrement": false,
313
+ "primary": false,
314
+ "nullable": true,
315
+ "unique": false,
316
+ "length": 6,
317
+ "precision": null,
318
+ "scale": null,
319
+ "default": null,
320
+ "comment": null,
321
+ "collation": null,
322
+ "enumItems": [],
323
+ "mappedType": "datetime"
324
+ },
325
+ "id": {
326
+ "name": "id",
327
+ "type": "uuid",
328
+ "unsigned": false,
329
+ "autoincrement": false,
330
+ "primary": true,
331
+ "nullable": false,
332
+ "unique": false,
333
+ "length": null,
334
+ "precision": null,
335
+ "scale": null,
336
+ "default": null,
337
+ "comment": null,
338
+ "collation": null,
339
+ "enumItems": [],
340
+ "mappedType": "uuid"
341
+ },
342
+ "lease_token": {
343
+ "name": "lease_token",
344
+ "type": "uuid",
85
345
  "unsigned": false,
86
346
  "autoincrement": false,
87
347
  "primary": false,
88
348
  "nullable": false,
89
- "mappedType": "integer"
349
+ "unique": false,
350
+ "length": null,
351
+ "precision": null,
352
+ "scale": null,
353
+ "default": null,
354
+ "comment": null,
355
+ "collation": null,
356
+ "enumItems": [],
357
+ "mappedType": "uuid"
90
358
  },
91
- "storage_driver": {
92
- "name": "storage_driver",
93
- "type": "text",
359
+ "organization_id": {
360
+ "name": "organization_id",
361
+ "type": "uuid",
94
362
  "unsigned": false,
95
363
  "autoincrement": false,
96
364
  "primary": false,
97
365
  "nullable": false,
98
- "default": "'local'",
366
+ "unique": false,
367
+ "length": null,
368
+ "precision": null,
369
+ "scale": null,
370
+ "default": null,
371
+ "comment": null,
372
+ "collation": null,
373
+ "enumItems": [],
374
+ "mappedType": "uuid"
375
+ },
376
+ "partition_code": {
377
+ "name": "partition_code",
378
+ "type": "text",
379
+ "unsigned": false,
380
+ "autoincrement": false,
381
+ "primary": false,
382
+ "nullable": true,
383
+ "unique": false,
384
+ "length": null,
385
+ "precision": null,
386
+ "scale": null,
387
+ "default": null,
388
+ "comment": null,
389
+ "collation": null,
390
+ "enumItems": [],
99
391
  "mappedType": "text"
100
392
  },
101
- "storage_path": {
102
- "name": "storage_path",
393
+ "reserved_bytes": {
394
+ "name": "reserved_bytes",
395
+ "type": "bigint",
396
+ "unsigned": false,
397
+ "autoincrement": false,
398
+ "primary": false,
399
+ "nullable": false,
400
+ "unique": false,
401
+ "length": null,
402
+ "precision": null,
403
+ "scale": null,
404
+ "default": null,
405
+ "comment": null,
406
+ "collation": null,
407
+ "enumItems": [],
408
+ "mappedType": "bigint"
409
+ },
410
+ "source": {
411
+ "name": "source",
103
412
  "type": "text",
104
413
  "unsigned": false,
105
414
  "autoincrement": false,
106
415
  "primary": false,
107
416
  "nullable": false,
417
+ "unique": false,
418
+ "length": null,
419
+ "precision": null,
420
+ "scale": null,
421
+ "default": null,
422
+ "comment": null,
423
+ "collation": null,
424
+ "enumItems": [],
108
425
  "mappedType": "text"
109
426
  },
110
- "storage_metadata": {
111
- "name": "storage_metadata",
112
- "type": "jsonb",
427
+ "status": {
428
+ "name": "status",
429
+ "type": "text",
113
430
  "unsigned": false,
114
431
  "autoincrement": false,
115
432
  "primary": false,
116
- "nullable": true,
117
- "mappedType": "json"
433
+ "nullable": false,
434
+ "unique": false,
435
+ "length": null,
436
+ "precision": null,
437
+ "scale": null,
438
+ "default": "'reserved'",
439
+ "comment": null,
440
+ "collation": null,
441
+ "enumItems": [],
442
+ "mappedType": "text"
118
443
  },
119
- "url": {
120
- "name": "url",
444
+ "storage_driver": {
445
+ "name": "storage_driver",
121
446
  "type": "text",
122
447
  "unsigned": false,
123
448
  "autoincrement": false,
124
449
  "primary": false,
125
450
  "nullable": false,
451
+ "unique": false,
452
+ "length": null,
453
+ "precision": null,
454
+ "scale": null,
455
+ "default": null,
456
+ "comment": null,
457
+ "collation": null,
458
+ "enumItems": [],
126
459
  "mappedType": "text"
127
460
  },
128
- "content": {
129
- "name": "content",
461
+ "storage_path": {
462
+ "name": "storage_path",
130
463
  "type": "text",
131
464
  "unsigned": false,
132
465
  "autoincrement": false,
133
466
  "primary": false,
134
- "nullable": true,
467
+ "nullable": false,
468
+ "unique": false,
469
+ "length": null,
470
+ "precision": null,
471
+ "scale": null,
472
+ "default": null,
473
+ "comment": null,
474
+ "collation": null,
475
+ "enumItems": [],
135
476
  "mappedType": "text"
136
477
  },
137
- "created_at": {
138
- "name": "created_at",
139
- "type": "timestamptz",
478
+ "tenant_id": {
479
+ "name": "tenant_id",
480
+ "type": "uuid",
481
+ "unsigned": false,
482
+ "autoincrement": false,
483
+ "primary": false,
484
+ "nullable": false,
485
+ "unique": true,
486
+ "length": null,
487
+ "precision": null,
488
+ "scale": null,
489
+ "default": null,
490
+ "comment": null,
491
+ "collation": null,
492
+ "enumItems": [],
493
+ "mappedType": "uuid"
494
+ },
495
+ "updated_at": {
496
+ "name": "updated_at",
497
+ "type": "timestamptz(6)",
140
498
  "unsigned": false,
141
499
  "autoincrement": false,
142
500
  "primary": false,
143
501
  "nullable": false,
502
+ "unique": false,
144
503
  "length": 6,
504
+ "precision": null,
505
+ "scale": null,
506
+ "default": null,
507
+ "comment": null,
508
+ "collation": null,
509
+ "enumItems": [],
145
510
  "mappedType": "datetime"
511
+ },
512
+ "upload_token_hash": {
513
+ "name": "upload_token_hash",
514
+ "type": "text",
515
+ "unsigned": false,
516
+ "autoincrement": false,
517
+ "primary": false,
518
+ "nullable": true,
519
+ "unique": false,
520
+ "length": null,
521
+ "precision": null,
522
+ "scale": null,
523
+ "default": null,
524
+ "comment": null,
525
+ "collation": null,
526
+ "enumItems": [],
527
+ "mappedType": "text"
146
528
  }
147
529
  },
148
- "name": "attachments",
149
- "schema": "public",
150
530
  "indexes": [
151
531
  {
152
532
  "columnNames": [
153
- "record_id"
533
+ "expires_at"
154
534
  ],
155
535
  "composite": false,
156
- "keyName": "attachments_entity_record_idx",
157
536
  "constraint": false,
537
+ "keyName": "attachment_quota_reservations_expires_idx",
158
538
  "primary": false,
159
539
  "unique": false
160
540
  },
161
541
  {
162
542
  "columnNames": [
163
- "partition_code"
543
+ "id"
164
544
  ],
165
545
  "composite": false,
166
- "keyName": "attachments_partition_code_idx",
167
- "constraint": false,
168
- "primary": false,
169
- "unique": false
546
+ "constraint": true,
547
+ "keyName": "attachment_quota_reservations_pkey",
548
+ "primary": true,
549
+ "unique": true
170
550
  },
171
551
  {
172
- "keyName": "attachments_pkey",
173
552
  "columnNames": [
174
- "id"
553
+ "tenant_id",
554
+ "storage_driver",
555
+ "storage_path"
175
556
  ],
176
- "composite": false,
557
+ "composite": true,
177
558
  "constraint": true,
178
- "primary": true,
559
+ "keyName": "attachment_quota_reservations_scope_path_unique",
560
+ "primary": false,
179
561
  "unique": true
562
+ },
563
+ {
564
+ "columnNames": [
565
+ "tenant_id",
566
+ "status"
567
+ ],
568
+ "composite": true,
569
+ "constraint": false,
570
+ "keyName": "attachment_quota_reservations_tenant_status_idx",
571
+ "primary": false,
572
+ "unique": false
180
573
  }
181
574
  ],
182
575
  "checks": [],
576
+ "triggers": [],
183
577
  "foreignKeys": {},
184
- "nativeEnums": {}
578
+ "comment": null
185
579
  },
186
580
  {
581
+ "name": "attachments",
582
+ "schema": "public",
187
583
  "columns": {
188
- "id": {
189
- "name": "id",
190
- "type": "uuid",
584
+ "content": {
585
+ "name": "content",
586
+ "type": "text",
587
+ "unsigned": false,
588
+ "autoincrement": false,
589
+ "primary": false,
590
+ "nullable": true,
591
+ "unique": false,
592
+ "length": null,
593
+ "precision": null,
594
+ "scale": null,
595
+ "default": null,
596
+ "comment": null,
597
+ "collation": null,
598
+ "enumItems": [],
599
+ "mappedType": "text"
600
+ },
601
+ "created_at": {
602
+ "name": "created_at",
603
+ "type": "timestamptz(6)",
191
604
  "unsigned": false,
192
605
  "autoincrement": false,
193
606
  "primary": false,
194
607
  "nullable": false,
195
- "default": "gen_random_uuid()",
196
- "mappedType": "uuid"
608
+ "unique": false,
609
+ "length": 6,
610
+ "precision": null,
611
+ "scale": null,
612
+ "default": null,
613
+ "comment": null,
614
+ "collation": null,
615
+ "enumItems": [],
616
+ "mappedType": "datetime"
197
617
  },
198
- "code": {
199
- "name": "code",
618
+ "entity_id": {
619
+ "name": "entity_id",
200
620
  "type": "text",
201
621
  "unsigned": false,
202
622
  "autoincrement": false,
203
623
  "primary": false,
204
624
  "nullable": false,
625
+ "unique": false,
626
+ "length": null,
627
+ "precision": null,
628
+ "scale": null,
629
+ "default": null,
630
+ "comment": null,
631
+ "collation": null,
632
+ "enumItems": [],
205
633
  "mappedType": "text"
206
634
  },
207
- "title": {
208
- "name": "title",
635
+ "file_name": {
636
+ "name": "file_name",
209
637
  "type": "text",
210
638
  "unsigned": false,
211
639
  "autoincrement": false,
212
640
  "primary": false,
213
641
  "nullable": false,
642
+ "unique": false,
643
+ "length": null,
644
+ "precision": null,
645
+ "scale": null,
646
+ "default": null,
647
+ "comment": null,
648
+ "collation": null,
649
+ "enumItems": [],
214
650
  "mappedType": "text"
215
651
  },
216
- "description": {
217
- "name": "description",
218
- "type": "text",
652
+ "file_size": {
653
+ "name": "file_size",
654
+ "type": "int",
219
655
  "unsigned": false,
220
656
  "autoincrement": false,
221
657
  "primary": false,
222
- "nullable": true,
223
- "mappedType": "text"
658
+ "nullable": false,
659
+ "unique": false,
660
+ "length": null,
661
+ "precision": null,
662
+ "scale": null,
663
+ "default": null,
664
+ "comment": null,
665
+ "collation": null,
666
+ "enumItems": [],
667
+ "mappedType": "integer"
224
668
  },
225
- "storage_driver": {
226
- "name": "storage_driver",
669
+ "id": {
670
+ "name": "id",
671
+ "type": "uuid",
672
+ "unsigned": false,
673
+ "autoincrement": false,
674
+ "primary": true,
675
+ "nullable": false,
676
+ "unique": false,
677
+ "length": null,
678
+ "precision": null,
679
+ "scale": null,
680
+ "default": "gen_random_uuid()",
681
+ "comment": null,
682
+ "collation": null,
683
+ "enumItems": [],
684
+ "mappedType": "uuid"
685
+ },
686
+ "mime_type": {
687
+ "name": "mime_type",
227
688
  "type": "text",
228
689
  "unsigned": false,
229
690
  "autoincrement": false,
230
691
  "primary": false,
231
692
  "nullable": false,
232
- "default": "'local'",
693
+ "unique": false,
694
+ "length": null,
695
+ "precision": null,
696
+ "scale": null,
697
+ "default": null,
698
+ "comment": null,
699
+ "collation": null,
700
+ "enumItems": [],
233
701
  "mappedType": "text"
234
702
  },
235
- "config_json": {
236
- "name": "config_json",
237
- "type": "jsonb",
703
+ "organization_id": {
704
+ "name": "organization_id",
705
+ "type": "uuid",
238
706
  "unsigned": false,
239
707
  "autoincrement": false,
240
708
  "primary": false,
241
709
  "nullable": true,
242
- "mappedType": "json"
710
+ "unique": false,
711
+ "length": null,
712
+ "precision": null,
713
+ "scale": null,
714
+ "default": null,
715
+ "comment": null,
716
+ "collation": null,
717
+ "enumItems": [],
718
+ "mappedType": "uuid"
243
719
  },
244
- "is_public": {
245
- "name": "is_public",
246
- "type": "boolean",
720
+ "partition_code": {
721
+ "name": "partition_code",
722
+ "type": "text",
247
723
  "unsigned": false,
248
724
  "autoincrement": false,
249
725
  "primary": false,
250
726
  "nullable": false,
251
- "default": "false",
252
- "mappedType": "boolean"
727
+ "unique": false,
728
+ "length": null,
729
+ "precision": null,
730
+ "scale": null,
731
+ "default": null,
732
+ "comment": null,
733
+ "collation": null,
734
+ "enumItems": [],
735
+ "mappedType": "text"
253
736
  },
254
- "requires_ocr": {
255
- "name": "requires_ocr",
256
- "type": "boolean",
737
+ "record_id": {
738
+ "name": "record_id",
739
+ "type": "text",
257
740
  "unsigned": false,
258
741
  "autoincrement": false,
259
742
  "primary": false,
260
743
  "nullable": false,
261
- "default": "true",
262
- "mappedType": "boolean"
744
+ "unique": false,
745
+ "length": null,
746
+ "precision": null,
747
+ "scale": null,
748
+ "default": null,
749
+ "comment": null,
750
+ "collation": null,
751
+ "enumItems": [],
752
+ "mappedType": "text"
263
753
  },
264
- "ocr_model": {
265
- "name": "ocr_model",
754
+ "storage_driver": {
755
+ "name": "storage_driver",
266
756
  "type": "text",
267
757
  "unsigned": false,
268
758
  "autoincrement": false,
269
759
  "primary": false,
270
- "nullable": true,
760
+ "nullable": false,
761
+ "unique": false,
762
+ "length": null,
763
+ "precision": null,
764
+ "scale": null,
765
+ "default": "'local'",
766
+ "comment": null,
767
+ "collation": null,
768
+ "enumItems": [],
271
769
  "mappedType": "text"
272
770
  },
273
- "organization_id": {
274
- "name": "organization_id",
275
- "type": "uuid",
771
+ "storage_metadata": {
772
+ "name": "storage_metadata",
773
+ "type": "jsonb",
276
774
  "unsigned": false,
277
775
  "autoincrement": false,
278
776
  "primary": false,
279
777
  "nullable": true,
280
- "mappedType": "uuid"
778
+ "unique": false,
779
+ "length": null,
780
+ "precision": null,
781
+ "scale": null,
782
+ "default": null,
783
+ "comment": null,
784
+ "collation": null,
785
+ "enumItems": [],
786
+ "mappedType": "json"
787
+ },
788
+ "storage_path": {
789
+ "name": "storage_path",
790
+ "type": "text",
791
+ "unsigned": false,
792
+ "autoincrement": false,
793
+ "primary": false,
794
+ "nullable": false,
795
+ "unique": false,
796
+ "length": null,
797
+ "precision": null,
798
+ "scale": null,
799
+ "default": null,
800
+ "comment": null,
801
+ "collation": null,
802
+ "enumItems": [],
803
+ "mappedType": "text"
281
804
  },
282
805
  "tenant_id": {
283
806
  "name": "tenant_id",
@@ -286,67 +809,72 @@
286
809
  "autoincrement": false,
287
810
  "primary": false,
288
811
  "nullable": true,
812
+ "unique": false,
813
+ "length": null,
814
+ "precision": null,
815
+ "scale": null,
816
+ "default": null,
817
+ "comment": null,
818
+ "collation": null,
819
+ "enumItems": [],
289
820
  "mappedType": "uuid"
290
821
  },
291
- "created_at": {
292
- "name": "created_at",
293
- "type": "timestamptz",
294
- "unsigned": false,
295
- "autoincrement": false,
296
- "primary": false,
297
- "nullable": false,
298
- "length": 6,
299
- "mappedType": "datetime"
300
- },
301
- "updated_at": {
302
- "name": "updated_at",
303
- "type": "timestamptz",
822
+ "url": {
823
+ "name": "url",
824
+ "type": "text",
304
825
  "unsigned": false,
305
826
  "autoincrement": false,
306
827
  "primary": false,
307
828
  "nullable": false,
308
- "length": 6,
309
- "mappedType": "datetime"
829
+ "unique": false,
830
+ "length": null,
831
+ "precision": null,
832
+ "scale": null,
833
+ "default": null,
834
+ "comment": null,
835
+ "collation": null,
836
+ "enumItems": [],
837
+ "mappedType": "text"
310
838
  }
311
839
  },
312
- "name": "attachment_partitions",
313
- "schema": "public",
314
840
  "indexes": [
315
841
  {
316
- "keyName": "attachment_partitions_tenant_idx",
317
842
  "columnNames": [
318
- "tenant_id"
843
+ "record_id"
319
844
  ],
320
845
  "composite": false,
321
846
  "constraint": false,
847
+ "keyName": "attachments_entity_record_idx",
322
848
  "primary": false,
323
849
  "unique": false
324
850
  },
325
851
  {
326
- "keyName": "attachment_partitions_code_unique",
327
852
  "columnNames": [
328
- "code"
853
+ "partition_code"
329
854
  ],
330
855
  "composite": false,
331
- "constraint": true,
856
+ "constraint": false,
857
+ "keyName": "attachments_partition_code_idx",
332
858
  "primary": false,
333
- "unique": true
859
+ "unique": false
334
860
  },
335
861
  {
336
- "keyName": "attachment_partitions_pkey",
337
862
  "columnNames": [
338
863
  "id"
339
864
  ],
340
865
  "composite": false,
341
866
  "constraint": true,
867
+ "keyName": "attachments_pkey",
342
868
  "primary": true,
343
869
  "unique": true
344
870
  }
345
871
  ],
346
872
  "checks": [],
873
+ "triggers": [],
347
874
  "foreignKeys": {},
348
- "nativeEnums": {}
875
+ "comment": null
349
876
  }
350
877
  ],
878
+ "views": [],
351
879
  "nativeEnums": {}
352
- }
880
+ }