@tstdl/base 0.91.49 → 0.91.51

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 (164) hide show
  1. package/ai/data-extracting.d.ts +1 -0
  2. package/ai/data-extracting.js +62 -0
  3. package/authentication/server/authentication.api-controller.js +4 -4
  4. package/cancellation/token.d.ts +1 -2
  5. package/cancellation/token.js +1 -1
  6. package/core.d.ts +1 -1
  7. package/core.js +1 -1
  8. package/document-management/api/document-management.api.d.ts +376 -0
  9. package/document-management/api/document-management.api.js +208 -0
  10. package/document-management/api/index.d.ts +1 -0
  11. package/document-management/api/index.js +1 -0
  12. package/document-management/drizzle/0000_wakeful_firebrand.sql +228 -0
  13. package/document-management/drizzle/meta/0000_snapshot.json +1538 -0
  14. package/document-management/drizzle/meta/_journal.json +13 -0
  15. package/document-management/drizzle.config.d.ts +2 -0
  16. package/document-management/drizzle.config.js +11 -0
  17. package/document-management/index.d.ts +2 -0
  18. package/document-management/index.js +2 -0
  19. package/document-management/localizations/english.d.ts +2 -0
  20. package/document-management/localizations/english.js +9 -0
  21. package/document-management/localizations/german.d.ts +2 -0
  22. package/document-management/localizations/german.js +9 -0
  23. package/document-management/localizations/index.d.ts +5 -0
  24. package/document-management/localizations/index.js +9 -0
  25. package/document-management/localizations/localization.d.ts +9 -0
  26. package/document-management/localizations/localization.js +2 -0
  27. package/document-management/models/document-category.model.d.ts +4 -0
  28. package/document-management/models/document-category.model.js +18 -0
  29. package/document-management/models/document-collection-document.model.d.ts +7 -0
  30. package/document-management/models/document-collection-document.model.js +33 -0
  31. package/document-management/models/document-collection.model.d.ts +3 -0
  32. package/document-management/models/document-collection.model.js +14 -0
  33. package/document-management/models/document-file.model.d.ts +7 -0
  34. package/document-management/models/document-file.model.js +33 -0
  35. package/document-management/models/document-property-value.model.d.ts +21 -0
  36. package/document-management/models/document-property-value.model.js +58 -0
  37. package/document-management/models/document-property.model.d.ts +11 -0
  38. package/document-management/models/document-property.model.js +30 -0
  39. package/document-management/models/document-request-collection.model.d.ts +6 -0
  40. package/document-management/models/document-request-collection.model.js +28 -0
  41. package/document-management/models/document-request-file.model.d.ts +11 -0
  42. package/document-management/models/document-request-file.model.js +56 -0
  43. package/document-management/models/document-request-template.d.ts +10 -0
  44. package/document-management/models/document-request-template.js +39 -0
  45. package/document-management/models/document-request.model.d.ts +9 -0
  46. package/document-management/models/document-request.model.js +37 -0
  47. package/document-management/models/document-requests-template.d.ts +5 -0
  48. package/document-management/models/document-requests-template.js +23 -0
  49. package/document-management/models/document-type-property.model.d.ts +6 -0
  50. package/document-management/models/document-type-property.model.js +28 -0
  51. package/document-management/models/document-type.model.d.ts +7 -0
  52. package/document-management/models/document-type.model.js +32 -0
  53. package/document-management/models/document.model.d.ts +9 -0
  54. package/document-management/models/document.model.js +44 -0
  55. package/document-management/models/index.d.ts +15 -0
  56. package/document-management/models/index.js +15 -0
  57. package/document-management/models/schemas.d.ts +33 -0
  58. package/document-management/models/schemas.js +34 -0
  59. package/document-management/models/service-models/categories-and-types.view-model.d.ts +6 -0
  60. package/document-management/models/service-models/categories-and-types.view-model.js +24 -0
  61. package/document-management/models/service-models/document-folders.view-model.d.ts +22 -0
  62. package/document-management/models/service-models/document-folders.view-model.js +56 -0
  63. package/document-management/models/service-models/document-requests-template.view-model.d.ts +8 -0
  64. package/document-management/models/service-models/document-requests-template.view-model.js +26 -0
  65. package/document-management/models/service-models/document.service-model.d.ts +262 -0
  66. package/document-management/models/service-models/document.service-model.js +50 -0
  67. package/document-management/models/service-models/document.view-model.d.ts +33 -0
  68. package/document-management/models/service-models/document.view-model.js +99 -0
  69. package/document-management/models/service-models/index.d.ts +8 -0
  70. package/document-management/models/service-models/index.js +8 -0
  71. package/document-management/models/service-models/normalized-document-collection-view.model.d.ts +73 -0
  72. package/document-management/models/service-models/normalized-document-collection-view.model.js +110 -0
  73. package/document-management/models/service-models/normalized-requests-template-data.model.d.ts +16 -0
  74. package/document-management/models/service-models/normalized-requests-template-data.model.js +13 -0
  75. package/document-management/models/service-models/stats.view-model.d.ts +6 -0
  76. package/document-management/models/service-models/stats.view-model.js +32 -0
  77. package/document-management/module.d.ts +11 -0
  78. package/document-management/module.js +27 -0
  79. package/document-management/services/document-management.service.d.ts +65 -0
  80. package/document-management/services/document-management.service.js +376 -0
  81. package/document-management/services/index.d.ts +1 -0
  82. package/document-management/services/index.js +1 -0
  83. package/examples/document-management/main.d.ts +1 -0
  84. package/examples/document-management/main.js +30 -0
  85. package/examples/orm/drizzle.config.js +2 -1
  86. package/examples/orm/schemas.d.ts +1 -1
  87. package/examples/orm/user.model.d.ts +1 -2
  88. package/examples/orm/user.model.js +0 -1
  89. package/http/server/node/node-http-server.js +5 -5
  90. package/injector/injector.d.ts +4 -1
  91. package/injector/injector.js +4 -1
  92. package/injector/interfaces.d.ts +3 -3
  93. package/json-path/json-path.d.ts +2 -0
  94. package/json-path/json-path.js +7 -0
  95. package/message-bus/message-bus.d.ts +4 -6
  96. package/orm/database-schema.d.ts +3 -0
  97. package/orm/database-schema.js +6 -2
  98. package/orm/database.d.ts +6 -0
  99. package/orm/database.js +14 -0
  100. package/orm/decorators.d.ts +25 -2
  101. package/orm/decorators.js +15 -0
  102. package/orm/drizzle/index.d.ts +1 -0
  103. package/orm/drizzle/index.js +1 -0
  104. package/orm/drizzle/schema-converter.d.ts +37 -8
  105. package/orm/drizzle/schema-converter.js +121 -40
  106. package/orm/entity.d.ts +15 -12
  107. package/orm/entity.js +24 -11
  108. package/orm/index.d.ts +3 -2
  109. package/orm/index.js +3 -2
  110. package/orm/module.d.ts +6 -0
  111. package/orm/module.js +15 -0
  112. package/orm/query-converter.d.ts +5 -0
  113. package/orm/query-converter.js +114 -0
  114. package/orm/query.d.ts +15 -13
  115. package/orm/repository.d.ts +90 -31
  116. package/orm/repository.js +357 -55
  117. package/orm/schemas/index.d.ts +3 -0
  118. package/orm/schemas/index.js +3 -0
  119. package/orm/schemas/json.d.ts +9 -0
  120. package/orm/schemas/json.js +19 -0
  121. package/orm/schemas/numeric-date.d.ts +8 -0
  122. package/orm/schemas/numeric-date.js +13 -0
  123. package/orm/schemas/timestamp.d.ts +10 -0
  124. package/orm/schemas/timestamp.js +20 -0
  125. package/orm/transaction.d.ts +29 -0
  126. package/orm/transaction.js +73 -0
  127. package/orm/types.d.ts +15 -8
  128. package/orm/types.js +3 -2
  129. package/package.json +22 -12
  130. package/{rxjs → rxjs-utils}/reject-error.d.ts +1 -1
  131. package/{rxjs → rxjs-utils}/retry-backoff.d.ts +2 -2
  132. package/{rxjs → rxjs-utils}/slow-array.d.ts +7 -7
  133. package/{rxjs → rxjs-utils}/slow-array.js +2 -2
  134. package/{rxjs → rxjs-utils}/start-with-provider.d.ts +1 -1
  135. package/{rxjs → rxjs-utils}/teardown.d.ts +1 -1
  136. package/{rxjs → rxjs-utils}/untrack.d.ts +1 -1
  137. package/schema/decorators/types.d.ts +2 -2
  138. package/schema/schemas/number.d.ts +1 -1
  139. package/signals/pipe.d.ts +1 -1
  140. package/signals/pipe.js +1 -2
  141. package/sse/server-sent-events.d.ts +54 -0
  142. package/sse/server-sent-events.js +54 -0
  143. package/types.d.ts +6 -2
  144. package/utils/comparison.d.ts +2 -1
  145. package/utils/comparison.js +4 -3
  146. package/utils/compression.d.ts +4 -4
  147. package/utils/compression.js +35 -43
  148. package/utils/object/dereference.d.ts +6 -4
  149. package/utils/object/dereference.js +20 -8
  150. package/utils/object/object.d.ts +2 -0
  151. package/utils/object/object.js +20 -0
  152. /package/{rxjs → rxjs-utils}/cast.d.ts +0 -0
  153. /package/{rxjs → rxjs-utils}/cast.js +0 -0
  154. /package/{rxjs → rxjs-utils}/index.d.ts +0 -0
  155. /package/{rxjs → rxjs-utils}/index.js +0 -0
  156. /package/{rxjs → rxjs-utils}/noop.d.ts +0 -0
  157. /package/{rxjs → rxjs-utils}/noop.js +0 -0
  158. /package/{rxjs → rxjs-utils}/reject-error.js +0 -0
  159. /package/{rxjs → rxjs-utils}/retry-backoff.js +0 -0
  160. /package/{rxjs → rxjs-utils}/start-with-provider.js +0 -0
  161. /package/{rxjs → rxjs-utils}/teardown.js +0 -0
  162. /package/{rxjs → rxjs-utils}/timing.d.ts +0 -0
  163. /package/{rxjs → rxjs-utils}/timing.js +0 -0
  164. /package/{rxjs → rxjs-utils}/untrack.js +0 -0
@@ -0,0 +1,208 @@
1
+ import { defineApi } from '../../api/index.js';
2
+ import { boolean, literal, nullable, object, optional, string } from '../../schema/index.js';
3
+ import { megabyte } from '../../utils/units.js';
4
+ 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';
5
+ export const documentManagementApiDefinition = defineApi({
6
+ resource: 'document-management',
7
+ endpoints: {
8
+ loadData: {
9
+ resource: 'data',
10
+ method: 'GET',
11
+ parameters: loadDataParametersSchema,
12
+ result: DocumentManagementData,
13
+ credentials: true
14
+ },
15
+ loadDocumentRequestsTemplateData: {
16
+ resource: 'views/document-requests-template-data',
17
+ method: 'GET',
18
+ result: DocumentRequestsTemplateData,
19
+ credentials: true
20
+ },
21
+ loadAvailableCategoriesAndTypes: {
22
+ resource: 'views/categories-and-types',
23
+ method: 'GET',
24
+ result: CategoryAndTypesView,
25
+ credentials: true
26
+ },
27
+ loadFileContent: {
28
+ resource: 'files/:id/content',
29
+ method: 'GET',
30
+ parameters: object({
31
+ id: string(),
32
+ title: nullable(string()),
33
+ download: optional(boolean({ coerce: true }))
34
+ }),
35
+ result: Uint8Array,
36
+ credentials: true
37
+ },
38
+ getFileContentUrl: {
39
+ resource: 'files/:id/content/url',
40
+ method: 'GET',
41
+ parameters: object({
42
+ id: string(),
43
+ title: nullable(string()),
44
+ download: optional(boolean({ coerce: true }))
45
+ }),
46
+ result: string(),
47
+ credentials: true
48
+ },
49
+ createCategory: {
50
+ resource: 'categories',
51
+ method: 'POST',
52
+ parameters: createDocumentCategoryParametersSchema,
53
+ result: DocumentCategory,
54
+ credentials: true
55
+ },
56
+ createType: {
57
+ resource: 'types',
58
+ method: 'POST',
59
+ parameters: createDocumentTypeParametersSchema,
60
+ result: DocumentType,
61
+ credentials: true
62
+ },
63
+ createCollection: {
64
+ resource: 'collections',
65
+ method: 'POST',
66
+ parameters: createCollectionParametersSchema,
67
+ result: DocumentCollection,
68
+ credentials: true
69
+ },
70
+ createDocument: {
71
+ resource: 'documents',
72
+ method: 'POST',
73
+ parameters: createDocumentParametersSchema,
74
+ body: Uint8Array,
75
+ maxBytes: 50 * megabyte,
76
+ result: Document,
77
+ credentials: true
78
+ },
79
+ createDocumentRequestsTemplate: {
80
+ resource: 'document-requests-template',
81
+ method: 'POST',
82
+ parameters: createDocumentRequestsTemplateParametersSchema,
83
+ result: DocumentRequestsTemplate,
84
+ credentials: true
85
+ },
86
+ updateDocumentRequestsTemplate: {
87
+ resource: 'document-requests-template/:id',
88
+ method: 'PATCH',
89
+ parameters: updateDocumentRequestsTemplateParametersSchema,
90
+ result: DocumentRequestsTemplate,
91
+ credentials: true
92
+ },
93
+ applyDocumentRequestsTemplate: {
94
+ resource: 'document-requests-template/:id',
95
+ method: 'POST',
96
+ parameters: applyDocumentRequestsTemplateParametersSchema,
97
+ result: literal('ok'),
98
+ credentials: true
99
+ },
100
+ deleteDocumentRequestsTemplate: {
101
+ resource: 'document-requests-template/:id',
102
+ method: 'DELETE',
103
+ parameters: deleteDocumentRequestsTemplateParametersSchema,
104
+ result: literal('ok'),
105
+ credentials: true
106
+ },
107
+ createDocumentRequestTemplate: {
108
+ resource: 'document-request-template',
109
+ method: 'POST',
110
+ parameters: createDocumentRequestTemplateParametersSchema,
111
+ result: DocumentRequestTemplate,
112
+ credentials: true
113
+ },
114
+ updateDocumentRequestTemplate: {
115
+ resource: 'document-request-template/:id',
116
+ method: 'PATCH',
117
+ parameters: updateDocumentRequestTemplateParametersSchema,
118
+ result: DocumentRequestTemplate,
119
+ credentials: true
120
+ },
121
+ deleteDocumentRequestTemplate: {
122
+ resource: 'document-request-template/:id',
123
+ method: 'DELETE',
124
+ parameters: deleteDocumentRequestTemplateParametersSchema,
125
+ result: literal('ok'),
126
+ credentials: true
127
+ },
128
+ createDocumentRequestFile: {
129
+ resource: 'requests/:requestId/files',
130
+ method: 'POST',
131
+ parameters: createDocumentRequestFileParametersSchema,
132
+ body: Uint8Array,
133
+ result: DocumentRequestFile,
134
+ maxBytes: 50 * megabyte,
135
+ credentials: true
136
+ },
137
+ approveDocumentRequestFile: {
138
+ resource: 'request-files/:id/create-document',
139
+ method: 'POST',
140
+ parameters: approveDocumentRequestFileParametersSchema,
141
+ result: Document,
142
+ credentials: true
143
+ },
144
+ rejectDocumentRequestFile: {
145
+ resource: 'request-files/:id/reject',
146
+ method: 'POST',
147
+ parameters: rejectDocumentRequestFileParametersSchema,
148
+ result: literal('ok'),
149
+ credentials: true
150
+ },
151
+ updateDocumentRequestFile: {
152
+ resource: 'request-files/:id',
153
+ method: 'PATCH',
154
+ parameters: updateDocumentRequestFileParametersSchema,
155
+ result: DocumentRequestFile,
156
+ credentials: true
157
+ },
158
+ deleteDocumentRequestFile: {
159
+ resource: 'request-files/:id',
160
+ method: 'DELETE',
161
+ parameters: deleteDocumentRequestFileParametersSchema,
162
+ result: literal('ok'),
163
+ credentials: true
164
+ },
165
+ createDocumentRequest: {
166
+ resource: 'requests',
167
+ method: 'POST',
168
+ parameters: createDocumentRequestParametersSchema,
169
+ result: DocumentRequest,
170
+ credentials: true
171
+ },
172
+ updateDocumentRequest: {
173
+ resource: 'requests/:id',
174
+ method: 'PATCH',
175
+ parameters: updateDocumentRequestParametersSchema,
176
+ result: literal('ok'),
177
+ credentials: true
178
+ },
179
+ deleteDocumentRequest: {
180
+ resource: 'requests/:id',
181
+ method: 'DELETE',
182
+ parameters: deleteDocumentRequestParametersSchema,
183
+ result: literal('ok'),
184
+ credentials: true
185
+ },
186
+ addDocumentToCollection: {
187
+ resource: 'collections/:collectionId/documents/:documentId',
188
+ method: 'PUT',
189
+ parameters: addOrArchiveDocumentToOrFromCollectionParametersSchema,
190
+ result: literal('ok'),
191
+ credentials: true
192
+ },
193
+ archiveDocument: {
194
+ resource: 'collections/:collectionId/documents/:documentId',
195
+ method: 'DELETE',
196
+ parameters: addOrArchiveDocumentToOrFromCollectionParametersSchema,
197
+ result: literal('ok'),
198
+ credentials: true
199
+ },
200
+ updateDocument: {
201
+ resource: 'documents/:id',
202
+ method: 'PATCH',
203
+ parameters: updateDocumentParametersSchema,
204
+ result: literal('ok'),
205
+ credentials: true
206
+ }
207
+ }
208
+ });
@@ -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;