@golemio/energetics 1.12.2-dev.2740931754 → 1.12.2-dev.2741327856
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/db/example/00_clear_test_data.sql +5 -0
- package/db/example/06_eno.sql +11 -0
- package/db/example/08_ded_search.sql +25 -0
- package/db/migrations/postgresql/20260807092000-ded-building-search.js +53 -0
- package/db/migrations/postgresql/sqls/20260807092000-ded-building-search-down.sql +41 -0
- package/db/migrations/postgresql/sqls/20260807092000-ded-building-search-up.sql +262 -0
- package/db/scripts/ded_gid_mapping_mock_import.sql +82 -23
- package/dist/integration-engine/enapo/ioc/Di.js +5 -1
- package/dist/integration-engine/enapo/ioc/Di.js.map +1 -1
- package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.d.ts +2 -0
- package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js +2 -0
- package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js.map +1 -1
- package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.d.ts +7 -0
- package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.js +50 -0
- package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.js.map +1 -0
- package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.d.ts +7 -0
- package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.js +3 -0
- package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.js.map +1 -0
- package/dist/integration-engine/enapo/workers/EnapoWorker.js +1 -0
- package/dist/integration-engine/enapo/workers/EnapoWorker.js.map +1 -1
- package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.d.ts +21 -0
- package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.js +58 -0
- package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.js.map +1 -0
- package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.d.ts +13 -1
- package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js +25 -2
- package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js.map +1 -1
- package/dist/output-gateway/constants/DedSearchWeights.d.ts +60 -0
- package/dist/output-gateway/constants/DedSearchWeights.js +42 -0
- package/dist/output-gateway/constants/DedSearchWeights.js.map +1 -0
- package/dist/output-gateway/controllers/v2/EnoBuildingsController.d.ts +6 -1
- package/dist/output-gateway/controllers/v2/EnoBuildingsController.js +29 -2
- package/dist/output-gateway/controllers/v2/EnoBuildingsController.js.map +1 -1
- package/dist/output-gateway/ioc/Di.js +5 -1
- package/dist/output-gateway/ioc/Di.js.map +1 -1
- package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +2 -0
- package/dist/output-gateway/ioc/ModuleContainerToken.js +2 -0
- package/dist/output-gateway/ioc/ModuleContainerToken.js.map +1 -1
- package/dist/output-gateway/models/DedBuildingSearchViewModel.d.ts +30 -0
- package/dist/output-gateway/models/DedBuildingSearchViewModel.js +38 -0
- package/dist/output-gateway/models/DedBuildingSearchViewModel.js.map +1 -0
- package/dist/output-gateway/models/EnoBuildingDetailViewModel.d.ts +14 -0
- package/dist/output-gateway/models/EnoBuildingDetailViewModel.js +14 -0
- package/dist/output-gateway/models/EnoBuildingDetailViewModel.js.map +1 -1
- package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.d.ts +24 -0
- package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.js +3 -0
- package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.js.map +1 -0
- package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.d.ts +14 -0
- package/dist/output-gateway/repositories/DedBuildingSearchRepository.d.ts +16 -0
- package/dist/output-gateway/repositories/DedBuildingSearchRepository.js +250 -0
- package/dist/output-gateway/repositories/DedBuildingSearchRepository.js.map +1 -0
- package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.d.ts +14 -0
- package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.js +3 -0
- package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.js.map +1 -0
- package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.d.ts +50 -0
- package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.js +3 -0
- package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.js.map +1 -0
- package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.d.ts +23 -1
- package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.d.ts +11 -0
- package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.js +3 -0
- package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.js.map +1 -0
- package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.d.ts +2 -0
- package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js +5 -0
- package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js.map +1 -1
- package/dist/output-gateway/transformations/DedBuildingSearchTransformation.d.ts +11 -0
- package/dist/output-gateway/transformations/DedBuildingSearchTransformation.js +57 -0
- package/dist/output-gateway/transformations/DedBuildingSearchTransformation.js.map +1 -0
- package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.d.ts +4 -0
- package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js +44 -1
- package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js.map +1 -1
- package/docs/implementation_documentation.md +49 -0
- package/docs/openapi-output.yaml +291 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DedBuildingSearchTransformation = void 0;
|
|
10
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
11
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
12
|
+
/** Set when the geometry originates from eno_geometrie, the only geometry source today. */
|
|
13
|
+
const GEOMETRY_SOURCE = "eno_geometrie";
|
|
14
|
+
/**
|
|
15
|
+
* Maps a scored search row to the response shape. All coordinates arrive from PostGIS already in
|
|
16
|
+
* EPSG:4326, so nothing here does coordinate math.
|
|
17
|
+
*/
|
|
18
|
+
let DedBuildingSearchTransformation = class DedBuildingSearchTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.name = "DedBuildingSearchTransformation";
|
|
22
|
+
this.transformInternal = (element) => {
|
|
23
|
+
const hasCentroid = element.centroid_lat !== null && element.centroid_lon !== null;
|
|
24
|
+
return {
|
|
25
|
+
gid: element.gid,
|
|
26
|
+
name: element.nazev,
|
|
27
|
+
designation: element.oznaceni,
|
|
28
|
+
// Mirrors EnoBuildingDetailTransformation: the lookup row exists only when its id does,
|
|
29
|
+
// so the id is what decides between an object and null.
|
|
30
|
+
registration_unit: element.ej_id === null
|
|
31
|
+
? null
|
|
32
|
+
: { id: element.ej_id, kod: element.ej_kod, nazev: element.ej_nazev, typ: element.ej_typ },
|
|
33
|
+
address: element.address_main,
|
|
34
|
+
addresses: element.addresses,
|
|
35
|
+
matched_by: element.matched_by,
|
|
36
|
+
matched_value: element.matched_value,
|
|
37
|
+
score: element.score,
|
|
38
|
+
identifiers: {
|
|
39
|
+
ean: element.ean,
|
|
40
|
+
eic: element.eic,
|
|
41
|
+
om: element.om,
|
|
42
|
+
},
|
|
43
|
+
geometry: element.geometry,
|
|
44
|
+
bbox: element.bbox,
|
|
45
|
+
centroid: hasCentroid ? { lat: element.centroid_lat, lon: element.centroid_lon } : null,
|
|
46
|
+
geometry_source: element.geometry === null ? null : GEOMETRY_SOURCE,
|
|
47
|
+
has_building_record: element.has_building_record,
|
|
48
|
+
active_points_count: element.active_points_count,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.DedBuildingSearchTransformation = DedBuildingSearchTransformation;
|
|
54
|
+
exports.DedBuildingSearchTransformation = DedBuildingSearchTransformation = __decorate([
|
|
55
|
+
(0, tsyringe_1.injectable)()
|
|
56
|
+
], DedBuildingSearchTransformation);
|
|
57
|
+
//# sourceMappingURL=DedBuildingSearchTransformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DedBuildingSearchTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/DedBuildingSearchTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,6GAA0G;AAC1G,iEAAgE;AAEhE,2FAA2F;AAC3F,MAAM,eAAe,GAAG,eAAe,CAAC;AAExC;;;GAGG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,+CAAuE;IAArH;;QACI,SAAI,GAAW,iCAAiC,CAAC;QAE9C,sBAAiB,GAAG,CAAC,OAA8B,EAA4B,EAAE;YACvF,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,KAAK,IAAI,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,CAAC;YAEnF,OAAO;gBACH,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,IAAI,EAAE,OAAO,CAAC,KAAK;gBACnB,WAAW,EAAE,OAAO,CAAC,QAAQ;gBAC7B,wFAAwF;gBACxF,wDAAwD;gBACxD,iBAAiB,EACb,OAAO,CAAC,KAAK,KAAK,IAAI;oBAClB,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE;gBAClG,OAAO,EAAE,OAAO,CAAC,YAAY;gBAC7B,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;gBACpC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,WAAW,EAAE;oBACT,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,GAAG,EAAE,OAAO,CAAC,GAAG;oBAChB,EAAE,EAAE,OAAO,CAAC,EAAE;iBACjB;gBACD,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,YAAsB,EAAE,GAAG,EAAE,OAAO,CAAC,YAAsB,EAAE,CAAC,CAAC,CAAC,IAAI;gBAC3G,eAAe,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe;gBACnE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;aACnD,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;AAlCY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,qBAAU,GAAE;GACA,+BAA+B,CAkC3C"}
|
|
@@ -4,6 +4,10 @@ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformatio
|
|
|
4
4
|
export declare class EnoBuildingDetailTransformation extends AbstractTransformation<IEnoBuildingDetailAggregate, IEnoBuildingDetailResponse> {
|
|
5
5
|
name: string;
|
|
6
6
|
protected transformInternal: (element: IEnoBuildingDetailAggregate) => IEnoBuildingDetailResponse;
|
|
7
|
+
private extractBuilding;
|
|
8
|
+
private transformProperty;
|
|
9
|
+
private buildRegistrationUnit;
|
|
10
|
+
private buildManager;
|
|
7
11
|
private transformPoint;
|
|
8
12
|
private transformElectricity;
|
|
9
13
|
private transformGas;
|
|
@@ -17,7 +17,8 @@ let EnoBuildingDetailTransformation = class EnoBuildingDetailTransformation exte
|
|
|
17
17
|
this.transformInternal = (element) => {
|
|
18
18
|
return {
|
|
19
19
|
gid: element.gid,
|
|
20
|
-
building: element.building === null ? null :
|
|
20
|
+
building: element.building === null ? null : this.extractBuilding(element.building),
|
|
21
|
+
property: element.building === null ? null : this.transformProperty(element.building),
|
|
21
22
|
addresses: element.addresses.map((address) => ({
|
|
22
23
|
popis: address.popis ?? null,
|
|
23
24
|
hlavni: address.hlavni ?? null,
|
|
@@ -27,6 +28,48 @@ let EnoBuildingDetailTransformation = class EnoBuildingDetailTransformation exte
|
|
|
27
28
|
consumption_points: element.points.map((point) => this.transformPoint(point, element)),
|
|
28
29
|
};
|
|
29
30
|
};
|
|
31
|
+
this.extractBuilding = (building) => {
|
|
32
|
+
return (0, objectMappers_1.omitKeys)(building, [
|
|
33
|
+
"gid",
|
|
34
|
+
"ej_id",
|
|
35
|
+
"ej_kod",
|
|
36
|
+
"ej_nazev",
|
|
37
|
+
"ej_typ",
|
|
38
|
+
"spm_id",
|
|
39
|
+
"spm_kod",
|
|
40
|
+
"spm_nazev",
|
|
41
|
+
"spm_ic",
|
|
42
|
+
"spm_dic",
|
|
43
|
+
"spu_id",
|
|
44
|
+
"spu_kod",
|
|
45
|
+
"spu_nazev",
|
|
46
|
+
"spu_ic",
|
|
47
|
+
"spu_dic",
|
|
48
|
+
]);
|
|
49
|
+
};
|
|
50
|
+
this.transformProperty = (building) => {
|
|
51
|
+
const registrationUnit = this.buildRegistrationUnit(building);
|
|
52
|
+
const mandate = this.buildManager(building, "spm_");
|
|
53
|
+
const accountingUnit = this.buildManager(building, "spu_");
|
|
54
|
+
if (registrationUnit === null && mandate === null && accountingUnit === null) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
registration_unit: registrationUnit,
|
|
59
|
+
managers: {
|
|
60
|
+
mandate,
|
|
61
|
+
accounting_unit: accountingUnit,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
this.buildRegistrationUnit = (building) => {
|
|
66
|
+
const unit = (0, objectMappers_1.stripPrefix)(building, "ej_");
|
|
67
|
+
return unit.id === null ? null : unit;
|
|
68
|
+
};
|
|
69
|
+
this.buildManager = (building, prefix) => {
|
|
70
|
+
const manager = (0, objectMappers_1.stripPrefix)(building, prefix);
|
|
71
|
+
return manager.id === null ? null : manager;
|
|
72
|
+
};
|
|
30
73
|
this.transformPoint = (point, aggregate) => {
|
|
31
74
|
const porsenna = this.buildPorsennaBlock(point, aggregate);
|
|
32
75
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnoBuildingDetailTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/EnoBuildingDetailTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAAA,4DAAkE;
|
|
1
|
+
{"version":3,"file":"EnoBuildingDetailTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/EnoBuildingDetailTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAAA,4DAAkE;AAiBlE,6GAA0G;AAC1G,iEAAgE;AAGzD,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,+CAGpD;IAHM;;QAII,SAAI,GAAW,iCAAiC,CAAC;QAE9C,sBAAiB,GAAG,CAAC,OAAoC,EAA8B,EAAE;YAC/F,OAAO;gBACH,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,C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AAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjG,MAAM,KAAK,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;YAE1F,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;AA7OY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,qBAAU,GAAE;GACA,+BAA+B,CA6O3C"}
|
|
@@ -651,6 +651,30 @@ Task stahuje geometrie (polygony) pro budovy a stavby ze systému ENO. Je automa
|
|
|
651
651
|
- unit testy
|
|
652
652
|
- [EnoGeometryTask.test.ts](../test/integration-engine/enapo/task/EnoGeometryTask.test.ts)
|
|
653
653
|
|
|
654
|
+
#### _task: DedSearchIndexRefreshTask_
|
|
655
|
+
|
|
656
|
+
Task přegeneruje materializovaný pohled `mv_ded_building_search`, nad kterým běží vyhledávací endpoint `/v2/energetics/ded/buildings`.
|
|
657
|
+
|
|
658
|
+
- vstupní rabbitmq fronta
|
|
659
|
+
- název: dataplatform.enapoenergetics.refreshDedSearchIndex
|
|
660
|
+
- TTL: 30 minut (starší zpráva už je překonaná novější, nemá smysl ji zpracovávat)
|
|
661
|
+
- parametry: žádné — refresh vždy přestaví celý index, takže není co validovat a `schema` je záměrně `undefined`
|
|
662
|
+
- cron definice
|
|
663
|
+
- cron.dataplatform.enapoenergetics.refreshDedSearchIndex — noční pojistka po okně synchronizace ENO
|
|
664
|
+
- rabin `0 30 3 * * *`
|
|
665
|
+
- prod `0 30 3 * * *`
|
|
666
|
+
- samotná definice cronu je vedena mimo tento repozitář (deployment konfigurace); hodnoty výše jsou zamýšlený rozvrh, běžnou cestou přestavby indexu je událost z [EnoGeometryTask](#task-enogeometrytask)
|
|
667
|
+
- spouštění na základě událostí
|
|
668
|
+
- [EnoGeometryTask](#task-enogeometrytask) po dokončení odesílá zprávu do fronty `refreshDedSearchIndex`; geometrie je poslední krok obou ENO řetězců (budovy i stavby ji spouštějí), takže se index přestaví jednou na konci, ne po každém dílčím tasku
|
|
669
|
+
- selhání tohoto odeslání se pouze zaloguje a task se nepřeposílá do fronty znovu — geometrie je už uložená a noční běh je pojistka
|
|
670
|
+
- data modely
|
|
671
|
+
- [DedSearchIndexRepository](../src/integration-engine/enapo/repositories/DedSearchIndexRepository.ts) — `REFRESH MATERIALIZED VIEW CONCURRENTLY energetics.mv_ded_building_search`, kontrakt [IDedSearchIndexRepository](../src/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.ts)
|
|
672
|
+
- funkce
|
|
673
|
+
- **CONCURRENTLY**: refresh neblokuje čtenáře, takže vyhledávání funguje i během přestavby; vyžaduje unikátní index nad `gid` (vytvořen migrací) a **nesmí běžet v transakci** — proto se příkaz posílá na běžné (autocommit) spojení a nikdy se neobaluje transakcí
|
|
674
|
+
- ve fixturách pro testy se používá neconcurrent `REFRESH MATERIALIZED VIEW` (v transakci loaderu concurrent varianta není povolená)
|
|
675
|
+
- unit testy
|
|
676
|
+
- [DedSearchIndexRefreshTask.test.ts](../test/integration-engine/enapo/task/DedSearchIndexRefreshTask.test.ts)
|
|
677
|
+
|
|
654
678
|
#### _PPAS Distribution API_
|
|
655
679
|
|
|
656
680
|
- zdroj dat
|
|
@@ -832,6 +856,7 @@ Přehled endpointů a parametru `accessLimit`:
|
|
|
832
856
|
| `/v2/energetics/devices/:id` | OICT Energetika (`consumption_energy_*`) | povinný |
|
|
833
857
|
| `/v2/energetics/measurements` | OICT Energetika (`consumption_energy_*`) | povinný |
|
|
834
858
|
| `/v2/energetics/measurements/monthly-reading` | OICT Energetika (`consumption_energy_*`) | povinný |
|
|
859
|
+
| `/v2/energetics/ded/buildings` | DeD / ENAPO (`enapo_*`, `eno_*`) | nepoužívá se — parametr je odmítnut s HTTP 400 |
|
|
835
860
|
| `/v2/energetics/ded/buildings/:gid` | DeD / ENAPO (`enapo_*`, `eno_*`) | nepoužívá se — parametr je odmítnut s HTTP 400 |
|
|
836
861
|
|
|
837
862
|
#### _/v2/energetics/buildings_
|
|
@@ -866,6 +891,30 @@ Přehled endpointů a parametru `accessLimit`:
|
|
|
866
891
|
- zdrojové tabulky
|
|
867
892
|
- consumption_energy_measurements
|
|
868
893
|
|
|
894
|
+
#### _/v2/energetics/ded/buildings_
|
|
895
|
+
|
|
896
|
+
- našeptávač (suggestion endpoint) pro mapu DeD — vyhledání budovy podle názvu, adresy, GID, EAN, EIC nebo OM identifikátoru
|
|
897
|
+
- přístup: bez `accessLimit` — stejně jako detail budovy (viz níže); jiné než deklarované query parametry endpoint odmítne s HTTP 400
|
|
898
|
+
- parametry
|
|
899
|
+
- `q` (povinný) — hledaný text, 1–100 znaků; jedno vstupní pole pro všechny typy hledání
|
|
900
|
+
- `limit` (volitelný) — 1–50, výchozí 10
|
|
901
|
+
- zdrojové tabulky a pohledy
|
|
902
|
+
- `mv_ded_building_search` — materializovaný pohled, jeden řádek na GID budovy; skládá se z `v_enapo_building_detail`, `eno_adresa` (`gid_typ = 'budova'`), `v_enapo_building_consumption_points`, `v_enapo_building_porsenna_devices` a `eno_geometrie`; vyřazené budovy (`eno_vyrazeno`) jsou z indexu vynechány
|
|
903
|
+
- stavby (`eno_stavba`) endpoint záměrně nepokrývá — stejně jako detail budovy
|
|
904
|
+
- funkce
|
|
905
|
+
- **Dvě úrovně shody**: přesná shoda na EAN / EIC / OM / GID má vlastní úroveň se skóre 1000 a fuzzy kandidáti se v takovém případě zahodí (`matched_exactly = true`). Jeden identifikátor může být namapován na více budov, takže i přesná shoda může vrátit více výsledků — mapa má zoomovat automaticky jen při jediném výsledku
|
|
906
|
+
- **Vážené řazení**: kombinace fulltextu (`tsvector` s vahami A/B/C/D — A název a označení, B hlavní adresa, C ostatní adresy, D identifikátory) a trigramové podobnosti; váhy jsou v [DedSearchWeights.ts](../src/output-gateway/constants/DedSearchWeights.ts) včetně zdůvodnění
|
|
907
|
+
- **Deterministická množina kandidátů**: fulltextová i trigramová větev si své kandidáty nejdřív seřadí (`ts_rank_cd`, resp. `<->`) a teprve pak ořízne na `DED_SEARCH_FTS_CANDIDATES` / `DED_SEARCH_FUZZY_CANDIDATES`; bez toho by `LIMIT` vzal libovolné řádky v pořadí, v jakém je vrátil index, a stejný dotaz by po autovacuum mohl odpovědět jinak
|
|
908
|
+
- **Evidenční jednotka**: `registration_unit` má záměrně stejný tvar (`id` / `kod` / `nazev` / `typ`) jako na detailu budovy, takže klient může pro obě odpovědi použít jeden typ
|
|
909
|
+
- **Projekce PostGIS až na výsledné stránce**: `ST_AsGeoJSON`, bbox a centroid se počítají až po filtru a `LIMIT`; trigramová větev se navíc při přesné shodě vůbec nespustí, protože její řádky by finální `WHERE` stejně zahodil
|
|
910
|
+
- **Diakritika**: dotaz i indexované sloupce se normalizují přes `lower(public.unaccent(...))`, takže hledání bez diakritiky funguje běžně; stejný výraz musí zůstat v migraci i v [DedBuildingSearchRepository](../src/output-gateway/repositories/DedBuildingSearchRepository.ts), jinak by normalizované sloupce přestaly odpovídat hledanému textu
|
|
911
|
+
- **Geometrie**: `geometry` (GeoJSON), `bbox` a `centroid` se počítají z PostGIS geometrie uložené v pohledu už v EPSG:4326 (zdroj `eno_geometrie` je v S-JTSK 5514); u budov bez použitelné geometrie jsou všechny tři `null` a `geometry_source` je `null`
|
|
912
|
+
- **Nečitelná geometrie**: `f_ded_safe_geom` vrací pro nevalidní WKT `NULL` místo chyby, aby jeden vadný řádek nezastavil refresh indexu
|
|
913
|
+
- index je aktualizován taskem [DedSearchIndexRefreshTask](#task-dedsearchindexrefreshtask)
|
|
914
|
+
- unit testy
|
|
915
|
+
- [V2EnoBuildingsSearchRouter.test.ts](../test/output-gateway/routers/v2/V2EnoBuildingsSearchRouter.test.ts)
|
|
916
|
+
- [DedBuildingSearchTransformation.test.ts](../test/output-gateway/transformations/DedBuildingSearchTransformation.test.ts)
|
|
917
|
+
|
|
869
918
|
#### _/v2/energetics/ded/buildings/:gid_
|
|
870
919
|
|
|
871
920
|
- detail budovy (ENO) s odběrnými místy (OM) a technickými parametry pro DeD
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -84,6 +84,66 @@ paths:
|
|
|
84
84
|
schema:
|
|
85
85
|
$ref: "#/components/schemas/EnergeticsBuildingFull"
|
|
86
86
|
|
|
87
|
+
/v2/energetics/ded/buildings:
|
|
88
|
+
get:
|
|
89
|
+
tags:
|
|
90
|
+
- 🗺️ Energetics DeD (v2)
|
|
91
|
+
summary: Search buildings by name, address, GID, EAN, EIC or OM identifier
|
|
92
|
+
description: >-
|
|
93
|
+
Suggestion endpoint for the DeD map. A single free-text query `q` is matched against the
|
|
94
|
+
building name, its addresses, the GID and the identifiers of every consumption point mapped
|
|
95
|
+
to the building.
|
|
96
|
+
|
|
97
|
+
Matching runs in two tiers. An exact match on an EAN, EIC, OM identifier or GID is returned
|
|
98
|
+
on its own — fuzzy candidates are dropped entirely and `matched_exactly` is `true`. Note that
|
|
99
|
+
one identifier can be mapped to several buildings, so an exact match may still return more
|
|
100
|
+
than one result; the map should zoom automatically only when exactly one result is returned.
|
|
101
|
+
Otherwise results are ranked by a weighted full-text and trigram score over the name
|
|
102
|
+
(highest weight), the main address, the secondary addresses and the identifiers. Queries
|
|
103
|
+
typed without Czech diacritics match normally.
|
|
104
|
+
|
|
105
|
+
Every result carries the building outline as GeoJSON together with its bounding box and
|
|
106
|
+
centroid, all in WGS84 (EPSG:4326), so the map can zoom to a hit. They are `null` when the
|
|
107
|
+
building has no usable geometry, signalled by `geometry_source: null`.
|
|
108
|
+
parameters:
|
|
109
|
+
- in: query
|
|
110
|
+
name: q
|
|
111
|
+
required: true
|
|
112
|
+
description: Search text — name, address, GID, EAN, EIC or OM identifier.
|
|
113
|
+
schema:
|
|
114
|
+
type: string
|
|
115
|
+
minLength: 1
|
|
116
|
+
maxLength: 100
|
|
117
|
+
example: "859182400000000001"
|
|
118
|
+
- in: query
|
|
119
|
+
name: limit
|
|
120
|
+
required: false
|
|
121
|
+
description: Maximum number of suggestions returned.
|
|
122
|
+
schema:
|
|
123
|
+
type: integer
|
|
124
|
+
minimum: 1
|
|
125
|
+
maximum: 50
|
|
126
|
+
default: 10
|
|
127
|
+
responses:
|
|
128
|
+
"200":
|
|
129
|
+
description: OK
|
|
130
|
+
headers:
|
|
131
|
+
Cache-Control:
|
|
132
|
+
description: Cache control directive for caching proxies
|
|
133
|
+
schema:
|
|
134
|
+
type: string
|
|
135
|
+
example: public, s-maxage=60, stale-while-revalidate=30
|
|
136
|
+
content:
|
|
137
|
+
application/json:
|
|
138
|
+
schema:
|
|
139
|
+
$ref: "#/components/schemas/EnergeticsDedBuildingSearch"
|
|
140
|
+
"400":
|
|
141
|
+
$ref: "#/components/responses/BadRequestError"
|
|
142
|
+
"401":
|
|
143
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
144
|
+
"500":
|
|
145
|
+
$ref: "#/components/responses/ServerError"
|
|
146
|
+
|
|
87
147
|
/v2/energetics/ded/buildings/{gid}:
|
|
88
148
|
get:
|
|
89
149
|
tags:
|
|
@@ -505,6 +565,181 @@ components:
|
|
|
505
565
|
type: string
|
|
506
566
|
|
|
507
567
|
schemas:
|
|
568
|
+
EnergeticsDedBuildingSearch:
|
|
569
|
+
type: object
|
|
570
|
+
properties:
|
|
571
|
+
query:
|
|
572
|
+
type: string
|
|
573
|
+
example: "859182400000000001"
|
|
574
|
+
matched_exactly:
|
|
575
|
+
type: boolean
|
|
576
|
+
description: >-
|
|
577
|
+
True when the query resolved to an exact EAN, EIC, OM identifier or GID. In that case
|
|
578
|
+
the results contain only exact matches.
|
|
579
|
+
example: true
|
|
580
|
+
results:
|
|
581
|
+
type: array
|
|
582
|
+
items:
|
|
583
|
+
$ref: "#/components/schemas/EnergeticsDedBuildingSearchResult"
|
|
584
|
+
required:
|
|
585
|
+
- query
|
|
586
|
+
- matched_exactly
|
|
587
|
+
- results
|
|
588
|
+
|
|
589
|
+
EnergeticsDedBuildingSearchResult:
|
|
590
|
+
type: object
|
|
591
|
+
properties:
|
|
592
|
+
gid:
|
|
593
|
+
type: string
|
|
594
|
+
example: GID100
|
|
595
|
+
name:
|
|
596
|
+
type: string
|
|
597
|
+
nullable: true
|
|
598
|
+
example: ZŠ Testovací
|
|
599
|
+
designation:
|
|
600
|
+
type: string
|
|
601
|
+
nullable: true
|
|
602
|
+
example: ZŠT
|
|
603
|
+
registration_unit:
|
|
604
|
+
allOf:
|
|
605
|
+
- $ref: "#/components/schemas/EnergeticsEnoRegistrationUnit"
|
|
606
|
+
nullable: true
|
|
607
|
+
description: >-
|
|
608
|
+
Evidenční jednotka (eno_ciselnik_evidencni_jednotka) resolved through eno_majetek;
|
|
609
|
+
null when the building has no majetek record. Its name is part of the search vector.
|
|
610
|
+
address:
|
|
611
|
+
type: string
|
|
612
|
+
nullable: true
|
|
613
|
+
description: Main address of the building.
|
|
614
|
+
example: Testovací 123/4, 100 00 Praha 10
|
|
615
|
+
addresses:
|
|
616
|
+
type: array
|
|
617
|
+
description: Every distinct address of the building, the main one first.
|
|
618
|
+
items:
|
|
619
|
+
type: string
|
|
620
|
+
example:
|
|
621
|
+
- Testovací 123/4, 100 00 Praha 10
|
|
622
|
+
- Testovací 125/6, 100 00 Praha 10
|
|
623
|
+
matched_by:
|
|
624
|
+
type: string
|
|
625
|
+
enum: [ean, eic, om, gid, name, address]
|
|
626
|
+
example: ean
|
|
627
|
+
matched_value:
|
|
628
|
+
type: string
|
|
629
|
+
nullable: true
|
|
630
|
+
description: The identifier that matched. Null for non-exact matches.
|
|
631
|
+
example: "859182400000000001"
|
|
632
|
+
score:
|
|
633
|
+
type: number
|
|
634
|
+
description: Relevance score. Exact matches always score 1000.
|
|
635
|
+
example: 1000
|
|
636
|
+
identifiers:
|
|
637
|
+
type: object
|
|
638
|
+
properties:
|
|
639
|
+
ean:
|
|
640
|
+
type: array
|
|
641
|
+
items:
|
|
642
|
+
type: string
|
|
643
|
+
eic:
|
|
644
|
+
type: array
|
|
645
|
+
items:
|
|
646
|
+
type: string
|
|
647
|
+
om:
|
|
648
|
+
type: array
|
|
649
|
+
items:
|
|
650
|
+
type: string
|
|
651
|
+
geometry:
|
|
652
|
+
type: object
|
|
653
|
+
nullable: true
|
|
654
|
+
description: Building outline as GeoJSON geometry in WGS84 (EPSG:4326).
|
|
655
|
+
properties:
|
|
656
|
+
type:
|
|
657
|
+
type: string
|
|
658
|
+
example: MultiPolygon
|
|
659
|
+
coordinates:
|
|
660
|
+
type: array
|
|
661
|
+
items: {}
|
|
662
|
+
bbox:
|
|
663
|
+
type: array
|
|
664
|
+
nullable: true
|
|
665
|
+
description: "[minLon, minLat, maxLon, maxLat] in WGS84, for zooming the map."
|
|
666
|
+
items:
|
|
667
|
+
type: number
|
|
668
|
+
minItems: 4
|
|
669
|
+
maxItems: 4
|
|
670
|
+
example: [14.4174, 50.0863, 14.4188, 50.0873]
|
|
671
|
+
centroid:
|
|
672
|
+
type: object
|
|
673
|
+
nullable: true
|
|
674
|
+
properties:
|
|
675
|
+
lat:
|
|
676
|
+
type: number
|
|
677
|
+
example: 50.0868
|
|
678
|
+
lon:
|
|
679
|
+
type: number
|
|
680
|
+
example: 14.4181
|
|
681
|
+
geometry_source:
|
|
682
|
+
type: string
|
|
683
|
+
nullable: true
|
|
684
|
+
description: Source of the geometry, null when the building has none.
|
|
685
|
+
example: eno_geometrie
|
|
686
|
+
has_building_record:
|
|
687
|
+
type: boolean
|
|
688
|
+
description: >-
|
|
689
|
+
False when the GID is known only through the consumption-point mapping or Porsenna
|
|
690
|
+
and has no eno_budova record. Such results are ranked below described buildings.
|
|
691
|
+
example: true
|
|
692
|
+
active_points_count:
|
|
693
|
+
type: integer
|
|
694
|
+
example: 3
|
|
695
|
+
# Every property is emitted unconditionally by DedBuildingSearchTransformation - the
|
|
696
|
+
# nullable ones are present with a null value, never absent.
|
|
697
|
+
required:
|
|
698
|
+
- gid
|
|
699
|
+
- name
|
|
700
|
+
- designation
|
|
701
|
+
- registration_unit
|
|
702
|
+
- address
|
|
703
|
+
- addresses
|
|
704
|
+
- matched_by
|
|
705
|
+
- matched_value
|
|
706
|
+
- score
|
|
707
|
+
- identifiers
|
|
708
|
+
- geometry
|
|
709
|
+
- bbox
|
|
710
|
+
- centroid
|
|
711
|
+
- geometry_source
|
|
712
|
+
- has_building_record
|
|
713
|
+
- active_points_count
|
|
714
|
+
|
|
715
|
+
EnergeticsEnoRegistrationUnit:
|
|
716
|
+
type: object
|
|
717
|
+
description: >-
|
|
718
|
+
Evidenční jednotka (eno_ciselnik_evidencni_jednotka) resolved through the building's
|
|
719
|
+
eno_majetek record. The same shape is returned by the search and the detail endpoint.
|
|
720
|
+
properties:
|
|
721
|
+
id:
|
|
722
|
+
type: number
|
|
723
|
+
nullable: true
|
|
724
|
+
example: 7001
|
|
725
|
+
kod:
|
|
726
|
+
type: string
|
|
727
|
+
nullable: true
|
|
728
|
+
example: EJ-7001
|
|
729
|
+
nazev:
|
|
730
|
+
type: string
|
|
731
|
+
nullable: true
|
|
732
|
+
example: Evidenční jednotka Praha 10
|
|
733
|
+
typ:
|
|
734
|
+
type: string
|
|
735
|
+
nullable: true
|
|
736
|
+
example: škola
|
|
737
|
+
required:
|
|
738
|
+
- id
|
|
739
|
+
- kod
|
|
740
|
+
- nazev
|
|
741
|
+
- typ
|
|
742
|
+
|
|
508
743
|
EnergeticsEnoBuildingDetail:
|
|
509
744
|
type: object
|
|
510
745
|
properties:
|
|
@@ -541,6 +776,62 @@ components:
|
|
|
541
776
|
type: string
|
|
542
777
|
nullable: true
|
|
543
778
|
additionalProperties: true
|
|
779
|
+
property:
|
|
780
|
+
type: object
|
|
781
|
+
nullable: true
|
|
782
|
+
description: >-
|
|
783
|
+
ENO lookup data (eno_ciselnik_*) resolved through the building's eno_majetek record.
|
|
784
|
+
Null when the building has no majetek record.
|
|
785
|
+
properties:
|
|
786
|
+
registration_unit:
|
|
787
|
+
allOf:
|
|
788
|
+
- $ref: "#/components/schemas/EnergeticsEnoRegistrationUnit"
|
|
789
|
+
nullable: true
|
|
790
|
+
description: Evidenční jednotka (eno_ciselnik_evidencni_jednotka).
|
|
791
|
+
managers:
|
|
792
|
+
type: object
|
|
793
|
+
description: Správci (eno_ciselnik_spravce) from the mandate and accounting-unit references.
|
|
794
|
+
properties:
|
|
795
|
+
mandate:
|
|
796
|
+
type: object
|
|
797
|
+
nullable: true
|
|
798
|
+
description: Správce referenced by eno_majetek.id_maj_spravce_mandatni.
|
|
799
|
+
properties:
|
|
800
|
+
id:
|
|
801
|
+
type: number
|
|
802
|
+
nullable: true
|
|
803
|
+
kod:
|
|
804
|
+
type: string
|
|
805
|
+
nullable: true
|
|
806
|
+
nazev:
|
|
807
|
+
type: string
|
|
808
|
+
nullable: true
|
|
809
|
+
ic:
|
|
810
|
+
type: string
|
|
811
|
+
nullable: true
|
|
812
|
+
dic:
|
|
813
|
+
type: string
|
|
814
|
+
nullable: true
|
|
815
|
+
accounting_unit:
|
|
816
|
+
type: object
|
|
817
|
+
nullable: true
|
|
818
|
+
description: Správce referenced by eno_majetek.id_maj_spravce_ucet_jednotka.
|
|
819
|
+
properties:
|
|
820
|
+
id:
|
|
821
|
+
type: number
|
|
822
|
+
nullable: true
|
|
823
|
+
kod:
|
|
824
|
+
type: string
|
|
825
|
+
nullable: true
|
|
826
|
+
nazev:
|
|
827
|
+
type: string
|
|
828
|
+
nullable: true
|
|
829
|
+
ic:
|
|
830
|
+
type: string
|
|
831
|
+
nullable: true
|
|
832
|
+
dic:
|
|
833
|
+
type: string
|
|
834
|
+
nullable: true
|
|
544
835
|
addresses:
|
|
545
836
|
type: array
|
|
546
837
|
items:
|