@golemio/energetics 1.10.1-dev.2609634792 → 1.10.1-dev.2634930492

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 (91) hide show
  1. package/db/migrations/postgresql/20260619000001-ppas-commercial-invoice.js +47 -0
  2. package/db/migrations/postgresql/sqls/20260619000001-ppas-commercial-invoice-down.sql +4 -0
  3. package/db/migrations/postgresql/sqls/20260619000001-ppas-commercial-invoice-up.sql +99 -0
  4. package/dist/integration-engine/enapo/datasources/ppas/AbstractPpasDatasource.d.ts +16 -0
  5. package/dist/integration-engine/enapo/datasources/ppas/AbstractPpasDatasource.js +88 -0
  6. package/dist/integration-engine/enapo/datasources/ppas/AbstractPpasDatasource.js.map +1 -0
  7. package/dist/integration-engine/enapo/datasources/ppas/commercial/PpasCommercialDatasource.d.ts +13 -0
  8. package/dist/integration-engine/enapo/datasources/ppas/commercial/PpasCommercialDatasource.js +66 -0
  9. package/dist/integration-engine/enapo/datasources/ppas/commercial/PpasCommercialDatasource.js.map +1 -0
  10. package/dist/integration-engine/enapo/datasources/ppas/distribution/PpasDistributionDatasource.d.ts +3 -14
  11. package/dist/integration-engine/enapo/datasources/ppas/distribution/PpasDistributionDatasource.js +6 -86
  12. package/dist/integration-engine/enapo/datasources/ppas/distribution/PpasDistributionDatasource.js.map +1 -1
  13. package/dist/integration-engine/enapo/ioc/Di.js +14 -0
  14. package/dist/integration-engine/enapo/ioc/Di.js.map +1 -1
  15. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.d.ts +7 -0
  16. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js +7 -0
  17. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js.map +1 -1
  18. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceDeviceRepository.d.ts +7 -0
  19. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceDeviceRepository.js +35 -0
  20. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceDeviceRepository.js.map +1 -0
  21. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceInstallationRepository.d.ts +7 -0
  22. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceInstallationRepository.js +35 -0
  23. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceInstallationRepository.js.map +1 -0
  24. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoicePriceRepository.d.ts +7 -0
  25. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoicePriceRepository.js +35 -0
  26. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoicePriceRepository.js.map +1 -0
  27. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceRepository.d.ts +7 -0
  28. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceRepository.js +35 -0
  29. package/dist/integration-engine/enapo/repositories/ppas/PpasCommercialInvoiceRepository.js.map +1 -0
  30. package/dist/integration-engine/enapo/transformations/ppas/PpasCommercialTransformation.d.ts +28 -0
  31. package/dist/integration-engine/enapo/transformations/ppas/PpasCommercialTransformation.js +184 -0
  32. package/dist/integration-engine/enapo/transformations/ppas/PpasCommercialTransformation.js.map +1 -0
  33. package/dist/integration-engine/enapo/transformations/ppas/PpasDistributionTransformation.d.ts +0 -18
  34. package/dist/integration-engine/enapo/transformations/ppas/PpasDistributionTransformation.js +14 -82
  35. package/dist/integration-engine/enapo/transformations/ppas/PpasDistributionTransformation.js.map +1 -1
  36. package/dist/integration-engine/enapo/transformations/ppas/PpasInvoicePriceTypeHelper.d.ts +33 -0
  37. package/dist/integration-engine/enapo/transformations/ppas/PpasInvoicePriceTypeHelper.js +87 -0
  38. package/dist/integration-engine/enapo/transformations/ppas/PpasInvoicePriceTypeHelper.js.map +1 -0
  39. package/dist/integration-engine/enapo/workers/EnapoWorker.js +1 -0
  40. package/dist/integration-engine/enapo/workers/EnapoWorker.js.map +1 -1
  41. package/dist/integration-engine/enapo/workers/interfaces/IEnapoPpasCommercialParams.d.ts +4 -0
  42. package/dist/integration-engine/enapo/workers/interfaces/IEnapoPpasCommercialParams.js +3 -0
  43. package/dist/integration-engine/enapo/workers/interfaces/IEnapoPpasCommercialParams.js.map +1 -0
  44. package/dist/integration-engine/enapo/workers/schema/EnapoPpasCommercialParamsSchema.d.ts +5 -0
  45. package/dist/integration-engine/enapo/workers/schema/EnapoPpasCommercialParamsSchema.js +29 -0
  46. package/dist/integration-engine/enapo/workers/schema/EnapoPpasCommercialParamsSchema.js.map +1 -0
  47. package/dist/integration-engine/enapo/workers/task/EnapoPpasCommercialTask.d.ts +34 -0
  48. package/dist/integration-engine/enapo/workers/task/EnapoPpasCommercialTask.js +181 -0
  49. package/dist/integration-engine/enapo/workers/task/EnapoPpasCommercialTask.js.map +1 -0
  50. package/dist/integration-engine/enapo/workers/task/EnapoPpasDistributionTask.js.map +1 -1
  51. package/dist/schema-definitions/datasources/enapo/ppas/IPpasInvoiceCommon.d.ts +23 -0
  52. package/dist/schema-definitions/datasources/enapo/ppas/IPpasInvoiceCommon.js +3 -0
  53. package/dist/schema-definitions/datasources/enapo/ppas/IPpasInvoiceCommon.js.map +1 -0
  54. package/dist/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceDetailInput.d.ts +62 -0
  55. package/dist/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceDetailInput.js +3 -0
  56. package/dist/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceDetailInput.js.map +1 -0
  57. package/dist/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceListInput.d.ts +26 -0
  58. package/dist/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceListInput.js +3 -0
  59. package/dist/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceListInput.js.map +1 -0
  60. package/dist/schema-definitions/datasources/enapo/ppas/commercial/PpasCommercialSchema.d.ts +5 -0
  61. package/dist/schema-definitions/datasources/enapo/ppas/commercial/PpasCommercialSchema.js +185 -0
  62. package/dist/schema-definitions/datasources/enapo/ppas/commercial/PpasCommercialSchema.js.map +1 -0
  63. package/dist/schema-definitions/datasources/enapo/ppas/distribution/IPpasDistributionInvoiceDetailInput.d.ts +7 -6
  64. package/dist/schema-definitions/datasources/enapo/ppas/distribution/IPpasDistributionInvoiceListInput.d.ts +5 -27
  65. package/dist/schema-definitions/datasources/enapo/ppas/distribution/PpasDistributionSchema.js.map +1 -1
  66. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceDeviceModel.d.ts +24 -0
  67. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceDeviceModel.js +54 -0
  68. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceDeviceModel.js.map +1 -0
  69. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceInstallationModel.d.ts +26 -0
  70. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceInstallationModel.js +56 -0
  71. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceInstallationModel.js.map +1 -0
  72. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceModel.d.ts +30 -0
  73. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceModel.js +64 -0
  74. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceModel.js.map +1 -0
  75. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoicePriceModel.d.ts +23 -0
  76. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoicePriceModel.js +52 -0
  77. package/dist/schema-definitions/models/enapo/ppas/PpasCommercialInvoicePriceModel.js.map +1 -0
  78. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoice.d.ts +24 -0
  79. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoice.js +3 -0
  80. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoice.js.map +1 -0
  81. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice.d.ts +19 -0
  82. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice.js +3 -0
  83. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice.js.map +1 -0
  84. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceInstallation.d.ts +20 -0
  85. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceInstallation.js +3 -0
  86. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceInstallation.js.map +1 -0
  87. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice.d.ts +18 -0
  88. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice.js +3 -0
  89. package/dist/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice.js.map +1 -0
  90. package/docs/implementation_documentation.md +60 -1
  91. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
2
+ import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
3
+ import { IPpasCommercialInvoice } from "./interfaces/IPpasCommercialInvoice";
4
+ export declare class PpasCommercialInvoiceModel extends Model<IPpasCommercialInvoice> implements IPpasCommercialInvoice {
5
+ static TABLE_NAME: string;
6
+ id: string;
7
+ preceding_id: string;
8
+ customer_id: string;
9
+ customer_company_id: string;
10
+ customer_name: string;
11
+ customer_contract_account_id: string;
12
+ customer_address_street: string;
13
+ customer_address_house_number: string;
14
+ customer_address_house_org_number: string;
15
+ customer_address_city: string;
16
+ customer_address_city_part: string;
17
+ customer_address_post_code: string;
18
+ customer_address_country: string;
19
+ customer_address_ruian_id: number | null;
20
+ facts_doc_date: string;
21
+ facts_net_date: string;
22
+ facts_billing_transaction: string;
23
+ facts_to_pay_amount: number;
24
+ facts_currency: string;
25
+ facts_price_brutto: number;
26
+ is_canceled: boolean;
27
+ canceled_reason: string;
28
+ static attributeModel: ModelAttributes<PpasCommercialInvoiceModel, IPpasCommercialInvoice>;
29
+ static jsonSchema: JSONSchemaType<IPpasCommercialInvoice[]>;
30
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PpasCommercialInvoiceModel = void 0;
4
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
5
+ class PpasCommercialInvoiceModel extends sequelize_1.Model {
6
+ }
7
+ exports.PpasCommercialInvoiceModel = PpasCommercialInvoiceModel;
8
+ PpasCommercialInvoiceModel.TABLE_NAME = "enapo_ppas_commercial_invoice";
9
+ PpasCommercialInvoiceModel.attributeModel = {
10
+ id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
11
+ preceding_id: { type: sequelize_1.DataTypes.STRING },
12
+ customer_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
13
+ customer_company_id: { type: sequelize_1.DataTypes.STRING },
14
+ customer_name: { type: sequelize_1.DataTypes.STRING },
15
+ customer_contract_account_id: { type: sequelize_1.DataTypes.STRING },
16
+ customer_address_street: { type: sequelize_1.DataTypes.STRING },
17
+ customer_address_house_number: { type: sequelize_1.DataTypes.STRING },
18
+ customer_address_house_org_number: { type: sequelize_1.DataTypes.STRING },
19
+ customer_address_city: { type: sequelize_1.DataTypes.STRING },
20
+ customer_address_city_part: { type: sequelize_1.DataTypes.STRING },
21
+ customer_address_post_code: { type: sequelize_1.DataTypes.STRING },
22
+ customer_address_country: { type: sequelize_1.DataTypes.STRING },
23
+ customer_address_ruian_id: { type: sequelize_1.DataTypes.BIGINT },
24
+ facts_doc_date: { type: sequelize_1.DataTypes.DATEONLY },
25
+ facts_net_date: { type: sequelize_1.DataTypes.DATEONLY },
26
+ facts_billing_transaction: { type: sequelize_1.DataTypes.STRING },
27
+ facts_to_pay_amount: { type: sequelize_1.DataTypes.DECIMAL },
28
+ facts_currency: { type: sequelize_1.DataTypes.STRING },
29
+ facts_price_brutto: { type: sequelize_1.DataTypes.DECIMAL },
30
+ is_canceled: { type: sequelize_1.DataTypes.BOOLEAN },
31
+ canceled_reason: { type: sequelize_1.DataTypes.STRING },
32
+ };
33
+ PpasCommercialInvoiceModel.jsonSchema = {
34
+ type: "array",
35
+ items: {
36
+ type: "object",
37
+ properties: {
38
+ id: { type: "string" },
39
+ preceding_id: { type: "string", nullable: true },
40
+ customer_id: { type: "string" },
41
+ customer_company_id: { type: "string" },
42
+ customer_name: { type: "string" },
43
+ customer_contract_account_id: { type: "string" },
44
+ customer_address_street: { type: "string" },
45
+ customer_address_house_number: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
46
+ customer_address_house_org_number: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
47
+ customer_address_city: { type: "string" },
48
+ customer_address_city_part: { type: "string" },
49
+ customer_address_post_code: { type: "string" },
50
+ customer_address_country: { type: "string" },
51
+ customer_address_ruian_id: { oneOf: [{ type: "number" }, { type: "null", nullable: true }] },
52
+ facts_doc_date: { type: "string" },
53
+ facts_net_date: { type: "string" },
54
+ facts_billing_transaction: { type: "string" },
55
+ facts_to_pay_amount: { type: "number" },
56
+ facts_currency: { type: "string" },
57
+ facts_price_brutto: { type: "number" },
58
+ is_canceled: { type: "boolean", nullable: true },
59
+ canceled_reason: { type: "string", nullable: true },
60
+ },
61
+ required: ["id", "customer_id"],
62
+ },
63
+ };
64
+ //# sourceMappingURL=PpasCommercialInvoiceModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PpasCommercialInvoiceModel.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceModel.ts"],"names":[],"mappings":";;;AACA,mEAAwF;AAGxF,MAAa,0BAA2B,SAAQ,iBAA6B;;AAA7E,gEAkFC;AAjFiB,qCAAU,GAAG,+BAA+B,CAAC;AAyB7C,yCAAc,GAAw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,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE;YAC5F,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClC,yBAAyB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC7C,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvC,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAClC,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;SACtD;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC;KAClC;CACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
2
+ import { IPpasCommercialInvoicePrice } from "./interfaces/IPpasCommercialInvoicePrice";
3
+ export declare class PpasCommercialInvoicePriceModel extends Model<IPpasCommercialInvoicePrice> implements IPpasCommercialInvoicePrice {
4
+ static TABLE_NAME: string;
5
+ invoice_id: string;
6
+ customer_id: string;
7
+ place_id: string;
8
+ date_from: string;
9
+ date_to: string;
10
+ kind: string;
11
+ description: string;
12
+ price_group: string;
13
+ quantity: number;
14
+ unit: string;
15
+ unit_price: number;
16
+ time_slot: number | null;
17
+ price_netto: number;
18
+ price_type: string;
19
+ currency: string;
20
+ tax_rate: number;
21
+ static attributeModel: ModelAttributes<PpasCommercialInvoicePriceModel, IPpasCommercialInvoicePrice>;
22
+ static jsonSchema: object;
23
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PpasCommercialInvoicePriceModel = void 0;
4
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
5
+ class PpasCommercialInvoicePriceModel extends sequelize_1.Model {
6
+ }
7
+ exports.PpasCommercialInvoicePriceModel = PpasCommercialInvoicePriceModel;
8
+ PpasCommercialInvoicePriceModel.TABLE_NAME = "enapo_ppas_commercial_invoice_price";
9
+ PpasCommercialInvoicePriceModel.attributeModel = {
10
+ invoice_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
11
+ customer_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
12
+ place_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
13
+ date_from: { type: sequelize_1.DataTypes.DATEONLY, primaryKey: true },
14
+ date_to: { type: sequelize_1.DataTypes.DATEONLY, primaryKey: true },
15
+ kind: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
16
+ description: { type: sequelize_1.DataTypes.STRING },
17
+ price_group: { type: sequelize_1.DataTypes.STRING },
18
+ quantity: { type: sequelize_1.DataTypes.DECIMAL },
19
+ unit: { type: sequelize_1.DataTypes.STRING },
20
+ unit_price: { type: sequelize_1.DataTypes.DECIMAL },
21
+ time_slot: { type: sequelize_1.DataTypes.DECIMAL },
22
+ price_netto: { type: sequelize_1.DataTypes.DECIMAL },
23
+ price_type: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
24
+ currency: { type: sequelize_1.DataTypes.STRING },
25
+ tax_rate: { type: sequelize_1.DataTypes.DECIMAL },
26
+ };
27
+ PpasCommercialInvoicePriceModel.jsonSchema = {
28
+ type: "array",
29
+ items: {
30
+ type: "object",
31
+ properties: {
32
+ invoice_id: { type: "string" },
33
+ customer_id: { type: "string" },
34
+ place_id: { type: "string" },
35
+ date_from: { type: "string" },
36
+ date_to: { type: "string" },
37
+ kind: { type: "string" },
38
+ description: { type: "string" },
39
+ price_group: { type: "string" },
40
+ quantity: { type: "number" },
41
+ unit: { type: "string" },
42
+ unit_price: { type: "number" },
43
+ time_slot: { anyOf: [{ type: "number" }, { type: "null" }] },
44
+ price_netto: { type: "number" },
45
+ price_type: { type: "string" },
46
+ currency: { type: "string" },
47
+ tax_rate: { type: "number" },
48
+ },
49
+ required: ["invoice_id", "customer_id", "place_id", "date_from", "date_to", "kind", "price_type"],
50
+ },
51
+ };
52
+ //# sourceMappingURL=PpasCommercialInvoicePriceModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PpasCommercialInvoicePriceModel.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/models/enapo/ppas/PpasCommercialInvoicePriceModel.ts"],"names":[],"mappings":";;;AAAA,mEAAwF;AAGxF,MAAa,+BAAgC,SAAQ,iBAAkC;;AAAvF,0EAgEC;AA/DiB,0CAAU,GAAG,qCAAqC,CAAC;AAmBnD,8CAAc,GAAkF;IAC1G,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IACxD,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IACzD,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IACtD,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE;IACzD,OAAO,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE;IACvD,IAAI,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IAClD,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IACvC,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IACvC,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,OAAO,EAAE;IACrC,IA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EAAE;YAC5D,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC;KACpG;CACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface IPpasCommercialInvoice {
2
+ id: string;
3
+ preceding_id?: string;
4
+ customer_id: string;
5
+ customer_company_id: string;
6
+ customer_name: string;
7
+ customer_contract_account_id: string;
8
+ customer_address_street: string;
9
+ customer_address_house_number: string | null;
10
+ customer_address_house_org_number: string | null;
11
+ customer_address_city: string;
12
+ customer_address_city_part: string;
13
+ customer_address_post_code: string;
14
+ customer_address_country: string;
15
+ customer_address_ruian_id: number | null;
16
+ facts_doc_date: string;
17
+ facts_net_date: string;
18
+ facts_billing_transaction: string;
19
+ facts_to_pay_amount: number;
20
+ facts_currency: string;
21
+ facts_price_brutto: number;
22
+ is_canceled?: boolean;
23
+ canceled_reason?: string;
24
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPpasCommercialInvoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPpasCommercialInvoice.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoice.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ export interface IPpasCommercialInvoiceDevice {
2
+ device_serial_number: string;
3
+ invoice_id: string;
4
+ place_id: string;
5
+ date_from: string;
6
+ date_to: string;
7
+ type: string;
8
+ kind: string;
9
+ reading_type: string;
10
+ reading_from: number | null;
11
+ reading_to: number | null;
12
+ consumption: number | null;
13
+ unit: string | null;
14
+ meter_reading_type: string | null;
15
+ gas_consumption_kwh: number | null;
16
+ volume_coefficient: number | null;
17
+ combustion_heat: number | null;
18
+ normometers_nm3: number | null;
19
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPpasCommercialInvoiceDevice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPpasCommercialInvoiceDevice.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export interface IPpasCommercialInvoiceInstallation {
2
+ invoice_id: string;
3
+ customer_id: string;
4
+ place_id: string;
5
+ eic: string;
6
+ billing_class: string;
7
+ measurement_type: string;
8
+ contract_contract_id: string | null;
9
+ contract_move_in_date: string;
10
+ contract_move_out_date: string;
11
+ tdd_class: string;
12
+ address_street: string;
13
+ address_house_number: string | null;
14
+ address_house_org_number: string | null;
15
+ address_city: string;
16
+ address_city_part: string;
17
+ address_post_code: string;
18
+ address_country: string;
19
+ address_ruian_id: number | null;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPpasCommercialInvoiceInstallation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPpasCommercialInvoiceInstallation.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceInstallation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ export interface IPpasCommercialInvoicePrice {
2
+ invoice_id: string;
3
+ customer_id: string;
4
+ place_id: string;
5
+ date_from: string;
6
+ date_to: string;
7
+ kind: string;
8
+ description: string;
9
+ price_group: string;
10
+ quantity: number;
11
+ unit: string;
12
+ unit_price: number;
13
+ time_slot: number | null;
14
+ price_netto: number;
15
+ price_type: string;
16
+ currency: string;
17
+ tax_rate: number;
18
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IPpasCommercialInvoicePrice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPpasCommercialInvoicePrice.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice.ts"],"names":[],"mappings":""}
@@ -702,12 +702,71 @@ Task stahuje fakturační data distribuce od PPAS včetně informací o fakturá
702
702
  - Transformuje fakturační hlavičku s informacemi o zákazníkovi, adresách a fakturovaných částkách
703
703
  - Zpracovává zařízení (devices) s jejich odečty včetně spotřeby elektřiny a plynu
704
704
  - Zpracovává cenové položky (prices) s detailními informacemi o tarifech a jednotkových cenách
705
- - Rozlišuje mezi standardní cenou STANDARD a korekcí CORRECTION
705
+ - Rozlišuje mezi standardní cenou STANDARD a korekcí CORRECTION
706
706
  - data modely
707
707
  - [PpasDistributionInvoiceModel](../src/schema-definitions/models/enapo/ppas/PpasDistributionInvoiceModel.ts) tabulka `ppas_distribution_invoice` - hlavičky faktur
708
708
  - [PpasDistributionInvoiceDeviceModel](../src/schema-definitions/models/enapo/ppas/PpasDistributionInvoiceDeviceModel.ts) tabulka `ppas_distribution_invoice_device` - zařízení a odečty
709
709
  - [PpasDistributionInvoicePriceModel](../src/schema-definitions/models/enapo/ppas/PpasDistributionInvoicePriceModel.ts) tabulka `ppas_distribution_invoice_price` - cenové položky
710
710
 
711
+ #### _PPAS Commercial API_
712
+
713
+ - zdroj dat
714
+ - url: module.energetics.enapo.ppas.commercial.url
715
+ - OAuth2 URL: module.energetics.enapo.ppas.commercial.oauthUrl
716
+ - autentizace: OAuth2 Client Credentials Flow
717
+ - clientId: module.energetics.enapo.ppas.commercial.clientId
718
+ - clientSecret: module.energetics.enapo.ppas.commercial.clientSecret
719
+ - accessToken header: module.energetics.enapo.ppas.commercial.accessToken
720
+ - seznam company ID (IČO): module.energetics.enapo.ppas.commercial.companyIdListUrl - JSON v Azure blob storage, ze kterého se čte pole company ID pro dotazování faktur
721
+ - prodleva mezi requesty: module.energetics.enapo.ppas.commercial.requestDelayMs (volitelné, výchozí 650 ms) - kvůli rate-limitu API (~100 req/min)
722
+ - API dokumentace: interní dokumentace PPAS (OpenAPI spec `/business/v1/invoice/`)
723
+ - formát dat
724
+ - protokol: https (REST API)
725
+ - datový typ: json
726
+ - validační schémata:
727
+ - [IPpasCommercialInvoiceListInput](../src/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceListInput.ts) - seznam faktur
728
+ - [IPpasCommercialInvoiceDetailInput](../src/schema-definitions/datasources/enapo/ppas/commercial/IPpasCommercialInvoiceDetailInput.ts) - detail faktury včetně instalací, zařízení a cen
729
+ - [PpasCommercialSchema](../src/schema-definitions/datasources/enapo/ppas/commercial/PpasCommercialSchema.ts) - JSON Schema validace
730
+ - příklad vstupních dat:
731
+ - [ppas_commercial_invoice_list_input.json](../test/integration-engine/data/enapo/ppas_commercial_invoice_list_input.json)
732
+ - [ppas_commercial_invoice_detail_input.json](../test/integration-engine/data/enapo/ppas_commercial_invoice_detail_input.json)
733
+ - specifika oproti distribuci: endpoint seznamu faktur vyžaduje query parametr `ic` (company ID) a může vrátit buď pole faktur, nebo jediný objekt (při jednom výsledku) - normalizuje se na pole
734
+ - datasource
735
+ - [PpasCommercialDatasource](../src/integration-engine/enapo/datasources/ppas/commercial/PpasCommercialDatasource.ts)
736
+ - `getCompanyIdList()` - načtení seznamu company ID z blob storage
737
+ - `getInvoiceList(from, to, companyId)` - získání seznamu faktur za období pro dané company ID
738
+ - `getInvoiceDetail(intNum)` - získání detailu faktury včetně instalací, zařízení, odečtů a cen
739
+ - Automatická správa OAuth2 tokenu (refresh před expirací)
740
+ - Validace odpovědí pomocí JSON Schema
741
+ - unit testy
742
+ - [PpasCommercialDatasource.test.ts](../test/integration-engine/enapo/datasources/ppas/commercial/PpasCommercialDatasource.test.ts)
743
+
744
+ #### _task: EnapoPpasCommercialTask_
745
+
746
+ Task stahuje fakturační data komerčního prodeje od PPAS pro seznam company ID. Pro každé company ID stáhne seznam faktur za období, poté po jedné stáhne detaily faktur a uloží je do čtyř souvisejících tabulek.
747
+
748
+ - vstupní rabbitmq fronta
749
+ - název: fetchPpasCommercial
750
+ - TTL: 1 hodina
751
+ - parametry: `{ from?, to? }`
752
+ - `from` - datum od (formát YYYY-MM-DD), volitelné - výchozí: poslední `facts_doc_date` v DB + 1 den, při prázdné DB backfill od 2024-01-01
753
+ - `to` - datum do (formát YYYY-MM-DD), volitelné - výchozí: dnes (max. rozsah 366 dní od `from`)
754
+ - validační schéma: [EnapoPpasCommercialParamsSchema](../src/integration-engine/enapo/workers/schema/EnapoPpasCommercialParamsSchema.ts)
755
+ - závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
756
+ - žádné
757
+ - datové zdroje
758
+ - PPAS Commercial API
759
+ - [PpasCommercialDatasource](../src/integration-engine/enapo/datasources/ppas/commercial/PpasCommercialDatasource.ts)
760
+ - transformace
761
+ - [PpasCommercialTransformation](../src/integration-engine/enapo/transformations/ppas/PpasCommercialTransformation.ts) - transformace dat faktur
762
+ - Transformuje fakturační hlavičku s informacemi o zákazníkovi, adresách a fakturovaných částkách
763
+ - Zpracovává instalace (installations) včetně zařízení (devices) s odečty a cenových položek (prices)
764
+ - data modely
765
+ - [PpasCommercialInvoiceModel](../src/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceModel.ts) tabulka `enapo_ppas_commercial_invoice` - hlavičky faktur
766
+ - [PpasCommercialInvoiceInstallationModel](../src/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceInstallationModel.ts) tabulka `enapo_ppas_commercial_invoice_installations` - instalace
767
+ - [PpasCommercialInvoiceDeviceModel](../src/schema-definitions/models/enapo/ppas/PpasCommercialInvoiceDeviceModel.ts) tabulka `enapo_ppas_commercial_invoice_device` - zařízení a odečty
768
+ - [PpasCommercialInvoicePriceModel](../src/schema-definitions/models/enapo/ppas/PpasCommercialInvoicePriceModel.ts) tabulka `enapo_ppas_commercial_invoice_price` - cenové položky
769
+
711
770
  #### _task: PorsennaDistributionTask_
712
771
 
713
772
  Task stahuje data o měřidlech a spotřebách z Porsenna API (e-Manazer).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/energetics",
3
- "version": "1.10.1-dev.2609634792",
3
+ "version": "1.10.1-dev.2634930492",
4
4
  "description": "Golemio Energetics Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",