@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.
Files changed (72) hide show
  1. package/db/example/00_clear_test_data.sql +5 -0
  2. package/db/example/06_eno.sql +11 -0
  3. package/db/example/08_ded_search.sql +25 -0
  4. package/db/migrations/postgresql/20260807092000-ded-building-search.js +53 -0
  5. package/db/migrations/postgresql/sqls/20260807092000-ded-building-search-down.sql +41 -0
  6. package/db/migrations/postgresql/sqls/20260807092000-ded-building-search-up.sql +262 -0
  7. package/db/scripts/ded_gid_mapping_mock_import.sql +82 -23
  8. package/dist/integration-engine/enapo/ioc/Di.js +5 -1
  9. package/dist/integration-engine/enapo/ioc/Di.js.map +1 -1
  10. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.d.ts +2 -0
  11. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js +2 -0
  12. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js.map +1 -1
  13. package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.d.ts +7 -0
  14. package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.js +50 -0
  15. package/dist/integration-engine/enapo/repositories/DedSearchIndexRepository.js.map +1 -0
  16. package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.d.ts +7 -0
  17. package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.js +3 -0
  18. package/dist/integration-engine/enapo/repositories/interfaces/IDedSearchIndexRepository.js.map +1 -0
  19. package/dist/integration-engine/enapo/workers/EnapoWorker.js +1 -0
  20. package/dist/integration-engine/enapo/workers/EnapoWorker.js.map +1 -1
  21. package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.d.ts +21 -0
  22. package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.js +58 -0
  23. package/dist/integration-engine/enapo/workers/task/DedSearchIndexRefreshTask.js.map +1 -0
  24. package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.d.ts +13 -1
  25. package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js +25 -2
  26. package/dist/integration-engine/enapo/workers/task/EnoGeometryTask.js.map +1 -1
  27. package/dist/output-gateway/constants/DedSearchWeights.d.ts +60 -0
  28. package/dist/output-gateway/constants/DedSearchWeights.js +42 -0
  29. package/dist/output-gateway/constants/DedSearchWeights.js.map +1 -0
  30. package/dist/output-gateway/controllers/v2/EnoBuildingsController.d.ts +6 -1
  31. package/dist/output-gateway/controllers/v2/EnoBuildingsController.js +29 -2
  32. package/dist/output-gateway/controllers/v2/EnoBuildingsController.js.map +1 -1
  33. package/dist/output-gateway/ioc/Di.js +5 -1
  34. package/dist/output-gateway/ioc/Di.js.map +1 -1
  35. package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +2 -0
  36. package/dist/output-gateway/ioc/ModuleContainerToken.js +2 -0
  37. package/dist/output-gateway/ioc/ModuleContainerToken.js.map +1 -1
  38. package/dist/output-gateway/models/DedBuildingSearchViewModel.d.ts +30 -0
  39. package/dist/output-gateway/models/DedBuildingSearchViewModel.js +38 -0
  40. package/dist/output-gateway/models/DedBuildingSearchViewModel.js.map +1 -0
  41. package/dist/output-gateway/models/EnoBuildingDetailViewModel.d.ts +14 -0
  42. package/dist/output-gateway/models/EnoBuildingDetailViewModel.js +14 -0
  43. package/dist/output-gateway/models/EnoBuildingDetailViewModel.js.map +1 -1
  44. package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.d.ts +24 -0
  45. package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.js +3 -0
  46. package/dist/output-gateway/models/interfaces/IDedBuildingSearchView.js.map +1 -0
  47. package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.d.ts +14 -0
  48. package/dist/output-gateway/repositories/DedBuildingSearchRepository.d.ts +16 -0
  49. package/dist/output-gateway/repositories/DedBuildingSearchRepository.js +250 -0
  50. package/dist/output-gateway/repositories/DedBuildingSearchRepository.js.map +1 -0
  51. package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.d.ts +14 -0
  52. package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.js +3 -0
  53. package/dist/output-gateway/repositories/interfaces/IDedBuildingSearchRow.js.map +1 -0
  54. package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.d.ts +50 -0
  55. package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.js +3 -0
  56. package/dist/output-gateway/routers/interfaces/IDedBuildingSearchResponse.js.map +1 -0
  57. package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.d.ts +23 -1
  58. package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.d.ts +11 -0
  59. package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.js +3 -0
  60. package/dist/output-gateway/routers/interfaces/IEnoRegistrationUnit.js.map +1 -0
  61. package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.d.ts +2 -0
  62. package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js +5 -0
  63. package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js.map +1 -1
  64. package/dist/output-gateway/transformations/DedBuildingSearchTransformation.d.ts +11 -0
  65. package/dist/output-gateway/transformations/DedBuildingSearchTransformation.js +57 -0
  66. package/dist/output-gateway/transformations/DedBuildingSearchTransformation.js.map +1 -0
  67. package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.d.ts +4 -0
  68. package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js +44 -1
  69. package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js.map +1 -1
  70. package/docs/implementation_documentation.md +49 -0
  71. package/docs/openapi-output.yaml +291 -0
  72. package/package.json +1 -1
@@ -11,7 +11,12 @@ truncate enapo_measurements;
11
11
  truncate enapo_pre_metadata_history;
12
12
  truncate enapo_gid_mapping;
13
13
  truncate eno_budova;
14
+ truncate eno_majetek;
15
+ truncate eno_ciselnik_evidencni_jednotka;
16
+ truncate eno_ciselnik_spravce;
14
17
  truncate eno_adresa;
18
+ truncate eno_geometrie;
19
+ truncate eno_vyrazeno;
15
20
  truncate enapo_ppas_distribution_invoice;
16
21
  truncate enapo_ppas_distribution_installation;
17
22
  truncate enapo_ppas_distribution_invoice_device;
@@ -23,3 +23,14 @@ INSERT INTO eno_adresa (gid, gid_typ, poradi, zdroj, id, popis, hlavni) VALUES
23
23
  ('GID100', 'budova', 4, 'mhmp', 505, NULL, false),
24
24
  ('GID200', 'budova', 1, 'mhmp', 503, 'Vedlejší 7, 100 00 Praha 10', true),
25
25
  ('GIDADDR1', 'stavba', 1, 'mhmp', 506, 'Stavební 9, 100 00 Praha 10', true);
26
+
27
+ -- GID100 (mhmp) is owned property linked to an evidenční jednotka and two správci; GID200 has no majetek row.
28
+ INSERT INTO eno_majetek (gid, gid_typ, zdroj, id_maj_evidencni_jednotka, id_maj_spravce_mandatni, id_maj_spravce_ucet_jednotka, v_majetku) VALUES
29
+ ('GID100', 'budova', 'mhmp', 7001, 8001, 8002, true);
30
+
31
+ INSERT INTO eno_ciselnik_evidencni_jednotka (guid, aktivni, id, kod, nazev, typ, platnost_od) VALUES
32
+ ('11111111-1111-1111-1111-111111111111', true, 7001, 'EJ-7001', 'Evidenční jednotka Praha 10', 'škola', '2020-01-01');
33
+
34
+ INSERT INTO eno_ciselnik_spravce (guid, aktivni, id_maj_spravce, id_organizace, kod, nazev, ic, dic, platnost_od) VALUES
35
+ ('22222222-2222-2222-2222-222222222222', true, 8001, 501, 'SPR-8001', 'Správce mandátní', '11111111', 'CZ11111111', '2020-01-01'),
36
+ ('33333333-3333-3333-3333-333333333333', true, 8002, 502, 'SPR-8002', 'Správce účetní jednotka', '22222222', 'CZ22222222', '2020-01-01');
@@ -0,0 +1,25 @@
1
+ -- Fixtures for the DeD building search endpoint.
2
+ -- Loaded last (08_ prefix) because it rebuilds mv_ded_building_search from everything above.
3
+
4
+ -- Building that is discarded in ENO - it must never appear in search results even though it has a
5
+ -- name, an address and a consumption point.
6
+ INSERT INTO eno_budova (gid, zdroj, nazev, oznaceni, platnost_od) VALUES
7
+ ('GIDDEL1', 'mhmp', 'ZŠ Vyřazená', 'ZŠV', '2019-01-01');
8
+
9
+ INSERT INTO eno_adresa (gid, gid_typ, poradi, zdroj, id, popis, hlavni) VALUES
10
+ ('GIDDEL1', 'budova', 1, 'mhmp', 601, 'Vyřazená 1, 100 00 Praha 10', true);
11
+
12
+ INSERT INTO eno_vyrazeno (gid, gid_typ, zdroj) VALUES
13
+ ('GIDDEL1', 'budova', 'mhmp');
14
+
15
+ -- Geometry in S-JTSK (EPSG 5514), the ENO default. GID100 has two polygons so the collected
16
+ -- geometry is a MultiPolygon and the bbox has to span both.
17
+ INSERT INTO eno_geometrie (gid, zdroj, poradi, id_organizace, uzivatelsky_zakres, zakres, epsg_code) VALUES
18
+ ('GID100', 'mhmp', 1, 1, false,
19
+ 'POLYGON((-743100 -1043100, -743050 -1043100, -743050 -1043050, -743100 -1043050, -743100 -1043100))', '5514'),
20
+ ('GID100', 'mhmp', 2, 1, false,
21
+ 'POLYGON((-743050 -1043050, -743000 -1043050, -743000 -1043000, -743050 -1043000, -743050 -1043050))', '5514'),
22
+ -- Unparsable geometry must degrade to NULL instead of aborting the index refresh.
23
+ ('GID200', 'mhmp', 1, 1, false, 'THIS IS NOT WKT', '5514');
24
+
25
+ REFRESH MATERIALIZED VIEW mv_ded_building_search;
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var dbm;
4
+ var type;
5
+ var seed;
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+ var Promise;
9
+
10
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20260807092000-ded-building-search-up.sql');
23
+ return new Promise( function( resolve, reject ) {
24
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
25
+ if (err) return reject(err);
26
+ console.log('received data: ' + data);
27
+
28
+ resolve(data);
29
+ });
30
+ })
31
+ .then(function(data) {
32
+ return db.runSql(data);
33
+ });
34
+ };
35
+
36
+ exports.down = function(db) {
37
+ var filePath = path.join(__dirname, 'sqls', '20260807092000-ded-building-search-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,41 @@
1
+ DROP MATERIALIZED VIEW IF EXISTS mv_ded_building_search;
2
+
3
+ DROP FUNCTION IF EXISTS f_ded_safe_geom(text, varchar);
4
+
5
+ -- Restore v_enapo_building_detail to the pre-search definition (migration 20260807090000), dropping the
6
+ -- ENO lookup columns this migration added. The view is dropped and recreated rather than replaced because
7
+ -- CREATE OR REPLACE VIEW cannot remove columns; the dependent mv_ded_building_search is already gone above.
8
+ DROP VIEW IF EXISTS v_enapo_building_detail;
9
+
10
+ CREATE VIEW v_enapo_building_detail AS
11
+ SELECT DISTINCT ON (b.gid)
12
+ b.gid,
13
+ b.zdroj,
14
+ b.nazev,
15
+ b.oznaceni,
16
+ b.druh_vytapeni,
17
+ b.pripojka_elektro,
18
+ b.pripojka_voda,
19
+ b.pripojka_kanalizace,
20
+ b.budova_rozdelena_byt_nebyt,
21
+ b.celkova_plocha_budova,
22
+ b.celkova_plocha_byt_budova,
23
+ b.celkova_plocha_nebyt_budova,
24
+ b.zastavena_plocha,
25
+ b.obestaveny_prostor,
26
+ b.pocet_byt,
27
+ b.pocet_nebyt_budova,
28
+ b.pocet_nadzem_podlazi,
29
+ b.pocet_podzem_podlazi,
30
+ b.pocet_podkrovi,
31
+ b.vytah,
32
+ b.czcc,
33
+ b.id_cuzk,
34
+ b.id_objekt,
35
+ b.kod_vyuziti,
36
+ b.nazev_vyuziti,
37
+ b.kod_ochrana,
38
+ b.nazev_ochrana,
39
+ b.platnost_od
40
+ FROM eno_budova b
41
+ ORDER BY b.gid, b.zdroj;
@@ -0,0 +1,262 @@
1
+ -- Trigram matching for the fuzzy part of the search. IF NOT EXISTS keeps the migration re-runnable
2
+ -- on environments that already have it; note it does NOT relocate an installation sitting in another
3
+ -- schema - the index definitions below reference public.gist_trgm_ops, so if the extension lives
4
+ -- elsewhere, move it first with ALTER EXTENSION pg_trgm SET SCHEMA public.
5
+ CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;
6
+ CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
7
+
8
+ -- Text is normalised with lower(public.unaccent(...)) so that searching without Czech diacritics
9
+ -- works. The same expression is applied to the incoming query in the search repository - keep the
10
+ -- two in sync, otherwise the normalised columns stop matching what is searched for.
11
+ -- unaccent is STABLE rather than IMMUTABLE, which is fine here: the normalised text is stored as
12
+ -- real columns of the materialized view and the trigram indexes are built on those columns, not on
13
+ -- an expression.
14
+
15
+ -- ENO geometry is stored as WKT text with a per-row EPSG code (S-JTSK 5514 by default).
16
+ -- Malformed WKT would abort the whole REFRESH, so the conversion returns NULL instead of raising.
17
+ CREATE OR REPLACE FUNCTION f_ded_safe_geom(wkt text, epsg varchar)
18
+ RETURNS public.geometry
19
+ LANGUAGE plpgsql
20
+ IMMUTABLE
21
+ PARALLEL SAFE
22
+ AS $$
23
+ BEGIN
24
+ RETURN public.ST_Transform(
25
+ public.ST_SetSRID(public.ST_GeomFromText(wkt), COALESCE(NULLIF(epsg, '')::int, 5514)),
26
+ 4326
27
+ );
28
+ EXCEPTION WHEN OTHERS THEN
29
+ RETURN NULL;
30
+ END;
31
+ $$;
32
+
33
+ COMMENT ON FUNCTION f_ded_safe_geom(text, varchar) IS
34
+ 'Converts an eno_geometrie WKT polygon to EPSG:4326, returning NULL for unparsable geometry instead of raising (a single bad row must not abort the search index refresh).';
35
+
36
+ -- Building detail view, expanded with the ENO lookups (eno_ciselnik_*) resolved through eno_majetek:
37
+ -- the evidenční jednotka and both správci (mandate and accounting-unit). Kept as one row per building
38
+ -- GID via DISTINCT ON; the mv_ded_building_search below depends on this view, so it must be defined first.
39
+ --
40
+ -- The LATERALs pick the latest row by platnost_od and deliberately do NOT filter on aktivni: every
41
+ -- existing ENO repository in this module reads these lookups the same way, and the endpoint has to keep
42
+ -- reporting the správce/evidenční jednotka a building was last assigned to even after that lookup row is
43
+ -- deactivated. If the ENO data contract ever says a deactivated row must disappear from the detail, the
44
+ -- filter belongs in all ENO consumers at once, not only here.
45
+ CREATE OR REPLACE VIEW v_enapo_building_detail AS
46
+ SELECT DISTINCT ON (b.gid)
47
+ b.gid,
48
+ b.zdroj,
49
+ b.nazev,
50
+ b.oznaceni,
51
+ b.druh_vytapeni,
52
+ b.pripojka_elektro,
53
+ b.pripojka_voda,
54
+ b.pripojka_kanalizace,
55
+ b.budova_rozdelena_byt_nebyt,
56
+ b.celkova_plocha_budova,
57
+ b.celkova_plocha_byt_budova,
58
+ b.celkova_plocha_nebyt_budova,
59
+ b.zastavena_plocha,
60
+ b.obestaveny_prostor,
61
+ b.pocet_byt,
62
+ b.pocet_nebyt_budova,
63
+ b.pocet_nadzem_podlazi,
64
+ b.pocet_podzem_podlazi,
65
+ b.pocet_podkrovi,
66
+ b.vytah,
67
+ b.czcc,
68
+ b.id_cuzk,
69
+ b.id_objekt,
70
+ b.kod_vyuziti,
71
+ b.nazev_vyuziti,
72
+ b.kod_ochrana,
73
+ b.nazev_ochrana,
74
+ b.platnost_od,
75
+ ej.ej_id,
76
+ ej.ej_kod,
77
+ ej.ej_nazev,
78
+ ej.ej_typ,
79
+ spm.sp_id AS spm_id,
80
+ spm.sp_kod AS spm_kod,
81
+ spm.sp_nazev AS spm_nazev,
82
+ spm.sp_ic AS spm_ic,
83
+ spm.sp_dic AS spm_dic,
84
+ spu.sp_id AS spu_id,
85
+ spu.sp_kod AS spu_kod,
86
+ spu.sp_nazev AS spu_nazev,
87
+ spu.sp_ic AS spu_ic,
88
+ spu.sp_dic AS spu_dic
89
+ FROM eno_budova b
90
+ LEFT JOIN eno_majetek m
91
+ ON m.gid = b.gid
92
+ AND m.gid_typ = 'budova'
93
+ AND m.zdroj = b.zdroj
94
+ LEFT JOIN LATERAL (
95
+ SELECT
96
+ e.id AS ej_id,
97
+ e.kod AS ej_kod,
98
+ e.nazev AS ej_nazev,
99
+ e.typ AS ej_typ
100
+ FROM eno_ciselnik_evidencni_jednotka e
101
+ WHERE e.id = m.id_maj_evidencni_jednotka
102
+ ORDER BY e.platnost_od DESC NULLS LAST
103
+ LIMIT 1
104
+ ) ej ON true
105
+ LEFT JOIN LATERAL (
106
+ SELECT
107
+ s.id_maj_spravce AS sp_id,
108
+ s.kod AS sp_kod,
109
+ s.nazev AS sp_nazev,
110
+ s.ic AS sp_ic,
111
+ s.dic AS sp_dic
112
+ FROM eno_ciselnik_spravce s
113
+ WHERE s.id_maj_spravce = m.id_maj_spravce_mandatni
114
+ ORDER BY s.platnost_od DESC NULLS LAST
115
+ LIMIT 1
116
+ ) spm ON true
117
+ LEFT JOIN LATERAL (
118
+ SELECT
119
+ s.id_maj_spravce AS sp_id,
120
+ s.kod AS sp_kod,
121
+ s.nazev AS sp_nazev,
122
+ s.ic AS sp_ic,
123
+ s.dic AS sp_dic
124
+ FROM eno_ciselnik_spravce s
125
+ WHERE s.id_maj_spravce = m.id_maj_spravce_ucet_jednotka
126
+ ORDER BY s.platnost_od DESC NULLS LAST
127
+ LIMIT 1
128
+ ) spu ON true
129
+ ORDER BY b.gid, b.zdroj;
130
+
131
+ -- One row per building GID, precomputed for the DeD search endpoint.
132
+ -- Materialized because v_enapo_building_consumption_points carries three LEFT JOIN LATERALs plus a
133
+ -- UNION ALL branch per point and the geometry needs a PostGIS transform - too much to recompute on
134
+ -- every keystroke of an autocomplete.
135
+ -- Scope: buildings only (eno_budova / gid_typ = 'budova'), eno_stavba is deliberately not covered.
136
+ CREATE MATERIALIZED VIEW mv_ded_building_search AS
137
+ WITH searchable_gid AS (
138
+ SELECT gid FROM v_enapo_building_detail
139
+ UNION
140
+ SELECT gid FROM enapo_gid_mapping
141
+ UNION
142
+ SELECT gid FROM v_enapo_building_porsenna_devices
143
+ ),
144
+ active_gid AS (
145
+ SELECT g.gid
146
+ FROM searchable_gid g
147
+ WHERE NOT EXISTS (
148
+ SELECT 1
149
+ FROM eno_vyrazeno v
150
+ WHERE v.gid = g.gid AND v.gid_typ = 'budova'
151
+ )
152
+ ),
153
+ building_address AS (
154
+ SELECT
155
+ a.gid,
156
+ array_agg(a.popis::text ORDER BY a.hlavni DESC NULLS LAST, a.poradi ASC) AS addresses
157
+ FROM (
158
+ SELECT DISTINCT ON (gid, popis) gid, popis, hlavni, poradi
159
+ FROM eno_adresa
160
+ WHERE gid_typ = 'budova' AND popis IS NOT NULL
161
+ ORDER BY gid, popis, hlavni DESC NULLS LAST, poradi ASC
162
+ ) a
163
+ GROUP BY a.gid
164
+ ),
165
+ building_point AS (
166
+ SELECT
167
+ gid,
168
+ COALESCE(array_agg(DISTINCT place_id::text ORDER BY place_id::text) FILTER (WHERE id_type = 'ean'), '{}'::text[]) AS ean,
169
+ COALESCE(array_agg(DISTINCT place_id::text ORDER BY place_id::text) FILTER (WHERE id_type = 'eic'), '{}'::text[]) AS eic,
170
+ COALESCE(array_agg(DISTINCT place_id::text ORDER BY place_id::text) FILTER (WHERE id_type = 'om'), '{}'::text[]) AS om,
171
+ count(*) FILTER (WHERE is_active) AS active_points_count
172
+ FROM v_enapo_building_consumption_points
173
+ GROUP BY gid
174
+ ),
175
+ building_geometry AS (
176
+ SELECT
177
+ gid,
178
+ public.ST_Multi(public.ST_Collect(f_ded_safe_geom(zakres, epsg_code))) AS geom
179
+ FROM eno_geometrie
180
+ WHERE zakres IS NOT NULL
181
+ GROUP BY gid
182
+ )
183
+ SELECT
184
+ g.gid::text AS gid,
185
+ b.nazev::text AS nazev,
186
+ b.oznaceni::text AS oznaceni,
187
+ -- The whole evidenční jednotka is carried so the search response can use the same shape as the
188
+ -- building detail endpoint (id / kod / nazev / typ) instead of a narrower look-alike.
189
+ b.ej_id AS ej_id,
190
+ b.ej_kod::text AS ej_kod,
191
+ b.ej_nazev::text AS ej_nazev,
192
+ b.ej_typ::text AS ej_typ,
193
+ a.addresses[1] AS address_main,
194
+ COALESCE(a.addresses, '{}'::text[]) AS addresses,
195
+ COALESCE(p.ean, '{}'::text[]) AS ean,
196
+ COALESCE(p.eic, '{}'::text[]) AS eic,
197
+ COALESCE(p.om, '{}'::text[]) AS om,
198
+ COALESCE(p.active_points_count, 0) AS active_points_count,
199
+ (b.gid IS NOT NULL) AS has_building_record,
200
+ lower(public.unaccent(concat_ws(' ', b.nazev, b.oznaceni))) AS name_norm,
201
+ lower(public.unaccent(COALESCE(array_to_string(a.addresses, ' '), ''))) AS address_norm,
202
+ (
203
+ setweight(to_tsvector('simple', lower(public.unaccent(concat_ws(' ', b.nazev, b.oznaceni, b.ej_nazev)))), 'A') ||
204
+ setweight(to_tsvector('simple', lower(public.unaccent(COALESCE(a.addresses[1], '')))), 'B') ||
205
+ setweight(to_tsvector('simple', lower(public.unaccent(COALESCE(array_to_string(a.addresses[2:], ' '), '')))), 'C') ||
206
+ setweight(
207
+ to_tsvector(
208
+ 'simple',
209
+ lower(concat_ws(' ', array_to_string(COALESCE(p.ean, '{}') || COALESCE(p.eic, '{}') || COALESCE(p.om, '{}'), ' '), g.gid, b.ej_kod))
210
+ ),
211
+ 'D'
212
+ )
213
+ ) AS search_document,
214
+ geo.geom
215
+ FROM active_gid g
216
+ LEFT JOIN v_enapo_building_detail b ON b.gid = g.gid
217
+ LEFT JOIN building_address a ON a.gid = g.gid
218
+ LEFT JOIN building_point p ON p.gid = g.gid
219
+ LEFT JOIN building_geometry geo ON geo.gid = g.gid;
220
+
221
+ COMMENT ON MATERIALIZED VIEW mv_ded_building_search IS
222
+ 'Search index for the DeD building search endpoint - one row per building GID with the weighted tsvector, normalised name/address for trigram matching, EAN/EIC/OM identifiers for exact matching and the building geometry in EPSG:4326. Refreshed by the DedSearchIndexRefreshTask (integration engine).';
223
+
224
+ -- The internal_ prefix the DB conventions mandate for generated columns is a rule about tables: every
225
+ -- column of this object is derived, so prefixing all of them would carry no information and would break
226
+ -- the shared naming with v_enapo_building_detail. The intent behind the rule - being able to tell how a
227
+ -- value was produced - is met with a per-column comment on each computed column instead.
228
+ COMMENT ON COLUMN mv_ded_building_search.addresses IS
229
+ 'Distinct eno_adresa.popis of the building (gid_typ = ''budova''), ordered main address first, then by poradi.';
230
+ COMMENT ON COLUMN mv_ded_building_search.address_main IS 'First element of addresses, i.e. the main address.';
231
+ COMMENT ON COLUMN mv_ded_building_search.ean IS
232
+ 'Distinct EAN identifiers of the building consumption points (v_enapo_building_consumption_points, id_type = ''ean'').';
233
+ COMMENT ON COLUMN mv_ded_building_search.eic IS
234
+ 'Distinct EIC identifiers of the building consumption points (v_enapo_building_consumption_points, id_type = ''eic'').';
235
+ COMMENT ON COLUMN mv_ded_building_search.om IS
236
+ 'Distinct OM identifiers of the building consumption points (v_enapo_building_consumption_points, id_type = ''om'').';
237
+ COMMENT ON COLUMN mv_ded_building_search.active_points_count IS
238
+ 'Number of consumption points of the building flagged is_active in v_enapo_building_consumption_points.';
239
+ COMMENT ON COLUMN mv_ded_building_search.has_building_record IS
240
+ 'False when the GID reached the index only through enapo_gid_mapping or Porsenna and has no eno_budova record.';
241
+ COMMENT ON COLUMN mv_ded_building_search.name_norm IS
242
+ 'lower(public.unaccent(nazev || '' '' || oznaceni)); the trigram column matched against the equally normalised query.';
243
+ COMMENT ON COLUMN mv_ded_building_search.address_norm IS
244
+ 'lower(public.unaccent(...)) over all addresses joined by a space; the trigram column for address matching.';
245
+ COMMENT ON COLUMN mv_ded_building_search.search_document IS
246
+ 'Weighted tsvector: A = nazev + oznaceni + evidenční jednotka name, B = main address, C = secondary addresses, D = EAN/EIC/OM + gid + evidenční jednotka code.';
247
+ COMMENT ON COLUMN mv_ded_building_search.geom IS
248
+ 'eno_geometrie.zakres polygons of the GID collected into one MultiPolygon and transformed to EPSG:4326 by f_ded_safe_geom; NULL when no polygon is parsable.';
249
+
250
+ -- Required by REFRESH MATERIALIZED VIEW CONCURRENTLY.
251
+ CREATE UNIQUE INDEX mv_ded_building_search_gid_uidx ON mv_ded_building_search (gid);
252
+
253
+ CREATE INDEX mv_ded_building_search_document_gin ON mv_ded_building_search USING gin (search_document);
254
+
255
+ -- GiST rather than GIN on the trigram columns: only GiST supports the <-> distance operator used by
256
+ -- the nearest-neighbour candidate generator.
257
+ CREATE INDEX mv_ded_building_search_name_trgm ON mv_ded_building_search USING gist (name_norm public.gist_trgm_ops);
258
+ CREATE INDEX mv_ded_building_search_address_trgm ON mv_ded_building_search USING gist (address_norm public.gist_trgm_ops);
259
+
260
+ CREATE INDEX mv_ded_building_search_ean_gin ON mv_ded_building_search USING gin (ean);
261
+ CREATE INDEX mv_ded_building_search_eic_gin ON mv_ded_building_search USING gin (eic);
262
+ CREATE INDEX mv_ded_building_search_om_gin ON mv_ded_building_search USING gin (om);
@@ -10,39 +10,98 @@
10
10
  -- script can be re-run any time and never touches future non-mock (sync task) rows.
11
11
  -- - The dbt table has no primary key; DISTINCT ON collapses duplicates per (place_id, gid),
12
12
  -- preferring an active mapping (valid_to IS NULL) and then the newest valid_from.
13
- -- - commodity: EB codes are normalized to the DeD naming ('1' -> electricity, '2' -> gas),
14
- -- with a fallback derived from id_type for any other value.
13
+ -- - id_type / commodity are resolved from each other so a row survives when only one of the
14
+ -- two columns is filled: an explicit value wins, the other column is the fallback.
15
+ -- commodity uses EB codes ('1' -> electricity, '2' -> gas) as well as the DeD names.
16
+ -- Because the two are resolved independently, a source row filling both with values that
17
+ -- disagree (id_type = 'eic' with commodity = 'electricity') would otherwise be written as an
18
+ -- impossible pair. EAN is always electricity and EIC always gas, so such rows are skipped -
19
+ -- the same invariant must hold when the dbt sync task takes this logic over.
15
20
  -- - valid_to = 1900-01-01 is the EB placeholder for "not canceled" and is converted to NULL
16
21
  -- (dbt should already do this — the NULLIF is a defensive guard).
22
+ -- - place_id is capped at 50 chars by the target column; longer values are skipped rather
23
+ -- than letting the whole insert fail on a string-truncation error.
24
+ --
25
+ -- Run the pre-flight query in the comment at the bottom first to see what would be skipped.
17
26
 
18
27
  BEGIN;
19
28
 
20
29
  DELETE FROM energetics.enapo_gid_mapping WHERE link_source = 'mock';
21
30
 
31
+ WITH src AS (
32
+ SELECT
33
+ trim(s.place_id) AS place_id,
34
+ trim(s.gid) AS gid,
35
+ lower(trim(s.commodity)) AS commodity_raw,
36
+ lower(trim(s.id_type)) AS id_type_raw,
37
+ COALESCE(s.is_first_gid, false) AS is_first_gid,
38
+ s.valid_from,
39
+ NULLIF(s.valid_to, DATE '1900-01-01') AS valid_to
40
+ FROM analytic_dbt.ded_gid_mapping s
41
+ WHERE s.place_id IS NOT NULL AND trim(s.place_id) <> ''
42
+ AND s.gid IS NOT NULL AND trim(s.gid) <> ''
43
+ ), resolved AS (
44
+ SELECT
45
+ place_id,
46
+ gid,
47
+ is_first_gid,
48
+ valid_from,
49
+ valid_to,
50
+ CASE
51
+ WHEN id_type_raw IN ('ean', 'eic') THEN id_type_raw
52
+ WHEN commodity_raw IN ('1', 'electricity', 'elektrina') THEN 'ean'
53
+ WHEN commodity_raw IN ('2', 'gas', 'plyn') THEN 'eic'
54
+ END AS id_type,
55
+ CASE
56
+ WHEN commodity_raw IN ('1', 'electricity', 'elektrina') THEN 'electricity'
57
+ WHEN commodity_raw IN ('2', 'gas', 'plyn') THEN 'gas'
58
+ WHEN id_type_raw = 'ean' THEN 'electricity'
59
+ WHEN id_type_raw = 'eic' THEN 'gas'
60
+ END AS commodity
61
+ FROM src
62
+ WHERE length(place_id) <= 50
63
+ )
22
64
  INSERT INTO energetics.enapo_gid_mapping
23
65
  (place_id, id_type, commodity, gid, is_first_gid, link_source, valid_from, valid_to)
24
- SELECT DISTINCT ON (trim(s.place_id), trim(s.gid))
25
- trim(s.place_id),
26
- lower(trim(s.id_type)),
27
- CASE
28
- WHEN trim(s.commodity) = '1' THEN 'electricity'
29
- WHEN trim(s.commodity) = '2' THEN 'gas'
30
- WHEN lower(trim(s.id_type)) = 'ean' THEN 'electricity'
31
- WHEN lower(trim(s.id_type)) = 'eic' THEN 'gas'
32
- END,
33
- trim(s.gid),
34
- COALESCE(s.is_first_gid, false),
66
+ SELECT DISTINCT ON (r.place_id, r.gid)
67
+ r.place_id,
68
+ r.id_type,
69
+ r.commodity,
70
+ r.gid,
71
+ r.is_first_gid,
35
72
  'mock',
36
- s.valid_from,
37
- NULLIF(s.valid_to, DATE '1900-01-01')
38
- FROM analytic_dbt.ded_gid_mapping s
39
- WHERE s.place_id IS NOT NULL AND trim(s.place_id) <> ''
40
- AND s.gid IS NOT NULL AND trim(s.gid) <> ''
41
- AND lower(trim(s.id_type)) IN ('ean', 'eic')
73
+ r.valid_from,
74
+ r.valid_to
75
+ FROM resolved r
76
+ WHERE r.id_type IS NOT NULL
77
+ AND r.commodity IS NOT NULL
78
+ -- Drops rows whose source id_type and commodity contradict each other; the two CASE
79
+ -- expressions above resolve independently and cannot catch the disagreement themselves.
80
+ AND (r.id_type, r.commodity) IN (('ean', 'electricity'), ('eic', 'gas'))
42
81
  ORDER BY
43
- trim(s.place_id),
44
- trim(s.gid),
45
- (s.valid_to IS NULL OR s.valid_to = DATE '1900-01-01') DESC,
46
- s.valid_from DESC NULLS LAST;
82
+ r.place_id,
83
+ r.gid,
84
+ (r.valid_to IS NULL) DESC,
85
+ r.valid_from DESC NULLS LAST;
47
86
 
48
87
  COMMIT;
88
+
89
+ -- Pre-flight / post-check on the source table: which (id_type, commodity) combinations exist,
90
+ -- how many rows each holds, whether this script can resolve them and whether the two columns
91
+ -- contradict each other (contradicting rows are skipped by the insert above).
92
+ --
93
+ -- SELECT
94
+ -- lower(trim(id_type)) AS id_type_raw,
95
+ -- lower(trim(commodity)) AS commodity_raw,
96
+ -- count(*) AS rows,
97
+ -- count(*) FILTER (WHERE length(trim(place_id)) > 50) AS too_long_place_id,
98
+ -- lower(trim(id_type)) IN ('ean', 'eic')
99
+ -- OR lower(trim(commodity)) IN ('1', '2', 'electricity', 'elektrina', 'gas', 'plyn') AS resolvable,
100
+ -- (lower(trim(id_type)) = 'ean' AND lower(trim(commodity)) IN ('2', 'gas', 'plyn'))
101
+ -- OR (lower(trim(id_type)) = 'eic' AND lower(trim(commodity)) IN ('1', 'electricity', 'elektrina'))
102
+ -- AS contradicting
103
+ -- FROM analytic_dbt.ded_gid_mapping
104
+ -- WHERE place_id IS NOT NULL AND trim(place_id) <> ''
105
+ -- AND gid IS NOT NULL AND trim(gid) <> ''
106
+ -- GROUP BY 1, 2
107
+ -- ORDER BY rows DESC;
@@ -17,6 +17,7 @@ const EnoAddressRepository_1 = require("../repositories/eno/EnoAddressRepository
17
17
  const EnoBuildingRepository_1 = require("../repositories/eno/EnoBuildingRepository");
18
18
  const EnoEJRepository_1 = require("../repositories/eno/EnoEJRepository");
19
19
  const EnoGeometryRepository_1 = require("../repositories/eno/EnoGeometryRepository");
20
+ const DedSearchIndexRepository_1 = require("../repositories/DedSearchIndexRepository");
20
21
  const EnoLocationRepository_1 = require("../repositories/eno/EnoLocationRepository");
21
22
  const EnoManagerRepository_1 = require("../repositories/eno/EnoManagerRepository");
22
23
  const EnoOrganizationRepository_1 = require("../repositories/eno/EnoOrganizationRepository");
@@ -53,6 +54,7 @@ const EnapoPpasTask_1 = require("../workers/task/EnapoPpasTask");
53
54
  const EnapoPrediTask_1 = require("../workers/task/EnapoPrediTask");
54
55
  const EnoBuildingTask_1 = require("../workers/task/EnoBuildingTask");
55
56
  const EnoGeometryTask_1 = require("../workers/task/EnoGeometryTask");
57
+ const DedSearchIndexRefreshTask_1 = require("../workers/task/DedSearchIndexRefreshTask");
56
58
  const EnoLookupTask_1 = require("../workers/task/EnoLookupTask");
57
59
  const EnoStructureTask_1 = require("../workers/task/EnoStructureTask");
58
60
  const PorsennaDistributionTask_1 = require("../workers/task/PorsennaDistributionTask");
@@ -85,6 +87,7 @@ EnapoContainer.register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.En
85
87
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoRemovedGIDRepository, EnoRemovedGIDRepository_1.EnoRemovedGIDRepository)
86
88
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoStructureRepository, EnoStructureRepository_1.EnoStructureRepository)
87
89
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoGeometryRepository, EnoGeometryRepository_1.EnoGeometryRepository)
90
+ .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.DedSearchIndexRepository, DedSearchIndexRepository_1.DedSearchIndexRepository)
88
91
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PpasDistributionInvoiceDeviceRepository, PpasDistributionInvoiceDeviceRepository_1.PpasDistributionInvoiceDeviceRepository)
89
92
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PpasDistributionInvoiceInstallationRepository, PpasDistributionInvoiceInstallationRepository_1.PpasDistributionInvoiceInstallationRepository)
90
93
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PpasDistributionInvoicePriceRepository, PpasDistributionInvoicePriceRepository_1.PpasDistributionInvoicePriceRepository)
@@ -120,5 +123,6 @@ EnapoContainer.register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.En
120
123
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnoGeometryTask, EnoGeometryTask_1.EnoGeometryTask)
121
124
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoPpasDistributionTask, EnapoPpasDistributionTask_1.EnapoPpasDistributionTask)
122
125
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoPpasCommercialTask, EnapoPpasCommercialTask_1.EnapoPpasCommercialTask)
123
- .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDistributionTask, PorsennaDistributionTask_1.PorsennaDistributionTask);
126
+ .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDistributionTask, PorsennaDistributionTask_1.PorsennaDistributionTask)
127
+ .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.DedSearchIndexRefreshTask, DedSearchIndexRefreshTask_1.DedSearchIndexRefreshTask);
124
128
  //# sourceMappingURL=Di.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iIAA4H;AAC5H,qHAAgH;AAChH,kIAA6H;AAC7H,6FAAwF;AACxF,qEAA0F;AAE1F,kFAA+E;AAC/E,mGAAgG;AAChG,mFAAgF;AAChF,sGAAmG;AACnG,4GAAyG;AACzG,6FAA0F;AAC1F,+FAA4F;AAC5F,mFAAgF;AAChF,qFAAkF;AAClF,yEAAsE;AACtE,qFAAkF;AAClF,qFAAkF;AAClF,mFAAgF;AAChF,6FAA0F;AAC1F,qFAAkF;AAClF,yFAAsF;AACtF,uFAAoF;AACpF,+FAA4F;AAC5F,sGAAmG;AACnG,0GAAuG;AACvG,kGAA+F;AAC/F,sHAAmH;AACnH,kIAA+H;AAC/H,oHAAiH;AACjH,0GAAuG;AACvG,0HAAuH;AACvH,sIAAmI;AACnI,wHAAqH;AACrH,8GAA2G;AAC3G,oGAAiG;AACjG,oFAAiF;AACjF,8FAA2F;AAC3F,wGAAqG;AACrG,0GAAuG;AACvG,qHAAkH;AAClH,yGAAsG;AACtG,uGAAoG;AACpG,2GAAwG;AACxG,kHAA+G;AAC/G,wGAAqG;AACrG,gGAA6F;AAC7F,qFAAkF;AAClF,yFAAsF;AACtF,iEAA8D;AAC9D,mEAAgE;AAChE,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,eAAe,EAAE,iCAAe,CAAC;KACpE,QAAQ,CAAC,qDAAyB,CAAC,yBAAyB,EAAE,qDAAyB,CAAC;KACxF,QAAQ,CAAC,qDAAyB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC;KACpF,QAAQ,CAAC,qDAAyB,CAAC,wBAAwB,EAAE,mDAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iIAA4H;AAC5H,qHAAgH;AAChH,kIAA6H;AAC7H,6FAAwF;AACxF,qEAA0F;AAE1F,kFAA+E;AAC/E,mGAAgG;AAChG,mFAAgF;AAChF,sGAAmG;AACnG,4GAAyG;AACzG,6FAA0F;AAC1F,+FAA4F;AAC5F,mFAAgF;AAChF,qFAAkF;AAClF,yEAAsE;AACtE,qFAAkF;AAClF,uFAAoF;AACpF,qFAAkF;AAClF,mFAAgF;AAChF,6FAA0F;AAC1F,qFAAkF;AAClF,yFAAsF;AACtF,uFAAoF;AACpF,+FAA4F;AAC5F,sGAAmG;AACnG,0GAAuG;AACvG,kGAA+F;AAC/F,sHAAmH;AACnH,kIAA+H;AAC/H,oHAAiH;AACjH,0GAAuG;AACvG,0HAAuH;AACvH,sIAAmI;AACnI,wHAAqH;AACrH,8GAA2G;AAC3G,oGAAiG;AACjG,oFAAiF;AACjF,8FAA2F;AAC3F,wGAAqG;AACrG,0GAAuG;AACvG,qHAAkH;AAClH,yGAAsG;AACtG,uGAAoG;AACpG,2GAAwG;AACxG,kHAA+G;AAC/G,wGAAqG;AACrG,gGAA6F;AAC7F,qFAAkF;AAClF,yFAAsF;AACtF,iEAA8D;AAC9D,mEAAgE;AAChE,qEAAkE;AAClE,qEAAkE;AAClE,yFAAsF;AACtF,iEAA8D;AAC9D,uEAAoE;AACpE,uFAAoF;AACpF,2EAAwE;AAExE,wBAAwB;AACxB,MAAM,cAAc,GAAwB,+BAA0B,CAAC,oBAAoB,EAA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AC;KACxF,QAAQ,CAAC,qDAAyB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC;KACpF,QAAQ,CAAC,qDAAyB,CAAC,wBAAwB,EAAE,mDAAwB,CAAC;KACtF,QAAQ,CAAC,qDAAyB,CAAC,yBAAyB,EAAE,qDAAyB,CAAC,CAAC"}
@@ -47,9 +47,11 @@ declare const EnapoWorkerContainerToken: {
47
47
  EnoRemovedGIDRepository: symbol;
48
48
  EnoStructureRepository: symbol;
49
49
  EnoGeometryRepository: symbol;
50
+ DedSearchIndexRepository: symbol;
50
51
  EnoLookupTask: symbol;
51
52
  EnoBuildingTask: symbol;
52
53
  EnoStructureTask: symbol;
53
54
  EnoGeometryTask: symbol;
55
+ DedSearchIndexRefreshTask: symbol;
54
56
  };
55
57
  export { EnapoWorkerContainerToken };
@@ -59,10 +59,12 @@ const EnapoWorkerContainerToken = {
59
59
  EnoRemovedGIDRepository: Symbol(),
60
60
  EnoStructureRepository: Symbol(),
61
61
  EnoGeometryRepository: Symbol(),
62
+ DedSearchIndexRepository: Symbol(),
62
63
  EnoLookupTask: Symbol(),
63
64
  EnoBuildingTask: Symbol(),
64
65
  EnoStructureTask: Symbol(),
65
66
  EnoGeometryTask: Symbol(),
67
+ DedSearchIndexRefreshTask: Symbol(),
66
68
  //#endregion
67
69
  };
68
70
  exports.EnapoWorkerContainerToken = EnapoWorkerContainerToken;
@@ -1 +1 @@
1
- {"version":3,"file":"EnapoWorkerContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/ioc/EnapoWorkerContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,yBAAyB,GAAG;IAC9B,oBAAoB;IACpB,kCAAkC,EAAE,MAAM,EAAE;IAC5C,+BAA+B,EAAE,MAAM,EAAE;IACzC,6BAA6B,EAAE,MAAM,EAAE;IACvC,kBAAkB,EAAE,MAAM,EAAE;IAC5B,0BAA0B,EAAE,MAAM,EAAE;IACpC,YAAY;IAEZ,sBAAsB;IACtB,2BAA2B,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;IACzB,qBAAqB,EAAE,MAAM,EAAE;IAC/B,oBAAoB,EAAE,MAAM,EAAE;IAC9B,qBAAqB,EAAE,MAAM,EAAE;IAC/B,qBAAqB,EAAE,MAAM,EAAE;IAC/B,uBAAuB,EAAE,MAAM,EAAE;IACjC,sBAAsB,EAAE,MAAM,EAAE;IAChC,qBAAqB,EAAE,MAAM,EAAE;IAE/B,aAAa,EAAE,MAAM,EAAE;IACvB,eAAe,EAAE,MAAM,EAAE;IACzB,gBAAgB,EAAE,MAAM,EAAE;IAC1B,eAAe,EAAE,MAAM,EAAE;IACzB,YAAY;CACf,CAAC;AAEO,8DAAyB"}
1
+ {"version":3,"file":"EnapoWorkerContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/ioc/EnapoWorkerContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,yBAAyB,GAAG;IAC9B,oBAAoB;IACpB,kCAAkC,EAAE,MAAM,EAAE;IAC5C,+BAA+B,EAAE,MAAM,EAAE;IACzC,6BAA6B,EAAE,MAAM,EAAE;IACvC,kBAAkB,EAAE,MAAM,EAAE;IAC5B,0BAA0B,EAAE,MAAM,EAAE;IACpC,YAAY;IAEZ,sBAAsB;IACtB,2BAA2B,EAAE,MAAM,EAAE;IACrC,uBAAuB,EAAE,MAAM,EAAE;IACjC,4BAA4B,EAAE,MAAM,EAAE;IACtC,uCAAuC,EAAE,MAAM,EAAE;IACjD,6CAA6C,EAAE,MAAM,EAAE;IACvD,sCAAsC,EAAE,MAAM,EAAE;IAChD,iCAAiC,EAAE,MAAM,EAAE;IAC3C,+BAA+B,EAAE,MAAM,EAAE;IACzC,2CAA2C,EAAE,MAAM,EAAE;IACrD,qCAAqC,EAAE,MAAM,EAAE;IAC/C,oCAAoC,EAAE,MAAM,EAAE;IAC9C,2BAA2B,EAAE,MAAM,EAAE;IACrC,6BAA6B,EAAE,MAAM,EAAE;IACvC,yBAAyB,EAAE,MAAM,EAAE;IACnC,YAAY;IAEZ,yBAAyB;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 +1,7 @@
1
+ import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
2
+ import { IDedSearchIndexRepository } from "./interfaces/IDedSearchIndexRepository";
3
+ export declare class DedSearchIndexRepository implements IDedSearchIndexRepository {
4
+ private connector;
5
+ constructor(connector: IDatabaseConnector);
6
+ refresh(): Promise<void>;
7
+ }