@golemio/energetics 1.3.5-dev.1300843460 → 1.3.5
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/example/00_clear_test_data.sql +0 -6
- package/db/migrations/postgresql/.config.json +1 -1
- package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.d.ts +4 -0
- package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js +19 -0
- package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js.map +1 -0
- package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.d.ts +4 -0
- package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js +19 -0
- package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js.map +1 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.d.ts +9 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js +44 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js.map +1 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js +2 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js.map +1 -1
- package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.d.ts +9 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js +44 -0
- package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js.map +1 -0
- package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.d.ts +7 -0
- package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js +166 -0
- package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js.map +1 -0
- package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.d.ts +7 -0
- package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js +41 -0
- package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js.map +1 -0
- package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js +4 -0
- package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js.map +1 -1
- package/docs/implementation_documentation.md +41 -41
- package/package.json +2 -4
- package/db/example/01_buildings.sql +0 -206
- package/db/example/02_organizations.sql +0 -24
- package/db/example/03_devices.sql +0 -24
- package/db/migrations/postgresql/20240514074033-buildings.js +0 -53
- package/db/migrations/postgresql/20240514111900-organizations.js +0 -53
- package/db/migrations/postgresql/sqls/20240514074033-buildings-down.sql +0 -2
- package/db/migrations/postgresql/sqls/20240514074033-buildings-up.sql +0 -138
- package/db/migrations/postgresql/sqls/20240514111900-organizations-down.sql +0 -3
- package/db/migrations/postgresql/sqls/20240514111900-organizations-up.sql +0 -37
- package/dist/output-gateway/constants/Links.d.ts +0 -3
- package/dist/output-gateway/constants/Links.js +0 -7
- package/dist/output-gateway/constants/Links.js.map +0 -1
- package/dist/output-gateway/constants/RouteVersion.d.ts +0 -3
- package/dist/output-gateway/constants/RouteVersion.js +0 -8
- package/dist/output-gateway/constants/RouteVersion.js.map +0 -1
- package/dist/output-gateway/controllers/v2/BuildingsController.d.ts +0 -11
- package/dist/output-gateway/controllers/v2/BuildingsController.js +0 -74
- package/dist/output-gateway/controllers/v2/BuildingsController.js.map +0 -1
- package/dist/output-gateway/controllers/v2/V2DevicesController.d.ts +0 -11
- package/dist/output-gateway/controllers/v2/V2DevicesController.js +0 -67
- package/dist/output-gateway/controllers/v2/V2DevicesController.js.map +0 -1
- package/dist/output-gateway/controllers/v2/V2OrganizationsController.d.ts +0 -13
- package/dist/output-gateway/controllers/v2/V2OrganizationsController.js +0 -79
- package/dist/output-gateway/controllers/v2/V2OrganizationsController.js.map +0 -1
- package/dist/output-gateway/helpers/CreateLinkHelper.d.ts +0 -6
- package/dist/output-gateway/helpers/CreateLinkHelper.js +0 -32
- package/dist/output-gateway/helpers/CreateLinkHelper.js.map +0 -1
- package/dist/output-gateway/index.d.ts +0 -1
- package/dist/output-gateway/index.js +0 -10
- package/dist/output-gateway/index.js.map +0 -1
- package/dist/output-gateway/ioc/Di.d.ts +0 -3
- package/dist/output-gateway/ioc/Di.js +0 -51
- package/dist/output-gateway/ioc/Di.js.map +0 -1
- package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +0 -22
- package/dist/output-gateway/ioc/ModuleContainerToken.js +0 -26
- package/dist/output-gateway/ioc/ModuleContainerToken.js.map +0 -1
- package/dist/output-gateway/models/BuildingsPrimaryModel.d.ts +0 -17
- package/dist/output-gateway/models/BuildingsPrimaryModel.js +0 -49
- package/dist/output-gateway/models/BuildingsPrimaryModel.js.map +0 -1
- package/dist/output-gateway/models/BuildingsSecondaryModel.d.ts +0 -124
- package/dist/output-gateway/models/BuildingsSecondaryModel.js +0 -338
- package/dist/output-gateway/models/BuildingsSecondaryModel.js.map +0 -1
- package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.d.ts +0 -6
- package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.js +0 -2
- package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.js.map +0 -1
- package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.d.ts +0 -156
- package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.js +0 -3
- package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.js.map +0 -1
- package/dist/output-gateway/models/interfaces/IPrimaryBuildings.d.ts +0 -10
- package/dist/output-gateway/models/interfaces/IPrimaryBuildings.js +0 -3
- package/dist/output-gateway/models/interfaces/IPrimaryBuildings.js.map +0 -1
- package/dist/output-gateway/models/interfaces/ISecondaryBuildings.d.ts +0 -114
- package/dist/output-gateway/models/interfaces/ISecondaryBuildings.js +0 -3
- package/dist/output-gateway/models/interfaces/ISecondaryBuildings.js.map +0 -1
- package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.d.ts +0 -117
- package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.js +0 -3
- package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.js.map +0 -1
- package/dist/output-gateway/repositories/DevicesRepository.d.ts +0 -8
- package/dist/output-gateway/repositories/DevicesRepository.js +0 -64
- package/dist/output-gateway/repositories/DevicesRepository.js.map +0 -1
- package/dist/output-gateway/repositories/OrganizationBuildingsRepository.d.ts +0 -6
- package/dist/output-gateway/repositories/OrganizationBuildingsRepository.js +0 -47
- package/dist/output-gateway/repositories/OrganizationBuildingsRepository.js.map +0 -1
- package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.d.ts +0 -6
- package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.js +0 -47
- package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.js.map +0 -1
- package/dist/output-gateway/repositories/OrganizationsRepository.d.ts +0 -17
- package/dist/output-gateway/repositories/OrganizationsRepository.js +0 -133
- package/dist/output-gateway/repositories/OrganizationsRepository.js.map +0 -1
- package/dist/output-gateway/repositories/PrimaryBuildingsRepository.d.ts +0 -15
- package/dist/output-gateway/repositories/PrimaryBuildingsRepository.js +0 -86
- package/dist/output-gateway/repositories/PrimaryBuildingsRepository.js.map +0 -1
- package/dist/output-gateway/repositories/SecondaryBuildingsRepository.d.ts +0 -6
- package/dist/output-gateway/repositories/SecondaryBuildingsRepository.js +0 -33
- package/dist/output-gateway/repositories/SecondaryBuildingsRepository.js.map +0 -1
- package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.d.ts +0 -9
- package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.js +0 -47
- package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.js.map +0 -1
- package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.d.ts +0 -5
- package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.js +0 -3
- package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.js.map +0 -1
- package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.d.ts +0 -18
- package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.js +0 -3
- package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.js.map +0 -1
- package/dist/output-gateway/repositories/interfaces/IOrganizationDto.d.ts +0 -4
- package/dist/output-gateway/repositories/interfaces/IOrganizationDto.js +0 -3
- package/dist/output-gateway/repositories/interfaces/IOrganizationDto.js.map +0 -1
- package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.d.ts +0 -8
- package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.js +0 -3
- package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.js.map +0 -1
- package/dist/output-gateway/routers/helpers/parseParams.d.ts +0 -4
- package/dist/output-gateway/routers/helpers/parseParams.js +0 -17
- package/dist/output-gateway/routers/helpers/parseParams.js.map +0 -1
- package/dist/output-gateway/routers/interfaces/IDeviceResponse.d.ts +0 -6
- package/dist/output-gateway/routers/interfaces/IDeviceResponse.js +0 -3
- package/dist/output-gateway/routers/interfaces/IDeviceResponse.js.map +0 -1
- package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.d.ts +0 -34
- package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.js +0 -3
- package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.js.map +0 -1
- package/dist/output-gateway/routers/interfaces/IOrganizationResponse.d.ts +0 -4
- package/dist/output-gateway/routers/interfaces/IOrganizationResponse.js +0 -3
- package/dist/output-gateway/routers/interfaces/IOrganizationResponse.js.map +0 -1
- package/dist/output-gateway/routers/interfaces/IPaginationParams.d.ts +0 -4
- package/dist/output-gateway/routers/interfaces/IPaginationParams.js +0 -3
- package/dist/output-gateway/routers/interfaces/IPaginationParams.js.map +0 -1
- package/dist/output-gateway/routers/v2/BuildingsRouter.d.ts +0 -10
- package/dist/output-gateway/routers/v2/BuildingsRouter.js +0 -26
- package/dist/output-gateway/routers/v2/BuildingsRouter.js.map +0 -1
- package/dist/output-gateway/routers/v2/V2DevicesRouter.d.ts +0 -7
- package/dist/output-gateway/routers/v2/V2DevicesRouter.js +0 -41
- package/dist/output-gateway/routers/v2/V2DevicesRouter.js.map +0 -1
- package/dist/output-gateway/routers/v2/V2OrganizationsRouter.d.ts +0 -7
- package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js +0 -41
- package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js.map +0 -1
- package/dist/output-gateway/transformations/BuildingTransformationFull.d.ts +0 -14
- package/dist/output-gateway/transformations/BuildingTransformationFull.js +0 -215
- package/dist/output-gateway/transformations/BuildingTransformationFull.js.map +0 -1
- package/dist/output-gateway/transformations/BuildingsTransformation.d.ts +0 -8
- package/dist/output-gateway/transformations/BuildingsTransformation.js +0 -38
- package/dist/output-gateway/transformations/BuildingsTransformation.js.map +0 -1
- package/dist/output-gateway/transformations/DeviceDtoTransformation.d.ts +0 -8
- package/dist/output-gateway/transformations/DeviceDtoTransformation.js +0 -43
- package/dist/output-gateway/transformations/DeviceDtoTransformation.js.map +0 -1
- package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.d.ts +0 -9
- package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.js +0 -64
- package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.js.map +0 -1
- package/dist/output-gateway/transformations/OrganizationDtoTransformation.d.ts +0 -9
- package/dist/output-gateway/transformations/OrganizationDtoTransformation.js +0 -36
- package/dist/output-gateway/transformations/OrganizationDtoTransformation.js.map +0 -1
- package/dist/schema-definitions/models/OrganizationBuildingModel.d.ts +0 -10
- package/dist/schema-definitions/models/OrganizationBuildingModel.js +0 -33
- package/dist/schema-definitions/models/OrganizationBuildingModel.js.map +0 -1
- package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.d.ts +0 -16
- package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.js +0 -44
- package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.js.map +0 -1
- package/dist/schema-definitions/models/OrganizationsModel.d.ts +0 -21
- package/dist/schema-definitions/models/OrganizationsModel.js +0 -59
- package/dist/schema-definitions/models/OrganizationsModel.js.map +0 -1
- package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.d.ts +0 -4
- package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.js +0 -3
- package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.js.map +0 -1
- package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.d.ts +0 -10
- package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.js +0 -3
- package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.js.map +0 -1
- package/dist/schema-definitions/models/interfaces/IOrganizationsModel.d.ts +0 -15
- package/dist/schema-definitions/models/interfaces/IOrganizationsModel.js +0 -3
- package/dist/schema-definitions/models/interfaces/IOrganizationsModel.js.map +0 -1
- package/docs/openapi-output.yaml +0 -834
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
truncate commodity_static_meter_settings;
|
|
2
2
|
truncate consumption_energy_measurements;
|
|
3
|
-
truncate consumption_energy_buildings_primary;
|
|
4
|
-
truncate consumption_energy_buildings_secondary;
|
|
5
|
-
truncate consumption_energy_devices;
|
|
6
|
-
truncate organization_responsible_users;
|
|
7
|
-
truncate organizations_buildings;
|
|
8
|
-
truncate organizations;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuildingsRepository = void 0;
|
|
4
|
+
const _sch_1 = require("../../../schema-definitions");
|
|
5
|
+
const models_1 = require("../../../schema-definitions/models");
|
|
6
|
+
const models_2 = require("@golemio/core/dist/integration-engine/models");
|
|
7
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
8
|
+
class BuildingsRepository extends models_2.PostgresModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super("BuildingsRepository", {
|
|
11
|
+
pgTableName: models_1.BuildingsModel.TABLE_NAME,
|
|
12
|
+
pgSchema: _sch_1.EnergeticsSchema.pgSchema,
|
|
13
|
+
outputSequelizeAttributes: models_1.BuildingsModel.attributeModel,
|
|
14
|
+
savingType: "insertOrUpdate",
|
|
15
|
+
}, new golemio_validator_1.JSONSchemaValidator("BuildingsRepositoryValidator", models_1.BuildingsModel.arrayJsonSchema));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.BuildingsRepository = BuildingsRepository;
|
|
19
|
+
//# sourceMappingURL=BuildingsRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildingsRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/repositories/oict-energetika/BuildingsRepository.ts"],"names":[],"mappings":";;;AAAA,sDAAwC;AACxC,+DAA6C;AAC7C,yEAAqF;AACrF,mFAAkF;AAElF,MAAa,mBAAoB,SAAQ,sBAAa;IAClD;QACI,KAAK,CACD,qBAAqB,EACrB;YACI,WAAW,EAAE,uBAAc,CAAC,UAAU;YACtC,QAAQ,EAAE,uBAAgB,CAAC,QAAQ;YACnC,yBAAyB,EAAE,uBAAc,CAAC,cAAc;YACxD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,8BAA8B,EAAE,uBAAc,CAAC,eAAe,CAAC,CAC1F,CAAC;IACN,CAAC;CACJ;AAbD,kDAaC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DevicesRepository = void 0;
|
|
4
|
+
const _sch_1 = require("../../../schema-definitions");
|
|
5
|
+
const models_1 = require("../../../schema-definitions/models");
|
|
6
|
+
const models_2 = require("@golemio/core/dist/integration-engine/models");
|
|
7
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
8
|
+
class DevicesRepository extends models_2.PostgresModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super("DevicesRepository", {
|
|
11
|
+
pgTableName: models_1.DevicesModel.TABLE_NAME,
|
|
12
|
+
pgSchema: _sch_1.EnergeticsSchema.pgSchema,
|
|
13
|
+
outputSequelizeAttributes: models_1.DevicesModel.attributeModel,
|
|
14
|
+
savingType: "insertOrUpdate",
|
|
15
|
+
}, new golemio_validator_1.JSONSchemaValidator("DevicesRepositoryValidator", models_1.DevicesModel.arrayJsonSchema));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.DevicesRepository = DevicesRepository;
|
|
19
|
+
//# sourceMappingURL=DevicesRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevicesRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/repositories/oict-energetika/DevicesRepository.ts"],"names":[],"mappings":";;;AAAA,sDAAwC;AACxC,+DAA2C;AAC3C,yEAAqF;AACrF,mFAAkF;AAElF,MAAa,iBAAkB,SAAQ,sBAAa;IAChD;QACI,KAAK,CACD,mBAAmB,EACnB;YACI,WAAW,EAAE,qBAAY,CAAC,UAAU;YACpC,QAAQ,EAAE,uBAAgB,CAAC,QAAQ;YACnC,yBAAyB,EAAE,qBAAY,CAAC,cAAc;YACtD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,4BAA4B,EAAE,qBAAY,CAAC,eAAe,CAAC,CACtF,CAAC;IACN,CAAC;CACJ;AAbD,8CAaC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/workers";
|
|
2
|
+
export declare class FetchBuildingsTask extends AbstractEmptyTask {
|
|
3
|
+
readonly queueName = "fetchBuildings";
|
|
4
|
+
readonly queueTtl: number;
|
|
5
|
+
private readonly buildingsRepository;
|
|
6
|
+
private readonly buildingsTransformation;
|
|
7
|
+
constructor(queuePrefix: string);
|
|
8
|
+
protected execute(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FetchBuildingsTask = void 0;
|
|
13
|
+
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
14
|
+
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
15
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
16
|
+
const BuildingsRepository_1 = require("../../repositories/oict-energetika/BuildingsRepository");
|
|
17
|
+
const helpers_2 = require("../../datasources/oict-energetika/helpers");
|
|
18
|
+
const BuildingsTransformation_1 = require("../../transformations/oict-energetika/BuildingsTransformation");
|
|
19
|
+
const OictDataSourceFactory_1 = require("../../datasources/oict-energetika/OictDataSourceFactory");
|
|
20
|
+
class FetchBuildingsTask extends workers_1.AbstractEmptyTask {
|
|
21
|
+
constructor(queuePrefix) {
|
|
22
|
+
super(queuePrefix);
|
|
23
|
+
this.queueName = "fetchBuildings";
|
|
24
|
+
this.queueTtl = 29 * 60 * 1000; // 29 minutes
|
|
25
|
+
this.buildingsRepository = new BuildingsRepository_1.BuildingsRepository();
|
|
26
|
+
this.buildingsTransformation = new BuildingsTransformation_1.BuildingsTransformation();
|
|
27
|
+
}
|
|
28
|
+
execute() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const datasource = OictDataSourceFactory_1.OictDataSourceFactory.getDataSource(helpers_2.OictResourceType.Buildings);
|
|
31
|
+
try {
|
|
32
|
+
const data = yield datasource.getAll();
|
|
33
|
+
const transformedData = yield this.buildingsTransformation.transform(data);
|
|
34
|
+
yield this.buildingsRepository.save(transformedData);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
helpers_1.log.error(err);
|
|
38
|
+
throw new golemio_errors_1.GeneralError("Failed to fetch buldings", this.constructor.name, err);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.FetchBuildingsTask = FetchBuildingsTask;
|
|
44
|
+
//# sourceMappingURL=FetchBuildingsTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FetchBuildingsTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/tasks/oict-energetika/FetchBuildingsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAAoE;AACpE,2EAAkF;AAClF,6EAAwE;AACxE,gGAA6F;AAC7F,uEAA6E;AAC7E,2GAAwG;AACxG,mGAA8F;AAE9F,MAAa,kBAAmB,SAAQ,2BAAiB;IAOrD,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAPP,cAAS,GAAG,gBAAgB,CAAC;QAC7B,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAOpD,IAAI,CAAC,mBAAmB,GAAG,IAAI,yCAAmB,EAAE,CAAC;QACrD,IAAI,CAAC,uBAAuB,GAAG,IAAI,iDAAuB,EAAE,CAAC;IACjE,CAAC;IAEe,OAAO;;YACnB,MAAM,UAAU,GAAG,6CAAqB,CAAC,aAAa,CAAC,0BAAgB,CAAC,SAAS,CAAC,CAAC;YAEnF,IAAI;gBACA,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;gBACvC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC3E,MAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACxD;YAAC,OAAO,GAAG,EAAE;gBACV,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACf,MAAM,IAAI,6BAAY,CAAC,0BAA0B,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aAClF;QACL,CAAC;KAAA;CACJ;AAzBD,gDAyBC"}
|
|
@@ -23,6 +23,8 @@ class FetchDataTask extends workers_1.AbstractTask {
|
|
|
23
23
|
}
|
|
24
24
|
execute({ targetDays }) {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "fetchBuildings", {});
|
|
27
|
+
yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "fetchDevices", {});
|
|
26
28
|
for (const dateParams of this.generateDateParams(targetDays)) {
|
|
27
29
|
yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "fetchConsumption", dateParams);
|
|
28
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchDataTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/tasks/oict-energetika/FetchDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kFAAuF;AACvF,2FAAqF;AACrF,2EAA6E;AAC7E,2DAAqE;AAErE,MAAa,aAAc,SAAQ,sBAA6B;IAK5D,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QALP,cAAS,GAAG,WAAW,CAAC;QACxB,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QACxC,WAAM,GAAG,2CAAyB,CAAC;IAInD,CAAC;IAEe,OAAO,CAAC,EAAE,UAAU,EAAmB;;YACnD,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE;gBAC1D,MAAM,8BAAY,CAAC,qBAAqB,CAAC,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8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;YACjF,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;YAE/E,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE;gBAC1D,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;IAEO,CAAC,kBAAkB,CAAC,UAAkB;QAC1C,MAAM,WAAW,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,gBAAQ,CAAC,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAE5F,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAC9B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAExC,MAAM;gBACF,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE;gBAC3B,MAAM,EAAE,GAAG,CAAC,SAAS,EAAE;aAC1B,CAAC;SACL;IACL,CAAC;CACJ;AAjCD,sCAiCC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/workers";
|
|
2
|
+
export declare class FetchDevicesTask extends AbstractEmptyTask {
|
|
3
|
+
readonly queueName = "fetchDevices";
|
|
4
|
+
readonly queueTtl: number;
|
|
5
|
+
private readonly devicesRepository;
|
|
6
|
+
private readonly devicesTransformation;
|
|
7
|
+
constructor(queuePrefix: string);
|
|
8
|
+
protected execute(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FetchDevicesTask = void 0;
|
|
13
|
+
const helpers_1 = require("../../datasources/oict-energetika/helpers");
|
|
14
|
+
const OictDataSourceFactory_1 = require("../../datasources/oict-energetika/OictDataSourceFactory");
|
|
15
|
+
const DevicesRepository_1 = require("../../repositories/oict-energetika/DevicesRepository");
|
|
16
|
+
const DevicesTransformation_1 = require("../../transformations/oict-energetika/DevicesTransformation");
|
|
17
|
+
const helpers_2 = require("@golemio/core/dist/integration-engine/helpers");
|
|
18
|
+
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
19
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
20
|
+
class FetchDevicesTask extends workers_1.AbstractEmptyTask {
|
|
21
|
+
constructor(queuePrefix) {
|
|
22
|
+
super(queuePrefix);
|
|
23
|
+
this.queueName = "fetchDevices";
|
|
24
|
+
this.queueTtl = 29 * 60 * 1000; // 29 minutes
|
|
25
|
+
this.devicesRepository = new DevicesRepository_1.DevicesRepository();
|
|
26
|
+
this.devicesTransformation = new DevicesTransformation_1.DevicesTransformation();
|
|
27
|
+
}
|
|
28
|
+
execute() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const datasource = OictDataSourceFactory_1.OictDataSourceFactory.getDataSource(helpers_1.OictResourceType.Devices);
|
|
31
|
+
try {
|
|
32
|
+
const data = yield datasource.getAll();
|
|
33
|
+
const transformedData = yield this.devicesTransformation.transform(data);
|
|
34
|
+
yield this.devicesRepository.save(transformedData);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
helpers_2.log.error(err);
|
|
38
|
+
throw new golemio_errors_1.GeneralError("Failed to fetch devices", this.constructor.name, err);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.FetchDevicesTask = FetchDevicesTask;
|
|
44
|
+
//# sourceMappingURL=FetchDevicesTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FetchDevicesTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/tasks/oict-energetika/FetchDevicesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAA2E;AAC3E,mGAA8F;AAC9F,4FAAuF;AACvF,uGAAkG;AAClG,2EAAoE;AACpE,2EAAkF;AAClF,6EAAwE;AAExE,MAAa,gBAAiB,SAAQ,2BAAiB;IAOnD,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAPP,cAAS,GAAG,cAAc,CAAC;QAC3B,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAOpD,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAC;QACjD,IAAI,CAAC,qBAAqB,GAAG,IAAI,6CAAqB,EAAE,CAAC;IAC7D,CAAC;IAEe,OAAO;;YACnB,MAAM,UAAU,GAAG,6CAAqB,CAAC,aAAa,CAAC,0BAAgB,CAAC,OAAO,CAAC,CAAC;YAEjF,IAAI;gBACA,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;gBACvC,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBACzE,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACtD;YAAC,OAAO,GAAG,EAAE;gBACV,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACf,MAAM,IAAI,6BAAY,CAAC,yBAAyB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACjF;QACL,CAAC;KAAA;CACJ;AAzBD,4CAyBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IOictBuildingsInput } from "../../../schema-definitions/datasources/interfaces";
|
|
2
|
+
import { IBuildingsModel } from "../../../schema-definitions/models/interfaces";
|
|
3
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
4
|
+
export declare class BuildingsTransformation extends BaseTransformation implements ITransformation {
|
|
5
|
+
name: string;
|
|
6
|
+
protected transformElement: (element: IOictBuildingsInput) => Promise<IBuildingsModel>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BuildingsTransformation = void 0;
|
|
13
|
+
const ParserHelpers_1 = require("../../helpers/ParserHelpers");
|
|
14
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
15
|
+
class BuildingsTransformation extends transformations_1.BaseTransformation {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.name = "BuildingsTransformation";
|
|
19
|
+
this.transformElement = (element) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
return {
|
|
21
|
+
// PK
|
|
22
|
+
id: element.id,
|
|
23
|
+
address_city: (0, ParserHelpers_1.toStringOrEmpty)(element.address.city),
|
|
24
|
+
address_country: (0, ParserHelpers_1.toStringOrEmpty)(element.address.country),
|
|
25
|
+
address_house_number: (0, ParserHelpers_1.toStringOrEmpty)(element.address.houseNumber),
|
|
26
|
+
address_mail: (0, ParserHelpers_1.toStringOrEmpty)(element.address.mail),
|
|
27
|
+
address_phone: (0, ParserHelpers_1.toStringOrEmpty)(element.address.phone),
|
|
28
|
+
address_street: (0, ParserHelpers_1.toStringOrEmpty)(element.address.street),
|
|
29
|
+
address_web_address: (0, ParserHelpers_1.toStringOrEmpty)(element.address.webAddress),
|
|
30
|
+
allotment_number: (0, ParserHelpers_1.toStringOrEmpty)(element.allotmentNumber),
|
|
31
|
+
beds_count: (0, ParserHelpers_1.toStringOrEmpty)(element.bedsCount),
|
|
32
|
+
building_address_code: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingAddressCode),
|
|
33
|
+
// Building envelope - Filling of hole ( ͡° ͜ʖ ͡°)
|
|
34
|
+
building_envelope_filling_of_hole_area: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.fillingOfHole.area),
|
|
35
|
+
building_envelope_filling_of_hole_construction: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.fillingOfHole.construction),
|
|
36
|
+
building_envelope_filling_of_hole_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.fillingOfHole.technicalCondition),
|
|
37
|
+
building_envelope_filling_of_hole_year_of_adjustment: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.fillingOfHole.yearOfAdjustment),
|
|
38
|
+
building_envelope_floor_of_the_lowest_heated_floor_area:
|
|
39
|
+
// Building envelope - Floor of the lowest heated floor
|
|
40
|
+
(0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.floorOfTheLowestHeatedFloor.area),
|
|
41
|
+
building_envelope_floor_of_the_lowest_heated_floor_construction: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.floorOfTheLowestHeatedFloor.construction),
|
|
42
|
+
building_envelope_floor_of_the_lowest_heated_floor_year_of_adjustment: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.floorOfTheLowestHeatedFloor.yearOfAdjustment),
|
|
43
|
+
floor_of_the_lowest_heated_floor_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.floorOfTheLowestHeatedFloor.technicalCondition),
|
|
44
|
+
floor_of_the_lowest_heated_floor_thermal_insulation: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.floorOfTheLowestHeatedFloor.thermalInsulation),
|
|
45
|
+
// Building envelope - Roof
|
|
46
|
+
building_envelope_roof_area: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.roof.area),
|
|
47
|
+
building_envelope_roof_construction: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.roof.construction),
|
|
48
|
+
building_envelope_roof_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.roof.technicalCondition),
|
|
49
|
+
building_envelope_roof_thermal_insulation: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.roof.thermalInsulation),
|
|
50
|
+
building_envelope_roof_year_of_adjustment: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.roof.yearOfAdjustment),
|
|
51
|
+
// Building envelope - Side wall
|
|
52
|
+
building_envelope_side_wall_area: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.sideWall.area),
|
|
53
|
+
building_envelope_side_wall_heat_insulation: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.sideWall.heatInsulation),
|
|
54
|
+
building_envelope_side_wall_prevailing_construction: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.sideWall.prevailingConstruction),
|
|
55
|
+
building_envelope_side_wall_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.sideWall.technicalCondition),
|
|
56
|
+
building_envelope_side_wall_year_of_adjustment: (0, ParserHelpers_1.toStringOrEmpty)(element.buildingEnvelope.sideWall.yearOfAdjustment),
|
|
57
|
+
building_label: (0, ParserHelpers_1.toStringOrEmpty)(element.label),
|
|
58
|
+
building_name: (0, ParserHelpers_1.toStringOrEmpty)(element.name),
|
|
59
|
+
built_up_area: (0, ParserHelpers_1.toStringOrEmpty)(element.builtUpArea),
|
|
60
|
+
classrooms_count: (0, ParserHelpers_1.toStringOrEmpty)(element.classroomsCount),
|
|
61
|
+
csu_code: (0, ParserHelpers_1.toStringOrEmpty)(element.csuCode),
|
|
62
|
+
current_note: (0, ParserHelpers_1.toStringOrEmpty)(element.currentNote),
|
|
63
|
+
description: (0, ParserHelpers_1.toStringOrEmpty)(element.description),
|
|
64
|
+
electricity_consumption_normatives: (0, ParserHelpers_1.toStringOrEmpty)(element.electricityConsumptionNormatives),
|
|
65
|
+
electricity_consumption_normatives_per_person: (0, ParserHelpers_1.toStringOrEmpty)(element.electricityConsumptionNormativesPerPerson),
|
|
66
|
+
employees_count: (0, ParserHelpers_1.toStringOrEmpty)(element.employeesCount),
|
|
67
|
+
energetic_management: (0, ParserHelpers_1.toStringOrEmpty)(element.energeticManagement).toLowerCase(),
|
|
68
|
+
// Energy Audits
|
|
69
|
+
energy_audits_created_at: (0, ParserHelpers_1.toStringOrEmpty)(element.energyAudits.createdAt),
|
|
70
|
+
energy_audits_earegistration_number: (0, ParserHelpers_1.toStringOrEmpty)(element.energyAudits.eaRegistrationNumber),
|
|
71
|
+
energy_audits_energy_audit: (0, ParserHelpers_1.toStringOrEmpty)(element.energyAudits.energyAudit),
|
|
72
|
+
eno_id: (0, ParserHelpers_1.toStringOrEmpty)(element.enoId),
|
|
73
|
+
// Fuel and energy
|
|
74
|
+
fuel_and_energy_coal: (0, ParserHelpers_1.toStringOrEmpty)(element.fuelAndEnergy.coal).toLowerCase(),
|
|
75
|
+
fuel_and_energy_czt: (0, ParserHelpers_1.toStringOrEmpty)(element.fuelAndEnergy.czt).toLowerCase(),
|
|
76
|
+
fuel_and_energy_electricity: (0, ParserHelpers_1.toStringOrEmpty)(element.fuelAndEnergy.electricity).toLowerCase(),
|
|
77
|
+
fuel_and_energy_gas: (0, ParserHelpers_1.toStringOrEmpty)(element.fuelAndEnergy.gas).toLowerCase(),
|
|
78
|
+
fuel_and_energy_other: (0, ParserHelpers_1.toStringOrEmpty)(element.fuelAndEnergy.other).toLowerCase(),
|
|
79
|
+
fuel_and_energy_oze: (0, ParserHelpers_1.toStringOrEmpty)(element.fuelAndEnergy.oze).toLowerCase(),
|
|
80
|
+
gas_consumption_normatives: (0, ParserHelpers_1.toStringOrEmpty)(element.gasConsumptionNormatives),
|
|
81
|
+
heat_consumption_normatives: (0, ParserHelpers_1.toStringOrEmpty)(element.heatConsumptionNormatives),
|
|
82
|
+
heated_bulding_volume: (0, ParserHelpers_1.toStringOrEmpty)(element.heatedBuldingVolume),
|
|
83
|
+
ku_code: (0, ParserHelpers_1.toStringOrEmpty)(element.kuCode),
|
|
84
|
+
latitude: (0, ParserHelpers_1.toStringOrEmpty)(element.latitude),
|
|
85
|
+
link: (0, ParserHelpers_1.toStringOrEmpty)(element.link),
|
|
86
|
+
longitude: (0, ParserHelpers_1.toStringOrEmpty)(element.longitude),
|
|
87
|
+
main_use: (0, ParserHelpers_1.toStringOrEmpty)(element.mainUse),
|
|
88
|
+
method_of_protection: (0, ParserHelpers_1.toStringOrEmpty)(element.methodOfProtection),
|
|
89
|
+
opening_hours: (0, ParserHelpers_1.toStringOrEmpty)(element.openingHours),
|
|
90
|
+
// Oze energy production
|
|
91
|
+
oze_energy_production_heat_pump: (0, ParserHelpers_1.toStringOrEmpty)(element.ozeEnergyProduction.heatPump),
|
|
92
|
+
oze_energy_production_integrated_turbines_wind_energy: (0, ParserHelpers_1.toStringOrEmpty)(element.ozeEnergyProduction.integratedTurbinesWindEnergy),
|
|
93
|
+
oze_energy_production_solar_energy_photothermal: (0, ParserHelpers_1.toStringOrEmpty)(element.ozeEnergyProduction.solarEnergyPhotothermal),
|
|
94
|
+
oze_energy_production_solar_energy_photovoltaic: (0, ParserHelpers_1.toStringOrEmpty)(element.ozeEnergyProduction.solarEnergyPhotovoltaic),
|
|
95
|
+
// Penb
|
|
96
|
+
penb_building_envelope: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.buildingEnvelope),
|
|
97
|
+
penb_building_envelope_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.buildingEnvelopeCategory),
|
|
98
|
+
penb_cooling: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.cooling),
|
|
99
|
+
penb_cooling_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.coolingCategory),
|
|
100
|
+
penb_heating: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.heating),
|
|
101
|
+
penb_heating_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.heatingCategory),
|
|
102
|
+
penb_humidity_adjustment: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.humidityAdjustment),
|
|
103
|
+
penb_humidity_adjustment_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.humidityAdjustmentCategory),
|
|
104
|
+
penb_issue_date: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.issueDate),
|
|
105
|
+
penb_lighting: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.lighting),
|
|
106
|
+
penb_lighting_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.lightingCategory),
|
|
107
|
+
penb_penbnumber: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.penbNumber),
|
|
108
|
+
penb_primary_non_renewable_energy: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.primaryNonRenewableEnergy),
|
|
109
|
+
penb_primary_non_renewable_energy_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.primaryNonRenewableEnergyCategory),
|
|
110
|
+
penb_total_building_envelope_area: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.totalBuildingEnvelopeArea),
|
|
111
|
+
penb_total_energy_reference_area: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.totalEnergyReferenceArea),
|
|
112
|
+
penb_total_provided_energy: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.totalProvidedEnergy),
|
|
113
|
+
penb_total_provided_energy_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.totalProvidedEnergyCategory),
|
|
114
|
+
penb_ventilation: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.ventilation),
|
|
115
|
+
penb_ventilation_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.ventilationCategory),
|
|
116
|
+
penb_volume_factor_of_avshape: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.volumeFactorOfAVShape),
|
|
117
|
+
penb_warm_water: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.warmWater),
|
|
118
|
+
penb_warm_water_category: (0, ParserHelpers_1.toStringOrEmpty)(element.penb.warmWaterCategory),
|
|
119
|
+
registration_unit: (0, ParserHelpers_1.toStringOrEmpty)(element.registrationUnit),
|
|
120
|
+
secondary_use: (0, ParserHelpers_1.toStringOrEmpty)(element.secondaryUse),
|
|
121
|
+
students_count: (0, ParserHelpers_1.toStringOrEmpty)(element.studentsCount),
|
|
122
|
+
// Technical equipment - Cooling
|
|
123
|
+
technical_equipment_cooling_cooling_area_percentage: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.cooling.coolingAreaPercentage),
|
|
124
|
+
technical_equipment_cooling_cooling_system: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.cooling.coolingSystem),
|
|
125
|
+
technical_equipment_cooling_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.cooling.technicalCondition),
|
|
126
|
+
technical_equipment_cooling_year: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.cooling.year),
|
|
127
|
+
// Technical equipment - Heating
|
|
128
|
+
technical_equipment_heating_heat_percentage: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.heating.heatPercentage),
|
|
129
|
+
technical_equipment_heating_heating_system: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.heating.heatingSystem),
|
|
130
|
+
technical_equipment_heating_main_source_of_heat: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.heating.mainSourceOfHeat),
|
|
131
|
+
technical_equipment_heating_secondary_source_of_heat: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.heating.secondarySourceOfHeat),
|
|
132
|
+
technical_equipment_heating_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.heating.technicalCondition),
|
|
133
|
+
technical_equipment_heating_year: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.heating.year),
|
|
134
|
+
// Technical equipment - Hot water
|
|
135
|
+
technical_equipment_hot_water_hot_water_source: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.hotWater.hotWaterSource),
|
|
136
|
+
technical_equipment_hot_water_predominant_way_of_heating_tv: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.hotWater.predominantWayOfHeatingTv),
|
|
137
|
+
technical_equipment_hot_water_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.hotWater.technicalCondition),
|
|
138
|
+
technical_equipment_hot_water_year: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.hotWater.year),
|
|
139
|
+
// Technical equipment - Humidity
|
|
140
|
+
technical_equipment_humidity_adjustment_humidity_adjustment: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.humidityAdjustment.humidityAdjustment),
|
|
141
|
+
technical_equipment_humidity_adjustment_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.humidityAdjustment.technicalCondition),
|
|
142
|
+
technical_equipment_humidity_adjustment_year: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.humidityAdjustment.year),
|
|
143
|
+
// Technical equipment - Lightning
|
|
144
|
+
technical_equipment_lighting_lighting: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.lighting.lighting),
|
|
145
|
+
technical_equipment_lighting_measurement_method: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.lighting.measurementMethod),
|
|
146
|
+
technical_equipment_lighting_other_technological_elements: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.lighting.otherTechnologicalElements),
|
|
147
|
+
technical_equipment_lighting_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.lighting.technicalCondition),
|
|
148
|
+
technical_equipment_lighting_year: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.lighting.year),
|
|
149
|
+
// Technical equipment - Ventilation
|
|
150
|
+
technical_equipment_ventilation_technical_condition: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.ventilation.technicalCondition),
|
|
151
|
+
technical_equipment_ventilation_ventilation: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.ventilation.ventilation),
|
|
152
|
+
technical_equipment_ventilation_year: (0, ParserHelpers_1.toStringOrEmpty)(element.technicalEquipment.ventilation.year),
|
|
153
|
+
// Waste and emissions
|
|
154
|
+
waste_and_emissions_operating_co_2emissions: (0, ParserHelpers_1.toStringOrEmpty)(element.wasteAndEmissions.operatingCo2Emissions),
|
|
155
|
+
waste_and_emissions_solid_waste_production: (0, ParserHelpers_1.toStringOrEmpty)(element.wasteAndEmissions.solidWasteProduction),
|
|
156
|
+
waste_and_emissions_sox_emissions: (0, ParserHelpers_1.toStringOrEmpty)(element.wasteAndEmissions.soxEmissions),
|
|
157
|
+
waste_and_emissions_tied_co2_emissions: (0, ParserHelpers_1.toStringOrEmpty)(element.wasteAndEmissions.tiedCo2Emissions),
|
|
158
|
+
water_consumption_normatives: (0, ParserHelpers_1.toStringOrEmpty)(element.waterConsumptionNormatives),
|
|
159
|
+
weekend_opening_hours: (0, ParserHelpers_1.toStringOrEmpty)(element.weekendOpeningHours),
|
|
160
|
+
year_of_construction: (0, ParserHelpers_1.toStringOrEmpty)(element.yearOfConstruction),
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.BuildingsTransformation = BuildingsTransformation;
|
|
166
|
+
//# sourceMappingURL=BuildingsTransformation.js.map
|
package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildingsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/transformations/oict-energetika/BuildingsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA4D;AAG5D,2FAA4G;AAE5G,MAAa,uBAAwB,SAAQ,oCAAkB;IAA/D;;QACW,SAAI,GAAG,yBAAyB,CAAC;QAE9B,qBAAgB,GAAG,CAAO,OAA4B,EAA4B,EAAE;YAC1F,OAAO;gBACH,KAAK;gBACL,EAAE,EAAE,OAAO,CAAC,EAAE;gBAEd,YAAY,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;gBACnD,eAAe,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzD,oBAAoB,EAAE,IAAA,+BAAe,EAA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,OAAO,CAAC,0BAA0B,CAAC;gBACjF,qBAAqB,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,mBAAmB,CAAC;gBACnE,oBAAoB,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,kBAAkB,CAAC;aACpE,CAAC;QACN,CAAC,CAAA,CAAC;IACN,CAAC;CAAA;AAjND,0DAiNC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IOictDevicesInput } from "../../../schema-definitions/datasources/interfaces";
|
|
2
|
+
import { IDevicesModel } from "../../../schema-definitions/models/interfaces";
|
|
3
|
+
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
4
|
+
export declare class DevicesTransformation extends BaseTransformation implements ITransformation {
|
|
5
|
+
name: string;
|
|
6
|
+
protected transformElement: (element: IOictDevicesInput) => Promise<IDevicesModel>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DevicesTransformation = void 0;
|
|
13
|
+
const ParserHelpers_1 = require("../../helpers/ParserHelpers");
|
|
14
|
+
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
15
|
+
class DevicesTransformation extends transformations_1.BaseTransformation {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.name = "DevicesTransformation";
|
|
19
|
+
this.transformElement = (element) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
return {
|
|
21
|
+
// PK
|
|
22
|
+
id: element.id,
|
|
23
|
+
addr: (0, ParserHelpers_1.toStringOrEmpty)(element.addr),
|
|
24
|
+
building_id: element.buildingId,
|
|
25
|
+
category: (0, ParserHelpers_1.toStringOrEmpty)(element.category),
|
|
26
|
+
deleted: (0, ParserHelpers_1.toStringOrEmpty)(element.deleted).toLowerCase(),
|
|
27
|
+
description: (0, ParserHelpers_1.toStringOrEmpty)(element.description),
|
|
28
|
+
include_in_evaluation: (0, ParserHelpers_1.toStringOrEmpty)(element.includeInEvaluation).toLowerCase(),
|
|
29
|
+
location_description: (0, ParserHelpers_1.toStringOrEmpty)(element.locationDescription),
|
|
30
|
+
location_number: (0, ParserHelpers_1.toStringOrEmpty)(element.locationNumber),
|
|
31
|
+
meter_index: (0, ParserHelpers_1.toStringOrEmpty)(element.meterIndex),
|
|
32
|
+
meter_number: (0, ParserHelpers_1.toStringOrEmpty)(element.meterNumber),
|
|
33
|
+
meter_type: (0, ParserHelpers_1.toStringOrEmpty)(element.meterType),
|
|
34
|
+
replaced_meter_id: (0, ParserHelpers_1.toStringOrEmpty)(element.replacedMeterId),
|
|
35
|
+
unit: (0, ParserHelpers_1.toStringOrEmpty)(element.unit),
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.DevicesTransformation = DevicesTransformation;
|
|
41
|
+
//# sourceMappingURL=DevicesTransformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevicesTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/transformations/oict-energetika/DevicesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA4D;AAG5D,2FAA4G;AAE5G,MAAa,qBAAsB,SAAQ,oCAAkB;IAA7D;;QACW,SAAI,GAAG,uBAAuB,CAAC;QAE5B,qBAAgB,GAAG,CAAO,OAA0B,EAA0B,EAAE;YACtF,OAAO;gBACH,KAAK;gBACL,EAAE,EAAE,OAAO,CAAC,EAAE;gBAEd,IAAI,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,IAAI,CAAC;gBACnC,WAAW,EAAE,OAAO,CAAC,UAAU;gBAC/B,QAAQ,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,QAAQ,CAAC;gBAC3C,OAAO,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE;gBACvD,WAAW,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,WAAW,CAAC;gBACjD,qBAAqB,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE;gBACjF,oBAAoB,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,mBAAmB,CAAC;gBAClE,eAAe,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,cAAc,CAAC;gBACxD,WAAW,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,UAAU,CAAC;gBAChD,YAAY,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,WAAW,CAAC;gBAClD,UAAU,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,SAAS,CAAC;gBAC9C,iBAAiB,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,eAAe,CAAC;gBAC3D,IAAI,EAAE,IAAA,+BAAe,EAAC,OAAO,CAAC,IAAI,CAAC;aACtC,CAAC;QACN,CAAC,CAAA,CAAC;IACN,CAAC;CAAA;AAvBD,sDAuBC"}
|
|
@@ -3,13 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OictEnergetikaWorker = void 0;
|
|
4
4
|
const FetchConsumptionTask_1 = require("../../tasks/oict-energetika/FetchConsumptionTask");
|
|
5
5
|
const FetchDataTask_1 = require("../../tasks/oict-energetika/FetchDataTask");
|
|
6
|
+
const FetchDevicesTask_1 = require("../../tasks/oict-energetika/FetchDevicesTask");
|
|
6
7
|
const AbstractWorker_1 = require("@golemio/core/dist/integration-engine/workers/AbstractWorker");
|
|
8
|
+
const FetchBuildingsTask_1 = require("../../tasks/oict-energetika/FetchBuildingsTask");
|
|
7
9
|
class OictEnergetikaWorker extends AbstractWorker_1.AbstractWorker {
|
|
8
10
|
constructor() {
|
|
9
11
|
super();
|
|
10
12
|
this.name = "energeticsOICT";
|
|
11
13
|
// Register tasks
|
|
12
14
|
this.registerTask(new FetchDataTask_1.FetchDataTask(this.getQueuePrefix()));
|
|
15
|
+
this.registerTask(new FetchBuildingsTask_1.FetchBuildingsTask(this.getQueuePrefix()));
|
|
16
|
+
this.registerTask(new FetchDevicesTask_1.FetchDevicesTask(this.getQueuePrefix()));
|
|
13
17
|
this.registerTask(new FetchConsumptionTask_1.FetchConsumptionTask(this.getQueuePrefix()));
|
|
14
18
|
}
|
|
15
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OictEnergetikaWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/oict-energetika/OictEnergetikaWorker.ts"],"names":[],"mappings":";;;AAAA,2FAAsF;AACtF,6EAAwE;AACxE,iGAA8F;
|
|
1
|
+
{"version":3,"file":"OictEnergetikaWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/oict-energetika/OictEnergetikaWorker.ts"],"names":[],"mappings":";;;AAAA,2FAAsF;AACtF,6EAAwE;AACxE,mFAA8E;AAC9E,iGAA8F;AAC9F,uFAAoF;AAEpF,MAAa,oBAAqB,SAAQ,+BAAc;IAGpD;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,gBAAgB,CAAC;QAK9B,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,6BAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,IAAI,uCAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ;AAZD,oDAYC"}
|