@tstdl/base 0.91.50 → 0.91.52
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.
- package/ai/data-extracting.d.ts +1 -0
- package/ai/data-extracting.js +62 -0
- package/authentication/server/authentication.api-controller.js +4 -4
- package/cancellation/token.d.ts +1 -2
- package/cancellation/token.js +1 -1
- package/core.d.ts +1 -1
- package/core.js +1 -1
- package/document-management/api/document-management.api.d.ts +753 -0
- package/document-management/api/document-management.api.js +222 -0
- package/document-management/api/index.d.ts +1 -0
- package/document-management/api/index.js +1 -0
- package/document-management/drizzle/0000_wakeful_firebrand.sql +228 -0
- package/document-management/drizzle/meta/0000_snapshot.json +1538 -0
- package/document-management/drizzle/meta/_journal.json +13 -0
- package/document-management/drizzle.config.d.ts +2 -0
- package/document-management/drizzle.config.js +11 -0
- package/document-management/index.d.ts +5 -0
- package/document-management/index.js +5 -0
- package/document-management/localizations/english.d.ts +2 -0
- package/document-management/localizations/english.js +9 -0
- package/document-management/localizations/german.d.ts +2 -0
- package/document-management/localizations/german.js +9 -0
- package/document-management/localizations/index.d.ts +5 -0
- package/document-management/localizations/index.js +9 -0
- package/document-management/localizations/localization.d.ts +9 -0
- package/document-management/localizations/localization.js +2 -0
- package/document-management/models/document-category.model.d.ts +4 -0
- package/document-management/models/document-category.model.js +18 -0
- package/document-management/models/document-collection-document.model.d.ts +7 -0
- package/document-management/models/document-collection-document.model.js +33 -0
- package/document-management/models/document-collection.model.d.ts +3 -0
- package/document-management/models/document-collection.model.js +14 -0
- package/document-management/models/document-file.model.d.ts +7 -0
- package/document-management/models/document-file.model.js +33 -0
- package/document-management/models/document-property-value.model.d.ts +21 -0
- package/document-management/models/document-property-value.model.js +58 -0
- package/document-management/models/document-property.model.d.ts +11 -0
- package/document-management/models/document-property.model.js +30 -0
- package/document-management/models/document-request-collection.model.d.ts +6 -0
- package/document-management/models/document-request-collection.model.js +28 -0
- package/document-management/models/document-request-file.model.d.ts +11 -0
- package/document-management/models/document-request-file.model.js +56 -0
- package/document-management/models/document-request-template.d.ts +10 -0
- package/document-management/models/document-request-template.js +39 -0
- package/document-management/models/document-request.model.d.ts +9 -0
- package/document-management/models/document-request.model.js +37 -0
- package/document-management/models/document-requests-template.d.ts +5 -0
- package/document-management/models/document-requests-template.js +23 -0
- package/document-management/models/document-type-property.model.d.ts +6 -0
- package/document-management/models/document-type-property.model.js +28 -0
- package/document-management/models/document-type.model.d.ts +7 -0
- package/document-management/models/document-type.model.js +32 -0
- package/document-management/models/document.model.d.ts +9 -0
- package/document-management/models/document.model.js +44 -0
- package/document-management/models/index.d.ts +15 -0
- package/document-management/models/index.js +15 -0
- package/document-management/models/schemas.d.ts +33 -0
- package/document-management/models/schemas.js +34 -0
- package/document-management/models/service-models/categories-and-types.view-model.d.ts +6 -0
- package/document-management/models/service-models/categories-and-types.view-model.js +24 -0
- package/document-management/models/service-models/document-folders.view-model.d.ts +22 -0
- package/document-management/models/service-models/document-folders.view-model.js +56 -0
- package/document-management/models/service-models/document-requests-template.view-model.d.ts +8 -0
- package/document-management/models/service-models/document-requests-template.view-model.js +26 -0
- package/document-management/models/service-models/document.service-model.d.ts +262 -0
- package/document-management/models/service-models/document.service-model.js +50 -0
- package/document-management/models/service-models/document.view-model.d.ts +33 -0
- package/document-management/models/service-models/document.view-model.js +99 -0
- package/document-management/models/service-models/index.d.ts +8 -0
- package/document-management/models/service-models/index.js +8 -0
- package/document-management/models/service-models/normalized-document-collection-view.model.d.ts +73 -0
- package/document-management/models/service-models/normalized-document-collection-view.model.js +110 -0
- package/document-management/models/service-models/normalized-requests-template-data.model.d.ts +16 -0
- package/document-management/models/service-models/normalized-requests-template-data.model.js +13 -0
- package/document-management/models/service-models/stats.view-model.d.ts +6 -0
- package/document-management/models/service-models/stats.view-model.js +32 -0
- package/document-management/module.d.ts +11 -0
- package/document-management/module.js +27 -0
- package/document-management/services/document-management.service.d.ts +65 -0
- package/document-management/services/document-management.service.js +376 -0
- package/document-management/services/index.d.ts +1 -0
- package/document-management/services/index.js +1 -0
- package/examples/document-management/main.d.ts +1 -0
- package/examples/document-management/main.js +30 -0
- package/examples/orm/drizzle.config.js +2 -1
- package/examples/orm/schemas.d.ts +1 -1
- package/examples/orm/user.model.d.ts +1 -2
- package/examples/orm/user.model.js +0 -1
- package/http/server/node/node-http-server.js +5 -5
- package/injector/injector.d.ts +4 -1
- package/injector/injector.js +4 -1
- package/injector/interfaces.d.ts +3 -3
- package/json-path/json-path.d.ts +2 -0
- package/json-path/json-path.js +7 -0
- package/message-bus/message-bus.d.ts +4 -6
- package/orm/database-schema.d.ts +3 -0
- package/orm/database-schema.js +6 -2
- package/orm/database.d.ts +6 -0
- package/orm/database.js +14 -0
- package/orm/decorators.d.ts +25 -2
- package/orm/decorators.js +15 -0
- package/orm/drizzle/index.d.ts +1 -0
- package/orm/drizzle/index.js +1 -0
- package/orm/drizzle/schema-converter.d.ts +37 -8
- package/orm/drizzle/schema-converter.js +121 -40
- package/orm/entity.d.ts +15 -12
- package/orm/entity.js +24 -11
- package/orm/index.d.ts +3 -2
- package/orm/index.js +3 -2
- package/orm/module.d.ts +6 -0
- package/orm/module.js +15 -0
- package/orm/query-converter.d.ts +5 -0
- package/orm/query-converter.js +114 -0
- package/orm/query.d.ts +15 -13
- package/orm/repository.d.ts +90 -31
- package/orm/repository.js +357 -55
- package/orm/schemas/index.d.ts +3 -0
- package/orm/schemas/index.js +3 -0
- package/orm/schemas/json.d.ts +9 -0
- package/orm/schemas/json.js +19 -0
- package/orm/schemas/numeric-date.d.ts +8 -0
- package/orm/schemas/numeric-date.js +13 -0
- package/orm/schemas/timestamp.d.ts +10 -0
- package/orm/schemas/timestamp.js +20 -0
- package/orm/transaction.d.ts +29 -0
- package/orm/transaction.js +73 -0
- package/orm/types.d.ts +15 -8
- package/orm/types.js +3 -2
- package/package.json +23 -12
- package/{rxjs → rxjs-utils}/reject-error.d.ts +1 -1
- package/{rxjs → rxjs-utils}/retry-backoff.d.ts +2 -2
- package/{rxjs → rxjs-utils}/slow-array.d.ts +7 -7
- package/{rxjs → rxjs-utils}/slow-array.js +2 -2
- package/{rxjs → rxjs-utils}/start-with-provider.d.ts +1 -1
- package/{rxjs → rxjs-utils}/teardown.d.ts +1 -1
- package/{rxjs → rxjs-utils}/untrack.d.ts +1 -1
- package/schema/decorators/types.d.ts +2 -2
- package/schema/schemas/number.d.ts +1 -1
- package/signals/pipe.d.ts +1 -1
- package/signals/pipe.js +1 -2
- package/sse/server-sent-events.d.ts +54 -0
- package/sse/server-sent-events.js +54 -0
- package/types.d.ts +5 -1
- package/utils/comparison.d.ts +2 -1
- package/utils/comparison.js +4 -3
- package/utils/compression.d.ts +4 -4
- package/utils/compression.js +35 -43
- package/utils/object/dereference.d.ts +6 -4
- package/utils/object/dereference.js +20 -8
- package/utils/object/object.d.ts +2 -0
- package/utils/object/object.js +20 -0
- /package/{rxjs → rxjs-utils}/cast.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/cast.js +0 -0
- /package/{rxjs → rxjs-utils}/index.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/index.js +0 -0
- /package/{rxjs → rxjs-utils}/noop.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/noop.js +0 -0
- /package/{rxjs → rxjs-utils}/reject-error.js +0 -0
- /package/{rxjs → rxjs-utils}/retry-backoff.js +0 -0
- /package/{rxjs → rxjs-utils}/start-with-provider.js +0 -0
- /package/{rxjs → rxjs-utils}/teardown.js +0 -0
- /package/{rxjs → rxjs-utils}/timing.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/timing.js +0 -0
- /package/{rxjs → rxjs-utils}/untrack.js +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { compileClient, defineApi } from '../../api/index.js';
|
|
8
|
+
import { ReplaceClass } from '../../injector/decorators.js';
|
|
9
|
+
import { boolean, literal, nullable, object, optional, string } from '../../schema/index.js';
|
|
10
|
+
import { megabyte } from '../../utils/units.js';
|
|
11
|
+
import { CategoryAndTypesView, Document, DocumentCategory, DocumentCollection, DocumentManagementData, DocumentRequest, DocumentRequestFile, DocumentRequestTemplate, DocumentRequestsTemplate, DocumentRequestsTemplateData, DocumentType, addOrArchiveDocumentToOrFromCollectionParametersSchema, applyDocumentRequestsTemplateParametersSchema, approveDocumentRequestFileParametersSchema, createCollectionParametersSchema, createDocumentCategoryParametersSchema, createDocumentParametersSchema, createDocumentRequestFileParametersSchema, createDocumentRequestParametersSchema, createDocumentRequestTemplateParametersSchema, createDocumentRequestsTemplateParametersSchema, createDocumentTypeParametersSchema, deleteDocumentRequestFileParametersSchema, deleteDocumentRequestParametersSchema, deleteDocumentRequestTemplateParametersSchema, deleteDocumentRequestsTemplateParametersSchema, loadDataParametersSchema, rejectDocumentRequestFileParametersSchema, updateDocumentParametersSchema, updateDocumentRequestFileParametersSchema, updateDocumentRequestParametersSchema, updateDocumentRequestTemplateParametersSchema, updateDocumentRequestsTemplateParametersSchema } from '../models/index.js';
|
|
12
|
+
export const documentManagementApiDefinition = defineApi({
|
|
13
|
+
resource: 'document-management',
|
|
14
|
+
endpoints: {
|
|
15
|
+
loadData: {
|
|
16
|
+
resource: 'data',
|
|
17
|
+
method: 'GET',
|
|
18
|
+
parameters: loadDataParametersSchema,
|
|
19
|
+
result: DocumentManagementData,
|
|
20
|
+
credentials: true
|
|
21
|
+
},
|
|
22
|
+
loadDocumentRequestsTemplateData: {
|
|
23
|
+
resource: 'views/document-requests-template-data',
|
|
24
|
+
method: 'GET',
|
|
25
|
+
result: DocumentRequestsTemplateData,
|
|
26
|
+
credentials: true
|
|
27
|
+
},
|
|
28
|
+
loadAvailableCategoriesAndTypes: {
|
|
29
|
+
resource: 'views/categories-and-types',
|
|
30
|
+
method: 'GET',
|
|
31
|
+
result: CategoryAndTypesView,
|
|
32
|
+
credentials: true
|
|
33
|
+
},
|
|
34
|
+
loadFileContent: {
|
|
35
|
+
resource: 'files/:id/content',
|
|
36
|
+
method: 'GET',
|
|
37
|
+
parameters: object({
|
|
38
|
+
id: string(),
|
|
39
|
+
title: nullable(string()),
|
|
40
|
+
download: optional(boolean({ coerce: true }))
|
|
41
|
+
}),
|
|
42
|
+
result: Uint8Array,
|
|
43
|
+
credentials: true
|
|
44
|
+
},
|
|
45
|
+
getFileContentUrl: {
|
|
46
|
+
resource: 'files/:id/content/url',
|
|
47
|
+
method: 'GET',
|
|
48
|
+
parameters: object({
|
|
49
|
+
id: string(),
|
|
50
|
+
title: nullable(string()),
|
|
51
|
+
download: optional(boolean({ coerce: true }))
|
|
52
|
+
}),
|
|
53
|
+
result: string(),
|
|
54
|
+
credentials: true
|
|
55
|
+
},
|
|
56
|
+
createCategory: {
|
|
57
|
+
resource: 'categories',
|
|
58
|
+
method: 'POST',
|
|
59
|
+
parameters: createDocumentCategoryParametersSchema,
|
|
60
|
+
result: DocumentCategory,
|
|
61
|
+
credentials: true
|
|
62
|
+
},
|
|
63
|
+
createType: {
|
|
64
|
+
resource: 'types',
|
|
65
|
+
method: 'POST',
|
|
66
|
+
parameters: createDocumentTypeParametersSchema,
|
|
67
|
+
result: DocumentType,
|
|
68
|
+
credentials: true
|
|
69
|
+
},
|
|
70
|
+
createCollection: {
|
|
71
|
+
resource: 'collections',
|
|
72
|
+
method: 'POST',
|
|
73
|
+
parameters: createCollectionParametersSchema,
|
|
74
|
+
result: DocumentCollection,
|
|
75
|
+
credentials: true
|
|
76
|
+
},
|
|
77
|
+
createDocument: {
|
|
78
|
+
resource: 'documents',
|
|
79
|
+
method: 'POST',
|
|
80
|
+
parameters: createDocumentParametersSchema,
|
|
81
|
+
body: Uint8Array,
|
|
82
|
+
maxBytes: 50 * megabyte,
|
|
83
|
+
result: Document,
|
|
84
|
+
credentials: true
|
|
85
|
+
},
|
|
86
|
+
createDocumentRequestsTemplate: {
|
|
87
|
+
resource: 'document-requests-template',
|
|
88
|
+
method: 'POST',
|
|
89
|
+
parameters: createDocumentRequestsTemplateParametersSchema,
|
|
90
|
+
result: DocumentRequestsTemplate,
|
|
91
|
+
credentials: true
|
|
92
|
+
},
|
|
93
|
+
updateDocumentRequestsTemplate: {
|
|
94
|
+
resource: 'document-requests-template/:id',
|
|
95
|
+
method: 'PATCH',
|
|
96
|
+
parameters: updateDocumentRequestsTemplateParametersSchema,
|
|
97
|
+
result: DocumentRequestsTemplate,
|
|
98
|
+
credentials: true
|
|
99
|
+
},
|
|
100
|
+
applyDocumentRequestsTemplate: {
|
|
101
|
+
resource: 'document-requests-template/:id',
|
|
102
|
+
method: 'POST',
|
|
103
|
+
parameters: applyDocumentRequestsTemplateParametersSchema,
|
|
104
|
+
result: literal('ok'),
|
|
105
|
+
credentials: true
|
|
106
|
+
},
|
|
107
|
+
deleteDocumentRequestsTemplate: {
|
|
108
|
+
resource: 'document-requests-template/:id',
|
|
109
|
+
method: 'DELETE',
|
|
110
|
+
parameters: deleteDocumentRequestsTemplateParametersSchema,
|
|
111
|
+
result: literal('ok'),
|
|
112
|
+
credentials: true
|
|
113
|
+
},
|
|
114
|
+
createDocumentRequestTemplate: {
|
|
115
|
+
resource: 'document-request-template',
|
|
116
|
+
method: 'POST',
|
|
117
|
+
parameters: createDocumentRequestTemplateParametersSchema,
|
|
118
|
+
result: DocumentRequestTemplate,
|
|
119
|
+
credentials: true
|
|
120
|
+
},
|
|
121
|
+
updateDocumentRequestTemplate: {
|
|
122
|
+
resource: 'document-request-template/:id',
|
|
123
|
+
method: 'PATCH',
|
|
124
|
+
parameters: updateDocumentRequestTemplateParametersSchema,
|
|
125
|
+
result: DocumentRequestTemplate,
|
|
126
|
+
credentials: true
|
|
127
|
+
},
|
|
128
|
+
deleteDocumentRequestTemplate: {
|
|
129
|
+
resource: 'document-request-template/:id',
|
|
130
|
+
method: 'DELETE',
|
|
131
|
+
parameters: deleteDocumentRequestTemplateParametersSchema,
|
|
132
|
+
result: literal('ok'),
|
|
133
|
+
credentials: true
|
|
134
|
+
},
|
|
135
|
+
createDocumentRequestFile: {
|
|
136
|
+
resource: 'requests/:requestId/files',
|
|
137
|
+
method: 'POST',
|
|
138
|
+
parameters: createDocumentRequestFileParametersSchema,
|
|
139
|
+
body: Uint8Array,
|
|
140
|
+
result: DocumentRequestFile,
|
|
141
|
+
maxBytes: 50 * megabyte,
|
|
142
|
+
credentials: true
|
|
143
|
+
},
|
|
144
|
+
approveDocumentRequestFile: {
|
|
145
|
+
resource: 'request-files/:id/create-document',
|
|
146
|
+
method: 'POST',
|
|
147
|
+
parameters: approveDocumentRequestFileParametersSchema,
|
|
148
|
+
result: Document,
|
|
149
|
+
credentials: true
|
|
150
|
+
},
|
|
151
|
+
rejectDocumentRequestFile: {
|
|
152
|
+
resource: 'request-files/:id/reject',
|
|
153
|
+
method: 'POST',
|
|
154
|
+
parameters: rejectDocumentRequestFileParametersSchema,
|
|
155
|
+
result: literal('ok'),
|
|
156
|
+
credentials: true
|
|
157
|
+
},
|
|
158
|
+
updateDocumentRequestFile: {
|
|
159
|
+
resource: 'request-files/:id',
|
|
160
|
+
method: 'PATCH',
|
|
161
|
+
parameters: updateDocumentRequestFileParametersSchema,
|
|
162
|
+
result: DocumentRequestFile,
|
|
163
|
+
credentials: true
|
|
164
|
+
},
|
|
165
|
+
deleteDocumentRequestFile: {
|
|
166
|
+
resource: 'request-files/:id',
|
|
167
|
+
method: 'DELETE',
|
|
168
|
+
parameters: deleteDocumentRequestFileParametersSchema,
|
|
169
|
+
result: literal('ok'),
|
|
170
|
+
credentials: true
|
|
171
|
+
},
|
|
172
|
+
createDocumentRequest: {
|
|
173
|
+
resource: 'requests',
|
|
174
|
+
method: 'POST',
|
|
175
|
+
parameters: createDocumentRequestParametersSchema,
|
|
176
|
+
result: DocumentRequest,
|
|
177
|
+
credentials: true
|
|
178
|
+
},
|
|
179
|
+
updateDocumentRequest: {
|
|
180
|
+
resource: 'requests/:id',
|
|
181
|
+
method: 'PATCH',
|
|
182
|
+
parameters: updateDocumentRequestParametersSchema,
|
|
183
|
+
result: literal('ok'),
|
|
184
|
+
credentials: true
|
|
185
|
+
},
|
|
186
|
+
deleteDocumentRequest: {
|
|
187
|
+
resource: 'requests/:id',
|
|
188
|
+
method: 'DELETE',
|
|
189
|
+
parameters: deleteDocumentRequestParametersSchema,
|
|
190
|
+
result: literal('ok'),
|
|
191
|
+
credentials: true
|
|
192
|
+
},
|
|
193
|
+
addDocumentToCollection: {
|
|
194
|
+
resource: 'collections/:collectionId/documents/:documentId',
|
|
195
|
+
method: 'PUT',
|
|
196
|
+
parameters: addOrArchiveDocumentToOrFromCollectionParametersSchema,
|
|
197
|
+
result: literal('ok'),
|
|
198
|
+
credentials: true
|
|
199
|
+
},
|
|
200
|
+
archiveDocument: {
|
|
201
|
+
resource: 'collections/:collectionId/documents/:documentId',
|
|
202
|
+
method: 'DELETE',
|
|
203
|
+
parameters: addOrArchiveDocumentToOrFromCollectionParametersSchema,
|
|
204
|
+
result: literal('ok'),
|
|
205
|
+
credentials: true
|
|
206
|
+
},
|
|
207
|
+
updateDocument: {
|
|
208
|
+
resource: 'documents/:id',
|
|
209
|
+
method: 'PATCH',
|
|
210
|
+
parameters: updateDocumentParametersSchema,
|
|
211
|
+
result: literal('ok'),
|
|
212
|
+
credentials: true
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const _DocumentManagementApi = compileClient(documentManagementApiDefinition);
|
|
217
|
+
let DocumentManagementApi = class DocumentManagementApi extends _DocumentManagementApi {
|
|
218
|
+
};
|
|
219
|
+
DocumentManagementApi = __decorate([
|
|
220
|
+
ReplaceClass(_DocumentManagementApi)
|
|
221
|
+
], DocumentManagementApi);
|
|
222
|
+
export { DocumentManagementApi };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './document-management.api.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './document-management.api.js';
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
CREATE TYPE "document_management"."document_property_data_type" AS ENUM('0', '1', '2', '3');--> statement-breakpoint
|
|
2
|
+
CREATE TABLE "document_management"."document" (
|
|
3
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
4
|
+
"file_id" uuid NOT NULL,
|
|
5
|
+
"type_id" uuid,
|
|
6
|
+
"addition" text,
|
|
7
|
+
"date" date,
|
|
8
|
+
"expiration" date,
|
|
9
|
+
"revision" integer NOT NULL,
|
|
10
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
11
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
12
|
+
"delete_timestamp" timestamp with time zone,
|
|
13
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
14
|
+
);
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
CREATE TABLE "document_management"."document_category" (
|
|
17
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
18
|
+
"label" text NOT NULL,
|
|
19
|
+
"revision" integer NOT NULL,
|
|
20
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
21
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
22
|
+
"delete_timestamp" timestamp with time zone,
|
|
23
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
24
|
+
);
|
|
25
|
+
--> statement-breakpoint
|
|
26
|
+
CREATE TABLE "document_management"."document_collection" (
|
|
27
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
28
|
+
"revision" integer NOT NULL,
|
|
29
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
30
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
31
|
+
"delete_timestamp" timestamp with time zone,
|
|
32
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
33
|
+
);
|
|
34
|
+
--> statement-breakpoint
|
|
35
|
+
CREATE TABLE "document_management"."document_collection_document" (
|
|
36
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
37
|
+
"collection_id" uuid NOT NULL,
|
|
38
|
+
"document_id" uuid NOT NULL,
|
|
39
|
+
"archive_timestamp" timestamp with time zone,
|
|
40
|
+
"revision" integer NOT NULL,
|
|
41
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
42
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
43
|
+
"delete_timestamp" timestamp with time zone,
|
|
44
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
45
|
+
);
|
|
46
|
+
--> statement-breakpoint
|
|
47
|
+
CREATE TABLE "document_management"."document_file" (
|
|
48
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
49
|
+
"original_file_name" text,
|
|
50
|
+
"mime_type" text NOT NULL,
|
|
51
|
+
"hash" text NOT NULL,
|
|
52
|
+
"size" integer NOT NULL,
|
|
53
|
+
"revision" integer NOT NULL,
|
|
54
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
55
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
56
|
+
"delete_timestamp" timestamp with time zone,
|
|
57
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
58
|
+
);
|
|
59
|
+
--> statement-breakpoint
|
|
60
|
+
CREATE TABLE "document_management"."document_property" (
|
|
61
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
62
|
+
"label" text NOT NULL,
|
|
63
|
+
"data_type" "document_management"."document_property_data_type" NOT NULL,
|
|
64
|
+
"revision" integer NOT NULL,
|
|
65
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
66
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
67
|
+
"delete_timestamp" timestamp with time zone,
|
|
68
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
69
|
+
);
|
|
70
|
+
--> statement-breakpoint
|
|
71
|
+
CREATE TABLE "document_management"."document_property_boolean_value" (
|
|
72
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
73
|
+
"document_id" uuid NOT NULL,
|
|
74
|
+
"property_id" uuid NOT NULL,
|
|
75
|
+
"value" boolean,
|
|
76
|
+
"revision" integer NOT NULL,
|
|
77
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
78
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
79
|
+
"delete_timestamp" timestamp with time zone,
|
|
80
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
81
|
+
);
|
|
82
|
+
--> statement-breakpoint
|
|
83
|
+
CREATE TABLE "document_management"."document_property_decimal_value" (
|
|
84
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
85
|
+
"document_id" uuid NOT NULL,
|
|
86
|
+
"property_id" uuid NOT NULL,
|
|
87
|
+
"value" double precision,
|
|
88
|
+
"revision" integer NOT NULL,
|
|
89
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
90
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
91
|
+
"delete_timestamp" timestamp with time zone,
|
|
92
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
93
|
+
);
|
|
94
|
+
--> statement-breakpoint
|
|
95
|
+
CREATE TABLE "document_management"."document_property_integer_value" (
|
|
96
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
97
|
+
"document_id" uuid NOT NULL,
|
|
98
|
+
"property_id" uuid NOT NULL,
|
|
99
|
+
"value" integer,
|
|
100
|
+
"revision" integer NOT NULL,
|
|
101
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
102
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
103
|
+
"delete_timestamp" timestamp with time zone,
|
|
104
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
105
|
+
);
|
|
106
|
+
--> statement-breakpoint
|
|
107
|
+
CREATE TABLE "document_management"."document_property_text_value" (
|
|
108
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
109
|
+
"document_id" uuid NOT NULL,
|
|
110
|
+
"property_id" uuid NOT NULL,
|
|
111
|
+
"value" text,
|
|
112
|
+
"revision" integer NOT NULL,
|
|
113
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
114
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
115
|
+
"delete_timestamp" timestamp with time zone,
|
|
116
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
117
|
+
);
|
|
118
|
+
--> statement-breakpoint
|
|
119
|
+
CREATE TABLE "document_management"."document_request" (
|
|
120
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
121
|
+
"type_id" uuid,
|
|
122
|
+
"required_files_count" integer NOT NULL,
|
|
123
|
+
"comment" text,
|
|
124
|
+
"completed" boolean NOT NULL,
|
|
125
|
+
"revision" integer NOT NULL,
|
|
126
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
127
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
128
|
+
"delete_timestamp" timestamp with time zone,
|
|
129
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
130
|
+
);
|
|
131
|
+
--> statement-breakpoint
|
|
132
|
+
CREATE TABLE "document_management"."document_request_collection" (
|
|
133
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
134
|
+
"request_id" uuid NOT NULL,
|
|
135
|
+
"collection_id" uuid NOT NULL,
|
|
136
|
+
"revision" integer NOT NULL,
|
|
137
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
138
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
139
|
+
"delete_timestamp" timestamp with time zone,
|
|
140
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
141
|
+
);
|
|
142
|
+
--> statement-breakpoint
|
|
143
|
+
CREATE TABLE "document_management"."document_request_file" (
|
|
144
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
145
|
+
"request_id" uuid NOT NULL,
|
|
146
|
+
"file_id" uuid NOT NULL,
|
|
147
|
+
"addition" text,
|
|
148
|
+
"created_document_id" uuid,
|
|
149
|
+
"approval" boolean,
|
|
150
|
+
"approval_comment" text,
|
|
151
|
+
"approval_timestamp" timestamp with time zone,
|
|
152
|
+
"revision" integer NOT NULL,
|
|
153
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
154
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
155
|
+
"delete_timestamp" timestamp with time zone,
|
|
156
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
157
|
+
);
|
|
158
|
+
--> statement-breakpoint
|
|
159
|
+
CREATE TABLE "document_management"."document_request_template" (
|
|
160
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
161
|
+
"requests_template_id" uuid NOT NULL,
|
|
162
|
+
"type_id" uuid,
|
|
163
|
+
"required_files_count" integer NOT NULL,
|
|
164
|
+
"comment" text,
|
|
165
|
+
"revision" integer NOT NULL,
|
|
166
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
167
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
168
|
+
"delete_timestamp" timestamp with time zone,
|
|
169
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
170
|
+
);
|
|
171
|
+
--> statement-breakpoint
|
|
172
|
+
CREATE TABLE "document_management"."document_requests_template" (
|
|
173
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
174
|
+
"label" text NOT NULL,
|
|
175
|
+
"description" text,
|
|
176
|
+
"revision" integer NOT NULL,
|
|
177
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
178
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
179
|
+
"delete_timestamp" timestamp with time zone,
|
|
180
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
181
|
+
);
|
|
182
|
+
--> statement-breakpoint
|
|
183
|
+
CREATE TABLE "document_management"."document_type" (
|
|
184
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
185
|
+
"category_id" uuid NOT NULL,
|
|
186
|
+
"group" text,
|
|
187
|
+
"label" text NOT NULL,
|
|
188
|
+
"revision" integer NOT NULL,
|
|
189
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
190
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
191
|
+
"delete_timestamp" timestamp with time zone,
|
|
192
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
193
|
+
);
|
|
194
|
+
--> statement-breakpoint
|
|
195
|
+
CREATE TABLE "document_management"."document_type_property" (
|
|
196
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
197
|
+
"type_id" uuid NOT NULL,
|
|
198
|
+
"property_id" uuid NOT NULL,
|
|
199
|
+
"revision" integer NOT NULL,
|
|
200
|
+
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
201
|
+
"create_timestamp" timestamp with time zone NOT NULL,
|
|
202
|
+
"delete_timestamp" timestamp with time zone,
|
|
203
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
204
|
+
);
|
|
205
|
+
--> statement-breakpoint
|
|
206
|
+
ALTER TABLE "document_management"."document" ADD CONSTRAINT "document_file_id_document_file_id_fk" FOREIGN KEY ("file_id") REFERENCES "document_management"."document_file"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
207
|
+
ALTER TABLE "document_management"."document" ADD CONSTRAINT "document_type_id_document_type_id_fk" FOREIGN KEY ("type_id") REFERENCES "document_management"."document_type"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
208
|
+
ALTER TABLE "document_management"."document_collection_document" ADD CONSTRAINT "document_collection_document_collection_id_document_collection_id_fk" FOREIGN KEY ("collection_id") REFERENCES "document_management"."document_collection"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
209
|
+
ALTER TABLE "document_management"."document_collection_document" ADD CONSTRAINT "document_collection_document_document_id_document_id_fk" FOREIGN KEY ("document_id") REFERENCES "document_management"."document"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
210
|
+
ALTER TABLE "document_management"."document_property_boolean_value" ADD CONSTRAINT "document_property_boolean_value_document_id_document_id_fk" FOREIGN KEY ("document_id") REFERENCES "document_management"."document"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
211
|
+
ALTER TABLE "document_management"."document_property_boolean_value" ADD CONSTRAINT "document_property_boolean_value_property_id_document_property_id_fk" FOREIGN KEY ("property_id") REFERENCES "document_management"."document_property"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
212
|
+
ALTER TABLE "document_management"."document_property_decimal_value" ADD CONSTRAINT "document_property_decimal_value_document_id_document_id_fk" FOREIGN KEY ("document_id") REFERENCES "document_management"."document"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
213
|
+
ALTER TABLE "document_management"."document_property_decimal_value" ADD CONSTRAINT "document_property_decimal_value_property_id_document_property_id_fk" FOREIGN KEY ("property_id") REFERENCES "document_management"."document_property"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
214
|
+
ALTER TABLE "document_management"."document_property_integer_value" ADD CONSTRAINT "document_property_integer_value_document_id_document_id_fk" FOREIGN KEY ("document_id") REFERENCES "document_management"."document"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
215
|
+
ALTER TABLE "document_management"."document_property_integer_value" ADD CONSTRAINT "document_property_integer_value_property_id_document_property_id_fk" FOREIGN KEY ("property_id") REFERENCES "document_management"."document_property"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
216
|
+
ALTER TABLE "document_management"."document_property_text_value" ADD CONSTRAINT "document_property_text_value_document_id_document_id_fk" FOREIGN KEY ("document_id") REFERENCES "document_management"."document"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
217
|
+
ALTER TABLE "document_management"."document_property_text_value" ADD CONSTRAINT "document_property_text_value_property_id_document_property_id_fk" FOREIGN KEY ("property_id") REFERENCES "document_management"."document_property"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
218
|
+
ALTER TABLE "document_management"."document_request" ADD CONSTRAINT "document_request_type_id_document_type_id_fk" FOREIGN KEY ("type_id") REFERENCES "document_management"."document_type"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
219
|
+
ALTER TABLE "document_management"."document_request_collection" ADD CONSTRAINT "document_request_collection_request_id_document_request_id_fk" FOREIGN KEY ("request_id") REFERENCES "document_management"."document_request"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
220
|
+
ALTER TABLE "document_management"."document_request_collection" ADD CONSTRAINT "document_request_collection_collection_id_document_collection_id_fk" FOREIGN KEY ("collection_id") REFERENCES "document_management"."document_collection"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
221
|
+
ALTER TABLE "document_management"."document_request_file" ADD CONSTRAINT "document_request_file_request_id_document_request_id_fk" FOREIGN KEY ("request_id") REFERENCES "document_management"."document_request"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
222
|
+
ALTER TABLE "document_management"."document_request_file" ADD CONSTRAINT "document_request_file_file_id_document_file_id_fk" FOREIGN KEY ("file_id") REFERENCES "document_management"."document_file"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
223
|
+
ALTER TABLE "document_management"."document_request_file" ADD CONSTRAINT "document_request_file_created_document_id_document_id_fk" FOREIGN KEY ("created_document_id") REFERENCES "document_management"."document"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
224
|
+
ALTER TABLE "document_management"."document_request_template" ADD CONSTRAINT "document_request_template_requests_template_id_document_requests_template_id_fk" FOREIGN KEY ("requests_template_id") REFERENCES "document_management"."document_requests_template"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
225
|
+
ALTER TABLE "document_management"."document_request_template" ADD CONSTRAINT "document_request_template_type_id_document_type_id_fk" FOREIGN KEY ("type_id") REFERENCES "document_management"."document_type"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
226
|
+
ALTER TABLE "document_management"."document_type" ADD CONSTRAINT "document_type_category_id_document_category_id_fk" FOREIGN KEY ("category_id") REFERENCES "document_management"."document_category"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
227
|
+
ALTER TABLE "document_management"."document_type_property" ADD CONSTRAINT "document_type_property_type_id_document_type_id_fk" FOREIGN KEY ("type_id") REFERENCES "document_management"."document_type"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
228
|
+
ALTER TABLE "document_management"."document_type_property" ADD CONSTRAINT "document_type_property_property_id_document_property_id_fk" FOREIGN KEY ("property_id") REFERENCES "document_management"."document_property"("id") ON DELETE no action ON UPDATE no action;
|