@golemio/energetics 1.5.3-dev.2164524892 → 1.5.3-dev.2180893364
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/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/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/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/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/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/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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnoStructureTransformation = void 0;
|
|
4
|
+
const EnumGIDTypes_1 = require("../../../../schema-definitions/models/eno/helpers/EnumGIDTypes");
|
|
5
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
6
|
+
class EnoStructureTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
7
|
+
constructor(source) {
|
|
8
|
+
super();
|
|
9
|
+
this.source = source;
|
|
10
|
+
this.name = "EnoStructureTransformation";
|
|
11
|
+
this.transformInternal = (input) => {
|
|
12
|
+
return {
|
|
13
|
+
structure: this.transformStructure(input.stavba),
|
|
14
|
+
property: this.transformProperty(input.majetek, input.stavba.gid),
|
|
15
|
+
address: input.adresy
|
|
16
|
+
? input.adresy.map((element, index) => this.transformAddress(element, input.stavba.gid, index))
|
|
17
|
+
: [],
|
|
18
|
+
location: input.umisteni
|
|
19
|
+
? input.umisteni.map((element, index) => this.transformLocation(element, input.stavba.gid, index))
|
|
20
|
+
: [],
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
this.transformStructure = (element) => {
|
|
24
|
+
return {
|
|
25
|
+
gid: element.gid,
|
|
26
|
+
zdroj: this.source,
|
|
27
|
+
delka: element.delka,
|
|
28
|
+
den_vystavba: element.denVystavbaStavba,
|
|
29
|
+
id_czcc: element.idCZCC,
|
|
30
|
+
id_objekt: element.idObjekt,
|
|
31
|
+
kod_druh_stavba: element.kodDruhStavba,
|
|
32
|
+
kod_ochrana_stavba: element.kodOchranaStavba,
|
|
33
|
+
material: element.material,
|
|
34
|
+
mesic_vystavba: element.mesicVystavbaStavba,
|
|
35
|
+
nazev: element.nazev,
|
|
36
|
+
nazev_druh_stavba: element.nazevDruhStavba,
|
|
37
|
+
nazev_ochrana_stavba: element.nazevOchranaStavba,
|
|
38
|
+
platnost_do: element.platnostDo ? new Date(element.platnostDo) : null,
|
|
39
|
+
platnost_od: element.platnostOd ? new Date(element.platnostOd) : null,
|
|
40
|
+
profil: element.profil,
|
|
41
|
+
rok_vystavba: element.rokVystavbaStavba,
|
|
42
|
+
sirka: element.sirka,
|
|
43
|
+
vyska: element.vyska,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
this.transformAddress = (element, gid, index) => {
|
|
47
|
+
return {
|
|
48
|
+
gid: gid,
|
|
49
|
+
gid_typ: EnumGIDTypes_1.EnumGidTypes.STRUCTURE,
|
|
50
|
+
poradi: index,
|
|
51
|
+
zdroj: this.source,
|
|
52
|
+
id: element.idAdresa,
|
|
53
|
+
popis: element.popisAdresa,
|
|
54
|
+
hlavni: element.hlavniAdresa,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
this.transformLocation = (element, gid, index) => {
|
|
58
|
+
return {
|
|
59
|
+
gid: gid,
|
|
60
|
+
gid_typ: EnumGIDTypes_1.EnumGidTypes.STRUCTURE,
|
|
61
|
+
poradi: index,
|
|
62
|
+
zdroj: this.source,
|
|
63
|
+
id_parcela_orig: element.idPracelaOrig,
|
|
64
|
+
hlavni_parcela_umisteni: element.hlavniParcelaUmisteni,
|
|
65
|
+
popis_umisteni: element.popisUmisteni,
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
this.transformProperty = (element, gid) => {
|
|
69
|
+
return {
|
|
70
|
+
gid: gid,
|
|
71
|
+
gid_typ: EnumGIDTypes_1.EnumGidTypes.STRUCTURE,
|
|
72
|
+
zdroj: this.source,
|
|
73
|
+
id_maj_evidencni_jednotka: element.idMajEvidencniJednotka,
|
|
74
|
+
datum_nabyti: element.datumNabyti ? new Date(element.datumNabyti) : null,
|
|
75
|
+
datum_pozbyti: element.datumPozbyti ? new Date(element.datumPozbyti) : null,
|
|
76
|
+
id_maj_spravce_mandatni: element.idMajSpravceMandatni,
|
|
77
|
+
id_maj_spravce_ucet_jednotka: element.idMajSpravceUcetJednotka,
|
|
78
|
+
id_vlastnik: element.idVlastnik,
|
|
79
|
+
penb: element.penb,
|
|
80
|
+
penb_platnost_od: element.penbPlatnostOd ? new Date(element.penbPlatnostOd) : null,
|
|
81
|
+
penb_poznamka: element.penbPoznamka,
|
|
82
|
+
podil_majetek_citatel: element.podilMajetekCitatel,
|
|
83
|
+
podil_majetek_jmenovatel: element.podilMajetekJmenovatel,
|
|
84
|
+
v_majetku: element.VMajetku,
|
|
85
|
+
v_majetku_statu: element.VMajetkuStatu,
|
|
86
|
+
v_procesu_svereni: element.VProcesuSvereni,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.EnoStructureTransformation = EnoStructureTransformation;
|
|
92
|
+
//# sourceMappingURL=EnoStructureTransformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoStructureTransformation.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/transformations/eno/EnoStructureTransformation.ts"],"names":[],"mappings":";;;AAMA,iGAAoE;AAKpE,6GAA0G;AAE1G,MAAa,0BAA2B,SAAQ,+CAA8D;IAG1G,YAAoB,MAAc;QAC9B,KAAK,EAAE,CAAC;QADQ,WAAM,GAAN,MAAM,CAAQ;QAF3B,SAAI,GAAG,4BAA4B,CAAC;QAMjC,sBAAiB,GAAG,CAAC,KAA0B,EAAqB,EAAE;YAC5E,OAAO;gBACH,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC;gBAChD,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GA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Y,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;gBACxE,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC3E,uBAAuB,EAAE,OAAO,CAAC,oBAAoB;gBACrD,4BAA4B,EAAE,OAAO,CAAC,wBAAwB;gBAC9D,WAAW,EAAE,OAAO,CAAC,UAAU;gBAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,gBAAgB,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI;gBAClF,aAAa,EAAE,OAAO,CAAC,YAAY;gBACnC,qBAAqB,EAAE,OAAO,CAAC,mBAAmB;gBAClD,wBAAwB,EAAE,OAAO,CAAC,sBAAsB;gBACxD,SAAS,EAAE,OAAO,CAAC,QAAQ;gBAC3B,eAAe,EAAE,OAAO,CAAC,aAAa;gBACtC,iBAAiB,EAAE,OAAO,CAAC,eAAe;aAC7C,CAAC;QACN,CAAC,CAAC;IAnFF,CAAC;CAoFJ;AAzFD,gEAyFC"}
|
|
@@ -18,6 +18,8 @@ class EnapoWorker extends integration_engine_1.AbstractWorker {
|
|
|
18
18
|
this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoPrediTask));
|
|
19
19
|
this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoLookupTask));
|
|
20
20
|
this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoBuildingTask));
|
|
21
|
+
this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoStructureTask));
|
|
22
|
+
this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoGeometryTask));
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
exports.EnapoWorker = EnapoWorker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnapoWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/workers/EnapoWorker.ts"],"names":[],"mappings":";;;AAAA,8EAAuE;AAEvE,4CAAiD;AACjD,kCAA2C;AAC3C,gFAA6E;AAE7E,MAAa,WAAY,SAAQ,mCAAc;IAG3C;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,6BAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnapoWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/workers/EnapoWorker.ts"],"names":[],"mappings":";;;AAAA,8EAAuE;AAEvE,4CAAiD;AACjD,kCAA2C;AAC3C,gFAA6E;AAE7E,MAAa,WAAY,SAAQ,mCAAc;IAG3C;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,6BAAiB,CAAC;QAc5B,iBAAY,GAAG,CAAC,IAAW,EAAQ,EAAE;YACxC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC7C,CAAC,CAAC;QAZE,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,aAAa,CAAC,CAAC,CAAC;QAC1F,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,aAAa,CAAC,CAAC,CAAC;QAC1F,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,eAAe,CAAC,CAAC,CAAC;QAC5F,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC7F,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChG,CAAC;CAMJ;AAnBD,kCAmBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumEnoDataType = void 0;
|
|
4
|
+
var EnumEnoDataType;
|
|
5
|
+
(function (EnumEnoDataType) {
|
|
6
|
+
EnumEnoDataType["CURRENT"] = "current";
|
|
7
|
+
EnumEnoDataType["REMOVED"] = "removed";
|
|
8
|
+
})(EnumEnoDataType || (exports.EnumEnoDataType = EnumEnoDataType = {}));
|
|
9
|
+
//# sourceMappingURL=IEnoDataTaskInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEnoDataTaskInput.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/interfaces/IEnoDataTaskInput.ts"],"names":[],"mappings":";;;AAMA,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;AACvB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEnoGeometryTaskInput.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/interfaces/IEnoGeometryTaskInput.ts"],"names":[],"mappings":""}
|
|
@@ -9,22 +9,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.EnoDataTaskInputSchema = void 0;
|
|
13
13
|
const class_validator_1 = require("@golemio/core/dist/shared/class-validator");
|
|
14
|
-
|
|
14
|
+
const IEnoDataTaskInput_1 = require("../interfaces/IEnoDataTaskInput");
|
|
15
|
+
class EnoDataTaskInputSchema {
|
|
15
16
|
}
|
|
16
|
-
exports.
|
|
17
|
+
exports.EnoDataTaskInputSchema = EnoDataTaskInputSchema;
|
|
17
18
|
__decorate([
|
|
18
|
-
(0, class_validator_1.IsEnum)(
|
|
19
|
+
(0, class_validator_1.IsEnum)(IEnoDataTaskInput_1.EnumEnoDataType),
|
|
19
20
|
__metadata("design:type", String)
|
|
20
|
-
],
|
|
21
|
+
], EnoDataTaskInputSchema.prototype, "type", void 0);
|
|
21
22
|
__decorate([
|
|
22
23
|
(0, class_validator_1.IsString)(),
|
|
23
24
|
__metadata("design:type", String)
|
|
24
|
-
],
|
|
25
|
+
], EnoDataTaskInputSchema.prototype, "source", void 0);
|
|
25
26
|
__decorate([
|
|
26
27
|
(0, class_validator_1.IsOptional)(),
|
|
27
28
|
(0, class_validator_1.IsNumber)(),
|
|
28
29
|
__metadata("design:type", Number)
|
|
29
|
-
],
|
|
30
|
-
//# sourceMappingURL=
|
|
30
|
+
], EnoDataTaskInputSchema.prototype, "daysBack", void 0);
|
|
31
|
+
//# sourceMappingURL=EnoDataTaskInputSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoDataTaskInputSchema.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/schema/EnoDataTaskInputSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAAmG;AACnG,uEAAqF;AAErF,MAAa,sBAAsB;CAUlC;AAVD,wDAUC;AARG;IADC,IAAA,wBAAM,EAAC,mCAAe,CAAC;;oDACV;AAGd;IADC,IAAA,0BAAQ,GAAE;;sDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACO"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EnoGeometryTaskInputSchema = void 0;
|
|
13
|
+
const class_validator_1 = require("@golemio/core/dist/shared/class-validator");
|
|
14
|
+
class EnoGeometryTaskInputSchema {
|
|
15
|
+
}
|
|
16
|
+
exports.EnoGeometryTaskInputSchema = EnoGeometryTaskInputSchema;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], EnoGeometryTaskInputSchema.prototype, "source", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
23
|
+
(0, class_validator_1.IsArray)(),
|
|
24
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
25
|
+
__metadata("design:type", Array)
|
|
26
|
+
], EnoGeometryTaskInputSchema.prototype, "listGid", void 0);
|
|
27
|
+
//# sourceMappingURL=EnoGeometryTaskInputSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoGeometryTaskInputSchema.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/schema/EnoGeometryTaskInputSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAA0F;AAG1F,MAAa,0BAA0B;CAQtC;AARD,gEAQC;AANG;IADC,IAAA,0BAAQ,GAAE;;0DACK;AAKhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;2DACN"}
|
|
@@ -5,12 +5,12 @@ import { EnoLocationRepository } from "../../repositories/eno/EnoLocationReposit
|
|
|
5
5
|
import { EnoPropertyRepository } from "../../repositories/eno/EnoPropertyRepository";
|
|
6
6
|
import { EnoRemovedGIDRepository } from "../../repositories/eno/EnoRemovedGIDRepository";
|
|
7
7
|
import { ILogger } from "@golemio/core/dist/helpers";
|
|
8
|
+
import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
|
|
8
9
|
import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
|
|
9
10
|
import { AbstractTask } from "@golemio/core/dist/integration-engine/workers/AbstractTask";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export declare class EnoBuildingTask extends AbstractTask<IEnoBuildingTaskInput> {
|
|
11
|
+
import { IEnoDataTaskInput } from "../interfaces/IEnoDataTaskInput";
|
|
12
|
+
import { EnoDataTaskInputSchema } from "../schema/EnoDataTaskInputSchema";
|
|
13
|
+
export declare class EnoBuildingTask extends AbstractTask<IEnoDataTaskInput> {
|
|
14
14
|
private enoDatasourceFactory;
|
|
15
15
|
private enoBuildingRepository;
|
|
16
16
|
private enoPropertyRepository;
|
|
@@ -20,13 +20,12 @@ export declare class EnoBuildingTask extends AbstractTask<IEnoBuildingTaskInput>
|
|
|
20
20
|
private logger;
|
|
21
21
|
protected dbConnector: IDatabaseConnector;
|
|
22
22
|
private simpleConfig;
|
|
23
|
-
protected schema: typeof
|
|
23
|
+
protected schema: typeof EnoDataTaskInputSchema;
|
|
24
24
|
queueName: string;
|
|
25
25
|
queueTtl: number;
|
|
26
26
|
private removedBuldingsStartDate;
|
|
27
|
-
private readonly ORGANIZATION_ID;
|
|
28
27
|
constructor(enoDatasourceFactory: EnoDatasourceFactory, enoBuildingRepository: EnoBuildingRepository, enoPropertyRepository: EnoPropertyRepository, enoLocationRepository: EnoLocationRepository, enoAddressRepository: EnoAddressRepository, enoRemovedGIDRepository: EnoRemovedGIDRepository, logger: ILogger, dbConnector: IDatabaseConnector, simpleConfig: ISimpleConfig);
|
|
29
|
-
execute(data:
|
|
28
|
+
execute(data: IEnoDataTaskInput): Promise<void>;
|
|
30
29
|
private saveData;
|
|
31
30
|
private getCurrentBuildingList;
|
|
32
31
|
private getRemovedBuildingList;
|
|
@@ -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;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AC5D;QAED,OAAO,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,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E;IAQJ,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,oBAAoB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,qDAAyB,CAAC,qBAAqB,CAAC,CAAA;qCAD8B,2CAAoB;QAClB,6CAAqB;GARxG,eAAe,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
|
+
}
|