@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
@@ -1,15 +1,27 @@
1
1
  import { EnoDatasourceFactory } from "../../datasources/eno/EnoDatasourceFactory";
2
2
  import { EnoGeometryRepository } from "../../repositories/eno/EnoGeometryRepository";
3
+ import { ILogger } from "@golemio/core/dist/helpers/logger/LoggerProvider";
3
4
  import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/AbstractTask";
4
5
  import { IEnoGeometryTaskInput } from "../interfaces/IEnoGeometryTaskInput";
5
6
  import { EnoGeometryTaskInputSchema } from "../schema/EnoGeometryTaskInputSchema";
6
7
  export declare class EnoGeometryTask extends AbstractTask<IEnoGeometryTaskInput> {
7
8
  private enoDatasourceFactory;
8
9
  private enoGeometryRepository;
10
+ private logger;
9
11
  queueName: string;
10
12
  queueTtl: number;
11
13
  schema: typeof EnoGeometryTaskInputSchema;
12
14
  private static readonly BATCH_SIZE;
13
- constructor(enoDatasourceFactory: EnoDatasourceFactory, enoGeometryRepository: EnoGeometryRepository);
15
+ constructor(enoDatasourceFactory: EnoDatasourceFactory, enoGeometryRepository: EnoGeometryRepository, logger: ILogger);
14
16
  execute(data: IEnoGeometryTaskInput): Promise<void>;
17
+ /**
18
+ * Geometry is the last step of both ENO chains (buildings and structures both trigger it), so the
19
+ * search index is rebuilt here rather than after each individual ENO task.
20
+ *
21
+ * A failed publish is logged and swallowed on purpose. The geometry is already persisted, so
22
+ * letting the error propagate would nack the message and re-run the whole ENO geometry fetch -
23
+ * expensive SOAP work that already succeeded - because of a lost notification. The nightly cron
24
+ * is the fallback; this only has to stop the failure being silent.
25
+ */
26
+ private triggerSearchIndexRefresh;
15
27
  }
@@ -20,16 +20,19 @@ const EnoOperationEnum_1 = require("../../datasources/eno/EnoOperationEnum");
20
20
  const EnapoWorkerContainerToken_1 = require("../../ioc/EnapoWorkerContainerToken");
21
21
  const EnoGeometryRepository_1 = require("../../repositories/eno/EnoGeometryRepository");
22
22
  const EnoGeometryTransformation_1 = require("../../transformations/eno/EnoGeometryTransformation");
23
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
24
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
23
25
  const AbstractTask_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTask");
24
26
  const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
25
27
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
26
28
  const EnoGeometryTaskInputSchema_1 = require("../schema/EnoGeometryTaskInputSchema");
27
29
  const Chunker_1 = require("../../helpers/Chunker");
28
30
  let EnoGeometryTask = EnoGeometryTask_1 = class EnoGeometryTask extends AbstractTask_1.AbstractTask {
29
- constructor(enoDatasourceFactory, enoGeometryRepository) {
31
+ constructor(enoDatasourceFactory, enoGeometryRepository, logger) {
30
32
  super(constants_1.ENAPO_WORKER_NAME);
31
33
  this.enoDatasourceFactory = enoDatasourceFactory;
32
34
  this.enoGeometryRepository = enoGeometryRepository;
35
+ this.logger = logger;
33
36
  this.queueName = "processEnoGeometry";
34
37
  this.queueTtl = 60 * 60 * 1000;
35
38
  this.schema = EnoGeometryTaskInputSchema_1.EnoGeometryTaskInputSchema;
@@ -49,6 +52,7 @@ let EnoGeometryTask = EnoGeometryTask_1 = class EnoGeometryTask extends Abstract
49
52
  await this.enoGeometryRepository.bulkSave(transformedData);
50
53
  }
51
54
  }
55
+ await this.triggerSearchIndexRefresh();
52
56
  }
53
57
  catch (err) {
54
58
  if (err instanceof golemio_errors_1.AbstractGolemioError) {
@@ -57,6 +61,24 @@ let EnoGeometryTask = EnoGeometryTask_1 = class EnoGeometryTask extends Abstract
57
61
  throw new golemio_errors_1.GeneralError(`Failed to save ENO geometry data (source: ${data.source}, gidCount: ${data.listGid.length})`, this.constructor.name, err);
58
62
  }
59
63
  }
64
+ /**
65
+ * Geometry is the last step of both ENO chains (buildings and structures both trigger it), so the
66
+ * search index is rebuilt here rather than after each individual ENO task.
67
+ *
68
+ * A failed publish is logged and swallowed on purpose. The geometry is already persisted, so
69
+ * letting the error propagate would nack the message and re-run the whole ENO geometry fetch -
70
+ * expensive SOAP work that already succeeded - because of a lost notification. The nightly cron
71
+ * is the fallback; this only has to stop the failure being silent.
72
+ */
73
+ async triggerSearchIndexRefresh() {
74
+ try {
75
+ await integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshDedSearchIndex", {});
76
+ }
77
+ catch (err) {
78
+ this.logger.error(`${this.constructor.name}: Failed to trigger the DeD search index refresh: ` +
79
+ (err instanceof Error ? err.message : String(err)));
80
+ }
81
+ }
60
82
  };
61
83
  exports.EnoGeometryTask = EnoGeometryTask;
62
84
  EnoGeometryTask.BATCH_SIZE = 1000;
@@ -64,7 +86,8 @@ exports.EnoGeometryTask = EnoGeometryTask = EnoGeometryTask_1 = __decorate([
64
86
  (0, tsyringe_1.injectable)(),
65
87
  __param(0, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoDatasourceFactory)),
66
88
  __param(1, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoGeometryRepository)),
89
+ __param(2, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
67
90
  __metadata("design:paramtypes", [EnoDatasourceFactory_1.EnoDatasourceFactory,
68
- EnoGeometryRepository_1.EnoGeometryRepository])
91
+ EnoGeometryRepository_1.EnoGeometryRepository, Object])
69
92
  ], EnoGeometryTask);
70
93
  //# sourceMappingURL=EnoGeometryTask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnoGeometryTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/task/EnoGeometryTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAqF;AACrF,qFAAoG;AACpG,6EAAoF;AACpF,mFAAoF;AACpF,wFAAyF;AACzF,mGAAoG;AACpG,6FAA0F;AAC1F,6EAA8F;AAC9F,iEAAwE;AAExE,qFAAkF;AAClF,mDAAmD;AAG5C,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,2BAAmC;IAMpE,YAC4D,oBAAkD,EACjD,qBAAoD;QAE7G,KAAK,CAAC,6BAAiB,CAAC,CAAC;QAHuC,yBAAoB,GAApB,oBAAoB,CAAsB;QACzC,0BAAqB,GAArB,qBAAqB,CAAuB;QAP1G,cAAS,GAAG,oBAAoB,CAAC;QACjC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAC1B,WAAM,GAAG,uDAA0B,CAAC;IAQ3C,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,IAA2B;QAC5C,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,mCAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/F,MAAM,cAAc,GAAG,IAAI,qDAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClE,MAAM,OAAO,GAAG,gBAAM,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAe,CAAC,UAAU,CAAC,CAAC;YAE5E,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,yCAAsB,EAAE,EAAE,EAAE;oBAChE,OAAO,EAAE,KAAK;oBACd,YAAY,EAAE,uCAA2B;iBAC5C,CAAC,CAAC;gBACH,IAAI,MAAM,EAAE,CAAC;oBACT,MAAM,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBACrE,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;gBAC/D,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,IAAI,GAAG,YAAY,qCAAoB,EAAE,CAAC;gBACtC,MAAM,GAAG,CAAC;YACd,CAAC;YAED,MAAM,IAAI,6BAAY,CAClB,6CAA6C,IAAI,CAAC,MAAM,eAAe,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAC7F,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,GAAG,CACN,CAAC;QACN,CAAC;IACL,CAAC;;AAxCQ,0CAAe;AAIA,0BAAU,GAAG,IAAI,AAAP,CAAQ;0BAJjC,eAAe;IAD3B,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;qCAD8B,2CAAoB;QAClB,6CAAqB;GARxG,eAAe,CAyC3B"}
1
+ {"version":3,"file":"EnoGeometryTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/task/EnoGeometryTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAqF;AACrF,qFAAoG;AACpG,6EAAoF;AACpF,mFAAoF;AACpF,wFAAyF;AACzF,mGAAoG;AACpG,wEAAqE;AAErE,8EAAqE;AACrE,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AI,CAAC,yBAAyB,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,IAAI,GAAG,YAAY,qCAAoB,EAAE,CAAC;gBACtC,MAAM,GAAG,CAAC;YACd,CAAC;YAED,MAAM,IAAI,6BAAY,CAClB,6CAA6C,IAAI,CAAC,MAAM,eAAe,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAC7F,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,GAAG,CACN,CAAC;QACN,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACK,KAAK,CAAC,yBAAyB;QACnC,IAAI,CAAC;YACD,MAAM,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,uBAAuB,EAAE,EAAE,CAAC,CAAC;QAC5F,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,oDAAoD;gBACxE,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACzD,CAAC;QACN,CAAC;IACL,CAAC;;AA/DQ,0CAAe;AAIA,0BAAU,GAAG,IAAI,AAAP,CAAQ;0BAJjC,eAAe;IAD3B,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;qCAF6D,2CAAoB;QAClB,6CAAqB;GARxG,eAAe,CAgE3B"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Ranking weights of the DeD building search.
3
+ *
4
+ * There are two layers and they are deliberately separate:
5
+ *
6
+ * 1. The tsvector weight classes (A/B/C/D) are baked into mv_ded_building_search by the migration -
7
+ * A = name + designation + registration unit (evidenční jednotka) name, B = main address,
8
+ * C = secondary addresses, D = identifiers + registration unit code. Changing those requires a
9
+ * migration and a refresh. tsRank below is the weight array ts_rank_cd applies to them, in
10
+ * Postgres order {D, C, B, A}.
11
+ * 2. Everything else is applied at query time and can be retuned without a release.
12
+ */
13
+ export interface IDedSearchWeights {
14
+ /** ts_rank_cd weight array in Postgres order {D, C, B, A}. */
15
+ readonly tsRank: readonly [number, number, number, number];
16
+ /** Share of the full-text rank in the final score. */
17
+ readonly ftsRank: number;
18
+ /** Share of the trigram similarity against the building name. */
19
+ readonly nameTrigram: number;
20
+ /** Share of the trigram similarity against the addresses. */
21
+ readonly addressTrigram: number;
22
+ /** Flat bonus when the name starts with the query. */
23
+ readonly prefixBonus: number;
24
+ /** Tie-break bonus for buildings the map can zoom to. */
25
+ readonly geometryBonus: number;
26
+ /** Tie-break bonus for buildings with at least one active consumption point. */
27
+ readonly activePointsBonus: number;
28
+ /** Multiplier applied to GIDs with no eno_budova record. */
29
+ readonly missingBuildingPenalty: number;
30
+ /** Results scoring below this are dropped. Exact matches always pass. */
31
+ readonly minScore: number;
32
+ }
33
+ /**
34
+ * Reasoning for the defaults:
35
+ * - tsRank {0.05, 0.2, 0.5, 1.0}: the name is the most distinctive field, the main address is worth
36
+ * half of it so a name hit outranks an address hit, secondary addresses stay at the Postgres
37
+ * default, and identifiers sit near zero because identifier queries are answered by the exact
38
+ * tier - class D only helps partially typed identifiers surface at all.
39
+ * - ftsRank 0.45: the primary relevance signal, but under half so it cannot alone dominate.
40
+ * - nameTrigram 0.30: typing Czech without diacritics is the normal case, not an error case.
41
+ * - addressTrigram 0.15: half of the name weight, mirroring the A/B ratio of layer 1.
42
+ * - prefixBonus 0.30: in a suggest box, what was typed at the start is strong evidence of intent.
43
+ * - geometryBonus / activePointsBonus 0.05: tie-breaks only, never enough to reorder real relevance.
44
+ * - missingBuildingPenalty 0.80: mapping-only GIDs must stay findable but rank below described
45
+ * buildings; multiplicative so it scales with confidence.
46
+ */
47
+ export declare const DED_SEARCH_WEIGHTS_DEFAULT: IDedSearchWeights;
48
+ /** Score assigned to an exact identifier or GID match. Its own tier, not a weight. */
49
+ export declare const DED_SEARCH_EXACT_SCORE = 1000;
50
+ /**
51
+ * Size of the candidate pool each non-exact tier contributes before scoring. Both tiers rank inside
52
+ * their own CTE and truncate deterministically, so raising these widens what can be scored at the
53
+ * cost of running the unindexable ranking functions over more rows.
54
+ */
55
+ export declare const DED_SEARCH_FTS_CANDIDATES = 100;
56
+ /** Rows admitted to the candidate pool from the trigram nearest-neighbour tier. */
57
+ export declare const DED_SEARCH_FUZZY_CANDIDATES = 50;
58
+ export declare const DED_SEARCH_LIMIT_DEFAULT = 10;
59
+ export declare const DED_SEARCH_LIMIT_MAX = 50;
60
+ export declare const DED_SEARCH_QUERY_MAX_LENGTH = 100;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DED_SEARCH_QUERY_MAX_LENGTH = exports.DED_SEARCH_LIMIT_MAX = exports.DED_SEARCH_LIMIT_DEFAULT = exports.DED_SEARCH_FUZZY_CANDIDATES = exports.DED_SEARCH_FTS_CANDIDATES = exports.DED_SEARCH_EXACT_SCORE = exports.DED_SEARCH_WEIGHTS_DEFAULT = void 0;
4
+ /**
5
+ * Reasoning for the defaults:
6
+ * - tsRank {0.05, 0.2, 0.5, 1.0}: the name is the most distinctive field, the main address is worth
7
+ * half of it so a name hit outranks an address hit, secondary addresses stay at the Postgres
8
+ * default, and identifiers sit near zero because identifier queries are answered by the exact
9
+ * tier - class D only helps partially typed identifiers surface at all.
10
+ * - ftsRank 0.45: the primary relevance signal, but under half so it cannot alone dominate.
11
+ * - nameTrigram 0.30: typing Czech without diacritics is the normal case, not an error case.
12
+ * - addressTrigram 0.15: half of the name weight, mirroring the A/B ratio of layer 1.
13
+ * - prefixBonus 0.30: in a suggest box, what was typed at the start is strong evidence of intent.
14
+ * - geometryBonus / activePointsBonus 0.05: tie-breaks only, never enough to reorder real relevance.
15
+ * - missingBuildingPenalty 0.80: mapping-only GIDs must stay findable but rank below described
16
+ * buildings; multiplicative so it scales with confidence.
17
+ */
18
+ exports.DED_SEARCH_WEIGHTS_DEFAULT = {
19
+ tsRank: [0.05, 0.2, 0.5, 1.0],
20
+ ftsRank: 0.45,
21
+ nameTrigram: 0.3,
22
+ addressTrigram: 0.15,
23
+ prefixBonus: 0.3,
24
+ geometryBonus: 0.05,
25
+ activePointsBonus: 0.05,
26
+ missingBuildingPenalty: 0.8,
27
+ minScore: 0.08,
28
+ };
29
+ /** Score assigned to an exact identifier or GID match. Its own tier, not a weight. */
30
+ exports.DED_SEARCH_EXACT_SCORE = 1000;
31
+ /**
32
+ * Size of the candidate pool each non-exact tier contributes before scoring. Both tiers rank inside
33
+ * their own CTE and truncate deterministically, so raising these widens what can be scored at the
34
+ * cost of running the unindexable ranking functions over more rows.
35
+ */
36
+ exports.DED_SEARCH_FTS_CANDIDATES = 100;
37
+ /** Rows admitted to the candidate pool from the trigram nearest-neighbour tier. */
38
+ exports.DED_SEARCH_FUZZY_CANDIDATES = 50;
39
+ exports.DED_SEARCH_LIMIT_DEFAULT = 10;
40
+ exports.DED_SEARCH_LIMIT_MAX = 50;
41
+ exports.DED_SEARCH_QUERY_MAX_LENGTH = 100;
42
+ //# sourceMappingURL=DedSearchWeights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DedSearchWeights.js","sourceRoot":"","sources":["../../../src/output-gateway/constants/DedSearchWeights.ts"],"names":[],"mappings":";;;AAiCA;;;;;;;;;;;;;GAaG;AACU,QAAA,0BAA0B,GAAsB;IACzD,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,GAAG;IAChB,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,GAAG;IAChB,aAAa,EAAE,IAAI;IACnB,iBAAiB,EAAE,IAAI;IACvB,sBAAsB,EAAE,GAAG;IAC3B,QAAQ,EAAE,IAAI;CACjB,CAAC;AAEF,sFAAsF;AACzE,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAC7C,mFAAmF;AACtE,QAAA,2BAA2B,GAAG,EAAE,CAAC;AAEjC,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAC9B,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAC1B,QAAA,2BAA2B,GAAG,GAAG,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare const ORGANIZATION_PATH = "energetics/organizations";
2
2
  export declare const BUILDING_PATH = "energetics/buildings";
3
+ export declare const DED_BUILDING_PATH = "energetics/ded/buildings";
3
4
  export declare const DEVICES_PATH = "energetics/devices";
4
5
  export declare const MEASUREMENTS_PATH = "energetics/measurements";
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MEASUREMENTS_PATH = exports.DEVICES_PATH = exports.BUILDING_PATH = exports.ORGANIZATION_PATH = void 0;
3
+ exports.MEASUREMENTS_PATH = exports.DEVICES_PATH = exports.DED_BUILDING_PATH = exports.BUILDING_PATH = exports.ORGANIZATION_PATH = void 0;
4
4
  exports.ORGANIZATION_PATH = `energetics/organizations`;
5
5
  exports.BUILDING_PATH = `energetics/buildings`;
6
+ exports.DED_BUILDING_PATH = `energetics/ded/buildings`;
6
7
  exports.DEVICES_PATH = `energetics/devices`;
7
8
  exports.MEASUREMENTS_PATH = `energetics/measurements`;
8
9
  //# sourceMappingURL=Links.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Links.js","sourceRoot":"","sources":["../../../src/output-gateway/constants/Links.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,0BAA0B,CAAC;AAC/C,QAAA,aAAa,GAAG,sBAAsB,CAAC;AACvC,QAAA,YAAY,GAAG,oBAAoB,CAAC;AACpC,QAAA,iBAAiB,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"Links.js","sourceRoot":"","sources":["../../../src/output-gateway/constants/Links.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,0BAA0B,CAAC;AAC/C,QAAA,aAAa,GAAG,sBAAsB,CAAC;AACvC,QAAA,iBAAiB,GAAG,0BAA0B,CAAC;AAC/C,QAAA,YAAY,GAAG,oBAAoB,CAAC;AACpC,QAAA,iBAAiB,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { AccessLimitationRepository } from "../../repositories/AccessLimitationRepository";
2
+ import { DedBuildingSearchRepository } from "../../repositories/DedBuildingSearchRepository";
3
+ import { EnoBuildingDetailRepository } from "../../repositories/EnoBuildingDetailRepository";
4
+ import { DedBuildingSearchTransformation } from "../../transformations/DedBuildingSearchTransformation";
5
+ import { EnoBuildingDetailTransformation } from "../../transformations/EnoBuildingDetailTransformation";
6
+ import { NextFunction, Request, Response } from "@golemio/core/dist/shared/express";
7
+ import { AbstractController } from "./AbstractController";
8
+ export declare class EnoBuildingsController extends AbstractController {
9
+ private detailRepository;
10
+ private transformation;
11
+ private searchRepository;
12
+ private searchTransformation;
13
+ constructor(accessLimitationRepository: AccessLimitationRepository, detailRepository: EnoBuildingDetailRepository, transformation: EnoBuildingDetailTransformation, searchRepository: DedBuildingSearchRepository, searchTransformation: DedBuildingSearchTransformation);
14
+ search: (req: Request, res: Response, next: NextFunction) => Promise<void>;
15
+ getOne: (req: Request, res: Response, next: NextFunction) => Promise<void>;
16
+ }
@@ -0,0 +1,80 @@
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
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.EnoBuildingsController = void 0;
16
+ const DedSearchWeights_1 = require("../../constants/DedSearchWeights");
17
+ const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
18
+ const AccessLimitationRepository_1 = require("../../repositories/AccessLimitationRepository");
19
+ const DedBuildingSearchRepository_1 = require("../../repositories/DedBuildingSearchRepository");
20
+ const EnoBuildingDetailRepository_1 = require("../../repositories/EnoBuildingDetailRepository");
21
+ const DedBuildingSearchTransformation_1 = require("../../transformations/DedBuildingSearchTransformation");
22
+ const EnoBuildingDetailTransformation_1 = require("../../transformations/EnoBuildingDetailTransformation");
23
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
24
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
25
+ const AbstractController_1 = require("./AbstractController");
26
+ let EnoBuildingsController = class EnoBuildingsController extends AbstractController_1.AbstractController {
27
+ constructor(accessLimitationRepository, detailRepository, transformation, searchRepository, searchTransformation) {
28
+ super(accessLimitationRepository);
29
+ this.detailRepository = detailRepository;
30
+ this.transformation = transformation;
31
+ this.searchRepository = searchRepository;
32
+ this.searchTransformation = searchTransformation;
33
+ this.search = async (req, res, next) => {
34
+ try {
35
+ const query = req.query.q.trim();
36
+ // The router's .toInt() has already converted this; Number() only restates that for the
37
+ // type system, which types req.query as string | ParsedQs | arrays of either.
38
+ const limit = req.query.limit === undefined ? DedSearchWeights_1.DED_SEARCH_LIMIT_DEFAULT : Number(req.query.limit);
39
+ const rows = await this.searchRepository.Search(query, limit, DedSearchWeights_1.DED_SEARCH_WEIGHTS_DEFAULT, DedSearchWeights_1.DED_SEARCH_EXACT_SCORE);
40
+ const response = {
41
+ query,
42
+ matched_exactly: rows.some((row) => row.is_exact),
43
+ results: this.searchTransformation.transformArray(rows),
44
+ };
45
+ res.json(response);
46
+ }
47
+ catch (err) {
48
+ next(err);
49
+ }
50
+ };
51
+ this.getOne = async (req, res, next) => {
52
+ try {
53
+ const paramGid = Array.isArray(req.params.gid) ? req.params.gid[0] : req.params.gid;
54
+ const result = await this.detailRepository.GetDetail(paramGid);
55
+ if (result === null) {
56
+ throw new golemio_errors_1.GeneralError("not_found", "EnoBuildingsController", undefined, 404);
57
+ }
58
+ res.json(this.transformation.transformElement(result));
59
+ }
60
+ catch (err) {
61
+ next(err);
62
+ }
63
+ };
64
+ }
65
+ };
66
+ exports.EnoBuildingsController = EnoBuildingsController;
67
+ exports.EnoBuildingsController = EnoBuildingsController = __decorate([
68
+ (0, tsyringe_1.injectable)(),
69
+ __param(0, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.AccessLimitationRepository)),
70
+ __param(1, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailRepository)),
71
+ __param(2, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailTransformation)),
72
+ __param(3, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.DedBuildingSearchRepository)),
73
+ __param(4, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.DedBuildingSearchTransformation)),
74
+ __metadata("design:paramtypes", [AccessLimitationRepository_1.AccessLimitationRepository,
75
+ EnoBuildingDetailRepository_1.EnoBuildingDetailRepository,
76
+ EnoBuildingDetailTransformation_1.EnoBuildingDetailTransformation,
77
+ DedBuildingSearchRepository_1.DedBuildingSearchRepository,
78
+ DedBuildingSearchTransformation_1.DedBuildingSearchTransformation])
79
+ ], EnoBuildingsController);
80
+ //# sourceMappingURL=EnoBuildingsController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnoBuildingsController.js","sourceRoot":"","sources":["../../../../src/output-gateway/controllers/v2/EnoBuildingsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA8H;AAC9H,yEAAoE;AACpE,8FAAyF;AACzF,gGAA2F;AAC3F,gGAA2F;AAE3F,2GAAsG;AACtG,2GAAsG;AAEtG,6EAAwE;AACxE,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,uCAAkB;IAC1D,YAC6D,0BAAsD,EACrD,gBAAqD,EACjD,cAAuD,EAC3D,gBAAqD,EAE/G,oBAA6D;QAE7D,KAAK,CAAC,0BAA0B,CAAC,CAAC;QANgC,qBAAgB,GAAhB,gBAAgB,CAA6B;QACzC,mBAAc,GAAd,cAAc,CAAiC;QACnD,qBAAgB,GAAhB,gBAAgB,CAA6B;QAEvG,yBAAoB,GAApB,oBAAoB,CAAiC;QAK1D,WAAM,GAAG,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACtE,IAAI,CAAC;gBACD,MAAM,KAAK,GAAI,GAAG,CAAC,KAAK,CAAC,CAAY,CAAC,IAAI,EAAE,CAAC;gBAC7C,wFAAwF;gBACxF,8EAA8E;gBAC9E,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,2CAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAEjG,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,6CAA0B,EAAE,yCAAsB,CAAC,CAAC;gBAElH,MAAM,QAAQ,GAA+B;oBACzC,KAAK;oBACL,e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,iBAAM,EAAC,2CAAoB,CAAC,2BAA2B,CAAC,CAAA;IACxD,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,+BAA+B,CAAC,CAAA;IAC5D,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,2BAA2B,CAAC,CAAA;IACxD,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,+BAA+B,CAAC,CAAA;qCAJwB,uDAA0B;QAC3B,yDAA2B;QACzB,iEAA+B;QACjC,yDAA2B;QAEjF,iEAA+B;GAPxD,sBAAsB,CA+ClC"}
@@ -0,0 +1,10 @@
1
+ export type StripPrefix<T, P extends string> = {
2
+ [K in keyof T as K extends `${P}${infer R}` ? R : never]: T[K];
3
+ };
4
+ export declare const stripPrefix: <T extends object, P extends string>(row: T, prefix: P) => StripPrefix<T, P>;
5
+ export declare const omitKeys: <T extends object, K extends keyof T>(obj: T, keys: K[]) => Omit<T, K>;
6
+ /**
7
+ * pg returns NUMERIC/DECIMAL and BIGINT columns as strings despite the model typing —
8
+ * coerces the listed fields back to numbers, preserving null and undefined values.
9
+ */
10
+ export declare const parseNumericFields: <T extends object>(row: T, keys: ReadonlyArray<keyof T>) => T;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseNumericFields = exports.omitKeys = exports.stripPrefix = void 0;
4
+ const stripPrefix = (row, prefix) => {
5
+ const result = {};
6
+ for (const [key, value] of Object.entries(row)) {
7
+ if (key.startsWith(prefix)) {
8
+ result[key.slice(prefix.length)] = value;
9
+ }
10
+ }
11
+ return result;
12
+ };
13
+ exports.stripPrefix = stripPrefix;
14
+ const omitKeys = (obj, keys) => {
15
+ const result = { ...obj };
16
+ for (const key of keys) {
17
+ delete result[key];
18
+ }
19
+ return result;
20
+ };
21
+ exports.omitKeys = omitKeys;
22
+ /**
23
+ * pg returns NUMERIC/DECIMAL and BIGINT columns as strings despite the model typing —
24
+ * coerces the listed fields back to numbers, preserving null and undefined values.
25
+ */
26
+ const parseNumericFields = (row, keys) => {
27
+ const result = { ...row };
28
+ for (const key of keys) {
29
+ const value = result[key];
30
+ if (value !== null && value !== undefined) {
31
+ result[key] = Number(value);
32
+ }
33
+ }
34
+ return result;
35
+ };
36
+ exports.parseNumericFields = parseNumericFields;
37
+ //# sourceMappingURL=objectMappers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectMappers.js","sourceRoot":"","sources":["../../../src/output-gateway/helpers/objectMappers.ts"],"names":[],"mappings":";;;AAIO,MAAM,WAAW,GAAG,CAAqC,GAAM,EAAE,MAAS,EAAqB,EAAE;IACpG,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC;QAC7C,CAAC;IACL,CAAC;IACD,OAAO,MAA2B,CAAC;AACvC,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB;AAEK,MAAM,QAAQ,GAAG,CAAsC,GAAM,EAAE,IAAS,EAAc,EAAE;IAC3F,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAmB,GAAM,EAAE,IAA4B,EAAK,EAAE;IAC5F,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,KAAK,GAAY,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAe,CAAC;QAC9C,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B"}
@@ -4,8 +4,15 @@ exports.routers = void 0;
4
4
  const ModuleContainerToken_1 = require("./ioc/ModuleContainerToken");
5
5
  const Di_1 = require("./ioc/Di");
6
6
  const v2BuildingsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2BuildingsRouter);
7
+ const v2EnoBuildingsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2EnoBuildingsRouter);
7
8
  const v2OrganizationsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsRouter);
8
9
  const v2DevicesRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2DevicesRouter);
9
10
  const v2MeasurementsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2MeasurementsRouter);
10
- exports.routers = [v2BuildingsRouter, v2OrganizationsRouter, v2DevicesRouter, v2MeasurementsRouter];
11
+ exports.routers = [
12
+ v2BuildingsRouter,
13
+ v2EnoBuildingsRouter,
14
+ v2OrganizationsRouter,
15
+ v2DevicesRouter,
16
+ v2MeasurementsRouter,
17
+ ];
11
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AACpE,iCAAmD;AAMnD,MAAM,iBAAiB,GAAG,0BAAqB,CAAC,OAAO,CAAoB,2CAAoB,CAAC,iBAAiB,CAAC,CAAC;AACnH,MAAM,qBAAqB,GAAG,0BAAqB,CAAC,OAAO,CAAwB,2CAAoB,CAAC,qBAAqB,CAAC,CAAC;AAC/H,MAAM,eAAe,GAAG,0BAAqB,CAAC,OAAO,CAAwB,2CAAoB,CAAC,eAAe,CAAC,CAAC;AACnH,MAAM,oBAAoB,GAAG,0BAAqB,CAAC,OAAO,CAAuB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;AAE/G,QAAA,OAAO,GAAqB,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,EAAE,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AACpE,iCAAmD;AAOnD,MAAM,iBAAiB,GAAG,0BAAqB,CAAC,OAAO,CAAoB,2CAAoB,CAAC,iBAAiB,CAAC,CAAC;AACnH,MAAM,oBAAoB,GAAG,0BAAqB,CAAC,OAAO,CAAuB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;AAC5H,MAAM,qBAAqB,GAAG,0BAAqB,CAAC,OAAO,CAAwB,2CAAoB,CAAC,qBAAqB,CAAC,CAAC;AAC/H,MAAM,eAAe,GAAG,0BAAqB,CAAC,OAAO,CAAwB,2CAAoB,CAAC,eAAe,CAAC,CAAC;AACnH,MAAM,oBAAoB,GAAG,0BAAqB,CAAC,OAAO,CAAuB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;AAE/G,QAAA,OAAO,GAAqB;IACrC,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,oBAAoB;CACvB,CAAC"}
@@ -25,6 +25,12 @@ const V2BuildingsRouter_1 = require("../routers/v2/V2BuildingsRouter");
25
25
  const AccessLimitationRepository_1 = require("../repositories/AccessLimitationRepository");
26
26
  const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
27
27
  const BuildingsController_1 = require("../controllers/v2/BuildingsController");
28
+ const EnoBuildingDetailRepository_1 = require("../repositories/EnoBuildingDetailRepository");
29
+ const EnoBuildingDetailTransformation_1 = require("../transformations/EnoBuildingDetailTransformation");
30
+ const EnoBuildingsController_1 = require("../controllers/v2/EnoBuildingsController");
31
+ const V2EnoBuildingsRouter_1 = require("../routers/v2/V2EnoBuildingsRouter");
32
+ const DedBuildingSearchRepository_1 = require("../repositories/DedBuildingSearchRepository");
33
+ const DedBuildingSearchTransformation_1 = require("../transformations/DedBuildingSearchTransformation");
28
34
  //#region Initialization
29
35
  const energeticsContainer = ioc_1.OutputGatewayContainer.createChildContainer();
30
36
  exports.OGEnergeticsContainer = energeticsContainer;
@@ -34,7 +40,9 @@ energeticsContainer
34
40
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.OrganizationDtoTransformation, OrganizationDtoTransformation_1.OrganizationDtoTransformation)
35
41
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.OrganizationDetailDtoTransformation, OrganizationDetailDtoTransformation_1.OrganizationDetailDtoTransformation)
36
42
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.DeviceDtoTransformation, DeviceDtoTransformation_1.DeviceDtoTransformation)
37
- .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.BuildingTransformationFull, BuildingTransformationFull_1.BuildingTransformationFull);
43
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.BuildingTransformationFull, BuildingTransformationFull_1.BuildingTransformationFull)
44
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailTransformation, EnoBuildingDetailTransformation_1.EnoBuildingDetailTransformation)
45
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.DedBuildingSearchTransformation, DedBuildingSearchTransformation_1.DedBuildingSearchTransformation);
38
46
  //#endregion
39
47
  //#region Repositories
40
48
  energeticsContainer
@@ -44,6 +52,8 @@ energeticsContainer
44
52
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.OrganizationResponsibleUsersRepository, OrganizationResponsibleUsersRepository_1.OrganizationResponsibleUsersRepository)
45
53
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.DevicesRepository, DevicesRepository_1.DevicesRepository)
46
54
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.MeasurementRepository, MeasurementRepository_1.MeasurementRepository)
55
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailRepository, EnoBuildingDetailRepository_1.EnoBuildingDetailRepository)
56
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.DedBuildingSearchRepository, DedBuildingSearchRepository_1.DedBuildingSearchRepository)
47
57
  .register(ModuleContainerToken_1.ModuleContainerToken.AccessLimitationRepository, {
48
58
  useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => new AccessLimitationRepository_1.AccessLimitationRepository(c.resolve(CoreToken_1.CoreToken.PostgresConnector), c.resolve(CoreToken_1.CoreToken.Logger))),
49
59
  });
@@ -51,6 +61,7 @@ energeticsContainer
51
61
  //#region Controllers
52
62
  energeticsContainer
53
63
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.BuildingsController, BuildingsController_1.BuildingsController)
64
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingsController, EnoBuildingsController_1.EnoBuildingsController)
54
65
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsController, V2OrganizationsController_1.V2OrganizationsController)
55
66
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2DevicesController, V2DevicesController_1.V2DevicesController)
56
67
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2MeasurementsController, V2MeasurementsController_1.V2MeasurementsController);
@@ -58,6 +69,7 @@ energeticsContainer
58
69
  //#region Routers
59
70
  energeticsContainer
60
71
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2BuildingsRouter, V2BuildingsRouter_1.V2BuildingsRouter)
72
+ .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2EnoBuildingsRouter, V2EnoBuildingsRouter_1.V2EnoBuildingsRouter)
61
73
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsRouter, V2OrganizationsRouter_1.V2OrganizationsRouter)
62
74
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2DevicesRouter, V2DevicesRouter_1.V2DevicesRouter)
63
75
  .registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2MeasurementsRouter, V2MeasurementsRouter_1.V2MeasurementsRouter);
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iEAAoE;AACpE,iEAAiG;AACjG,+DAA+E;AAC/E,qFAAmF;AACnF,2FAAyF;AACzF,mHAAiH;AACjH,2FAAyF;AACzF,qGAAmG;AACnG,yEAAuE;AACvE,+EAA6E;AAC7E,+EAA6E;AAC7E,mEAAiE;AACjE,oGAAkG;AAClG,gHAA8G;AAC9G,wFAAsF;AACtF,8FAA4F;AAC5F,kEAAgE;AAChE,iFAA+E;AAC/E,6EAA2E;AAC3E,yFAAuF;AACvF,uEAAqE;AACrE,2FAAyF;AACzF,wEAAqE;AACrE,+EAA6E;AAE7E,wBAAwB;AACxB,MAAM,mBAAmB,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAoD/D,oDAAqB;AAnDrD,YAAY;AAEZ,yBAAyB;AACzB,mBAAmB;KACd,iBAAiB,CAAC,2CAAoB,CAAC,6BAA6B,EAAE,6DAA6B,CAAC;KACpG,iBAAiB,CAAC,2CAAoB,CAAC,mCAAmC,EAAE,yEAAmC,CAAC;KAChH,iBAAiB,CAAC,2CAAoB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC;KACxF,iBAAiB,CAAC,2CAAoB,CAAC,0BAA0B,EAAE,uDAA0B,CAAC,CAAC;AACpG,YAAY;AAEZ,sBAAsB;AACtB,mBAAmB;KACd,iBAAiB,CAA6B,2CAAoB,CAAC,0BAA0B,EA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AiB,EAAE,qCAAiB,CAAC;KAC/F,iBAAiB,CAAuB,2CAAoB,CAAC,oBAAoB,EAAE,2CAAoB,CAAC;KACxG,iBAAiB,CAAwB,2CAAoB,CAAC,qBAAqB,EAAE,6CAAqB,CAAC;KAC3G,iBAAiB,CAAkB,2CAAoB,CAAC,eAAe,EAAE,iCAAe,CAAC;KACzF,iBAAiB,CAAuB,2CAAoB,CAAC,oBAAoB,EAAE,2CAAoB,CAAC,CAAC;AAC9G,YAAY;AAEZ,iBAAiB;AACjB,mBAAmB,CAAC,iBAAiB,CAAmB,2CAAoB,CAAC,gBAAgB,EAAE,mCAAgB,CAAC,CAAC"}
@@ -4,6 +4,8 @@ declare const ModuleContainerToken: {
4
4
  OrganizationDetailDtoTransformation: symbol;
5
5
  DeviceDtoTransformation: symbol;
6
6
  BuildingTransformationFull: symbol;
7
+ EnoBuildingDetailTransformation: symbol;
8
+ DedBuildingSearchTransformation: symbol;
7
9
  /** repositories */
8
10
  PrimaryBuildingsRepository: symbol;
9
11
  OrganizationsRepository: symbol;
@@ -11,14 +13,18 @@ declare const ModuleContainerToken: {
11
13
  OrganizationResponsibleUsersRepository: symbol;
12
14
  DevicesRepository: symbol;
13
15
  MeasurementRepository: symbol;
16
+ EnoBuildingDetailRepository: symbol;
17
+ DedBuildingSearchRepository: symbol;
14
18
  AccessLimitationRepository: symbol;
15
19
  /** controllers */
16
20
  BuildingsController: symbol;
21
+ EnoBuildingsController: symbol;
17
22
  V2OrganizationsController: symbol;
18
23
  V2DevicesController: symbol;
19
24
  V2MeasurementsController: symbol;
20
25
  /** routers */
21
26
  V2BuildingsRouter: symbol;
27
+ V2EnoBuildingsRouter: symbol;
22
28
  V2OrganizationsRouter: symbol;
23
29
  V2DevicesRouter: symbol;
24
30
  V2MeasurementsRouter: symbol;
@@ -7,6 +7,8 @@ const ModuleContainerToken = {
7
7
  OrganizationDetailDtoTransformation: Symbol("OrganizationDetailDtoTransformation"),
8
8
  DeviceDtoTransformation: Symbol("DeviceDtoTransformation"),
9
9
  BuildingTransformationFull: Symbol("BuildingTransformationFull"),
10
+ EnoBuildingDetailTransformation: Symbol("EnoBuildingDetailTransformation"),
11
+ DedBuildingSearchTransformation: Symbol("DedBuildingSearchTransformation"),
10
12
  /** repositories */
11
13
  PrimaryBuildingsRepository: Symbol("PrimaryBuildingsRepository"),
12
14
  OrganizationsRepository: Symbol("OrganizationsRepository"),
@@ -14,14 +16,18 @@ const ModuleContainerToken = {
14
16
  OrganizationResponsibleUsersRepository: Symbol("OrganizationResponsibleUsersRepository"),
15
17
  DevicesRepository: Symbol("DevicesRepository"),
16
18
  MeasurementRepository: Symbol("MeasurementRepository"),
19
+ EnoBuildingDetailRepository: Symbol("EnoBuildingDetailRepository"),
20
+ DedBuildingSearchRepository: Symbol("DedBuildingSearchRepository"),
17
21
  AccessLimitationRepository: Symbol(),
18
22
  /** controllers */
19
23
  BuildingsController: Symbol("BuildingController"),
24
+ EnoBuildingsController: Symbol("EnoBuildingsController"),
20
25
  V2OrganizationsController: Symbol("V2OrganizationsController"),
21
26
  V2DevicesController: Symbol("V2DevicesController"),
22
27
  V2MeasurementsController: Symbol("V2MeasurementsController"),
23
28
  /** routers */
24
29
  V2BuildingsRouter: Symbol("V2BuildingsRouter"),
30
+ V2EnoBuildingsRouter: Symbol("V2EnoBuildingsRouter"),
25
31
  V2OrganizationsRouter: Symbol("V2OrganizationsRouter"),
26
32
  V2DevicesRouter: Symbol("V2DevicesRouter"),
27
33
  V2MeasurementsRouter: Symbol("V2MeasurementsRouter"),
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleContainerToken.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/ModuleContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG;IACzB,sBAAsB;IACtB,6BAA6B,EAAE,MAAM,CAAC,+BAA+B,CAAC;IACtE,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,uBAAuB,EAAE,MAAM,CAAC,yBA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M,CAAC,iCAAiC,CAAC;IAC1E,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,mBAAmB;IACnB,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,sCAAsC,EAAE,MAAM,CAAC,wCAAwC,CAAC;IACxF,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,0BAA0B,EAAE,MAAM,EAAE;IACpC,kBAAkB;IAClB,mBAAmB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IACjD,sBAAsB,EAAE,MAAM,CAAC,wBAAwB,CAAC;IACxD,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,cAAc;IACd,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,cAAc;IACd,gBAAgB,EAAE,MAAM,CAAC,0BAA0B,CAAC;CACvD,CAAC;AAEO,oDAAoB"}
@@ -0,0 +1,30 @@
1
+ import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
2
+ import { IDedBuildingSearchView } from "./interfaces/IDedBuildingSearchView";
3
+ /**
4
+ * Model over the mv_ded_building_search materialized view. The search itself runs as a single raw
5
+ * query (weighted ranking is not expressible through the query builder); this model exists so the
6
+ * repository inherits the numeric column parsing and the schema binding.
7
+ * The search_document and geom columns are intentionally not declared - they are never selected as
8
+ * values, only used inside the query.
9
+ */
10
+ export declare class DedBuildingSearchViewModel extends Model<IDedBuildingSearchView> implements IDedBuildingSearchView {
11
+ static tableName: string;
12
+ static modelName: string;
13
+ gid: string;
14
+ nazev: string | null;
15
+ oznaceni: string | null;
16
+ ej_id: number | null;
17
+ ej_kod: string | null;
18
+ ej_nazev: string | null;
19
+ ej_typ: string | null;
20
+ address_main: string | null;
21
+ addresses: string[];
22
+ ean: string[];
23
+ eic: string[];
24
+ om: string[];
25
+ active_points_count: number;
26
+ has_building_record: boolean;
27
+ name_norm: string;
28
+ address_norm: string;
29
+ static attributeModel: ModelAttributes<DedBuildingSearchViewModel, IDedBuildingSearchView>;
30
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DedBuildingSearchViewModel = void 0;
4
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
5
+ /**
6
+ * Model over the mv_ded_building_search materialized view. The search itself runs as a single raw
7
+ * query (weighted ranking is not expressible through the query builder); this model exists so the
8
+ * repository inherits the numeric column parsing and the schema binding.
9
+ * The search_document and geom columns are intentionally not declared - they are never selected as
10
+ * values, only used inside the query.
11
+ */
12
+ class DedBuildingSearchViewModel extends sequelize_1.Model {
13
+ }
14
+ exports.DedBuildingSearchViewModel = DedBuildingSearchViewModel;
15
+ DedBuildingSearchViewModel.tableName = "mv_ded_building_search";
16
+ DedBuildingSearchViewModel.modelName = "DedBuildingSearchViewModelData";
17
+ DedBuildingSearchViewModel.attributeModel = {
18
+ gid: {
19
+ primaryKey: true,
20
+ type: sequelize_1.DataTypes.TEXT,
21
+ },
22
+ nazev: sequelize_1.DataTypes.TEXT,
23
+ oznaceni: sequelize_1.DataTypes.TEXT,
24
+ ej_id: sequelize_1.DataTypes.INTEGER,
25
+ ej_kod: sequelize_1.DataTypes.TEXT,
26
+ ej_nazev: sequelize_1.DataTypes.TEXT,
27
+ ej_typ: sequelize_1.DataTypes.TEXT,
28
+ address_main: sequelize_1.DataTypes.TEXT,
29
+ addresses: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.TEXT),
30
+ ean: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.TEXT),
31
+ eic: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.TEXT),
32
+ om: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.TEXT),
33
+ active_points_count: sequelize_1.DataTypes.BIGINT,
34
+ has_building_record: sequelize_1.DataTypes.BOOLEAN,
35
+ name_norm: sequelize_1.DataTypes.TEXT,
36
+ address_norm: sequelize_1.DataTypes.TEXT,
37
+ };
38
+ //# sourceMappingURL=DedBuildingSearchViewModel.js.map