@golemio/energetics 1.12.2-dev.2740928370 → 1.12.2-dev.2741327856

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 (137) hide show
  1. package/db/example/00_clear_test_data.sql +19 -0
  2. package/db/example/06_eno.sql +36 -0
  3. package/db/example/07_enapo_om_detail.sql +140 -0
  4. package/db/example/08_ded_search.sql +25 -0
  5. package/db/migrations/postgresql/20260807090000-enapo-gid-mapping-om-detail.js +53 -0
  6. package/db/migrations/postgresql/20260807091000-enapo-om-detail-porsenna.js +53 -0
  7. package/db/migrations/postgresql/20260807092000-ded-building-search.js +53 -0
  8. package/db/migrations/postgresql/sqls/20260807090000-enapo-gid-mapping-om-detail-down.sql +3 -0
  9. package/db/migrations/postgresql/sqls/20260807090000-enapo-gid-mapping-om-detail-up.sql +182 -0
  10. package/db/migrations/postgresql/sqls/20260807091000-enapo-om-detail-porsenna-down.sql +135 -0
  11. package/db/migrations/postgresql/sqls/20260807091000-enapo-om-detail-porsenna-up.sql +292 -0
  12. package/db/migrations/postgresql/sqls/20260807092000-ded-building-search-down.sql +41 -0
  13. package/db/migrations/postgresql/sqls/20260807092000-ded-building-search-up.sql +262 -0
  14. package/db/scripts/ded_gid_mapping_mock_import.sql +107 -0
  15. package/dist/integration-engine/enapo/ioc/Di.js +5 -1
  16. package/dist/integration-engine/enapo/ioc/Di.js.map +1 -1
  17. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.d.ts +2 -0
  18. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js +2 -0
  19. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js.map +1 -1
  20. package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.d.ts +7 -0
  21. package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.js +50 -0
  22. package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.js.map +1 -0
  23. package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.d.ts +7 -0
  24. package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.js +3 -0
  25. package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.js.map +1 -0
  26. package/dist/integration-engine/enapo/workers/EnapoWorker.js +1 -0
  27. package/dist/integration-engine/enapo/workers/EnapoWorker.js.map +1 -1
  28. package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.d.ts +21 -0
  29. package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.js +58 -0
  30. package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.js.map +1 -0
  31. package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.d.ts +13 -1
  32. package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js +25 -2
  33. package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js.map +1 -1
  34. package/dist/output-gateway/constants/DedSearchWeights.d.ts +60 -0
  35. package/dist/output-gateway/constants/DedSearchWeights.js +42 -0
  36. package/dist/output-gateway/constants/DedSearchWeights.js.map +1 -0
  37. package/dist/output-gateway/constants/Links.d.ts +1 -0
  38. package/dist/output-gateway/constants/Links.js +2 -1
  39. package/dist/output-gateway/constants/Links.js.map +1 -1
  40. package/dist/output-gateway/controllers/v2/EnoBuildingsController.d.ts +16 -0
  41. package/dist/output-gateway/controllers/v2/EnoBuildingsController.js +80 -0
  42. package/dist/output-gateway/controllers/v2/EnoBuildingsController.js.map +1 -0
  43. package/dist/output-gateway/helpers/objectMappers.d.ts +10 -0
  44. package/dist/output-gateway/helpers/objectMappers.js +37 -0
  45. package/dist/output-gateway/helpers/objectMappers.js.map +1 -0
  46. package/dist/output-gateway/index.js +8 -1
  47. package/dist/output-gateway/index.js.map +1 -1
  48. package/dist/output-gateway/ioc/Di.js +13 -1
  49. package/dist/output-gateway/ioc/Di.js.map +1 -1
  50. package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +6 -0
  51. package/dist/output-gateway/ioc/ModuleContainerToken.js +6 -0
  52. package/dist/output-gateway/ioc/ModuleContainerToken.js.map +1 -1
  53. package/dist/output-gateway/models/DedBuildingSearchViewModel.d.ts +30 -0
  54. package/dist/output-gateway/models/DedBuildingSearchViewModel.js +38 -0
  55. package/dist/output-gateway/models/DedBuildingSearchViewModel.js.map +1 -0
  56. package/dist/output-gateway/models/EnoBuildingDetailViewModel.d.ts +49 -0
  57. package/dist/output-gateway/models/EnoBuildingDetailViewModel.js +57 -0
  58. package/dist/output-gateway/models/EnoBuildingDetailViewModel.js.map +1 -0
  59. package/dist/output-gateway/models/EnoConsumptionPointViewModel.d.ts +106 -0
  60. package/dist/output-gateway/models/EnoConsumptionPointViewModel.js +119 -0
  61. package/dist/output-gateway/models/EnoConsumptionPointViewModel.js.map +1 -0
  62. package/dist/output-gateway/models/EnoPorsennaDeviceViewModel.d.ts +27 -0
  63. package/dist/output-gateway/models/EnoPorsennaDeviceViewModel.js +41 -0
  64. package/dist/output-gateway/models/EnoPorsennaDeviceViewModel.js.map +1 -0
  65. package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.d.ts +24 -0
  66. package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.js +3 -0
  67. package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.js.map +1 -0
  68. package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.d.ts +44 -0
  69. package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.js +3 -0
  70. package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.js.map +1 -0
  71. package/dist/output-gateway/models/interfaces/IEnoConsumptionPointView.d.ts +106 -0
  72. package/dist/output-gateway/models/interfaces/IEnoConsumptionPointView.js +3 -0
  73. package/dist/output-gateway/models/interfaces/IEnoConsumptionPointView.js.map +1 -0
  74. package/dist/output-gateway/models/interfaces/IEnoPorsennaDeviceView.d.ts +22 -0
  75. package/dist/output-gateway/models/interfaces/IEnoPorsennaDeviceView.js +3 -0
  76. package/dist/output-gateway/models/interfaces/IEnoPorsennaDeviceView.js.map +1 -0
  77. package/dist/output-gateway/repositories/AbstractNumericParsingRepository.d.ts +12 -0
  78. package/dist/output-gateway/repositories/AbstractNumericParsingRepository.js +41 -0
  79. package/dist/output-gateway/repositories/AbstractNumericParsingRepository.js.map +1 -0
  80. package/dist/output-gateway/repositories/DedBuildingSearchRepository.d.ts +16 -0
  81. package/dist/output-gateway/repositories/DedBuildingSearchRepository.js +250 -0
  82. package/dist/output-gateway/repositories/DedBuildingSearchRepository.js.map +1 -0
  83. package/dist/output-gateway/repositories/EnoBuildingAddressesRepository.d.ts +8 -0
  84. package/dist/output-gateway/repositories/EnoBuildingAddressesRepository.js +62 -0
  85. package/dist/output-gateway/repositories/EnoBuildingAddressesRepository.js.map +1 -0
  86. package/dist/output-gateway/repositories/EnoBuildingDetailRepository.d.ts +18 -0
  87. package/dist/output-gateway/repositories/EnoBuildingDetailRepository.js +100 -0
  88. package/dist/output-gateway/repositories/EnoBuildingDetailRepository.js.map +1 -0
  89. package/dist/output-gateway/repositories/EnoConsumptionPointsRepository.d.ts +8 -0
  90. package/dist/output-gateway/repositories/EnoConsumptionPointsRepository.js +51 -0
  91. package/dist/output-gateway/repositories/EnoConsumptionPointsRepository.js.map +1 -0
  92. package/dist/output-gateway/repositories/EnoPorsennaDevicesRepository.d.ts +8 -0
  93. package/dist/output-gateway/repositories/EnoPorsennaDevicesRepository.js +51 -0
  94. package/dist/output-gateway/repositories/EnoPorsennaDevicesRepository.js.map +1 -0
  95. package/dist/output-gateway/repositories/PorsennaConsumptionsRepository.d.ts +8 -0
  96. package/dist/output-gateway/repositories/PorsennaConsumptionsRepository.js +52 -0
  97. package/dist/output-gateway/repositories/PorsennaConsumptionsRepository.js.map +1 -0
  98. package/dist/output-gateway/repositories/PpasInvoiceChildRepository.d.ts +13 -0
  99. package/dist/output-gateway/repositories/PpasInvoiceChildRepository.js +39 -0
  100. package/dist/output-gateway/repositories/PpasInvoiceChildRepository.js.map +1 -0
  101. package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.d.ts +14 -0
  102. package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.js +3 -0
  103. package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.js.map +1 -0
  104. package/dist/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.d.ts +22 -0
  105. package/dist/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.js +3 -0
  106. package/dist/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.js.map +1 -0
  107. package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.d.ts +50 -0
  108. package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.js +3 -0
  109. package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.js.map +1 -0
  110. package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.d.ts +130 -0
  111. package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.js +3 -0
  112. package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.js.map +1 -0
  113. package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.d.ts +11 -0
  114. package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.js +3 -0
  115. package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.js.map +1 -0
  116. package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.d.ts +11 -0
  117. package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js +45 -0
  118. package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js.map +1 -0
  119. package/dist/output-gateway/transformations/DedBuildingSearchTransformation.d.ts +11 -0
  120. package/dist/output-gateway/transformations/DedBuildingSearchTransformation.js +57 -0
  121. package/dist/output-gateway/transformations/DedBuildingSearchTransformation.js.map +1 -0
  122. package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.d.ts +18 -0
  123. package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js +193 -0
  124. package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js.map +1 -0
  125. package/dist/schema-definitions/models/enapo/EnapoGidMappingModel.d.ts +17 -0
  126. package/dist/schema-definitions/models/enapo/EnapoGidMappingModel.js +63 -0
  127. package/dist/schema-definitions/models/enapo/EnapoGidMappingModel.js.map +1 -0
  128. package/dist/schema-definitions/models/enapo/interfaces/IEnapoGidMapping.d.ts +11 -0
  129. package/dist/schema-definitions/models/enapo/interfaces/IEnapoGidMapping.js +3 -0
  130. package/dist/schema-definitions/models/enapo/interfaces/IEnapoGidMapping.js.map +1 -0
  131. package/dist/schema-definitions/models/eno/AddressModel.d.ts +1 -1
  132. package/dist/schema-definitions/models/eno/AddressModel.js +1 -1
  133. package/dist/schema-definitions/models/eno/AddressModel.js.map +1 -1
  134. package/dist/schema-definitions/models/eno/interfaces/IAddress.d.ts +1 -1
  135. package/docs/implementation_documentation.md +90 -2
  136. package/docs/openapi-output.yaml +554 -1
  137. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EnoPorsennaDevicesRepository = void 0;
13
+ const EnoPorsennaDeviceViewModel_1 = require("../models/EnoPorsennaDeviceViewModel");
14
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
15
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
16
+ const AbstractNumericParsingRepository_1 = require("./AbstractNumericParsingRepository");
17
+ let EnoPorsennaDevicesRepository = class EnoPorsennaDevicesRepository extends AbstractNumericParsingRepository_1.AbstractNumericParsingRepository {
18
+ constructor() {
19
+ super(EnoPorsennaDeviceViewModel_1.EnoPorsennaDeviceViewModel.modelName, EnoPorsennaDeviceViewModel_1.EnoPorsennaDeviceViewModel.tableName, EnoPorsennaDeviceViewModel_1.EnoPorsennaDeviceViewModel.attributeModel, {
20
+ schema: "energetics",
21
+ });
22
+ }
23
+ async GetByGid(gid) {
24
+ try {
25
+ const rows = (await this.sequelizeModel.findAll({
26
+ where: { gid },
27
+ order: [
28
+ ["source", "ASC"],
29
+ ["identifier", "ASC"],
30
+ ],
31
+ raw: true,
32
+ }));
33
+ return this.parseNumericColumns(rows);
34
+ }
35
+ catch (err) {
36
+ throw new golemio_errors_1.GeneralError("Database error ~ GetByGid EnoPorsennaDevicesRepository", this.name, err, 500);
37
+ }
38
+ }
39
+ GetAll() {
40
+ throw new Error("Not implemented");
41
+ }
42
+ GetOne() {
43
+ throw new Error("Not implemented");
44
+ }
45
+ };
46
+ exports.EnoPorsennaDevicesRepository = EnoPorsennaDevicesRepository;
47
+ exports.EnoPorsennaDevicesRepository = EnoPorsennaDevicesRepository = __decorate([
48
+ (0, tsyringe_1.injectable)(),
49
+ __metadata("design:paramtypes", [])
50
+ ], EnoPorsennaDevicesRepository);
51
+ //# sourceMappingURL=EnoPorsennaDevicesRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnoPorsennaDevicesRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/EnoPorsennaDevicesRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qFAAmF;AAEnF,6EAAwE;AACxE,iEAAgE;AAChE,yFAAsF;AAG/E,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,mEAAgC;IAC9E;QACI,KAAK,CACD,uDAA0B,CAAC,SAAS,EACpC,uDAA0B,CAAC,SAAS,EACpC,uDAA0B,CAAC,cAAc,EACzC;YACI,MAAM,EAAE,YAAY;SACvB,CACJ,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,GAAW;QAC7B,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBAC5C,KAAK,EAAE,EAAE,GAAG,EAAE;gBACd,KAAK,EAAE;oBACH,CAAC,QAAQ,EAAE,KAAK,CAAC;oBACjB,CAAC,YAAY,EAAE,KAAK,CAAC;iBACxB;gBACD,GAAG,EAAE,IAAI;aACZ,CAAC,CAAwC,CAAC;YAE3C,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,6BAAY,CAAC,wDAAwD,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1G,CAAC;IACL,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AApCY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,qBAAU,GAAE;;GACA,4BAA4B,CAoCxC"}
@@ -0,0 +1,8 @@
1
+ import { IConsumption } from "../../schema-definitions/models/porsenna/interfaces/IConsumption";
2
+ import { AbstractNumericParsingRepository } from "./AbstractNumericParsingRepository";
3
+ export declare class PorsennaConsumptionsRepository extends AbstractNumericParsingRepository {
4
+ constructor();
5
+ GetByDeviceIds(deviceIds: string[]): Promise<IConsumption[]>;
6
+ GetAll(): never;
7
+ GetOne(): never;
8
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PorsennaConsumptionsRepository = void 0;
13
+ const PorsennaConsumptionModel_1 = require("../../schema-definitions/models/porsenna/PorsennaConsumptionModel");
14
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
15
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
16
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
17
+ const AbstractNumericParsingRepository_1 = require("./AbstractNumericParsingRepository");
18
+ let PorsennaConsumptionsRepository = class PorsennaConsumptionsRepository extends AbstractNumericParsingRepository_1.AbstractNumericParsingRepository {
19
+ constructor() {
20
+ super("EnoPorsennaConsumptionModelData", PorsennaConsumptionModel_1.PorsennaConsumptionModel.TABLE_NAME, PorsennaConsumptionModel_1.PorsennaConsumptionModel.attributeModel, {
21
+ schema: "energetics",
22
+ });
23
+ }
24
+ async GetByDeviceIds(deviceIds) {
25
+ if (deviceIds.length === 0) {
26
+ return [];
27
+ }
28
+ try {
29
+ const rows = (await this.sequelizeModel.findAll({
30
+ where: { device_id: { [sequelize_1.Op.in]: deviceIds } },
31
+ order: [["period", "ASC"]],
32
+ raw: true,
33
+ }));
34
+ return this.parseNumericColumns(rows);
35
+ }
36
+ catch (err) {
37
+ throw new golemio_errors_1.GeneralError("Database error ~ GetByDeviceIds PorsennaConsumptionsRepository", this.name, err, 500);
38
+ }
39
+ }
40
+ GetAll() {
41
+ throw new Error("Not implemented");
42
+ }
43
+ GetOne() {
44
+ throw new Error("Not implemented");
45
+ }
46
+ };
47
+ exports.PorsennaConsumptionsRepository = PorsennaConsumptionsRepository;
48
+ exports.PorsennaConsumptionsRepository = PorsennaConsumptionsRepository = __decorate([
49
+ (0, tsyringe_1.injectable)(),
50
+ __metadata("design:paramtypes", [])
51
+ ], PorsennaConsumptionsRepository);
52
+ //# sourceMappingURL=PorsennaConsumptionsRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PorsennaConsumptionsRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/PorsennaConsumptionsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gHAAyF;AAEzF,6EAAwE;AACxE,mEAAyD;AACzD,iEAAgE;AAChE,yFAAsF;AAG/E,IAAM,8BAA8B,GAApC,MAAM,8BAA+B,SAAQ,mEAAgC;IAChF;QACI,KAAK,CAAC,iCAAiC,EAAE,mDAAwB,CAAC,UAAU,EAAE,mDAAwB,CAAC,cAAc,EAAE;YACnH,MAAM,EAAE,YAAY;SACvB,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,SAAmB;QAC3C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACd,CAAC;QAED,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBAC5C,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE;gBAC5C,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC1B,GAAG,EAAE,IAAI;aACZ,CAAC,CAA8B,CAAC;YAEjC,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,6BAAY,CAAC,gEAAgE,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClH,CAAC;IACL,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAhCY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,qBAAU,GAAE;;GACA,8BAA8B,CAgC1C"}
@@ -0,0 +1,13 @@
1
+ import { ModelAttributes } from "@golemio/core/dist/shared/sequelize";
2
+ import { AbstractNumericParsingRepository } from "./AbstractNumericParsingRepository";
3
+ /**
4
+ * Read-only access to a PPAS invoice child table (devices/prices) keyed by `invoice_id`.
5
+ */
6
+ export declare class PpasInvoiceChildRepository<T extends {
7
+ invoice_id: string;
8
+ }> extends AbstractNumericParsingRepository {
9
+ constructor(modelName: string, tableName: string, attributes: ModelAttributes);
10
+ GetByInvoiceIds(invoiceIds: string[]): Promise<T[]>;
11
+ GetAll(): never;
12
+ GetOne(): never;
13
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PpasInvoiceChildRepository = void 0;
4
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
5
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
6
+ const AbstractNumericParsingRepository_1 = require("./AbstractNumericParsingRepository");
7
+ /**
8
+ * Read-only access to a PPAS invoice child table (devices/prices) keyed by `invoice_id`.
9
+ */
10
+ class PpasInvoiceChildRepository extends AbstractNumericParsingRepository_1.AbstractNumericParsingRepository {
11
+ constructor(modelName, tableName, attributes) {
12
+ super(modelName, tableName, attributes, {
13
+ schema: "energetics",
14
+ });
15
+ }
16
+ async GetByInvoiceIds(invoiceIds) {
17
+ if (invoiceIds.length === 0) {
18
+ return [];
19
+ }
20
+ try {
21
+ const rows = (await this.sequelizeModel.findAll({
22
+ where: { invoice_id: { [sequelize_1.Op.in]: invoiceIds } },
23
+ raw: true,
24
+ }));
25
+ return this.parseNumericColumns(rows);
26
+ }
27
+ catch (err) {
28
+ throw new golemio_errors_1.GeneralError("Database error ~ GetByInvoiceIds PpasInvoiceChildRepository", this.name, err, 500);
29
+ }
30
+ }
31
+ GetAll() {
32
+ throw new Error("Not implemented");
33
+ }
34
+ GetOne() {
35
+ throw new Error("Not implemented");
36
+ }
37
+ }
38
+ exports.PpasInvoiceChildRepository = PpasInvoiceChildRepository;
39
+ //# sourceMappingURL=PpasInvoiceChildRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PpasInvoiceChildRepository.js","sourceRoot":"","sources":["../../../src/output-gateway/repositories/PpasInvoiceChildRepository.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AACxE,mEAA0E;AAC1E,yFAAsF;AAEtF;;GAEG;AACH,MAAa,0BAA6D,SAAQ,mEAAgC;IAC9G,YAAY,SAAiB,EAAE,SAAiB,EAAE,UAA2B;QACzE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE;YACpC,MAAM,EAAE,YAAY;SACvB,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,UAAoB;QAC7C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,CAAC;QACd,CAAC;QAED,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBAC5C,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE;gBAC9C,GAAG,EAAE,IAAI;aACZ,CAAC,CAAmB,CAAC;YAEtB,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,IAAI,6BAAY,CAAC,6DAA6D,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/G,CAAC;IACL,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ;AA/BD,gEA+BC"}
@@ -0,0 +1,14 @@
1
+ import { IDedBuildingSearchView } from "../../models/interfaces/IDedBuildingSearchView";
2
+ import { DedSearchMatchedBy, IDedGeoJsonGeometry } from "../../routers/interfaces/IDedBuildingSearchResponse";
3
+ /** Scored row returned by the DeD building search query. */
4
+ export interface IDedBuildingSearchRow extends IDedBuildingSearchView {
5
+ /** True when the row came from the exact identifier or GID tier, reported by the query itself. */
6
+ is_exact: boolean;
7
+ matched_by: DedSearchMatchedBy;
8
+ matched_value: string | null;
9
+ score: number;
10
+ geometry: IDedGeoJsonGeometry | null;
11
+ bbox: [number, number, number, number] | null;
12
+ centroid_lat: number | null;
13
+ centroid_lon: number | null;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IDedBuildingSearchRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDedBuildingSearchRow.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/interfaces/IDedBuildingSearchRow.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { IEnoBuildingDetailView } from "../../models/interfaces/IEnoBuildingDetailView";
2
+ import { IEnoConsumptionPointView } from "../../models/interfaces/IEnoConsumptionPointView";
3
+ import { IEnoPorsennaDeviceView } from "../../models/interfaces/IEnoPorsennaDeviceView";
4
+ import { IAddress } from "../../../schema-definitions/models/eno/interfaces/IAddress";
5
+ import { IConsumption } from "../../../schema-definitions/models/porsenna/interfaces/IConsumption";
6
+ import { IPpasCommercialInvoiceDevice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice";
7
+ import { IPpasCommercialInvoicePrice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice";
8
+ import { IPpasDistributionInvoiceDevice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasDistributionInvoiceDevice";
9
+ import { IPpasDistributionInvoicePrice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasDistributionInvoicePrice";
10
+ export interface IEnoBuildingDetailAggregate {
11
+ gid: string;
12
+ /** null when the GID is known to the mapping but has no eno_budova record */
13
+ building: IEnoBuildingDetailView | null;
14
+ addresses: IAddress[];
15
+ points: IEnoConsumptionPointView[];
16
+ distributionDevices: IPpasDistributionInvoiceDevice[];
17
+ distributionPrices: IPpasDistributionInvoicePrice[];
18
+ commercialDevices: IPpasCommercialInvoiceDevice[];
19
+ commercialPrices: IPpasCommercialInvoicePrice[];
20
+ porsennaDevices: IEnoPorsennaDeviceView[];
21
+ porsennaConsumption: IConsumption[];
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IEnoBuildingDetailAggregate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEnoBuildingDetailAggregate.js","sourceRoot":"","sources":["../../../../src/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import { IEnoRegistrationUnit } from "./IEnoRegistrationUnit";
2
+ /** Which field produced the hit. Identifier and GID values come from the exact match tier. */
3
+ export type DedSearchMatchedBy = "ean" | "eic" | "om" | "gid" | "name" | "address";
4
+ /** Nested coordinate array of a GeoJSON geometry. */
5
+ export type DedGeoJsonCoordinates = number[] | DedGeoJsonCoordinates[];
6
+ export interface IDedGeoJsonGeometry {
7
+ type: string;
8
+ coordinates: DedGeoJsonCoordinates;
9
+ }
10
+ export interface IDedCentroid {
11
+ lat: number;
12
+ lon: number;
13
+ }
14
+ export interface IDedBuildingSearchResult {
15
+ gid: string;
16
+ name: string | null;
17
+ designation: string | null;
18
+ /**
19
+ * Evidenční jednotka, null when the building has no majetek record. Deliberately the same shape
20
+ * as on the building detail endpoint so a client can reuse one type across both.
21
+ */
22
+ registration_unit: IEnoRegistrationUnit | null;
23
+ /** Main address of the building (eno_adresa.hlavni), null when the building has no address. */
24
+ address: string | null;
25
+ /** Every distinct address of the building, main one first. */
26
+ addresses: string[];
27
+ matched_by: DedSearchMatchedBy;
28
+ /** The identifier that matched, present only for exact matches. */
29
+ matched_value: string | null;
30
+ score: number;
31
+ identifiers: {
32
+ ean: string[];
33
+ eic: string[];
34
+ om: string[];
35
+ };
36
+ /** Building outline in EPSG:4326, null when the building has no usable geometry. */
37
+ geometry: IDedGeoJsonGeometry | null;
38
+ /** [minLon, minLat, maxLon, maxLat] in EPSG:4326, for zooming the map. */
39
+ bbox: [number, number, number, number] | null;
40
+ centroid: IDedCentroid | null;
41
+ geometry_source: string | null;
42
+ has_building_record: boolean;
43
+ active_points_count: number;
44
+ }
45
+ export interface IDedBuildingSearchResponse {
46
+ query: string;
47
+ /** True when at least one result came from the exact identifier or GID tier. */
48
+ matched_exactly: boolean;
49
+ results: IDedBuildingSearchResult[];
50
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IDedBuildingSearchResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDedBuildingSearchResponse.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IDedBuildingSearchResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,130 @@
1
+ import { StripPrefix } from "../../helpers/objectMappers";
2
+ import { IEnoBuildingDetailView } from "../../models/interfaces/IEnoBuildingDetailView";
3
+ import { IEnoConsumptionPointView } from "../../models/interfaces/IEnoConsumptionPointView";
4
+ import { IPpasCommercialInvoiceDevice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice";
5
+ import { IPpasCommercialInvoicePrice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice";
6
+ import { IPpasDistributionInvoiceDevice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasDistributionInvoiceDevice";
7
+ import { IPpasDistributionInvoicePrice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasDistributionInvoicePrice";
8
+ import { EnapoCommodity } from "../../../schema-definitions/models/enapo/interfaces/IEnapoGidMapping";
9
+ import { IEnoRegistrationUnit } from "./IEnoRegistrationUnit";
10
+ export type TEnoElectricityMetadata = StripPrefix<IEnoConsumptionPointView, "md_">;
11
+ export type TEnoDistributionInvoice = StripPrefix<IEnoConsumptionPointView, "di_">;
12
+ export type TEnoDistributionInstallation = Omit<StripPrefix<IEnoConsumptionPointView, "dinst_">, "place_id">;
13
+ export type TEnoCommercialInvoice = StripPrefix<IEnoConsumptionPointView, "ci_">;
14
+ export type TEnoCommercialInstallation = Omit<StripPrefix<IEnoConsumptionPointView, "cinst_">, "place_id">;
15
+ export type TEnoDistributionDevice = Omit<IPpasDistributionInvoiceDevice, "invoice_id" | "place_id">;
16
+ export type TEnoDistributionPrice = Omit<IPpasDistributionInvoicePrice, "invoice_id" | "customer_id" | "place_id">;
17
+ export type TEnoCommercialDevice = Omit<IPpasCommercialInvoiceDevice, "invoice_id" | "place_id">;
18
+ export type TEnoCommercialPrice = Omit<IPpasCommercialInvoicePrice, "invoice_id" | "customer_id" | "place_id">;
19
+ export interface IEnoPorsennaDeviceInfo {
20
+ name: string | null;
21
+ type: string | null;
22
+ level: string | null;
23
+ measurement_target: string | null;
24
+ meter_number: string | null;
25
+ supply_point_number: string | null;
26
+ disabled_at: Date | null;
27
+ tenant: string;
28
+ }
29
+ export interface IEnoPorsennaSubDevice {
30
+ name: string | null;
31
+ type: string | null;
32
+ meter_number: string | null;
33
+ disabled_at: Date | null;
34
+ }
35
+ export interface IEnoPorsennaYearlyConsumption {
36
+ period: string;
37
+ value: number;
38
+ unit: string;
39
+ days_covered: number | null;
40
+ }
41
+ export interface IEnoPorsennaBlock {
42
+ device: IEnoPorsennaDeviceInfo;
43
+ sub_devices: IEnoPorsennaSubDevice[];
44
+ yearly_consumption: IEnoPorsennaYearlyConsumption[];
45
+ }
46
+ export interface IEnoPorsennaOnlyBlock {
47
+ porsenna: IEnoPorsennaBlock | null;
48
+ }
49
+ export interface IEnoEnergyManagement {
50
+ source: string;
51
+ building_name: string | null;
52
+ address: string | null;
53
+ devices_total: number;
54
+ devices_active: number;
55
+ }
56
+ export interface IEnoElectricityBlock {
57
+ metadata: TEnoElectricityMetadata | null;
58
+ porsenna?: IEnoPorsennaBlock;
59
+ }
60
+ export interface IEnoGasDistributionBlock {
61
+ invoice: TEnoDistributionInvoice;
62
+ installation: TEnoDistributionInstallation;
63
+ devices: TEnoDistributionDevice[];
64
+ prices: TEnoDistributionPrice[];
65
+ }
66
+ export interface IEnoGasCommercialBlock {
67
+ invoice: TEnoCommercialInvoice;
68
+ installation: TEnoCommercialInstallation;
69
+ devices: TEnoCommercialDevice[];
70
+ prices: TEnoCommercialPrice[];
71
+ }
72
+ export interface IEnoGasBlock {
73
+ distribution: IEnoGasDistributionBlock | null;
74
+ commercial: IEnoGasCommercialBlock | null;
75
+ porsenna?: IEnoPorsennaBlock;
76
+ }
77
+ export interface IEnoConsumptionPointResponse {
78
+ place_id: string;
79
+ id_type: "ean" | "eic" | "om";
80
+ commodity: EnapoCommodity;
81
+ is_first_gid: boolean;
82
+ is_active: boolean;
83
+ link_source: string;
84
+ valid_from: string | null;
85
+ valid_to: string | null;
86
+ address: string | null;
87
+ /** Present only when commodity = electricity */
88
+ electricity?: IEnoElectricityBlock;
89
+ /** Present only when commodity = gas */
90
+ gas?: IEnoGasBlock;
91
+ /** Present only when commodity = heat (Porsenna-sourced) */
92
+ heat?: IEnoPorsennaOnlyBlock;
93
+ /** Present only when commodity = water (Porsenna-sourced) */
94
+ water?: IEnoPorsennaOnlyBlock;
95
+ }
96
+ export interface IEnoBuildingAddressResponse {
97
+ popis: string | null;
98
+ hlavni: boolean | null;
99
+ poradi: number;
100
+ }
101
+ /** eno_budova physical attributes only; the eno_ciselnik lookups live under `property`. */
102
+ export type TEnoBuildingPhysical = Omit<IEnoBuildingDetailView, "gid" | "ej_id" | "ej_kod" | "ej_nazev" | "ej_typ" | "spm_id" | "spm_kod" | "spm_nazev" | "spm_ic" | "spm_dic" | "spu_id" | "spu_kod" | "spu_nazev" | "spu_ic" | "spu_dic">;
103
+ /** Správce (eno_ciselnik_spravce). */
104
+ export interface IEnoManager {
105
+ id: number | null;
106
+ kod: string | null;
107
+ nazev: string | null;
108
+ ic: string | null;
109
+ dic: string | null;
110
+ }
111
+ export interface IEnoBuildingProperty {
112
+ registration_unit: IEnoRegistrationUnit | null;
113
+ managers: {
114
+ /** eno_majetek.id_maj_spravce_mandatni */
115
+ mandate: IEnoManager | null;
116
+ /** eno_majetek.id_maj_spravce_ucet_jednotka */
117
+ accounting_unit: IEnoManager | null;
118
+ };
119
+ }
120
+ export interface IEnoBuildingDetailResponse {
121
+ gid: string;
122
+ /** null when the GID has no eno_budova record (known only to the OM mapping or Porsenna) */
123
+ building: TEnoBuildingPhysical | null;
124
+ /** ENO lookup data resolved through eno_majetek; null when the building has no majetek record */
125
+ property: IEnoBuildingProperty | null;
126
+ addresses: IEnoBuildingAddressResponse[];
127
+ /** null when the building is not tracked in Porsenna (e-manazer) */
128
+ energy_management: IEnoEnergyManagement | null;
129
+ consumption_points: IEnoConsumptionPointResponse[];
130
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IEnoBuildingDetailResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEnoBuildingDetailResponse.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Evidenční jednotka (eno_ciselnik_evidencni_jednotka), resolved through the building's eno_majetek
3
+ * record. Shared by the building detail and the building search so a client can reuse one type for
4
+ * both; null on either endpoint means the building has no majetek record.
5
+ */
6
+ export interface IEnoRegistrationUnit {
7
+ id: number | null;
8
+ kod: string | null;
9
+ nazev: string | null;
10
+ typ: string | null;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IEnoRegistrationUnit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEnoRegistrationUnit.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/interfaces/IEnoRegistrationUnit.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { AbstractRouter } from "@golemio/core/dist/helpers/routing/AbstractRouter";
2
+ export declare class V2EnoBuildingsRouter extends AbstractRouter {
3
+ private controller;
4
+ private cacheHeaderMiddleware;
5
+ private maxAge;
6
+ private staleWhileRevalidate;
7
+ private searchMaxAge;
8
+ private searchStaleWhileRevalidate;
9
+ constructor();
10
+ protected initRoutes(): void;
11
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.V2EnoBuildingsRouter = void 0;
13
+ const DedSearchWeights_1 = require("../../constants/DedSearchWeights");
14
+ const Links_1 = require("../../constants/Links");
15
+ const RouteVersion_1 = require("../../constants/RouteVersion");
16
+ const Di_1 = require("../../ioc/Di");
17
+ const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
18
+ const AbstractRouter_1 = require("@golemio/core/dist/helpers/routing/AbstractRouter");
19
+ const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
20
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
21
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
22
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
23
+ let V2EnoBuildingsRouter = class V2EnoBuildingsRouter extends AbstractRouter_1.AbstractRouter {
24
+ constructor() {
25
+ super(RouteVersion_1.RouteVersion.v2, Links_1.DED_BUILDING_PATH);
26
+ this.maxAge = 6 * 60 * 60; // 6 hours
27
+ this.staleWhileRevalidate = 60; // 1 minute
28
+ // Suggestions must follow ingest closely, so the search is cached far more briefly than the detail.
29
+ this.searchMaxAge = 60; // 1 minute
30
+ this.searchStaleWhileRevalidate = 30; // 30 seconds
31
+ this.controller = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingsController);
32
+ this.cacheHeaderMiddleware = Di_1.OGEnergeticsContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
33
+ this.initRoutes();
34
+ }
35
+ initRoutes() {
36
+ this.router.get("/", (0, express_validator_1.query)("q").exists().isString().not().isArray().trim().isLength({ min: 1, max: DedSearchWeights_1.DED_SEARCH_QUERY_MAX_LENGTH }), (0, express_validator_1.query)("limit").optional().isInt({ min: 1, max: DedSearchWeights_1.DED_SEARCH_LIMIT_MAX }).toInt(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.searchMaxAge, this.searchStaleWhileRevalidate), this.controller.search);
37
+ this.router.get("/:gid", (0, express_validator_1.param)("gid").exists().isString().not().isArray(), Validation_1.checkErrors, this.cacheHeaderMiddleware.getMiddleware(this.maxAge, this.staleWhileRevalidate), this.controller.getOne);
38
+ }
39
+ };
40
+ exports.V2EnoBuildingsRouter = V2EnoBuildingsRouter;
41
+ exports.V2EnoBuildingsRouter = V2EnoBuildingsRouter = __decorate([
42
+ (0, tsyringe_1.injectable)(),
43
+ __metadata("design:paramtypes", [])
44
+ ], V2EnoBuildingsRouter);
45
+ //# sourceMappingURL=V2EnoBuildingsRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"V2EnoBuildingsRouter.js","sourceRoot":"","sources":["../../../../src/output-gateway/routers/v2/V2EnoBuildingsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAmG;AACnG,iDAAwD;AACxD,+DAA0D;AAE1D,qCAAmD;AACnD,yEAAoE;AACpE,sFAAmF;AAEnF,6EAA2E;AAC3E,+DAAuE;AACvE,mFAA2E;AAC3E,iEAAgE;AAGzD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,+BAAc;IASpD;QACI,KAAK,CAAC,2BAAY,CAAC,EAAE,EAAE,yBAAiB,CAAC,CAAC;QAPtC,WAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;QAChC,yBAAoB,GAAG,EAAE,CAAC,CAAC,WAAW;QAC9C,oGAAoG;QAC5F,iBAAY,GAAG,EAAE,CAAC,CAAC,WAAW;QAC9B,+BAA0B,GAAG,EAAE,CAAC,CAAC,aAAa;QAIlD,IAAI,CAAC,UAAU,GAAG,0BAAqB,CAAC,OAAO,CAAyB,2CAAoB,CAAC,sBAAsB,CAAC,CAAC;QACrH,IAAI,CAAC,qBAAqB,GAAG,0BAAqB,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACxH,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAES,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,GAAG,EACH,IAAA,yBAAK,EAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,8CAA2B,EAAE,CAAC,EAC5G,IAAA,yBAAK,EAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,uCAAoB,EAAE,CAAC,CAAC,KAAK,EAAE,EAC9E,wBAAW,EACX,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,CAAC,EAC5F,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,OAAO,EACP,IAAA,yBAAK,EAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAChD,wBAAW,EACX,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,EAChF,IAAI,CAAC,UAAU,CAAC,MAAM,CACzB,CAAC;IACN,CAAC;CACJ,CAAA;AAlCY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,qBAAU,GAAE;;GACA,oBAAoB,CAkChC"}
@@ -0,0 +1,11 @@
1
+ import { IDedBuildingSearchRow } from "../repositories/interfaces/IDedBuildingSearchRow";
2
+ import { IDedBuildingSearchResult } from "../routers/interfaces/IDedBuildingSearchResponse";
3
+ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
4
+ /**
5
+ * Maps a scored search row to the response shape. All coordinates arrive from PostGIS already in
6
+ * EPSG:4326, so nothing here does coordinate math.
7
+ */
8
+ export declare class DedBuildingSearchTransformation extends AbstractTransformation<IDedBuildingSearchRow, IDedBuildingSearchResult> {
9
+ name: string;
10
+ protected transformInternal: (element: IDedBuildingSearchRow) => IDedBuildingSearchResult;
11
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DedBuildingSearchTransformation = void 0;
10
+ const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
11
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
12
+ /** Set when the geometry originates from eno_geometrie, the only geometry source today. */
13
+ const GEOMETRY_SOURCE = "eno_geometrie";
14
+ /**
15
+ * Maps a scored search row to the response shape. All coordinates arrive from PostGIS already in
16
+ * EPSG:4326, so nothing here does coordinate math.
17
+ */
18
+ let DedBuildingSearchTransformation = class DedBuildingSearchTransformation extends AbstractTransformation_1.AbstractTransformation {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.name = "DedBuildingSearchTransformation";
22
+ this.transformInternal = (element) => {
23
+ const hasCentroid = element.centroid_lat !== null && element.centroid_lon !== null;
24
+ return {
25
+ gid: element.gid,
26
+ name: element.nazev,
27
+ designation: element.oznaceni,
28
+ // Mirrors EnoBuildingDetailTransformation: the lookup row exists only when its id does,
29
+ // so the id is what decides between an object and null.
30
+ registration_unit: element.ej_id === null
31
+ ? null
32
+ : { id: element.ej_id, kod: element.ej_kod, nazev: element.ej_nazev, typ: element.ej_typ },
33
+ address: element.address_main,
34
+ addresses: element.addresses,
35
+ matched_by: element.matched_by,
36
+ matched_value: element.matched_value,
37
+ score: element.score,
38
+ identifiers: {
39
+ ean: element.ean,
40
+ eic: element.eic,
41
+ om: element.om,
42
+ },
43
+ geometry: element.geometry,
44
+ bbox: element.bbox,
45
+ centroid: hasCentroid ? { lat: element.centroid_lat, lon: element.centroid_lon } : null,
46
+ geometry_source: element.geometry === null ? null : GEOMETRY_SOURCE,
47
+ has_building_record: element.has_building_record,
48
+ active_points_count: element.active_points_count,
49
+ };
50
+ };
51
+ }
52
+ };
53
+ exports.DedBuildingSearchTransformation = DedBuildingSearchTransformation;
54
+ exports.DedBuildingSearchTransformation = DedBuildingSearchTransformation = __decorate([
55
+ (0, tsyringe_1.injectable)()
56
+ ], DedBuildingSearchTransformation);
57
+ //# sourceMappingURL=DedBuildingSearchTransformation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DedBuildingSearchTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/DedBuildingSearchTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,6GAA0G;AAC1G,iEAAgE;AAEhE,2FAA2F;AAC3F,MAAM,eAAe,GAAG,eAAe,CAAC;AAExC;;;GAGG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,+CAAuE;IAArH;;QACI,SAAI,GAAW,iCAAiC,CAAC;QAE9C,sBAAiB,GAAG,CAAC,OAA8B,EAA4B,EAAE;YACvF,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,KAAK,IAAI,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC;YAEnF,OAAO;gBACH,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,IAAI,EAAE,OAAO,CAAC,KAAK;gBACnB,WAAW,EAAE,OAAO,CAAC,QAAQ;gBAC7B,wFAAwF;gBACxF,wDAAwD;gBACxD,iBAAiB,EACb,OAAO,CAAC,KAAK,KAAK,IAAI;oBAClB,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE;gBAClG,OAAO,EAAE,OAAO,CAAC,YAAY;gBAC7B,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;gBACpC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,WAAW,EAAE;oBACT,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,EAAE,EAAE,OAAO,CAAC,EAAE;iBACjB;gBACD,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,YAAsB,EAAE,GAAG,EAAE,OAAO,CAAC,YAAsB,EAAE,CAAC,CAAC,CAAC,IAAI;gBAC3G,eAAe,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe;gBACnE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;aACnD,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;AAlCY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,qBAAU,GAAE;GACA,+BAA+B,CAkC3C"}
@@ -0,0 +1,18 @@
1
+ import { IEnoBuildingDetailAggregate } from "../repositories/interfaces/IEnoBuildingDetailAggregate";
2
+ import { IEnoBuildingDetailResponse } from "../routers/interfaces/IEnoBuildingDetailResponse";
3
+ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
4
+ export declare class EnoBuildingDetailTransformation extends AbstractTransformation<IEnoBuildingDetailAggregate, IEnoBuildingDetailResponse> {
5
+ name: string;
6
+ protected transformInternal: (element: IEnoBuildingDetailAggregate) => IEnoBuildingDetailResponse;
7
+ private extractBuilding;
8
+ private transformProperty;
9
+ private buildRegistrationUnit;
10
+ private buildManager;
11
+ private transformPoint;
12
+ private transformElectricity;
13
+ private transformGas;
14
+ private buildPorsennaBlock;
15
+ private transformEnergyManagement;
16
+ private resolveAddress;
17
+ private composeAddress;
18
+ }