@fast-white-cat/integration-ksef-direct 0.1.0

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 (140) hide show
  1. package/README.md +36 -0
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +7 -0
  4. package/dist/modules/integration_ksef_direct/acl.js +13 -0
  5. package/dist/modules/integration_ksef_direct/acl.js.map +7 -0
  6. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/documents/[id].js +92 -0
  7. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/documents/[id].js.map +7 -0
  8. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/documents.js +105 -0
  9. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/documents.js.map +7 -0
  10. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/health.js +158 -0
  11. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/health.js.map +7 -0
  12. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/received-documents/[id].js +86 -0
  13. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/received-documents/[id].js.map +7 -0
  14. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/received-documents.js +112 -0
  15. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/received-documents.js.map +7 -0
  16. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/seller-info.js +54 -0
  17. package/dist/modules/integration_ksef_direct/api/get/integration-ksef-direct/seller-info.js.map +7 -0
  18. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/documents/[id]/send.js +64 -0
  19. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/documents/[id]/send.js.map +7 -0
  20. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/documents.js +104 -0
  21. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/documents.js.map +7 -0
  22. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/invoice-numbers.js +41 -0
  23. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/invoice-numbers.js.map +7 -0
  24. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/received-documents/fetch.js +172 -0
  25. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/received-documents/fetch.js.map +7 -0
  26. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/received-documents/sync.js +80 -0
  27. package/dist/modules/integration_ksef_direct/api/post/integration-ksef-direct/received-documents/sync.js.map +7 -0
  28. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/new/page.js +441 -0
  29. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/new/page.js.map +7 -0
  30. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/new/page.meta.js +8 -0
  31. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/new/page.meta.js.map +7 -0
  32. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/page.js +193 -0
  33. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/page.js.map +7 -0
  34. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/received-documents/page.js +314 -0
  35. package/dist/modules/integration_ksef_direct/backend/integration-ksef-direct/received-documents/page.js.map +7 -0
  36. package/dist/modules/integration_ksef_direct/backend/page.js +154 -0
  37. package/dist/modules/integration_ksef_direct/backend/page.js.map +7 -0
  38. package/dist/modules/integration_ksef_direct/commands/create-ksef-direct-document.js +80 -0
  39. package/dist/modules/integration_ksef_direct/commands/create-ksef-direct-document.js.map +7 -0
  40. package/dist/modules/integration_ksef_direct/commands/enqueue-ksef-direct-document.js +43 -0
  41. package/dist/modules/integration_ksef_direct/commands/enqueue-ksef-direct-document.js.map +7 -0
  42. package/dist/modules/integration_ksef_direct/data/entities.js +224 -0
  43. package/dist/modules/integration_ksef_direct/data/entities.js.map +7 -0
  44. package/dist/modules/integration_ksef_direct/data/validators.js +103 -0
  45. package/dist/modules/integration_ksef_direct/data/validators.js.map +7 -0
  46. package/dist/modules/integration_ksef_direct/di.js +11 -0
  47. package/dist/modules/integration_ksef_direct/di.js.map +7 -0
  48. package/dist/modules/integration_ksef_direct/events.js +21 -0
  49. package/dist/modules/integration_ksef_direct/events.js.map +7 -0
  50. package/dist/modules/integration_ksef_direct/index.js +10 -0
  51. package/dist/modules/integration_ksef_direct/index.js.map +7 -0
  52. package/dist/modules/integration_ksef_direct/integration.js +56 -0
  53. package/dist/modules/integration_ksef_direct/integration.js.map +7 -0
  54. package/dist/modules/integration_ksef_direct/lib/health.js +32 -0
  55. package/dist/modules/integration_ksef_direct/lib/health.js.map +7 -0
  56. package/dist/modules/integration_ksef_direct/lib/invoiceNumberFormat.js +23 -0
  57. package/dist/modules/integration_ksef_direct/lib/invoiceNumberFormat.js.map +7 -0
  58. package/dist/modules/integration_ksef_direct/lib/ksefClient.js +523 -0
  59. package/dist/modules/integration_ksef_direct/lib/ksefClient.js.map +7 -0
  60. package/dist/modules/integration_ksef_direct/lib/ksefCrypto.js +103 -0
  61. package/dist/modules/integration_ksef_direct/lib/ksefCrypto.js.map +7 -0
  62. package/dist/modules/integration_ksef_direct/lib/ksefFa2Xml.js +123 -0
  63. package/dist/modules/integration_ksef_direct/lib/ksefFa2Xml.js.map +7 -0
  64. package/dist/modules/integration_ksef_direct/lib/ksefXmlParser.js +76 -0
  65. package/dist/modules/integration_ksef_direct/lib/ksefXmlParser.js.map +7 -0
  66. package/dist/modules/integration_ksef_direct/migrations/Migration20260519210000_integration_ksef_direct.js +15 -0
  67. package/dist/modules/integration_ksef_direct/migrations/Migration20260519210000_integration_ksef_direct.js.map +7 -0
  68. package/dist/modules/integration_ksef_direct/migrations/Migration20260520120000_ksef_direct_documents.js +17 -0
  69. package/dist/modules/integration_ksef_direct/migrations/Migration20260520120000_ksef_direct_documents.js.map +7 -0
  70. package/dist/modules/integration_ksef_direct/migrations/Migration20260520220000_ksef_direct_send_queue.js +15 -0
  71. package/dist/modules/integration_ksef_direct/migrations/Migration20260520220000_ksef_direct_send_queue.js.map +7 -0
  72. package/dist/modules/integration_ksef_direct/migrations/Migration20260520230000_ksef_direct_seller_per_document.js +17 -0
  73. package/dist/modules/integration_ksef_direct/migrations/Migration20260520230000_ksef_direct_seller_per_document.js.map +7 -0
  74. package/dist/modules/integration_ksef_direct/migrations/Migration20260521120000_ksef_direct_received_documents.js +16 -0
  75. package/dist/modules/integration_ksef_direct/migrations/Migration20260521120000_ksef_direct_received_documents.js.map +7 -0
  76. package/dist/modules/integration_ksef_direct/migrations/Migration20260521130000_ksef_received_download_urls.js +15 -0
  77. package/dist/modules/integration_ksef_direct/migrations/Migration20260521130000_ksef_received_download_urls.js.map +7 -0
  78. package/dist/modules/integration_ksef_direct/setup.js +11 -0
  79. package/dist/modules/integration_ksef_direct/setup.js.map +7 -0
  80. package/dist/modules/integration_ksef_direct/subscribers/auto-enqueue-ksef-document.js +19 -0
  81. package/dist/modules/integration_ksef_direct/subscribers/auto-enqueue-ksef-document.js.map +7 -0
  82. package/dist/modules/integration_ksef_direct/workers/check-ksef-document-status.js +103 -0
  83. package/dist/modules/integration_ksef_direct/workers/check-ksef-document-status.js.map +7 -0
  84. package/dist/modules/integration_ksef_direct/workers/send-ksef-document.js +104 -0
  85. package/dist/modules/integration_ksef_direct/workers/send-ksef-document.js.map +7 -0
  86. package/dist/modules/integration_ksef_direct/workers/sync-received-documents.js +137 -0
  87. package/dist/modules/integration_ksef_direct/workers/sync-received-documents.js.map +7 -0
  88. package/dist/types/declarations.d.js +1 -0
  89. package/dist/types/declarations.d.js.map +7 -0
  90. package/package.json +98 -0
  91. package/src/index.ts +1 -0
  92. package/src/modules/integration_ksef_direct/__tests__/invoiceNumberFormat.test.ts +42 -0
  93. package/src/modules/integration_ksef_direct/__tests__/ksefFa2Xml.test.ts +407 -0
  94. package/src/modules/integration_ksef_direct/__tests__/ksefXmlParser.test.ts +230 -0
  95. package/src/modules/integration_ksef_direct/acl.ts +9 -0
  96. package/src/modules/integration_ksef_direct/api/get/integration-ksef-direct/documents/[id].ts +94 -0
  97. package/src/modules/integration_ksef_direct/api/get/integration-ksef-direct/documents.ts +111 -0
  98. package/src/modules/integration_ksef_direct/api/get/integration-ksef-direct/health.ts +194 -0
  99. package/src/modules/integration_ksef_direct/api/get/integration-ksef-direct/received-documents/[id].ts +88 -0
  100. package/src/modules/integration_ksef_direct/api/get/integration-ksef-direct/received-documents.ts +119 -0
  101. package/src/modules/integration_ksef_direct/api/get/integration-ksef-direct/seller-info.ts +62 -0
  102. package/src/modules/integration_ksef_direct/api/post/integration-ksef-direct/documents/[id]/send.ts +64 -0
  103. package/src/modules/integration_ksef_direct/api/post/integration-ksef-direct/documents.ts +109 -0
  104. package/src/modules/integration_ksef_direct/api/post/integration-ksef-direct/invoice-numbers.ts +40 -0
  105. package/src/modules/integration_ksef_direct/api/post/integration-ksef-direct/received-documents/fetch.ts +185 -0
  106. package/src/modules/integration_ksef_direct/api/post/integration-ksef-direct/received-documents/sync.ts +86 -0
  107. package/src/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/new/page.meta.ts +4 -0
  108. package/src/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/new/page.tsx +470 -0
  109. package/src/modules/integration_ksef_direct/backend/integration-ksef-direct/documents/page.tsx +233 -0
  110. package/src/modules/integration_ksef_direct/backend/integration-ksef-direct/received-documents/page.tsx +415 -0
  111. package/src/modules/integration_ksef_direct/backend/page.tsx +183 -0
  112. package/src/modules/integration_ksef_direct/commands/create-ksef-direct-document.ts +93 -0
  113. package/src/modules/integration_ksef_direct/commands/enqueue-ksef-direct-document.ts +57 -0
  114. package/src/modules/integration_ksef_direct/data/entities.ts +195 -0
  115. package/src/modules/integration_ksef_direct/data/validators.ts +115 -0
  116. package/src/modules/integration_ksef_direct/di.ts +9 -0
  117. package/src/modules/integration_ksef_direct/events.ts +18 -0
  118. package/src/modules/integration_ksef_direct/i18n/en.json +115 -0
  119. package/src/modules/integration_ksef_direct/i18n/pl.json +115 -0
  120. package/src/modules/integration_ksef_direct/index.ts +6 -0
  121. package/src/modules/integration_ksef_direct/integration.ts +54 -0
  122. package/src/modules/integration_ksef_direct/lib/health.ts +43 -0
  123. package/src/modules/integration_ksef_direct/lib/invoiceNumberFormat.ts +23 -0
  124. package/src/modules/integration_ksef_direct/lib/ksefClient.ts +668 -0
  125. package/src/modules/integration_ksef_direct/lib/ksefCrypto.ts +138 -0
  126. package/src/modules/integration_ksef_direct/lib/ksefFa2Xml.ts +147 -0
  127. package/src/modules/integration_ksef_direct/lib/ksefXmlParser.ts +97 -0
  128. package/src/modules/integration_ksef_direct/migrations/.snapshot-open-mercato.json +1028 -0
  129. package/src/modules/integration_ksef_direct/migrations/Migration20260519210000_integration_ksef_direct.ts +15 -0
  130. package/src/modules/integration_ksef_direct/migrations/Migration20260520120000_ksef_direct_documents.ts +17 -0
  131. package/src/modules/integration_ksef_direct/migrations/Migration20260520220000_ksef_direct_send_queue.ts +15 -0
  132. package/src/modules/integration_ksef_direct/migrations/Migration20260520230000_ksef_direct_seller_per_document.ts +17 -0
  133. package/src/modules/integration_ksef_direct/migrations/Migration20260521120000_ksef_direct_received_documents.ts +16 -0
  134. package/src/modules/integration_ksef_direct/migrations/Migration20260521130000_ksef_received_download_urls.ts +15 -0
  135. package/src/modules/integration_ksef_direct/setup.ts +9 -0
  136. package/src/modules/integration_ksef_direct/subscribers/auto-enqueue-ksef-document.ts +21 -0
  137. package/src/modules/integration_ksef_direct/workers/check-ksef-document-status.ts +129 -0
  138. package/src/modules/integration_ksef_direct/workers/send-ksef-document.ts +137 -0
  139. package/src/modules/integration_ksef_direct/workers/sync-received-documents.ts +171 -0
  140. package/src/types/declarations.d.ts +1 -0
@@ -0,0 +1,1028 @@
1
+ {
2
+ "name": "public",
3
+ "namespaces": [
4
+ "public"
5
+ ],
6
+ "tables": [
7
+ {
8
+ "name": "ksef_direct_connections",
9
+ "schema": "public",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "unsigned": false,
15
+ "autoincrement": false,
16
+ "primary": true,
17
+ "nullable": false,
18
+ "unique": false,
19
+ "length": null,
20
+ "precision": null,
21
+ "scale": null,
22
+ "default": "gen_random_uuid()",
23
+ "comment": null,
24
+ "enumItems": [],
25
+ "mappedType": "uuid"
26
+ },
27
+ "organization_id": {
28
+ "name": "organization_id",
29
+ "type": "uuid",
30
+ "unsigned": false,
31
+ "autoincrement": false,
32
+ "primary": false,
33
+ "nullable": false,
34
+ "unique": true,
35
+ "length": null,
36
+ "precision": null,
37
+ "scale": null,
38
+ "default": null,
39
+ "comment": null,
40
+ "enumItems": [],
41
+ "mappedType": "uuid"
42
+ },
43
+ "tenant_id": {
44
+ "name": "tenant_id",
45
+ "type": "uuid",
46
+ "unsigned": false,
47
+ "autoincrement": false,
48
+ "primary": false,
49
+ "nullable": false,
50
+ "unique": false,
51
+ "length": null,
52
+ "precision": null,
53
+ "scale": null,
54
+ "default": null,
55
+ "comment": null,
56
+ "enumItems": [],
57
+ "mappedType": "uuid"
58
+ },
59
+ "status": {
60
+ "name": "status",
61
+ "type": "text",
62
+ "unsigned": false,
63
+ "autoincrement": false,
64
+ "primary": false,
65
+ "nullable": false,
66
+ "unique": false,
67
+ "length": null,
68
+ "precision": null,
69
+ "scale": null,
70
+ "default": "'unconfigured'",
71
+ "comment": null,
72
+ "enumItems": [],
73
+ "mappedType": "text"
74
+ },
75
+ "last_checked_at": {
76
+ "name": "last_checked_at",
77
+ "type": "timestamptz(6)",
78
+ "unsigned": false,
79
+ "autoincrement": false,
80
+ "primary": false,
81
+ "nullable": true,
82
+ "unique": false,
83
+ "length": 6,
84
+ "precision": null,
85
+ "scale": null,
86
+ "default": null,
87
+ "comment": null,
88
+ "enumItems": [],
89
+ "mappedType": "datetime"
90
+ },
91
+ "error_message": {
92
+ "name": "error_message",
93
+ "type": "text",
94
+ "unsigned": false,
95
+ "autoincrement": false,
96
+ "primary": false,
97
+ "nullable": true,
98
+ "unique": false,
99
+ "length": null,
100
+ "precision": null,
101
+ "scale": null,
102
+ "default": null,
103
+ "comment": null,
104
+ "enumItems": [],
105
+ "mappedType": "text"
106
+ },
107
+ "error_code": {
108
+ "name": "error_code",
109
+ "type": "text",
110
+ "unsigned": false,
111
+ "autoincrement": false,
112
+ "primary": false,
113
+ "nullable": true,
114
+ "unique": false,
115
+ "length": null,
116
+ "precision": null,
117
+ "scale": null,
118
+ "default": null,
119
+ "comment": null,
120
+ "enumItems": [],
121
+ "mappedType": "text"
122
+ },
123
+ "created_at": {
124
+ "name": "created_at",
125
+ "type": "timestamptz(6)",
126
+ "unsigned": false,
127
+ "autoincrement": false,
128
+ "primary": false,
129
+ "nullable": false,
130
+ "unique": false,
131
+ "length": 6,
132
+ "precision": null,
133
+ "scale": null,
134
+ "default": null,
135
+ "comment": null,
136
+ "enumItems": [],
137
+ "mappedType": "datetime"
138
+ },
139
+ "updated_at": {
140
+ "name": "updated_at",
141
+ "type": "timestamptz(6)",
142
+ "unsigned": false,
143
+ "autoincrement": false,
144
+ "primary": false,
145
+ "nullable": false,
146
+ "unique": false,
147
+ "length": 6,
148
+ "precision": null,
149
+ "scale": null,
150
+ "default": null,
151
+ "comment": null,
152
+ "enumItems": [],
153
+ "mappedType": "datetime"
154
+ }
155
+ },
156
+ "indexes": [
157
+ {
158
+ "columnNames": [
159
+ "organization_id",
160
+ "tenant_id"
161
+ ],
162
+ "composite": true,
163
+ "constraint": true,
164
+ "keyName": "ksef_direct_connections_organization_id_tenant_id_unique",
165
+ "primary": false,
166
+ "unique": true
167
+ },
168
+ {
169
+ "columnNames": [
170
+ "id"
171
+ ],
172
+ "composite": false,
173
+ "constraint": true,
174
+ "keyName": "ksef_direct_connections_pkey",
175
+ "primary": true,
176
+ "unique": true
177
+ },
178
+ {
179
+ "columnNames": [
180
+ "status",
181
+ "updated_at"
182
+ ],
183
+ "composite": true,
184
+ "constraint": false,
185
+ "keyName": "ksef_direct_connections_status_updated_at_index",
186
+ "primary": false,
187
+ "unique": false
188
+ }
189
+ ],
190
+ "checks": [],
191
+ "foreignKeys": {},
192
+ "comment": null
193
+ },
194
+ {
195
+ "name": "ksef_direct_documents",
196
+ "schema": "public",
197
+ "columns": {
198
+ "id": {
199
+ "name": "id",
200
+ "type": "uuid",
201
+ "unsigned": false,
202
+ "autoincrement": false,
203
+ "primary": true,
204
+ "nullable": false,
205
+ "unique": false,
206
+ "length": null,
207
+ "precision": null,
208
+ "scale": null,
209
+ "default": "gen_random_uuid()",
210
+ "comment": null,
211
+ "enumItems": [],
212
+ "mappedType": "uuid"
213
+ },
214
+ "organization_id": {
215
+ "name": "organization_id",
216
+ "type": "uuid",
217
+ "unsigned": false,
218
+ "autoincrement": false,
219
+ "primary": false,
220
+ "nullable": false,
221
+ "unique": false,
222
+ "length": null,
223
+ "precision": null,
224
+ "scale": null,
225
+ "default": null,
226
+ "comment": null,
227
+ "enumItems": [],
228
+ "mappedType": "uuid"
229
+ },
230
+ "tenant_id": {
231
+ "name": "tenant_id",
232
+ "type": "uuid",
233
+ "unsigned": false,
234
+ "autoincrement": false,
235
+ "primary": false,
236
+ "nullable": false,
237
+ "unique": false,
238
+ "length": null,
239
+ "precision": null,
240
+ "scale": null,
241
+ "default": null,
242
+ "comment": null,
243
+ "enumItems": [],
244
+ "mappedType": "uuid"
245
+ },
246
+ "source": {
247
+ "name": "source",
248
+ "type": "text",
249
+ "unsigned": false,
250
+ "autoincrement": false,
251
+ "primary": false,
252
+ "nullable": false,
253
+ "unique": false,
254
+ "length": null,
255
+ "precision": null,
256
+ "scale": null,
257
+ "default": "'manual'",
258
+ "comment": null,
259
+ "enumItems": [],
260
+ "mappedType": "text"
261
+ },
262
+ "status": {
263
+ "name": "status",
264
+ "type": "text",
265
+ "unsigned": false,
266
+ "autoincrement": false,
267
+ "primary": false,
268
+ "nullable": false,
269
+ "unique": false,
270
+ "length": null,
271
+ "precision": null,
272
+ "scale": null,
273
+ "default": "'draft'",
274
+ "comment": null,
275
+ "enumItems": [],
276
+ "mappedType": "text"
277
+ },
278
+ "ksef_reference_number": {
279
+ "name": "ksef_reference_number",
280
+ "type": "text",
281
+ "unsigned": false,
282
+ "autoincrement": false,
283
+ "primary": false,
284
+ "nullable": true,
285
+ "unique": false,
286
+ "length": null,
287
+ "precision": null,
288
+ "scale": null,
289
+ "default": null,
290
+ "comment": null,
291
+ "enumItems": [],
292
+ "mappedType": "text"
293
+ },
294
+ "seller_nip": {
295
+ "name": "seller_nip",
296
+ "type": "text",
297
+ "unsigned": false,
298
+ "autoincrement": false,
299
+ "primary": false,
300
+ "nullable": false,
301
+ "unique": false,
302
+ "length": null,
303
+ "precision": null,
304
+ "scale": null,
305
+ "default": null,
306
+ "comment": null,
307
+ "enumItems": [],
308
+ "mappedType": "text"
309
+ },
310
+ "buyer_nip": {
311
+ "name": "buyer_nip",
312
+ "type": "text",
313
+ "unsigned": false,
314
+ "autoincrement": false,
315
+ "primary": false,
316
+ "nullable": false,
317
+ "unique": false,
318
+ "length": null,
319
+ "precision": null,
320
+ "scale": null,
321
+ "default": null,
322
+ "comment": null,
323
+ "enumItems": [],
324
+ "mappedType": "text"
325
+ },
326
+ "buyer_name": {
327
+ "name": "buyer_name",
328
+ "type": "text",
329
+ "unsigned": false,
330
+ "autoincrement": false,
331
+ "primary": false,
332
+ "nullable": true,
333
+ "unique": false,
334
+ "length": null,
335
+ "precision": null,
336
+ "scale": null,
337
+ "default": null,
338
+ "comment": null,
339
+ "enumItems": [],
340
+ "mappedType": "text"
341
+ },
342
+ "invoice_number": {
343
+ "name": "invoice_number",
344
+ "type": "text",
345
+ "unsigned": false,
346
+ "autoincrement": false,
347
+ "primary": false,
348
+ "nullable": false,
349
+ "unique": false,
350
+ "length": null,
351
+ "precision": null,
352
+ "scale": null,
353
+ "default": null,
354
+ "comment": null,
355
+ "enumItems": [],
356
+ "mappedType": "text"
357
+ },
358
+ "issue_date": {
359
+ "name": "issue_date",
360
+ "type": "timestamptz(6)",
361
+ "unsigned": false,
362
+ "autoincrement": false,
363
+ "primary": false,
364
+ "nullable": false,
365
+ "unique": false,
366
+ "length": 6,
367
+ "precision": null,
368
+ "scale": null,
369
+ "default": null,
370
+ "comment": null,
371
+ "enumItems": [],
372
+ "mappedType": "datetime"
373
+ },
374
+ "sale_date": {
375
+ "name": "sale_date",
376
+ "type": "timestamptz(6)",
377
+ "unsigned": false,
378
+ "autoincrement": false,
379
+ "primary": false,
380
+ "nullable": true,
381
+ "unique": false,
382
+ "length": 6,
383
+ "precision": null,
384
+ "scale": null,
385
+ "default": null,
386
+ "comment": null,
387
+ "enumItems": [],
388
+ "mappedType": "datetime"
389
+ },
390
+ "net_amount": {
391
+ "name": "net_amount",
392
+ "type": "numeric(15,2)",
393
+ "unsigned": false,
394
+ "autoincrement": false,
395
+ "primary": false,
396
+ "nullable": false,
397
+ "unique": false,
398
+ "length": null,
399
+ "precision": 15,
400
+ "scale": 2,
401
+ "default": null,
402
+ "comment": null,
403
+ "enumItems": [],
404
+ "mappedType": "decimal"
405
+ },
406
+ "vat_amount": {
407
+ "name": "vat_amount",
408
+ "type": "numeric(15,2)",
409
+ "unsigned": false,
410
+ "autoincrement": false,
411
+ "primary": false,
412
+ "nullable": false,
413
+ "unique": false,
414
+ "length": null,
415
+ "precision": 15,
416
+ "scale": 2,
417
+ "default": null,
418
+ "comment": null,
419
+ "enumItems": [],
420
+ "mappedType": "decimal"
421
+ },
422
+ "gross_amount": {
423
+ "name": "gross_amount",
424
+ "type": "numeric(15,2)",
425
+ "unsigned": false,
426
+ "autoincrement": false,
427
+ "primary": false,
428
+ "nullable": false,
429
+ "unique": false,
430
+ "length": null,
431
+ "precision": 15,
432
+ "scale": 2,
433
+ "default": null,
434
+ "comment": null,
435
+ "enumItems": [],
436
+ "mappedType": "decimal"
437
+ },
438
+ "currency": {
439
+ "name": "currency",
440
+ "type": "text",
441
+ "unsigned": false,
442
+ "autoincrement": false,
443
+ "primary": false,
444
+ "nullable": false,
445
+ "unique": false,
446
+ "length": null,
447
+ "precision": null,
448
+ "scale": null,
449
+ "default": "'PLN'",
450
+ "comment": null,
451
+ "enumItems": [],
452
+ "mappedType": "text"
453
+ },
454
+ "line_items": {
455
+ "name": "line_items",
456
+ "type": "jsonb",
457
+ "unsigned": false,
458
+ "autoincrement": false,
459
+ "primary": false,
460
+ "nullable": false,
461
+ "unique": false,
462
+ "length": null,
463
+ "precision": null,
464
+ "scale": null,
465
+ "default": "'[]'",
466
+ "comment": null,
467
+ "enumItems": [],
468
+ "mappedType": "json"
469
+ },
470
+ "notes": {
471
+ "name": "notes",
472
+ "type": "text",
473
+ "unsigned": false,
474
+ "autoincrement": false,
475
+ "primary": false,
476
+ "nullable": true,
477
+ "unique": false,
478
+ "length": null,
479
+ "precision": null,
480
+ "scale": null,
481
+ "default": null,
482
+ "comment": null,
483
+ "enumItems": [],
484
+ "mappedType": "text"
485
+ },
486
+ "ksef_processing_reference_number": {
487
+ "name": "ksef_processing_reference_number",
488
+ "type": "text",
489
+ "unsigned": false,
490
+ "autoincrement": false,
491
+ "primary": false,
492
+ "nullable": true,
493
+ "unique": false,
494
+ "length": null,
495
+ "precision": null,
496
+ "scale": null,
497
+ "default": null,
498
+ "comment": null,
499
+ "enumItems": [],
500
+ "mappedType": "text"
501
+ },
502
+ "seller_name": {
503
+ "name": "seller_name",
504
+ "type": "text",
505
+ "unsigned": false,
506
+ "autoincrement": false,
507
+ "primary": false,
508
+ "nullable": true,
509
+ "unique": false,
510
+ "length": null,
511
+ "precision": null,
512
+ "scale": null,
513
+ "default": null,
514
+ "comment": null,
515
+ "enumItems": [],
516
+ "mappedType": "text"
517
+ },
518
+ "seller_address_l1": {
519
+ "name": "seller_address_l1",
520
+ "type": "text",
521
+ "unsigned": false,
522
+ "autoincrement": false,
523
+ "primary": false,
524
+ "nullable": true,
525
+ "unique": false,
526
+ "length": null,
527
+ "precision": null,
528
+ "scale": null,
529
+ "default": null,
530
+ "comment": null,
531
+ "enumItems": [],
532
+ "mappedType": "text"
533
+ },
534
+ "seller_city": {
535
+ "name": "seller_city",
536
+ "type": "text",
537
+ "unsigned": false,
538
+ "autoincrement": false,
539
+ "primary": false,
540
+ "nullable": true,
541
+ "unique": false,
542
+ "length": null,
543
+ "precision": null,
544
+ "scale": null,
545
+ "default": null,
546
+ "comment": null,
547
+ "enumItems": [],
548
+ "mappedType": "text"
549
+ },
550
+ "seller_country": {
551
+ "name": "seller_country",
552
+ "type": "text",
553
+ "unsigned": false,
554
+ "autoincrement": false,
555
+ "primary": false,
556
+ "nullable": true,
557
+ "unique": false,
558
+ "length": null,
559
+ "precision": null,
560
+ "scale": null,
561
+ "default": null,
562
+ "comment": null,
563
+ "enumItems": [],
564
+ "mappedType": "text"
565
+ },
566
+ "error_message": {
567
+ "name": "error_message",
568
+ "type": "text",
569
+ "unsigned": false,
570
+ "autoincrement": false,
571
+ "primary": false,
572
+ "nullable": true,
573
+ "unique": false,
574
+ "length": null,
575
+ "precision": null,
576
+ "scale": null,
577
+ "default": null,
578
+ "comment": null,
579
+ "enumItems": [],
580
+ "mappedType": "text"
581
+ },
582
+ "created_at": {
583
+ "name": "created_at",
584
+ "type": "timestamptz(6)",
585
+ "unsigned": false,
586
+ "autoincrement": false,
587
+ "primary": false,
588
+ "nullable": false,
589
+ "unique": false,
590
+ "length": 6,
591
+ "precision": null,
592
+ "scale": null,
593
+ "default": null,
594
+ "comment": null,
595
+ "enumItems": [],
596
+ "mappedType": "datetime"
597
+ },
598
+ "updated_at": {
599
+ "name": "updated_at",
600
+ "type": "timestamptz(6)",
601
+ "unsigned": false,
602
+ "autoincrement": false,
603
+ "primary": false,
604
+ "nullable": false,
605
+ "unique": false,
606
+ "length": 6,
607
+ "precision": null,
608
+ "scale": null,
609
+ "default": null,
610
+ "comment": null,
611
+ "enumItems": [],
612
+ "mappedType": "datetime"
613
+ }
614
+ },
615
+ "indexes": [
616
+ {
617
+ "columnNames": ["id"],
618
+ "composite": false,
619
+ "constraint": true,
620
+ "keyName": "ksef_direct_documents_pkey",
621
+ "primary": true,
622
+ "unique": true
623
+ },
624
+ {
625
+ "columnNames": ["organization_id", "tenant_id"],
626
+ "composite": true,
627
+ "constraint": false,
628
+ "keyName": "ksef_direct_documents_organization_id_tenant_id_index",
629
+ "primary": false,
630
+ "unique": false
631
+ },
632
+ {
633
+ "columnNames": ["organization_id", "tenant_id", "status"],
634
+ "composite": true,
635
+ "constraint": false,
636
+ "keyName": "ksef_direct_documents_organization_id_tenant_id_status_index",
637
+ "primary": false,
638
+ "unique": false
639
+ },
640
+ {
641
+ "columnNames": ["organization_id", "tenant_id", "source"],
642
+ "composite": true,
643
+ "constraint": false,
644
+ "keyName": "ksef_direct_documents_organization_id_tenant_id_source_index",
645
+ "primary": false,
646
+ "unique": false
647
+ },
648
+ {
649
+ "columnNames": ["ksef_reference_number"],
650
+ "composite": false,
651
+ "constraint": false,
652
+ "keyName": "ksef_direct_documents_ksef_reference_number_index",
653
+ "primary": false,
654
+ "unique": false
655
+ }
656
+ ],
657
+ "checks": [],
658
+ "foreignKeys": {},
659
+ "comment": null
660
+ },
661
+ {
662
+ "name": "ksef_direct_received_documents",
663
+ "schema": "public",
664
+ "columns": {
665
+ "id": {
666
+ "name": "id",
667
+ "type": "uuid",
668
+ "unsigned": false,
669
+ "autoincrement": false,
670
+ "primary": true,
671
+ "nullable": false,
672
+ "unique": false,
673
+ "length": null,
674
+ "precision": null,
675
+ "scale": null,
676
+ "default": "gen_random_uuid()",
677
+ "comment": null,
678
+ "enumItems": [],
679
+ "mappedType": "uuid"
680
+ },
681
+ "organization_id": {
682
+ "name": "organization_id",
683
+ "type": "uuid",
684
+ "unsigned": false,
685
+ "autoincrement": false,
686
+ "primary": false,
687
+ "nullable": false,
688
+ "unique": false,
689
+ "length": null,
690
+ "precision": null,
691
+ "scale": null,
692
+ "default": null,
693
+ "comment": null,
694
+ "enumItems": [],
695
+ "mappedType": "uuid"
696
+ },
697
+ "tenant_id": {
698
+ "name": "tenant_id",
699
+ "type": "uuid",
700
+ "unsigned": false,
701
+ "autoincrement": false,
702
+ "primary": false,
703
+ "nullable": false,
704
+ "unique": false,
705
+ "length": null,
706
+ "precision": null,
707
+ "scale": null,
708
+ "default": null,
709
+ "comment": null,
710
+ "enumItems": [],
711
+ "mappedType": "uuid"
712
+ },
713
+ "ksef_reference_number": {
714
+ "name": "ksef_reference_number",
715
+ "type": "text",
716
+ "unsigned": false,
717
+ "autoincrement": false,
718
+ "primary": false,
719
+ "nullable": false,
720
+ "unique": false,
721
+ "length": null,
722
+ "precision": null,
723
+ "scale": null,
724
+ "default": null,
725
+ "comment": null,
726
+ "enumItems": [],
727
+ "mappedType": "text"
728
+ },
729
+ "raw_xml": {
730
+ "name": "raw_xml",
731
+ "type": "text",
732
+ "unsigned": false,
733
+ "autoincrement": false,
734
+ "primary": false,
735
+ "nullable": true,
736
+ "unique": false,
737
+ "length": null,
738
+ "precision": null,
739
+ "scale": null,
740
+ "default": null,
741
+ "comment": null,
742
+ "enumItems": [],
743
+ "mappedType": "text"
744
+ },
745
+ "invoice_number": {
746
+ "name": "invoice_number",
747
+ "type": "text",
748
+ "unsigned": false,
749
+ "autoincrement": false,
750
+ "primary": false,
751
+ "nullable": true,
752
+ "unique": false,
753
+ "length": null,
754
+ "precision": null,
755
+ "scale": null,
756
+ "default": null,
757
+ "comment": null,
758
+ "enumItems": [],
759
+ "mappedType": "text"
760
+ },
761
+ "seller_nip": {
762
+ "name": "seller_nip",
763
+ "type": "text",
764
+ "unsigned": false,
765
+ "autoincrement": false,
766
+ "primary": false,
767
+ "nullable": true,
768
+ "unique": false,
769
+ "length": null,
770
+ "precision": null,
771
+ "scale": null,
772
+ "default": null,
773
+ "comment": null,
774
+ "enumItems": [],
775
+ "mappedType": "text"
776
+ },
777
+ "seller_name": {
778
+ "name": "seller_name",
779
+ "type": "text",
780
+ "unsigned": false,
781
+ "autoincrement": false,
782
+ "primary": false,
783
+ "nullable": true,
784
+ "unique": false,
785
+ "length": null,
786
+ "precision": null,
787
+ "scale": null,
788
+ "default": null,
789
+ "comment": null,
790
+ "enumItems": [],
791
+ "mappedType": "text"
792
+ },
793
+ "issue_date": {
794
+ "name": "issue_date",
795
+ "type": "date",
796
+ "unsigned": false,
797
+ "autoincrement": false,
798
+ "primary": false,
799
+ "nullable": true,
800
+ "unique": false,
801
+ "length": null,
802
+ "precision": null,
803
+ "scale": null,
804
+ "default": null,
805
+ "comment": null,
806
+ "enumItems": [],
807
+ "mappedType": "date"
808
+ },
809
+ "currency": {
810
+ "name": "currency",
811
+ "type": "text",
812
+ "unsigned": false,
813
+ "autoincrement": false,
814
+ "primary": false,
815
+ "nullable": true,
816
+ "unique": false,
817
+ "length": null,
818
+ "precision": null,
819
+ "scale": null,
820
+ "default": null,
821
+ "comment": null,
822
+ "enumItems": [],
823
+ "mappedType": "text"
824
+ },
825
+ "net_amount": {
826
+ "name": "net_amount",
827
+ "type": "numeric(15,2)",
828
+ "unsigned": false,
829
+ "autoincrement": false,
830
+ "primary": false,
831
+ "nullable": true,
832
+ "unique": false,
833
+ "length": null,
834
+ "precision": 15,
835
+ "scale": 2,
836
+ "default": null,
837
+ "comment": null,
838
+ "enumItems": [],
839
+ "mappedType": "decimal"
840
+ },
841
+ "vat_amount": {
842
+ "name": "vat_amount",
843
+ "type": "numeric(15,2)",
844
+ "unsigned": false,
845
+ "autoincrement": false,
846
+ "primary": false,
847
+ "nullable": true,
848
+ "unique": false,
849
+ "length": null,
850
+ "precision": 15,
851
+ "scale": 2,
852
+ "default": null,
853
+ "comment": null,
854
+ "enumItems": [],
855
+ "mappedType": "decimal"
856
+ },
857
+ "gross_amount": {
858
+ "name": "gross_amount",
859
+ "type": "numeric(15,2)",
860
+ "unsigned": false,
861
+ "autoincrement": false,
862
+ "primary": false,
863
+ "nullable": true,
864
+ "unique": false,
865
+ "length": null,
866
+ "precision": 15,
867
+ "scale": 2,
868
+ "default": null,
869
+ "comment": null,
870
+ "enumItems": [],
871
+ "mappedType": "decimal"
872
+ },
873
+ "status": {
874
+ "name": "status",
875
+ "type": "text",
876
+ "unsigned": false,
877
+ "autoincrement": false,
878
+ "primary": false,
879
+ "nullable": false,
880
+ "unique": false,
881
+ "length": null,
882
+ "precision": null,
883
+ "scale": null,
884
+ "default": "'pending_download'",
885
+ "comment": null,
886
+ "enumItems": [],
887
+ "mappedType": "text"
888
+ },
889
+ "error_message": {
890
+ "name": "error_message",
891
+ "type": "text",
892
+ "unsigned": false,
893
+ "autoincrement": false,
894
+ "primary": false,
895
+ "nullable": true,
896
+ "unique": false,
897
+ "length": null,
898
+ "precision": null,
899
+ "scale": null,
900
+ "default": null,
901
+ "comment": null,
902
+ "enumItems": [],
903
+ "mappedType": "text"
904
+ },
905
+ "upo_download_url": {
906
+ "name": "upo_download_url",
907
+ "type": "text",
908
+ "unsigned": false,
909
+ "autoincrement": false,
910
+ "primary": false,
911
+ "nullable": true,
912
+ "unique": false,
913
+ "length": null,
914
+ "precision": null,
915
+ "scale": null,
916
+ "default": null,
917
+ "comment": null,
918
+ "enumItems": [],
919
+ "mappedType": "text"
920
+ },
921
+ "invoice_download_url": {
922
+ "name": "invoice_download_url",
923
+ "type": "text",
924
+ "unsigned": false,
925
+ "autoincrement": false,
926
+ "primary": false,
927
+ "nullable": true,
928
+ "unique": false,
929
+ "length": null,
930
+ "precision": null,
931
+ "scale": null,
932
+ "default": null,
933
+ "comment": null,
934
+ "enumItems": [],
935
+ "mappedType": "text"
936
+ },
937
+ "synced_at": {
938
+ "name": "synced_at",
939
+ "type": "timestamptz(6)",
940
+ "unsigned": false,
941
+ "autoincrement": false,
942
+ "primary": false,
943
+ "nullable": true,
944
+ "unique": false,
945
+ "length": 6,
946
+ "precision": null,
947
+ "scale": null,
948
+ "default": null,
949
+ "comment": null,
950
+ "enumItems": [],
951
+ "mappedType": "datetime"
952
+ },
953
+ "created_at": {
954
+ "name": "created_at",
955
+ "type": "timestamptz(6)",
956
+ "unsigned": false,
957
+ "autoincrement": false,
958
+ "primary": false,
959
+ "nullable": false,
960
+ "unique": false,
961
+ "length": 6,
962
+ "precision": null,
963
+ "scale": null,
964
+ "default": null,
965
+ "comment": null,
966
+ "enumItems": [],
967
+ "mappedType": "datetime"
968
+ },
969
+ "updated_at": {
970
+ "name": "updated_at",
971
+ "type": "timestamptz(6)",
972
+ "unsigned": false,
973
+ "autoincrement": false,
974
+ "primary": false,
975
+ "nullable": false,
976
+ "unique": false,
977
+ "length": 6,
978
+ "precision": null,
979
+ "scale": null,
980
+ "default": null,
981
+ "comment": null,
982
+ "enumItems": [],
983
+ "mappedType": "datetime"
984
+ }
985
+ },
986
+ "indexes": [
987
+ {
988
+ "columnNames": ["id"],
989
+ "composite": false,
990
+ "constraint": true,
991
+ "keyName": "ksef_direct_received_documents_pkey",
992
+ "primary": true,
993
+ "unique": true
994
+ },
995
+ {
996
+ "columnNames": ["organization_id", "tenant_id"],
997
+ "composite": true,
998
+ "constraint": false,
999
+ "keyName": "ksef_direct_received_documents_organization_id_tenant_id_index",
1000
+ "primary": false,
1001
+ "unique": false
1002
+ },
1003
+ {
1004
+ "columnNames": ["organization_id", "tenant_id", "status"],
1005
+ "composite": true,
1006
+ "constraint": false,
1007
+ "keyName": "ksef_direct_received_documents_organization_id_tenant_id_status_index",
1008
+ "primary": false,
1009
+ "unique": false
1010
+ },
1011
+ {
1012
+ "columnNames": ["organization_id", "ksef_reference_number"],
1013
+ "composite": true,
1014
+ "constraint": true,
1015
+ "keyName": "ksef_direct_received_documents_organization_id_ksef_reference_number_unique",
1016
+ "primary": false,
1017
+ "unique": true
1018
+ }
1019
+ ],
1020
+ "checks": [],
1021
+ "foreignKeys": {},
1022
+ "comment": null
1023
+ }
1024
+ ],
1025
+ "views": [],
1026
+ "nativeEnums": {}
1027
+ }
1028
+