@golemio/energetics 1.6.0 → 1.6.1-dev.2190914714
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/db/migrations/postgresql/20250213141826-add-device-serial-id.js +53 -0
- package/db/migrations/postgresql/20251119123216-eno-stavby-geometrie.js +53 -0
- package/db/migrations/postgresql/20251126125250-eno-ej-lookup-type-fix.js +53 -0
- package/db/migrations/postgresql/sqls/20250213141826-add-device-serial-id-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20250213141826-add-device-serial-id-up.sql +1 -0
- package/db/migrations/postgresql/sqls/20251119123216-eno-stavby-geometrie-down.sql +2 -0
- package/db/migrations/postgresql/sqls/20251119123216-eno-stavby-geometrie-up.sql +37 -0
- package/db/migrations/postgresql/sqls/20251126125250-eno-ej-lookup-type-fix-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20251126125250-eno-ej-lookup-type-fix-up.sql +1 -0
- package/dist/integration-engine/commodity-providers/transformations/AveMeasurementTransformation.d.ts +3 -2
- package/dist/integration-engine/commodity-providers/transformations/AveMeasurementTransformation.js +2 -1
- package/dist/integration-engine/commodity-providers/transformations/AveMeasurementTransformation.js.map +1 -1
- package/dist/integration-engine/commodity-providers/transformations/CemMeasurementTransformation.d.ts +2 -0
- package/dist/integration-engine/commodity-providers/transformations/CemMeasurementTransformation.js +1 -0
- package/dist/integration-engine/commodity-providers/transformations/CemMeasurementTransformation.js.map +1 -1
- package/dist/integration-engine/commodity-providers/transformations/PreElectroTransformation.js +1 -0
- package/dist/integration-engine/commodity-providers/transformations/PreElectroTransformation.js.map +1 -1
- package/dist/integration-engine/commodity-providers/transformations/PreMeasurementTransformation.js +1 -0
- package/dist/integration-engine/commodity-providers/transformations/PreMeasurementTransformation.js.map +1 -1
- package/dist/integration-engine/commodity-providers/transformations/PtasWebMeasurementTransformation.js +1 -0
- package/dist/integration-engine/commodity-providers/transformations/PtasWebMeasurementTransformation.js.map +1 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchPpasEEMeasurementsTask.js +2 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchPpasEEMeasurementsTask.js.map +1 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchPpasMeasurementsTask.js +2 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchPpasMeasurementsTask.js.map +1 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchPreMeasurementDataTask.js +1 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchPreMeasurementDataTask.js.map +1 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchVeoliaMeasurementsTask.js +3 -1
- package/dist/integration-engine/commodity-providers/workers/tasks/FetchVeoliaMeasurementsTask.js.map +1 -1
- package/dist/integration-engine/enapo/constants.d.ts +1 -0
- package/dist/integration-engine/enapo/constants.js +2 -1
- package/dist/integration-engine/enapo/constants.js.map +1 -1
- package/dist/integration-engine/enapo/datasources/eno/EnoDatasource.js +10 -0
- package/dist/integration-engine/enapo/datasources/eno/EnoDatasource.js.map +1 -1
- package/dist/integration-engine/enapo/datasources/eno/EnoDatasourceFactory.d.ts +3 -1
- package/dist/integration-engine/enapo/datasources/eno/EnoDatasourceFactory.js +2 -0
- package/dist/integration-engine/enapo/datasources/eno/EnoDatasourceFactory.js.map +1 -1
- package/dist/integration-engine/enapo/datasources/eno/EnoOperationEnum.d.ts +6 -0
- package/dist/integration-engine/enapo/datasources/eno/EnoOperationEnum.js +8 -1
- package/dist/integration-engine/enapo/datasources/eno/EnoOperationEnum.js.map +1 -1
- package/dist/integration-engine/enapo/helpers/Chunker.d.ts +3 -0
- package/dist/integration-engine/enapo/helpers/Chunker.js +14 -0
- package/dist/integration-engine/enapo/helpers/Chunker.js.map +1 -0
- package/dist/integration-engine/enapo/interfaces/eno/IEnoStructureInfo.d.ts +10 -0
- package/dist/integration-engine/enapo/{workers/interfaces/IEnoBuildingTaskInput.js → interfaces/eno/IEnoStructureInfo.js} +1 -1
- package/dist/integration-engine/enapo/interfaces/eno/IEnoStructureInfo.js.map +1 -0
- package/dist/integration-engine/enapo/interfaces/eno/IGeometryInputWithIndex.d.ts +4 -0
- package/dist/integration-engine/enapo/interfaces/eno/IGeometryInputWithIndex.js +3 -0
- package/dist/integration-engine/enapo/interfaces/eno/IGeometryInputWithIndex.js.map +1 -0
- package/dist/integration-engine/enapo/ioc/Di.js +11 -2
- package/dist/integration-engine/enapo/ioc/Di.js.map +1 -1
- package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.d.ts +4 -0
- package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js +4 -0
- package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js.map +1 -1
- package/dist/integration-engine/enapo/repositories/eno/EnoGeometryRepository.d.ts +5 -0
- package/dist/integration-engine/enapo/repositories/eno/EnoGeometryRepository.js +32 -0
- package/dist/integration-engine/enapo/repositories/eno/EnoGeometryRepository.js.map +1 -0
- package/dist/integration-engine/enapo/repositories/eno/EnoStructureRepository.d.ts +5 -0
- package/dist/integration-engine/enapo/repositories/eno/EnoStructureRepository.js +32 -0
- package/dist/integration-engine/enapo/repositories/eno/EnoStructureRepository.js.map +1 -0
- package/dist/integration-engine/enapo/transformations/eno/EnoGeometryTransformation.d.ts +11 -0
- package/dist/integration-engine/enapo/transformations/eno/EnoGeometryTransformation.js +34 -0
- package/dist/integration-engine/enapo/transformations/eno/EnoGeometryTransformation.js.map +1 -0
- package/dist/integration-engine/enapo/transformations/eno/EnoStructureTransformation.d.ts +13 -0
- package/dist/integration-engine/enapo/transformations/eno/EnoStructureTransformation.js +92 -0
- package/dist/integration-engine/enapo/transformations/eno/EnoStructureTransformation.js.map +1 -0
- package/dist/integration-engine/enapo/workers/EnapoWorker.js +2 -0
- package/dist/integration-engine/enapo/workers/EnapoWorker.js.map +1 -1
- package/dist/integration-engine/enapo/workers/interfaces/IEnoDataTaskInput.d.ts +9 -0
- package/dist/integration-engine/enapo/workers/interfaces/IEnoDataTaskInput.js +9 -0
- package/dist/integration-engine/enapo/workers/interfaces/IEnoDataTaskInput.js.map +1 -0
- package/dist/integration-engine/enapo/workers/interfaces/IEnoGeometryTaskInput.d.ts +4 -0
- package/dist/integration-engine/enapo/workers/interfaces/IEnoGeometryTaskInput.js +3 -0
- package/dist/integration-engine/enapo/workers/interfaces/IEnoGeometryTaskInput.js.map +1 -0
- package/dist/integration-engine/enapo/workers/schema/EnoDataTaskInputSchema.d.ts +6 -0
- package/dist/integration-engine/enapo/workers/schema/{EnoBuildingTaskInputSchema.js → EnoDataTaskInputSchema.js} +9 -8
- package/dist/integration-engine/enapo/workers/schema/EnoDataTaskInputSchema.js.map +1 -0
- package/dist/integration-engine/enapo/workers/schema/EnoGeometryTaskInputSchema.d.ts +5 -0
- package/dist/integration-engine/enapo/workers/schema/EnoGeometryTaskInputSchema.js +27 -0
- package/dist/integration-engine/enapo/workers/schema/EnoGeometryTaskInputSchema.js.map +1 -0
- package/dist/integration-engine/enapo/workers/task/EnoBuildingTask.d.ts +6 -7
- package/dist/integration-engine/enapo/workers/task/EnoBuildingTask.js +11 -6
- package/dist/integration-engine/enapo/workers/task/EnoBuildingTask.js.map +1 -1
- package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.d.ts +15 -0
- package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js +69 -0
- package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js.map +1 -0
- package/dist/integration-engine/enapo/workers/task/EnoStructureTask.d.ts +33 -0
- package/dist/integration-engine/enapo/workers/task/EnoStructureTask.js +150 -0
- package/dist/integration-engine/enapo/workers/task/EnoStructureTask.js.map +1 -0
- package/dist/schema-definitions/datasources/StaticMeterSettingsJsonSchema.js +4 -3
- package/dist/schema-definitions/datasources/StaticMeterSettingsJsonSchema.js.map +1 -1
- package/dist/schema-definitions/datasources/eno/EnoGeometryJsonSchema.d.ts +5 -0
- package/dist/schema-definitions/datasources/eno/EnoGeometryJsonSchema.js +24 -0
- package/dist/schema-definitions/datasources/eno/EnoGeometryJsonSchema.js.map +1 -0
- package/dist/schema-definitions/datasources/eno/EnoStructureInfoJsonSchema.d.ts +5 -0
- package/dist/schema-definitions/datasources/eno/EnoStructureInfoJsonSchema.js +102 -0
- package/dist/schema-definitions/datasources/eno/EnoStructureInfoJsonSchema.js.map +1 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IGeometryInput.d.ts +7 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IGeometryInput.js +3 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IGeometryInput.js.map +1 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IStructureInfoInput.d.ts +10 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IStructureInfoInput.js +3 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IStructureInfoInput.js.map +1 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IStructureInput.d.ts +20 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IStructureInput.js +3 -0
- package/dist/schema-definitions/datasources/eno/interfaces/IStructureInput.js.map +1 -0
- package/dist/schema-definitions/datasources/interfaces/IStaticMeterSettings.d.ts +3 -2
- package/dist/schema-definitions/models/MeasurementsModel.d.ts +1 -0
- package/dist/schema-definitions/models/MeasurementsModel.js +15 -1
- package/dist/schema-definitions/models/MeasurementsModel.js.map +1 -1
- package/dist/schema-definitions/models/eno/EJLookupModel.js +1 -1
- package/dist/schema-definitions/models/eno/EJLookupModel.js.map +1 -1
- package/dist/schema-definitions/models/eno/GeometryModel.d.ts +15 -0
- package/dist/schema-definitions/models/eno/GeometryModel.js +43 -0
- package/dist/schema-definitions/models/eno/GeometryModel.js.map +1 -0
- package/dist/schema-definitions/models/eno/StructureModel.d.ts +27 -0
- package/dist/schema-definitions/models/eno/StructureModel.js +80 -0
- package/dist/schema-definitions/models/eno/StructureModel.js.map +1 -0
- package/dist/schema-definitions/models/eno/interfaces/IGeometry.d.ts +9 -0
- package/dist/schema-definitions/models/eno/interfaces/IGeometry.js +3 -0
- package/dist/schema-definitions/models/eno/interfaces/IGeometry.js.map +1 -0
- package/dist/schema-definitions/models/eno/interfaces/IStructure.d.ts +21 -0
- package/dist/schema-definitions/models/eno/interfaces/IStructure.js +3 -0
- package/dist/schema-definitions/models/eno/interfaces/IStructure.js.map +1 -0
- package/dist/schema-definitions/models/interfaces/IMeasurementDto.d.ts +1 -0
- package/docs/asyncapi.yaml +54 -0
- package/docs/implementation_documentation.md +74 -0
- package/package.json +1 -1
- package/dist/integration-engine/enapo/workers/interfaces/IEnoBuildingTaskInput.d.ts +0 -5
- package/dist/integration-engine/enapo/workers/interfaces/IEnoBuildingTaskInput.js.map +0 -1
- package/dist/integration-engine/enapo/workers/schema/EnoBuildingTaskInputSchema.d.ts +0 -6
- package/dist/integration-engine/enapo/workers/schema/EnoBuildingTaskInputSchema.js.map +0 -1
|
@@ -25,11 +25,13 @@ const EnoRemovedGIDRepository_1 = require("../../repositories/eno/EnoRemovedGIDR
|
|
|
25
25
|
const EnoBuildingTransformation_1 = require("../../transformations/eno/EnoBuildingTransformation");
|
|
26
26
|
const EnumGIDTypes_1 = require("../../../../schema-definitions/models/eno/helpers/EnumGIDTypes");
|
|
27
27
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
28
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
28
29
|
const AbstractTask_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTask");
|
|
29
30
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
30
31
|
const luxon_1 = require("@golemio/core/dist/shared/luxon");
|
|
31
32
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
32
|
-
const
|
|
33
|
+
const IEnoDataTaskInput_1 = require("../interfaces/IEnoDataTaskInput");
|
|
34
|
+
const EnoDataTaskInputSchema_1 = require("../schema/EnoDataTaskInputSchema");
|
|
33
35
|
let EnoBuildingTask = exports.EnoBuildingTask = class EnoBuildingTask extends AbstractTask_1.AbstractTask {
|
|
34
36
|
constructor(enoDatasourceFactory, enoBuildingRepository, enoPropertyRepository, enoLocationRepository, enoAddressRepository, enoRemovedGIDRepository, logger, dbConnector, simpleConfig) {
|
|
35
37
|
super(constants_1.ENAPO_WORKER_NAME);
|
|
@@ -42,16 +44,15 @@ let EnoBuildingTask = exports.EnoBuildingTask = class EnoBuildingTask extends Ab
|
|
|
42
44
|
this.logger = logger;
|
|
43
45
|
this.dbConnector = dbConnector;
|
|
44
46
|
this.simpleConfig = simpleConfig;
|
|
45
|
-
this.schema =
|
|
47
|
+
this.schema = EnoDataTaskInputSchema_1.EnoDataTaskInputSchema;
|
|
46
48
|
this.queueName = "processEnoBuildings";
|
|
47
49
|
this.queueTtl = 60 * 60 * 1000;
|
|
48
|
-
this.ORGANIZATION_ID = 1;
|
|
49
50
|
this.removedBuldingsStartDate = this.simpleConfig.getValue("module.energetics.eno.removedBuldingsStartDate", "2025-01-01T00:00:00+01:00");
|
|
50
51
|
}
|
|
51
52
|
async execute(data) {
|
|
52
53
|
try {
|
|
53
54
|
const datasource = this.enoDatasourceFactory.getDatasource(EnoDatasourceFactory_1.ENO_ENDPOINT.BUILDINGS, data.source);
|
|
54
|
-
const listGID = data.type ===
|
|
55
|
+
const listGID = data.type === IEnoDataTaskInput_1.EnumEnoDataType.CURRENT
|
|
55
56
|
? await this.getCurrentBuildingList(datasource, data)
|
|
56
57
|
: await this.getRemovedBuildingList(datasource, data);
|
|
57
58
|
if (!listGID || (Array.isArray(listGID.return) && listGID.return.length === 0)) {
|
|
@@ -66,6 +67,10 @@ let EnoBuildingTask = exports.EnoBuildingTask = class EnoBuildingTask extends Ab
|
|
|
66
67
|
const transformation = new EnoBuildingTransformation_1.EnoBuildingTransformation(data.source);
|
|
67
68
|
const transformedData = transformation.transformArray(buildingDetails.return);
|
|
68
69
|
await this.saveData(transformedData);
|
|
70
|
+
integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "processEnoGeometry", {
|
|
71
|
+
source: data.source,
|
|
72
|
+
listGid: listGID.return,
|
|
73
|
+
});
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
catch (err) {
|
|
@@ -95,14 +100,14 @@ let EnoBuildingTask = exports.EnoBuildingTask = class EnoBuildingTask extends Ab
|
|
|
95
100
|
}
|
|
96
101
|
async getCurrentBuildingList(datasource, data) {
|
|
97
102
|
const listGID = await datasource.getData(EnoOperationEnum_1.EnoOperationBuildingEnum.LIST_BY_ORG, "", {
|
|
98
|
-
idOrganizace:
|
|
103
|
+
idOrganizace: constants_1.ENO_DEFAULT_ORGANIZATION_ID,
|
|
99
104
|
...(data.daysBack ? { datum: luxon_1.DateTime.now().minus({ days: data.daysBack }).toISO() } : {}),
|
|
100
105
|
});
|
|
101
106
|
return listGID;
|
|
102
107
|
}
|
|
103
108
|
async getRemovedBuildingList(datasource, data) {
|
|
104
109
|
const listRemovedBuildingGID = await datasource.getData(EnoOperationEnum_1.EnoOperationBuildingEnum.REMOVED_LIST, "", {
|
|
105
|
-
idOrganizace:
|
|
110
|
+
idOrganizace: constants_1.ENO_DEFAULT_ORGANIZATION_ID,
|
|
106
111
|
datum: data.daysBack ? luxon_1.DateTime.now().minus({ days: data.daysBack }).toISO() : this.removedBuldingsStartDate,
|
|
107
112
|
});
|
|
108
113
|
if (listRemovedBuildingGID) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnoBuildingTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/task/EnoBuildingTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"EnoBuildingTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/task/EnoBuildingTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAqF;AAErF,qFAAoG;AACpG,6EAAsF;AAEtF,mFAAoF;AACpF,sFAAuF;AACvF,wFAAyF;AACzF,wFAAyF;AACzF,wFAAyF;AAC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sBAAsB,CAAC;IAClC,CAAC;CACJ,CAAA;0BA9GY,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,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,uBAAuB,CAAC,CAAA;IACzD,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IACnC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;qCARuD,2CAAoB;QAClB,6CAAqB;QACrB,6CAAqB;QACrB,6CAAqB;QACvB,2CAAoB;QACd,iDAAuB;GAZ9G,eAAe,CA8G3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EnoDatasourceFactory } from "../../datasources/eno/EnoDatasourceFactory";
|
|
2
|
+
import { EnoGeometryRepository } from "../../repositories/eno/EnoGeometryRepository";
|
|
3
|
+
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/AbstractTask";
|
|
4
|
+
import { IEnoGeometryTaskInput } from "../interfaces/IEnoGeometryTaskInput";
|
|
5
|
+
import { EnoGeometryTaskInputSchema } from "../schema/EnoGeometryTaskInputSchema";
|
|
6
|
+
export declare class EnoGeometryTask extends AbstractTask<IEnoGeometryTaskInput> {
|
|
7
|
+
private enoDatasourceFactory;
|
|
8
|
+
private enoGeometryRepository;
|
|
9
|
+
queueName: string;
|
|
10
|
+
queueTtl: number;
|
|
11
|
+
schema: typeof EnoGeometryTaskInputSchema;
|
|
12
|
+
private static readonly BATCH_SIZE;
|
|
13
|
+
constructor(enoDatasourceFactory: EnoDatasourceFactory, enoGeometryRepository: EnoGeometryRepository);
|
|
14
|
+
execute(data: IEnoGeometryTaskInput): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
var EnoGeometryTask_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.EnoGeometryTask = void 0;
|
|
17
|
+
const constants_1 = require("../../constants");
|
|
18
|
+
const EnoDatasourceFactory_1 = require("../../datasources/eno/EnoDatasourceFactory");
|
|
19
|
+
const EnoOperationEnum_1 = require("../../datasources/eno/EnoOperationEnum");
|
|
20
|
+
const EnapoWorkerContainerToken_1 = require("../../ioc/EnapoWorkerContainerToken");
|
|
21
|
+
const EnoGeometryRepository_1 = require("../../repositories/eno/EnoGeometryRepository");
|
|
22
|
+
const EnoGeometryTransformation_1 = require("../../transformations/eno/EnoGeometryTransformation");
|
|
23
|
+
const AbstractTask_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTask");
|
|
24
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
25
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
26
|
+
const EnoGeometryTaskInputSchema_1 = require("../schema/EnoGeometryTaskInputSchema");
|
|
27
|
+
const Chunker_1 = require("../../helpers/Chunker");
|
|
28
|
+
let EnoGeometryTask = exports.EnoGeometryTask = EnoGeometryTask_1 = class EnoGeometryTask extends AbstractTask_1.AbstractTask {
|
|
29
|
+
constructor(enoDatasourceFactory, enoGeometryRepository) {
|
|
30
|
+
super(constants_1.ENAPO_WORKER_NAME);
|
|
31
|
+
this.enoDatasourceFactory = enoDatasourceFactory;
|
|
32
|
+
this.enoGeometryRepository = enoGeometryRepository;
|
|
33
|
+
this.queueName = "processEnoGeometry";
|
|
34
|
+
this.queueTtl = 60 * 60 * 1000;
|
|
35
|
+
this.schema = EnoGeometryTaskInputSchema_1.EnoGeometryTaskInputSchema;
|
|
36
|
+
}
|
|
37
|
+
async execute(data) {
|
|
38
|
+
try {
|
|
39
|
+
const datasource = this.enoDatasourceFactory.getDatasource(EnoDatasourceFactory_1.ENO_ENDPOINT.GEOMETRY, data.source);
|
|
40
|
+
const transformation = new EnoGeometryTransformation_1.EnoGeometryTransformation(data.source);
|
|
41
|
+
const batches = Chunker_1.Slicer.chunkArray(data.listGid, EnoGeometryTask_1.BATCH_SIZE);
|
|
42
|
+
for (const batch of batches) {
|
|
43
|
+
const result = await datasource.getData(EnoOperationEnum_1.ENO_GEOMETRY_OPERATION, "", {
|
|
44
|
+
gidList: batch,
|
|
45
|
+
idOrganizace: constants_1.ENO_DEFAULT_ORGANIZATION_ID,
|
|
46
|
+
});
|
|
47
|
+
if (result) {
|
|
48
|
+
const transformedData = transformation.transformArray(result.return);
|
|
49
|
+
await this.enoGeometryRepository.bulkSave(transformedData);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
throw new golemio_errors_1.GeneralError("Failed to save ENO geometry data", this.constructor.name, err);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
EnoGeometryTask.BATCH_SIZE = 1000;
|
|
62
|
+
exports.EnoGeometryTask = EnoGeometryTask = EnoGeometryTask_1 = __decorate([
|
|
63
|
+
(0, tsyringe_1.injectable)(),
|
|
64
|
+
__param(0, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoDatasourceFactory)),
|
|
65
|
+
__param(1, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoGeometryRepository)),
|
|
66
|
+
__metadata("design:paramtypes", [EnoDatasourceFactory_1.EnoDatasourceFactory,
|
|
67
|
+
EnoGeometryRepository_1.EnoGeometryRepository])
|
|
68
|
+
], EnoGeometryTask);
|
|
69
|
+
//# sourceMappingURL=EnoGeometryTask.js.map
|
|
@@ -0,0 +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,iDAArB,MAAM,eAAgB,SAAQ,2BAAmC;IAMpE,YAC4D,oBAAkD,EACjD,qBAAoD;QAE7G,KAAK,CAAC,6BAAiB,CAAC,CAAC;QAHuC,yBAAoB,GAApB,oB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AAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;qCAD8B,2CAAoB;QAClB,6CAAqB;GARxG,eAAe,CAqC3B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EnoDatasourceFactory } from "../../datasources/eno/EnoDatasourceFactory";
|
|
2
|
+
import { EnoAddressRepository } from "../../repositories/eno/EnoAddressRepository";
|
|
3
|
+
import { EnoLocationRepository } from "../../repositories/eno/EnoLocationRepository";
|
|
4
|
+
import { EnoPropertyRepository } from "../../repositories/eno/EnoPropertyRepository";
|
|
5
|
+
import { EnoRemovedGIDRepository } from "../../repositories/eno/EnoRemovedGIDRepository";
|
|
6
|
+
import { EnoStructureRepository } from "../../repositories/eno/EnoStructureRepository";
|
|
7
|
+
import { ILogger } from "@golemio/core/dist/helpers";
|
|
8
|
+
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
9
|
+
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
10
|
+
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/AbstractTask";
|
|
11
|
+
import { IEnoDataTaskInput } from "../interfaces/IEnoDataTaskInput";
|
|
12
|
+
import { EnoDataTaskInputSchema } from "../schema/EnoDataTaskInputSchema";
|
|
13
|
+
export declare class EnoStructureTask extends AbstractTask<IEnoDataTaskInput> {
|
|
14
|
+
private enoDatasourceFactory;
|
|
15
|
+
private enoStructureRepository;
|
|
16
|
+
private enoPropertyRepository;
|
|
17
|
+
private enoLocationRepository;
|
|
18
|
+
private enoAddressRepository;
|
|
19
|
+
private enoRemovedGIDRepository;
|
|
20
|
+
private logger;
|
|
21
|
+
protected dbConnector: IDatabaseConnector;
|
|
22
|
+
private simpleConfig;
|
|
23
|
+
protected schema: typeof EnoDataTaskInputSchema;
|
|
24
|
+
queueName: string;
|
|
25
|
+
queueTtl: number;
|
|
26
|
+
private removedBuldingsStartDate;
|
|
27
|
+
private static readonly BATCH_SIZE;
|
|
28
|
+
constructor(enoDatasourceFactory: EnoDatasourceFactory, enoStructureRepository: EnoStructureRepository, enoPropertyRepository: EnoPropertyRepository, enoLocationRepository: EnoLocationRepository, enoAddressRepository: EnoAddressRepository, enoRemovedGIDRepository: EnoRemovedGIDRepository, logger: ILogger, dbConnector: IDatabaseConnector, simpleConfig: ISimpleConfig);
|
|
29
|
+
execute(data: IEnoDataTaskInput): Promise<void>;
|
|
30
|
+
private saveData;
|
|
31
|
+
private getCurrentStructureList;
|
|
32
|
+
private getRemovedStructureList;
|
|
33
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
var EnoStructureTask_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.EnoStructureTask = void 0;
|
|
17
|
+
const constants_1 = require("../../constants");
|
|
18
|
+
const EnoDatasourceFactory_1 = require("../../datasources/eno/EnoDatasourceFactory");
|
|
19
|
+
const EnoOperationEnum_1 = require("../../datasources/eno/EnoOperationEnum");
|
|
20
|
+
const Chunker_1 = require("../../helpers/Chunker");
|
|
21
|
+
const EnapoWorkerContainerToken_1 = require("../../ioc/EnapoWorkerContainerToken");
|
|
22
|
+
const EnoAddressRepository_1 = require("../../repositories/eno/EnoAddressRepository");
|
|
23
|
+
const EnoLocationRepository_1 = require("../../repositories/eno/EnoLocationRepository");
|
|
24
|
+
const EnoPropertyRepository_1 = require("../../repositories/eno/EnoPropertyRepository");
|
|
25
|
+
const EnoRemovedGIDRepository_1 = require("../../repositories/eno/EnoRemovedGIDRepository");
|
|
26
|
+
const EnoStructureRepository_1 = require("../../repositories/eno/EnoStructureRepository");
|
|
27
|
+
const EnoStructureTransformation_1 = require("../../transformations/eno/EnoStructureTransformation");
|
|
28
|
+
const EnumGIDTypes_1 = require("../../../../schema-definitions/models/eno/helpers/EnumGIDTypes");
|
|
29
|
+
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
30
|
+
const QueueManager_1 = require("@golemio/core/dist/integration-engine/queueprocessors/QueueManager");
|
|
31
|
+
const AbstractTask_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTask");
|
|
32
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
33
|
+
const luxon_1 = require("@golemio/core/dist/shared/luxon");
|
|
34
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
35
|
+
const IEnoDataTaskInput_1 = require("../interfaces/IEnoDataTaskInput");
|
|
36
|
+
const EnoDataTaskInputSchema_1 = require("../schema/EnoDataTaskInputSchema");
|
|
37
|
+
let EnoStructureTask = exports.EnoStructureTask = EnoStructureTask_1 = class EnoStructureTask extends AbstractTask_1.AbstractTask {
|
|
38
|
+
constructor(enoDatasourceFactory, enoStructureRepository, enoPropertyRepository, enoLocationRepository, enoAddressRepository, enoRemovedGIDRepository, logger, dbConnector, simpleConfig) {
|
|
39
|
+
super(constants_1.ENAPO_WORKER_NAME);
|
|
40
|
+
this.enoDatasourceFactory = enoDatasourceFactory;
|
|
41
|
+
this.enoStructureRepository = enoStructureRepository;
|
|
42
|
+
this.enoPropertyRepository = enoPropertyRepository;
|
|
43
|
+
this.enoLocationRepository = enoLocationRepository;
|
|
44
|
+
this.enoAddressRepository = enoAddressRepository;
|
|
45
|
+
this.enoRemovedGIDRepository = enoRemovedGIDRepository;
|
|
46
|
+
this.logger = logger;
|
|
47
|
+
this.dbConnector = dbConnector;
|
|
48
|
+
this.simpleConfig = simpleConfig;
|
|
49
|
+
this.schema = EnoDataTaskInputSchema_1.EnoDataTaskInputSchema;
|
|
50
|
+
this.queueName = "processEnoStructures";
|
|
51
|
+
this.queueTtl = 60 * 60 * 1000;
|
|
52
|
+
this.removedBuldingsStartDate = this.simpleConfig.getValue("module.energetics.eno.removedBuldingsStartDate", "2025-01-01T00:00:00+01:00");
|
|
53
|
+
}
|
|
54
|
+
async execute(data) {
|
|
55
|
+
try {
|
|
56
|
+
const datasource = this.enoDatasourceFactory.getDatasource(EnoDatasourceFactory_1.ENO_ENDPOINT.STRUCTURE, data.source);
|
|
57
|
+
const listGID = data.type === IEnoDataTaskInput_1.EnumEnoDataType.CURRENT
|
|
58
|
+
? await this.getCurrentStructureList(datasource, data)
|
|
59
|
+
: await this.getRemovedStructureList(datasource, data);
|
|
60
|
+
if (!listGID || (Array.isArray(listGID.return) && listGID.return.length === 0)) {
|
|
61
|
+
this.logger.info(`No Structures found for source: ${data.source} type: ${data.type} ${data.daysBack ? data.daysBack + " days back incremenetal synchronization" : "full synchronization"}`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const batches = Chunker_1.Slicer.chunkArray(listGID.return, EnoStructureTask_1.BATCH_SIZE);
|
|
65
|
+
for (const batch of batches) {
|
|
66
|
+
const structureDetails = await datasource.getData(EnoOperationEnum_1.EnoOperationStructureEnum.DETAIL, "", {
|
|
67
|
+
idOrganizace: 1,
|
|
68
|
+
seznamGID: batch,
|
|
69
|
+
});
|
|
70
|
+
if (structureDetails) {
|
|
71
|
+
const transformation = new EnoStructureTransformation_1.EnoStructureTransformation(data.source);
|
|
72
|
+
const transformedData = transformation.transformArray(structureDetails.return);
|
|
73
|
+
await this.saveData(transformedData);
|
|
74
|
+
}
|
|
75
|
+
QueueManager_1.QueueManager.sendMessageToExchange(this.queuePrefix, "processEnoGeometry", {
|
|
76
|
+
source: data.source,
|
|
77
|
+
listGid: batch,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
83
|
+
throw err;
|
|
84
|
+
}
|
|
85
|
+
throw new golemio_errors_1.GeneralError("Failed to save ENO Structure data", this.constructor.name, err);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async saveData(transformedData) {
|
|
89
|
+
const structures = transformedData.map((el) => el.structure);
|
|
90
|
+
const property = transformedData.map((el) => el.property);
|
|
91
|
+
const address = transformedData.flatMap((el) => el.address);
|
|
92
|
+
const location = transformedData.flatMap((el) => el.location);
|
|
93
|
+
const transaction = await this.dbConnector.getConnection().transaction();
|
|
94
|
+
try {
|
|
95
|
+
await this.enoStructureRepository.bulkSave(structures, undefined, undefined, undefined, transaction);
|
|
96
|
+
await this.enoAddressRepository.bulkSave(address, undefined, undefined, undefined, transaction);
|
|
97
|
+
await this.enoPropertyRepository.bulkSave(property, undefined, undefined, undefined, transaction);
|
|
98
|
+
await this.enoLocationRepository.bulkSave(location, undefined, undefined, undefined, transaction);
|
|
99
|
+
await transaction.commit();
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
await transaction.rollback();
|
|
103
|
+
throw err;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async getCurrentStructureList(datasource, data) {
|
|
107
|
+
const listGID = await datasource.getData(EnoOperationEnum_1.EnoOperationStructureEnum.LIST_BY_ORG, "", {
|
|
108
|
+
idOrganizace: constants_1.ENO_DEFAULT_ORGANIZATION_ID,
|
|
109
|
+
...(data.daysBack ? { datum: luxon_1.DateTime.now().minus({ days: data.daysBack }).toISO() } : {}),
|
|
110
|
+
});
|
|
111
|
+
return listGID;
|
|
112
|
+
}
|
|
113
|
+
async getRemovedStructureList(datasource, data) {
|
|
114
|
+
const listRemovedStructureGID = await datasource.getData(EnoOperationEnum_1.EnoOperationStructureEnum.REMOVED_LIST, "", {
|
|
115
|
+
idOrganizace: constants_1.ENO_DEFAULT_ORGANIZATION_ID,
|
|
116
|
+
datum: data.daysBack ? luxon_1.DateTime.now().minus({ days: data.daysBack }).toISO() : this.removedBuldingsStartDate,
|
|
117
|
+
});
|
|
118
|
+
if (listRemovedStructureGID) {
|
|
119
|
+
const removedGids = listRemovedStructureGID.return.map((gid) => {
|
|
120
|
+
return {
|
|
121
|
+
gid: gid,
|
|
122
|
+
gid_typ: EnumGIDTypes_1.EnumGidTypes.STRUCTURE,
|
|
123
|
+
zdroj: data.source,
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
await this.enoRemovedGIDRepository.bulkSave(removedGids);
|
|
127
|
+
}
|
|
128
|
+
return listRemovedStructureGID;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
EnoStructureTask.BATCH_SIZE = 1000;
|
|
132
|
+
exports.EnoStructureTask = EnoStructureTask = EnoStructureTask_1 = __decorate([
|
|
133
|
+
(0, tsyringe_1.injectable)(),
|
|
134
|
+
__param(0, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoDatasourceFactory)),
|
|
135
|
+
__param(1, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoStructureRepository)),
|
|
136
|
+
__param(2, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoPropertyRepository)),
|
|
137
|
+
__param(3, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoLocationRepository)),
|
|
138
|
+
__param(4, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoAddressRepository)),
|
|
139
|
+
__param(5, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoRemovedGIDRepository)),
|
|
140
|
+
__param(6, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
141
|
+
__param(7, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
|
|
142
|
+
__param(8, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
|
|
143
|
+
__metadata("design:paramtypes", [EnoDatasourceFactory_1.EnoDatasourceFactory,
|
|
144
|
+
EnoStructureRepository_1.EnoStructureRepository,
|
|
145
|
+
EnoPropertyRepository_1.EnoPropertyRepository,
|
|
146
|
+
EnoLocationRepository_1.EnoLocationRepository,
|
|
147
|
+
EnoAddressRepository_1.EnoAddressRepository,
|
|
148
|
+
EnoRemovedGIDRepository_1.EnoRemovedGIDRepository, Object, Object, Object])
|
|
149
|
+
], EnoStructureTask);
|
|
150
|
+
//# sourceMappingURL=EnoStructureTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoStructureTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/task/EnoStructureTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAqF;AAErF,qFAAoG;AACpG,6EAAuF;AACvF,mDAAmD;AAEnD,mFAAoF;AACpF,sFAAuF;AACvF,wFAAyF;AACzF,wFAAyF;AACzF,4FAA6F;AAC7F,0FAA2F;AAC3F,qGAAsG;AAEtG,iGAAoE;AAKpE,wEAAqE;AACrE,qGAAkG;AAClG,6FAA0F;AAC1F,6EAA8F;AAC9F,2DAA2D;AAC3D,iEAAwE;AACxE,uEAAqF;AAErF,6EAA0E;AAGnE,IAAM,gBAAgB,mD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,GAAG,IAAI,AAAP,CAAQ;2BALjC,gBAAgB;IAD5B,IAAA,qBAAU,GAAE;IASJ,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,sBAAsB,CAAC,CAAA;IACxD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,uBAAuB,CAAC,CAAA;IACzD,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,iBAAiB,CAAC,CAAA;IACnC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;qCARuD,2CAAoB;QAChB,+CAAsB;QACxB,6CAAqB;QACrB,6CAAqB;QACvB,2CAAoB;QACd,iDAAuB;GAb9G,gBAAgB,CAiH5B"}
|
|
@@ -11,14 +11,15 @@ exports.staticMeterSettingsJsonSchema = {
|
|
|
11
11
|
items: {
|
|
12
12
|
type: "object",
|
|
13
13
|
properties: {
|
|
14
|
-
MeterSerialNumber: { type: "string" },
|
|
15
14
|
Name: { type: "string" },
|
|
16
15
|
Addr: { type: "string" },
|
|
17
|
-
Meter: { type: "string" },
|
|
16
|
+
Meter: { type: "string", nullable: true },
|
|
18
17
|
Type: { type: "string" },
|
|
19
18
|
Var: { type: "string" },
|
|
19
|
+
MeId: { type: "number", nullable: true },
|
|
20
|
+
EIC: { type: "string", nullable: true },
|
|
20
21
|
},
|
|
21
|
-
required: ["Name", "Addr", "
|
|
22
|
+
required: ["Name", "Addr", "Type", "Var"],
|
|
22
23
|
},
|
|
23
24
|
},
|
|
24
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticMeterSettingsJsonSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/StaticMeterSettingsJsonSchema.ts"],"names":[],"mappings":";;;AAGa,QAAA,6BAA6B,GAAyC;IAC/E,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,kBAAkB,EAAE;gBAChB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,
|
|
1
|
+
{"version":3,"file":"StaticMeterSettingsJsonSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/StaticMeterSettingsJsonSchema.ts"],"names":[],"mappings":";;;AAGa,QAAA,6BAA6B,GAAyC;IAC/E,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,kBAAkB,EAAE;gBAChB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;wBACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACvB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;wBACxC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;qBAC1C;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;iBAC5C;aACJ;SACJ;QACD,QAAQ,EAAE,CAAC,oBAAoB,CAAC;KACnC;IACD,QAAQ,EAAE,EAAE;CACf,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enoGeometryInputJsonSchema = void 0;
|
|
4
|
+
exports.enoGeometryInputJsonSchema = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
return: {
|
|
8
|
+
type: "array",
|
|
9
|
+
items: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
gid: { type: "string" },
|
|
13
|
+
idOrganizace: { type: "integer" },
|
|
14
|
+
uzivatelskyZakres: { type: "boolean" },
|
|
15
|
+
zakres: { type: "string" },
|
|
16
|
+
epsgCode: { type: "string", nullable: true },
|
|
17
|
+
},
|
|
18
|
+
required: ["gid"],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
required: ["return"],
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=EnoGeometryJsonSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoGeometryJsonSchema.js","sourceRoot":"","sources":["../../../../src/schema-definitions/datasources/eno/EnoGeometryJsonSchema.ts"],"names":[],"mappings":";;;AAGa,QAAA,0BAA0B,GAAiD;IACpF,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACvB,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBACjC,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBACtC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;iBAC/C;gBACD,QAAQ,EAAE,CAAC,KAAK,CAAC;aACpB;SACJ;KACJ;IACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enoStructureInfoInputJsonSchema = void 0;
|
|
4
|
+
exports.enoStructureInfoInputJsonSchema = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
return: {
|
|
8
|
+
type: "array",
|
|
9
|
+
items: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
adresy: {
|
|
13
|
+
type: "array",
|
|
14
|
+
items: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
hlavniAdresa: { type: "boolean" },
|
|
18
|
+
idAdresa: { type: "integer" },
|
|
19
|
+
popisAdresa: { type: "string" },
|
|
20
|
+
},
|
|
21
|
+
required: [],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
stavba: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
delka: { type: "number" },
|
|
28
|
+
denVystavbaStavba: { type: "integer" },
|
|
29
|
+
gid: { type: "string" },
|
|
30
|
+
idCZCC: { type: "integer" },
|
|
31
|
+
idObjekt: { type: "integer" },
|
|
32
|
+
kodDruhStavba: { type: "string" },
|
|
33
|
+
kodOchranaStavba: { type: "string" },
|
|
34
|
+
material: { type: "string" },
|
|
35
|
+
mesicVystavbaStavba: { type: "integer" },
|
|
36
|
+
nazev: { type: "string" },
|
|
37
|
+
nazevDruhStavba: { type: "string" },
|
|
38
|
+
nazevOchranaStavba: { type: "string" },
|
|
39
|
+
platnostDo: {
|
|
40
|
+
type: "object",
|
|
41
|
+
required: ["toISOString"],
|
|
42
|
+
},
|
|
43
|
+
platnostOd: {
|
|
44
|
+
type: "object",
|
|
45
|
+
required: ["toISOString"],
|
|
46
|
+
},
|
|
47
|
+
profil: { type: "string" },
|
|
48
|
+
rokVystavbaStavba: { type: "integer" },
|
|
49
|
+
sirka: { type: "number" },
|
|
50
|
+
vyska: { type: "number" },
|
|
51
|
+
},
|
|
52
|
+
required: ["gid"],
|
|
53
|
+
},
|
|
54
|
+
majetek: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
datumNabyti: {
|
|
58
|
+
type: "object",
|
|
59
|
+
required: ["toISOString"],
|
|
60
|
+
},
|
|
61
|
+
datumPozbyti: {
|
|
62
|
+
type: "object",
|
|
63
|
+
required: ["toISOString"],
|
|
64
|
+
},
|
|
65
|
+
idMajEvidencniJednotka: { type: "integer" },
|
|
66
|
+
idMajSpravceMandatni: { type: "integer" },
|
|
67
|
+
idMajSpravceUcetJednotka: { type: "integer" },
|
|
68
|
+
idVlastnik: { type: "integer" },
|
|
69
|
+
penb: { type: "boolean" },
|
|
70
|
+
penbPlatnostOd: {
|
|
71
|
+
type: "object",
|
|
72
|
+
required: ["toISOString"],
|
|
73
|
+
},
|
|
74
|
+
penbPoznamka: { type: "string" },
|
|
75
|
+
podilMajetekCitatel: { type: "integer" },
|
|
76
|
+
podilMajetekJmenovatel: { type: "integer" },
|
|
77
|
+
VMajetku: { type: "boolean" },
|
|
78
|
+
VMajetkuStatu: { type: "boolean" },
|
|
79
|
+
VProcesuSvereni: { type: "boolean" },
|
|
80
|
+
},
|
|
81
|
+
required: [],
|
|
82
|
+
},
|
|
83
|
+
umisteni: {
|
|
84
|
+
type: "array",
|
|
85
|
+
items: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {
|
|
88
|
+
hlavniParcelaUmisteni: { type: "boolean" },
|
|
89
|
+
idPracelaOrig: { type: "integer" },
|
|
90
|
+
popisUmisteni: { type: "string" },
|
|
91
|
+
},
|
|
92
|
+
required: [],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
required: ["stavba", "majetek"],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: ["return"],
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=EnoStructureInfoJsonSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoStructureInfoJsonSchema.js","sourceRoot":"","sources":["../../../../src/schema-definitions/datasources/eno/EnoStructureInfoJsonSchema.ts"],"names":[],"mappings":";;;AAGa,QAAA,+BAA+B,GAAsD;IAC9F,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,MAAM,EAAE;wBACJ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACR,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gCACjC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gCAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;6BAClC;4BACD,QAAQ,EAAE,EAAE;yBACf;qBACJ;oBACD,MAAM,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACR,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACzB,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BACtC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACvB,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BAC7B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BACjC,gBAAgB,EAAE,EAAE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AE;gCACZ,IAAI,EAAE,QAAQ;gCACd,QAAQ,EAAE,CAAC,aAAa,CAAC;6BAC5B;4BACD,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;4BAChC,mBAAmB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BACxC,sBAAsB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BAC7B,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;4BAClC,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;yBACvC;wBACD,QAAQ,EAAE,EAAE;qBACf;oBACD,QAAQ,EAAE;wBACN,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACH,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACR,qBAAqB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gCAC1C,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gCAClC,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;6BACpC;4BACD,QAAQ,EAAE,EAAE;yBACf;qBACJ;iBACJ;gBACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;aAClC;SACJ;KACJ;IACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IGeometryInput.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/datasources/eno/interfaces/IGeometryInput.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAddressInput } from "./IAddressInput";
|
|
2
|
+
import { IStructureInput } from "./IStructureInput";
|
|
3
|
+
import { ILocationInput } from "./ILocationInput";
|
|
4
|
+
import { IPropertyInput } from "./IPropertyInput";
|
|
5
|
+
export interface IStructureInfoInput {
|
|
6
|
+
adresy: IAddressInput[];
|
|
7
|
+
stavba: IStructureInput;
|
|
8
|
+
majetek: IPropertyInput;
|
|
9
|
+
umisteni: ILocationInput[];
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IStructureInfoInput.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/datasources/eno/interfaces/IStructureInfoInput.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IStructureInput {
|
|
2
|
+
delka: number;
|
|
3
|
+
denVystavbaStavba: number;
|
|
4
|
+
gid: string;
|
|
5
|
+
idCZCC: number;
|
|
6
|
+
idObjekt: number;
|
|
7
|
+
kodDruhStavba: string;
|
|
8
|
+
kodOchranaStavba: string;
|
|
9
|
+
material: string;
|
|
10
|
+
mesicVystavbaStavba: number;
|
|
11
|
+
nazev: string;
|
|
12
|
+
nazevDruhStavba: string;
|
|
13
|
+
nazevOchranaStavba: string;
|
|
14
|
+
platnostDo: Date;
|
|
15
|
+
platnostOd: Date;
|
|
16
|
+
profil: string;
|
|
17
|
+
rokVystavbaStavba: number;
|
|
18
|
+
sirka: number;
|
|
19
|
+
vyska: number;
|
|
20
|
+
}
|