@golemio/energetics 2.1.1-dev.3090059999 → 2.1.1-dev.3090107004
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/docs/openapi-input.yaml +313 -2
- package/package.json +2 -2
package/docs/openapi-input.yaml
CHANGED
|
@@ -9,9 +9,9 @@ info:
|
|
|
9
9
|
email: golemio@operatorict.cz
|
|
10
10
|
url: https://golemio.cz
|
|
11
11
|
servers:
|
|
12
|
-
- url: https://rabin.golemio.cz/
|
|
12
|
+
- url: https://rabin.golemio.cz/input-gateway/v1
|
|
13
13
|
description: Test (development) server
|
|
14
|
-
- url: https://api.golemio.cz/
|
|
14
|
+
- url: https://api.golemio.cz/input-gateway/v1
|
|
15
15
|
description: Main (production) server
|
|
16
16
|
|
|
17
17
|
paths:
|
|
@@ -151,6 +151,115 @@ paths:
|
|
|
151
151
|
$ref: "#/components/responses/UnauthorizedError"
|
|
152
152
|
422:
|
|
153
153
|
description: Error while validating input data
|
|
154
|
+
/pvk/invoices:
|
|
155
|
+
post:
|
|
156
|
+
tags:
|
|
157
|
+
- ⚡ Energetics
|
|
158
|
+
summary: Receive a PVK invoice
|
|
159
|
+
description: >-
|
|
160
|
+
<img src="https://img.shields.io/badge/stability-experimental-orange" alt="golemioapi-stability-badge" />
|
|
161
|
+
Receives one invoice from Pražské vodovody a kanalizace (PVK) per request, as one XML
|
|
162
|
+
document. The content is not validated against the schema yet: any well-formed XML document is accepted and stored.
|
|
163
|
+
requestBody:
|
|
164
|
+
required: true
|
|
165
|
+
content:
|
|
166
|
+
application/xml:
|
|
167
|
+
schema:
|
|
168
|
+
$ref: "#/components/schemas/PvkInvoice"
|
|
169
|
+
examples:
|
|
170
|
+
regularInvoice:
|
|
171
|
+
summary: Regular invoice (I)
|
|
172
|
+
value: |
|
|
173
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
174
|
+
<ROWSET>
|
|
175
|
+
<HEADER>
|
|
176
|
+
<IVA_ID>10000001</IVA_ID>
|
|
177
|
+
<INVOICE_NO>2600000001</INVOICE_NO>
|
|
178
|
+
<INVOICE_TYPE>I</INVOICE_TYPE>
|
|
179
|
+
<INVOICE_TYPE_NAME>Faktura</INVOICE_TYPE_NAME>
|
|
180
|
+
<ORIG_INVOICE_NO/>
|
|
181
|
+
<ORIG_IVA_ID/>
|
|
182
|
+
<PARTNER_ID>30000001</PARTNER_ID>
|
|
183
|
+
<SUBJECT_NAME>Organizace, a.s.</SUBJECT_NAME>
|
|
184
|
+
<ICO>12345678</ICO>
|
|
185
|
+
<DIC>CZ12345678</DIC>
|
|
186
|
+
<ULICE>Ukázková</ULICE>
|
|
187
|
+
<SUBJECT_HOUSENUM>100</SUBJECT_HOUSENUM>
|
|
188
|
+
<SUBJECT_STREETNUM>1</SUBJECT_STREETNUM>
|
|
189
|
+
<SUBJECT_CITY>Praha</SUBJECT_CITY>
|
|
190
|
+
<SUBJECT_ZIP>11000</SUBJECT_ZIP>
|
|
191
|
+
<CP_NAME/>
|
|
192
|
+
<CP_STREET>Vzorová</CP_STREET>
|
|
193
|
+
<CP_HOUSENUM>200</CP_HOUSENUM>
|
|
194
|
+
<CP_STREETNUM>2</CP_STREETNUM>
|
|
195
|
+
<CP_CITY>Praha</CP_CITY>
|
|
196
|
+
<CP_ZIP>12000</CP_ZIP>
|
|
197
|
+
<CP_ID>300000001</CP_ID>
|
|
198
|
+
<CP_NUMBER>300000-1</CP_NUMBER>
|
|
199
|
+
<MAIL_ADDR_CODE>30000101</MAIL_ADDR_CODE>
|
|
200
|
+
<MAIL_ADDR_NAME/>
|
|
201
|
+
<MAIL_ADDR_ADDRESS>Ukázková 100/1</MAIL_ADDR_ADDRESS>
|
|
202
|
+
<MAIL_ADDR_CITY>Praha</MAIL_ADDR_CITY>
|
|
203
|
+
<MAIL_ADDR_ZIP>11000</MAIL_ADDR_ZIP>
|
|
204
|
+
<BILLING_BANKACC>123456789/0100</BILLING_BANKACC>
|
|
205
|
+
<BILLING_ADVI_FREQ>čtvrtletně</BILLING_ADVI_FREQ>
|
|
206
|
+
<BILLING_ADVI_AMOUNT>10000</BILLING_ADVI_AMOUNT>
|
|
207
|
+
<TOTAL_PRICE_EXCL_VAT>17614.42</TOTAL_PRICE_EXCL_VAT>
|
|
208
|
+
<TOTAL_PRICE_V>6953</TOTAL_PRICE_V>
|
|
209
|
+
<TOTAL_PRICE_S>10661.42</TOTAL_PRICE_S>
|
|
210
|
+
<TOTAL_PRICE_FULL>19728</TOTAL_PRICE_FULL>
|
|
211
|
+
<VAT>
|
|
212
|
+
<VAT_ROW>
|
|
213
|
+
<VAT_RATE>12</VAT_RATE>
|
|
214
|
+
<VAT_BASE>17614.42</VAT_BASE>
|
|
215
|
+
</VAT_ROW>
|
|
216
|
+
</VAT>
|
|
217
|
+
</HEADER>
|
|
218
|
+
<DETAIL>
|
|
219
|
+
<DETAIL_ROW>
|
|
220
|
+
<DATE_FROM>01.01.2026</DATE_FROM>
|
|
221
|
+
<DATE_TO>31.03.2026</DATE_TO>
|
|
222
|
+
<PRICE_V>6953</PRICE_V>
|
|
223
|
+
<PRICE_S>7084</PRICE_S>
|
|
224
|
+
<PRICE_R>0</PRICE_R>
|
|
225
|
+
<STATUS_FROM>1000</STATUS_FROM>
|
|
226
|
+
<STATUS_TO>1100</STATUS_TO>
|
|
227
|
+
<CONS_M3_V>100</CONS_M3_V>
|
|
228
|
+
<CONS_M3_S>100</CONS_M3_S>
|
|
229
|
+
<CONS_M3_R>0</CONS_M3_R>
|
|
230
|
+
<DEVNUM>00000000001</DEVNUM>
|
|
231
|
+
<UNIT_PRICE_V>69.53</UNIT_PRICE_V>
|
|
232
|
+
<UNIT_PRICE_S>70.84</UNIT_PRICE_S>
|
|
233
|
+
<UNIT_PRICE_R>0</UNIT_PRICE_R>
|
|
234
|
+
</DETAIL_ROW>
|
|
235
|
+
<DETAIL_ROW>
|
|
236
|
+
<DATE_FROM>01.01.2026</DATE_FROM>
|
|
237
|
+
<DATE_TO>31.03.2026</DATE_TO>
|
|
238
|
+
<PRICE_V>0</PRICE_V>
|
|
239
|
+
<PRICE_S>0</PRICE_S>
|
|
240
|
+
<PRICE_R>3577.42</PRICE_R>
|
|
241
|
+
<CONS_M3_V>0</CONS_M3_V>
|
|
242
|
+
<CONS_M3_S>0</CONS_M3_S>
|
|
243
|
+
<CONS_M3_R>50.5</CONS_M3_R>
|
|
244
|
+
<UNIT_PRICE_V>0</UNIT_PRICE_V>
|
|
245
|
+
<UNIT_PRICE_S>0</UNIT_PRICE_S>
|
|
246
|
+
<UNIT_PRICE_R>70.84</UNIT_PRICE_R>
|
|
247
|
+
</DETAIL_ROW>
|
|
248
|
+
</DETAIL>
|
|
249
|
+
</ROWSET>
|
|
250
|
+
responses:
|
|
251
|
+
204:
|
|
252
|
+
description: OK
|
|
253
|
+
400:
|
|
254
|
+
description: Bad Request
|
|
255
|
+
401:
|
|
256
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
257
|
+
403:
|
|
258
|
+
description: Forbidden
|
|
259
|
+
406:
|
|
260
|
+
description: Not Acceptable
|
|
261
|
+
413:
|
|
262
|
+
description: Payload Too Large
|
|
154
263
|
components:
|
|
155
264
|
responses:
|
|
156
265
|
UnauthorizedError:
|
|
@@ -212,5 +321,207 @@ components:
|
|
|
212
321
|
properties:
|
|
213
322
|
companies:
|
|
214
323
|
type: object
|
|
324
|
+
PvkInvoice:
|
|
325
|
+
type: object
|
|
326
|
+
description: >-
|
|
327
|
+
One PVK invoice document.
|
|
328
|
+
xml:
|
|
329
|
+
name: ROWSET
|
|
330
|
+
required:
|
|
331
|
+
- HEADER
|
|
332
|
+
- DETAIL
|
|
333
|
+
properties:
|
|
334
|
+
HEADER:
|
|
335
|
+
$ref: "#/components/schemas/PvkInvoiceHeader"
|
|
336
|
+
DETAIL:
|
|
337
|
+
type: object
|
|
338
|
+
required:
|
|
339
|
+
- DETAIL_ROW
|
|
340
|
+
properties:
|
|
341
|
+
DETAIL_ROW:
|
|
342
|
+
type: array
|
|
343
|
+
minItems: 1
|
|
344
|
+
items:
|
|
345
|
+
$ref: "#/components/schemas/PvkInvoiceDetailRow"
|
|
346
|
+
PvkInvoiceHeader:
|
|
347
|
+
type: object
|
|
348
|
+
required:
|
|
349
|
+
- IVA_ID
|
|
350
|
+
- INVOICE_NO
|
|
351
|
+
- INVOICE_TYPE
|
|
352
|
+
- PARTNER_ID
|
|
353
|
+
- ICO
|
|
354
|
+
- CP_ID
|
|
355
|
+
- CP_NUMBER
|
|
356
|
+
- TOTAL_PRICE_EXCL_VAT
|
|
357
|
+
- TOTAL_PRICE_FULL
|
|
358
|
+
- VAT
|
|
359
|
+
properties:
|
|
360
|
+
IVA_ID:
|
|
361
|
+
type: string
|
|
362
|
+
description: PVK internal ID of the document
|
|
363
|
+
INVOICE_NO:
|
|
364
|
+
type: string
|
|
365
|
+
description: Tax document number
|
|
366
|
+
INVOICE_TYPE:
|
|
367
|
+
type: string
|
|
368
|
+
enum:
|
|
369
|
+
- I
|
|
370
|
+
- R
|
|
371
|
+
- S
|
|
372
|
+
description: Document type - `I` regular invoice, `R` corrective invoice, `S` cancellation
|
|
373
|
+
INVOICE_TYPE_NAME:
|
|
374
|
+
type: string
|
|
375
|
+
example: Faktura
|
|
376
|
+
ORIG_INVOICE_NO:
|
|
377
|
+
type: string
|
|
378
|
+
description: Number of the original invoice, required for `R` and `S`
|
|
379
|
+
ORIG_IVA_ID:
|
|
380
|
+
type: string
|
|
381
|
+
description: PVK internal ID of the original invoice, required for `R` and `S`
|
|
382
|
+
PARTNER_ID:
|
|
383
|
+
type: string
|
|
384
|
+
SUBJECT_NAME:
|
|
385
|
+
type: string
|
|
386
|
+
ICO:
|
|
387
|
+
type: string
|
|
388
|
+
example: "12345678"
|
|
389
|
+
DIC:
|
|
390
|
+
type: string
|
|
391
|
+
ULICE:
|
|
392
|
+
type: string
|
|
393
|
+
SUBJECT_HOUSENUM:
|
|
394
|
+
type: string
|
|
395
|
+
SUBJECT_STREETNUM:
|
|
396
|
+
type: string
|
|
397
|
+
SUBJECT_CITY:
|
|
398
|
+
type: string
|
|
399
|
+
SUBJECT_ZIP:
|
|
400
|
+
type: string
|
|
401
|
+
CP_NAME:
|
|
402
|
+
type: string
|
|
403
|
+
description: Name of the consumption point
|
|
404
|
+
CP_STREET:
|
|
405
|
+
type: string
|
|
406
|
+
CP_HOUSENUM:
|
|
407
|
+
type: string
|
|
408
|
+
CP_STREETNUM:
|
|
409
|
+
type: string
|
|
410
|
+
CP_CITY:
|
|
411
|
+
type: string
|
|
412
|
+
CP_ZIP:
|
|
413
|
+
type: string
|
|
414
|
+
CP_ID:
|
|
415
|
+
type: string
|
|
416
|
+
description: ID of the consumption point
|
|
417
|
+
CP_NUMBER:
|
|
418
|
+
type: string
|
|
419
|
+
description: Number of the consumption point
|
|
420
|
+
MAIL_ADDR_CODE:
|
|
421
|
+
type: string
|
|
422
|
+
MAIL_ADDR_NAME:
|
|
423
|
+
type: string
|
|
424
|
+
MAIL_ADDR_ADDRESS:
|
|
425
|
+
type: string
|
|
426
|
+
MAIL_ADDR_CITY:
|
|
427
|
+
type: string
|
|
428
|
+
MAIL_ADDR_ZIP:
|
|
429
|
+
type: string
|
|
430
|
+
BILLING_BANKACC:
|
|
431
|
+
type: string
|
|
432
|
+
BILLING_ADVI_FREQ:
|
|
433
|
+
type: string
|
|
434
|
+
description: Frequency of advance payments, empty for a cancellation
|
|
435
|
+
BILLING_ADVI_AMOUNT:
|
|
436
|
+
type: number
|
|
437
|
+
nullable: true
|
|
438
|
+
description: Amount of an advance payment, empty for a cancellation
|
|
439
|
+
TOTAL_PRICE_EXCL_VAT:
|
|
440
|
+
type: number
|
|
441
|
+
description: Total excluding VAT
|
|
442
|
+
TOTAL_PRICE_V:
|
|
443
|
+
type: number
|
|
444
|
+
description: Total for water supply
|
|
445
|
+
TOTAL_PRICE_S:
|
|
446
|
+
type: number
|
|
447
|
+
description: Total for sewage, including rainwater and surcharges
|
|
448
|
+
TOTAL_PRICE_FULL:
|
|
449
|
+
type: number
|
|
450
|
+
description: Total including VAT, rounded
|
|
451
|
+
VAT:
|
|
452
|
+
type: object
|
|
453
|
+
required:
|
|
454
|
+
- VAT_ROW
|
|
455
|
+
properties:
|
|
456
|
+
VAT_ROW:
|
|
457
|
+
type: array
|
|
458
|
+
minItems: 1
|
|
459
|
+
items:
|
|
460
|
+
$ref: "#/components/schemas/PvkInvoiceVatRow"
|
|
461
|
+
PvkInvoiceVatRow:
|
|
462
|
+
type: object
|
|
463
|
+
required:
|
|
464
|
+
- VAT_RATE
|
|
465
|
+
- VAT_BASE
|
|
466
|
+
properties:
|
|
467
|
+
VAT_RATE:
|
|
468
|
+
type: number
|
|
469
|
+
description: VAT rate in percent
|
|
470
|
+
VAT_BASE:
|
|
471
|
+
type: number
|
|
472
|
+
description: Tax base for the rate
|
|
473
|
+
PvkInvoiceDetailRow:
|
|
474
|
+
type: object
|
|
475
|
+
description: >-
|
|
476
|
+
One billed period. Amounts are negative for a cancellation. For a corrective invoice they are the
|
|
477
|
+
difference from the original invoice. Suffix `V` is water supply, `S` sewage and `R` rainwater.
|
|
478
|
+
required:
|
|
479
|
+
- DATE_FROM
|
|
480
|
+
- DATE_TO
|
|
481
|
+
- PRICE_V
|
|
482
|
+
- PRICE_S
|
|
483
|
+
- PRICE_R
|
|
484
|
+
- CONS_M3_V
|
|
485
|
+
- CONS_M3_S
|
|
486
|
+
- CONS_M3_R
|
|
487
|
+
- UNIT_PRICE_V
|
|
488
|
+
- UNIT_PRICE_S
|
|
489
|
+
- UNIT_PRICE_R
|
|
490
|
+
properties:
|
|
491
|
+
DATE_FROM:
|
|
492
|
+
type: string
|
|
493
|
+
pattern: '^\d{2}\.\d{2}\.\d{4}$'
|
|
494
|
+
example: 13.05.2025
|
|
495
|
+
DATE_TO:
|
|
496
|
+
type: string
|
|
497
|
+
pattern: '^\d{2}\.\d{2}\.\d{4}$'
|
|
498
|
+
example: 31.12.2025
|
|
499
|
+
PRICE_V:
|
|
500
|
+
type: number
|
|
501
|
+
PRICE_S:
|
|
502
|
+
type: number
|
|
503
|
+
PRICE_R:
|
|
504
|
+
type: number
|
|
505
|
+
STATUS_FROM:
|
|
506
|
+
type: number
|
|
507
|
+
description: Meter reading at the start of the period, missing for rainwater rows
|
|
508
|
+
STATUS_TO:
|
|
509
|
+
type: number
|
|
510
|
+
description: Meter reading at the end of the period, missing for rainwater rows
|
|
511
|
+
CONS_M3_V:
|
|
512
|
+
type: number
|
|
513
|
+
CONS_M3_S:
|
|
514
|
+
type: number
|
|
515
|
+
CONS_M3_R:
|
|
516
|
+
type: number
|
|
517
|
+
DEVNUM:
|
|
518
|
+
type: string
|
|
519
|
+
description: Meter serial number, missing for rainwater rows
|
|
520
|
+
UNIT_PRICE_V:
|
|
521
|
+
type: number
|
|
522
|
+
UNIT_PRICE_S:
|
|
523
|
+
type: number
|
|
524
|
+
UNIT_PRICE_R:
|
|
525
|
+
type: number
|
|
215
526
|
|
|
216
527
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/energetics",
|
|
3
|
-
"version": "2.1.1-dev.
|
|
3
|
+
"version": "2.1.1-dev.3090107004",
|
|
4
4
|
"description": "Golemio Energetics Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"test": "run-s prepare-db typecheck test:only",
|
|
15
15
|
"test-debug": "run-s 'test -- --inspect-brk=9230'",
|
|
16
16
|
"apidocs-test": "npm run apidocs-test-input && npm run apidocs-test-output",
|
|
17
|
-
"apidocs-test-input": "cross-env NODE_ENV=test golemio swagger api-test --oas docs/openapi-input.yaml --script test/api-docs/input-gateway/server.js",
|
|
17
|
+
"apidocs-test-input": "cross-env NODE_ENV=test golemio swagger api-test --oas docs/openapi-input.yaml --script test/api-docs/input-gateway/server.js --filter test/api-docs/input-gateway/portman-filter.json",
|
|
18
18
|
"apidocs-test-output": "cross-env NODE_ENV=test golemio swagger api-test --oas docs/openapi-output.yaml --script test/api-docs/output-gateway/server.js --config test/api-docs/output-gateway/portman-config.json",
|
|
19
19
|
"coverage:only": "nyc --reporter=text --reporter=lcov npm run test:only -- -r source-map-support/register",
|
|
20
20
|
"code-coverage": "run-s prepare-db typecheck coverage:only",
|