@golemio/energetics 1.13.1-dev.2791580222 → 1.14.0

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 (33) hide show
  1. package/db/example/09_enapo_consumption_history.sql +25 -30
  2. package/db/migrations/postgresql/sqls/20260813090000-enapo-consumption-history-up.sql +42 -33
  3. package/db/scripts/ded_gid_mapping_mock_import.sql +1 -4
  4. package/dist/integration-engine/enapo/ioc/Di.js +3 -11
  5. package/dist/integration-engine/enapo/ioc/Di.js.map +1 -1
  6. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.d.ts +0 -4
  7. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js +0 -4
  8. package/dist/integration-engine/enapo/ioc/EnapoWorkerContainerToken.js.map +1 -1
  9. package/dist/integration-engine/enapo/workers/EnapoWorker.js +0 -1
  10. package/dist/integration-engine/enapo/workers/EnapoWorker.js.map +1 -1
  11. package/docs/implementation_documentation.md +6 -40
  12. package/package.json +1 -1
  13. package/db/migrations/postgresql/20260821090000-enapo-gid-mapping-sync-comment.js +0 -53
  14. package/db/migrations/postgresql/sqls/20260821090000-enapo-gid-mapping-sync-comment-down.sql +0 -3
  15. package/db/migrations/postgresql/sqls/20260821090000-enapo-gid-mapping-sync-comment-up.sql +0 -4
  16. package/dist/integration-engine/enapo/datasources/gid-mapping/EnapoGidMappingDataSource.d.ts +0 -14
  17. package/dist/integration-engine/enapo/datasources/gid-mapping/EnapoGidMappingDataSource.js +0 -56
  18. package/dist/integration-engine/enapo/datasources/gid-mapping/EnapoGidMappingDataSource.js.map +0 -1
  19. package/dist/integration-engine/enapo/helpers/EnapoGidMappingNormalizer.d.ts +0 -43
  20. package/dist/integration-engine/enapo/helpers/EnapoGidMappingNormalizer.js +0 -203
  21. package/dist/integration-engine/enapo/helpers/EnapoGidMappingNormalizer.js.map +0 -1
  22. package/dist/integration-engine/enapo/repositories/EnapoGidMappingRepository.d.ts +0 -13
  23. package/dist/integration-engine/enapo/repositories/EnapoGidMappingRepository.js +0 -42
  24. package/dist/integration-engine/enapo/repositories/EnapoGidMappingRepository.js.map +0 -1
  25. package/dist/integration-engine/enapo/workers/task/EnapoGidMappingSyncTask.d.ts +0 -45
  26. package/dist/integration-engine/enapo/workers/task/EnapoGidMappingSyncTask.js +0 -121
  27. package/dist/integration-engine/enapo/workers/task/EnapoGidMappingSyncTask.js.map +0 -1
  28. package/dist/schema-definitions/datasources/enapo/gid-mapping/EnapoGidMappingCsvSchema.d.ts +0 -3
  29. package/dist/schema-definitions/datasources/enapo/gid-mapping/EnapoGidMappingCsvSchema.js +0 -23
  30. package/dist/schema-definitions/datasources/enapo/gid-mapping/EnapoGidMappingCsvSchema.js.map +0 -1
  31. package/dist/schema-definitions/datasources/enapo/gid-mapping/interfaces/IEnapoGidMappingCsvRow.d.ts +0 -15
  32. package/dist/schema-definitions/datasources/enapo/gid-mapping/interfaces/IEnapoGidMappingCsvRow.js +0 -3
  33. package/dist/schema-definitions/datasources/enapo/gid-mapping/interfaces/IEnapoGidMappingCsvRow.js.map +0 -1
@@ -67,48 +67,43 @@ FROM generate_series(timestamptz '2026-03-01 00:00:00+00', timestamptz '2026-03-
67
67
  -- =================================================================================================
68
68
  -- Gas, metered (PPAS InternetAVE)
69
69
  -- =================================================================================================
70
+ -- Value is core(first day of next month) - core(first day of current month), core being the
71
+ -- cumulative meter state in m3. The corediff rows below carry no weight in that computation any
72
+ -- more; they exist only to seed gas_registration, which picks the (device_serial_number, place_id)
73
+ -- an EIC's 'core' readings must be joined through.
70
74
 
71
- -- 27ZG100Z0000CH01, 2026-07: corediff is the primary value -> 3 * 50 = 150 m3, over 3 distinct days.
72
- -- core2 is present and non-zero but must NOT win.
75
+ -- 27ZG100Z0000CH01: single registration, one meter.
73
76
  INSERT INTO enapo_measurements (id, id_type, value, "timestamp", var, source, place_id, device_serial_number) VALUES
74
- ('27ZG100Z0000CH01', 'eic', 50.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
75
- ('27ZG100Z0000CH01', 'eic', 50.0, '2026-07-02 01:00:00+02', 'corediff', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
76
- ('27ZG100Z0000CH01', 'eic', 50.0, '2026-07-03 01:00:00+02', 'corediff', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
77
- ('27ZG100Z0000CH01', 'eic', 55.0, '2026-07-01 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
78
- ('27ZG100Z0000CH01', 'eic', 55.0, '2026-07-02 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
79
- ('27ZG100Z0000CH01', 'eic', 55.0, '2026-07-03 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
80
- -- the cumulative meter state: present, and deliberately unused (max - min across an EIC's
81
- -- registrations is the distance between unrelated counters, so it is not a fallback)
82
- ('27ZG100Z0000CH01', 'eic', 900000.0, '2026-07-01 01:00:00+02', 'core', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
83
- ('27ZG100Z0000CH01', 'eic', 900150.0, '2026-07-03 01:00:00+02', 'core', 'ppas_ave_api', '9900001', 'GAS-CH-1');
84
-
85
- -- 2026-06: corediff has data, core2 is present but ALL ZERO. 0 is not NULL, so a bare COALESCE
86
- -- would return a flat-zero Nm3 series here - exactly what production does for some EICs. The
87
- -- expected result is 120 m3 from corediff.
88
- INSERT INTO enapo_measurements (id, id_type, value, "timestamp", var, source, place_id, device_serial_number) VALUES
89
- ('27ZG100Z0000CH01', 'eic', 60.0, '2026-06-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
90
- ('27ZG100Z0000CH01', 'eic', 60.0, '2026-06-02 01:00:00+02', 'corediff', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
91
- ('27ZG100Z0000CH01', 'eic', 0.0, '2026-06-01 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
92
- ('27ZG100Z0000CH01', 'eic', 0.0, '2026-06-02 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1');
77
+ ('27ZG100Z0000CH01', 'eic', 50.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900001', 'GAS-CH-1');
93
78
 
94
- -- 2026-05: only core2. The series falls back to Nm3 for this month, which means one point can change
95
- -- unit mid-window and therefore appears as two series - honest, and why `unit` is part of the key.
79
+ -- Core readings on the first day of each month. 2026-05-01 is deliberately missing, so both April
80
+ -- (missing its "next month" boundary) and May (missing its "current month" boundary) come back
81
+ -- null - a diff needs both sides.
96
82
  INSERT INTO enapo_measurements (id, id_type, value, "timestamp", var, source, place_id, device_serial_number) VALUES
97
- ('27ZG100Z0000CH01', 'eic', 30.0, '2026-05-01 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
98
- ('27ZG100Z0000CH01', 'eic', 30.0, '2026-05-02 01:00:00+02', 'core2', 'ppas_ave_api', '9900001', 'GAS-CH-1');
83
+ ('27ZG100Z0000CH01', 'eic', 900000.0, '2026-04-01 01:00:00+02', 'core', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
84
+ ('27ZG100Z0000CH01', 'eic', 900060.0, '2026-06-01 01:00:00+02', 'core', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
85
+ ('27ZG100Z0000CH01', 'eic', 900180.0, '2026-07-01 01:00:00+02', 'core', 'ppas_ave_api', '9900001', 'GAS-CH-1'),
86
+ ('27ZG100Z0000CH01', 'eic', 900330.0, '2026-08-01 01:00:00+02', 'core', 'ppas_ave_api', '9900001', 'GAS-CH-1');
87
+ -- June = 900180 - 900060 = 120; July = 900330 - 900180 = 150.
99
88
 
100
89
  -- 27ZG100Z0000CH02, 2026-07: TWO place_ids, ONE meter serial - two live registrations of the same
101
- -- physical meter, both reporting the same intervals. Expected 100 m3, NOT 200: the aggregate picks
102
- -- one registration per serial (the most recently reporting one, here 9900012).
90
+ -- physical meter. gas_registration picks one per serial (the most recently reporting one, here
91
+ -- 9900012), so only that place_id's core readings feed the diff: 100 m3, NOT 200.
103
92
  INSERT INTO enapo_measurements (id, id_type, value, "timestamp", var, source, place_id, device_serial_number) VALUES
104
93
  ('27ZG100Z0000CH02', 'eic', 100.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900011', 'GAS-CH-DUP'),
105
- ('27ZG100Z0000CH02', 'eic', 100.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900012', 'GAS-CH-DUP');
94
+ ('27ZG100Z0000CH02', 'eic', 100.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900012', 'GAS-CH-DUP'),
95
+ ('27ZG100Z0000CH02', 'eic', 500000.0, '2026-07-01 01:00:00+02', 'core', 'ppas_ave_api', '9900012', 'GAS-CH-DUP'),
96
+ ('27ZG100Z0000CH02', 'eic', 500100.0, '2026-08-01 01:00:00+02', 'core', 'ppas_ave_api', '9900012', 'GAS-CH-DUP');
106
97
 
107
98
  -- 27ZG100Z0000CH03, 2026-07: TWO place_ids, TWO serials - genuinely two meters on one delivery
108
- -- point. Expected 200 m3: deltas from distinct meters do add up.
99
+ -- point. Each registration gets its own diff and they add up: 100 + 100 = 200 m3.
109
100
  INSERT INTO enapo_measurements (id, id_type, value, "timestamp", var, source, place_id, device_serial_number) VALUES
110
101
  ('27ZG100Z0000CH03', 'eic', 100.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900021', 'GAS-CH-A'),
111
- ('27ZG100Z0000CH03', 'eic', 100.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900022', 'GAS-CH-B');
102
+ ('27ZG100Z0000CH03', 'eic', 100.0, '2026-07-01 01:00:00+02', 'corediff', 'ppas_ave_api', '9900022', 'GAS-CH-B'),
103
+ ('27ZG100Z0000CH03', 'eic', 700000.0, '2026-07-01 01:00:00+02', 'core', 'ppas_ave_api', '9900021', 'GAS-CH-A'),
104
+ ('27ZG100Z0000CH03', 'eic', 700100.0, '2026-08-01 01:00:00+02', 'core', 'ppas_ave_api', '9900021', 'GAS-CH-A'),
105
+ ('27ZG100Z0000CH03', 'eic', 800000.0, '2026-07-01 01:00:00+02', 'core', 'ppas_ave_api', '9900022', 'GAS-CH-B'),
106
+ ('27ZG100Z0000CH03', 'eic', 800100.0, '2026-08-01 01:00:00+02', 'core', 'ppas_ave_api', '9900022', 'GAS-CH-B');
112
107
 
113
108
 
114
109
  -- =================================================================================================
@@ -73,19 +73,17 @@ gas_registration AS (
73
73
  GROUP BY em.id, em.device_serial_number, em.place_id
74
74
  ORDER BY em.id, em.device_serial_number, max(em."timestamp") DESC, em.place_id DESC
75
75
  ),
76
- gas_metered AS (
77
- SELECT
78
- em.id AS place_id,
79
- date_trunc('month', em."timestamp" AT TIME ZONE 'Europe/Prague')::date AS period_start,
80
- sum(em.value) FILTER (WHERE em.var = 'corediff') AS m3_sum,
81
- sum(em.value) FILTER (WHERE em.var = 'core2') AS nm3_sum,
82
- -- Coverage is the max day-count across corediff/core2, not just the winning var's.
83
- GREATEST(
84
- count(DISTINCT (em."timestamp" AT TIME ZONE 'Europe/Prague')::date)
85
- FILTER (WHERE em.var = 'corediff'),
86
- count(DISTINCT (em."timestamp" AT TIME ZONE 'Europe/Prague')::date)
87
- FILTER (WHERE em.var = 'core2')
88
- ) AS days_covered
76
+ gas_core_month AS (
77
+ -- Cumulative 'core' reading (m3) at the first measured hour of each first-of-month day, kept
78
+ -- per (id, device_serial_number, place_id) - an id can carry several registrations (see
79
+ -- gas_registration) whose diffs must be summed separately, not collapsed into one reading.
80
+ SELECT DISTINCT ON (em.id, em.device_serial_number, em.place_id,
81
+ date_trunc('month', em."timestamp" AT TIME ZONE 'Europe/Prague'))
82
+ em.id,
83
+ em.device_serial_number,
84
+ em.place_id,
85
+ date_trunc('month', em."timestamp" AT TIME ZONE 'Europe/Prague')::date AS month_start,
86
+ em.value
89
87
  FROM enapo_measurements em
90
88
  CROSS JOIN bounds b
91
89
  INNER JOIN gas_registration gr
@@ -93,10 +91,29 @@ gas_metered AS (
93
91
  AND gr.device_serial_number = em.device_serial_number
94
92
  AND gr.place_id = em.place_id
95
93
  WHERE em.source = 'ppas_ave_api'
96
- AND em.var IN ('core2', 'corediff')
94
+ AND em.var = 'core'
95
+ AND (em."timestamp" AT TIME ZONE 'Europe/Prague')::date
96
+ = date_trunc('month', em."timestamp" AT TIME ZONE 'Europe/Prague')::date
97
97
  AND em."timestamp" >= b.month_from_tstz
98
- AND em."timestamp" < b.month_to_tstz
99
- GROUP BY em.id, date_trunc('month', em."timestamp" AT TIME ZONE 'Europe/Prague')::date
98
+ AND em."timestamp" < (b.month_to_tstz + interval '1 month')
99
+ ORDER BY em.id, em.device_serial_number, em.place_id,
100
+ date_trunc('month', em."timestamp" AT TIME ZONE 'Europe/Prague'), em."timestamp"
101
+ ),
102
+ gas_metered AS (
103
+ SELECT
104
+ cur.id AS place_id,
105
+ cur.month_start AS period_start,
106
+ -- A negative diff means the meter was exchanged/reset between the two boundary readings -
107
+ -- null rather than a nonsense negative volume.
108
+ (CASE WHEN sum(nxt.value - cur.value) < 0 THEN NULL ELSE sum(nxt.value - cur.value) END) AS m3_sum,
109
+ ((cur.month_start + interval '1 month')::date - cur.month_start) AS days_covered
110
+ FROM gas_core_month cur
111
+ INNER JOIN gas_core_month nxt
112
+ ON nxt.id = cur.id
113
+ AND nxt.device_serial_number = cur.device_serial_number
114
+ AND nxt.place_id = cur.place_id
115
+ AND nxt.month_start = (cur.month_start + interval '1 month')::date
116
+ GROUP BY cur.id, cur.month_start
100
117
  ),
101
118
 
102
119
  distribution_device AS (
@@ -253,15 +270,6 @@ invoice_year AS (
253
270
  GROUP BY source, place_id, date_trunc('year', period_start)::date
254
271
  ),
255
272
 
256
- gas_combustion_heat AS (
257
- SELECT DISTINCT ON (d.eic)
258
- d.eic,
259
- NULLIF(d.combustion_heat, 0)::numeric AS heat_kwh_per_m3
260
- FROM distribution_device d
261
- WHERE NULLIF(d.combustion_heat, 0) IS NOT NULL
262
- ORDER BY d.eic, d.date_to DESC
263
- ),
264
-
265
273
  porsenna_period AS (
266
274
  SELECT *
267
275
  FROM (
@@ -314,16 +322,15 @@ monthly AS (
314
322
  'ppas_ave_api',
315
323
  'monthly',
316
324
  g.period_start,
317
- CASE WHEN g.m3_sum IS NOT NULL THEN g.m3_sum ELSE NULLIF(g.nm3_sum, 0) END,
318
- CASE WHEN g.m3_sum IS NOT NULL THEN 'm3' ELSE 'Nm3' END,
319
- (NULLIF(g.nm3_sum, 0) * ch.heat_kwh_per_m3)::numeric,
320
- CASE WHEN g.m3_sum IS NOT NULL THEN 'corediff' ELSE 'core2' END,
325
+ g.m3_sum,
326
+ 'm3',
327
+ NULL::numeric,
328
+ 'core',
321
329
  g.days_covered,
322
330
  false,
323
331
  '{}'::text[]
324
332
  FROM point p
325
333
  INNER JOIN gas_metered g ON g.place_id = p.place_id
326
- LEFT JOIN gas_combustion_heat ch ON ch.eic = p.place_id
327
334
  WHERE p.commodity = 'gas'
328
335
 
329
336
  UNION ALL
@@ -438,7 +445,9 @@ FROM (
438
445
  SELECT * FROM yearly
439
446
  ) all_periods
440
447
  WHERE value IS NOT NULL
441
- GROUP BY gid, place_id, commodity, source, unit, period_type, period_start;
448
+ GROUP BY gid, place_id, commodity, source, unit, period_type, period_start
449
+ with no data;
450
+
442
451
 
443
452
  COMMENT ON MATERIALIZED VIEW mv_enapo_om_consumption IS
444
453
  'Monthly and yearly consumption per consumption point per source, for the last 48 months, behind the DeD building detail endpoint. One row per (gid, place_id, commodity, source, unit, period_type, period_start). Refreshed by EnapoConsumptionHistoryRefreshTask (integration engine).';
@@ -446,9 +455,9 @@ COMMENT ON MATERIALIZED VIEW mv_enapo_om_consumption IS
446
455
  COMMENT ON COLUMN mv_enapo_om_consumption.place_id IS
447
456
  'EAN / EIC / OM code, as in enapo_gid_mapping.place_id - NOT enapo_measurements.place_id, which holds a PPAS-internal place id. Measurements are joined through enapo_measurements.id.';
448
457
  COMMENT ON COLUMN mv_enapo_om_consumption.value IS
449
- 'Consumption for the period in `unit`. Electricity is kWh (the upstream T1_Wh_total naming is wrong); metered gas is m3 from corediff, or Nm3 from core2 when corediff is absent; invoiced gas follows the invoice unit; Porsenna carries its own unit.';
458
+ 'Consumption for the period in `unit`. Electricity is kWh (the upstream T1_Wh_total naming is wrong); metered gas is m3, the difference between the cumulative `core` reading on the first day of the next month and the first day of the current month; invoiced gas follows the invoice unit; Porsenna carries its own unit.';
450
459
  COMMENT ON COLUMN mv_enapo_om_consumption.value_kwh IS
451
- 'Derived comparable energy: for gas, normometers_nm3 * combustion_heat (verified exact). NULL when the conversion inputs are missing - `value` + `unit` stay authoritative.';
460
+ 'Derived comparable energy: for gas, normometers_nm3 * combustion_heat (verified exact). NULL when the conversion inputs are missing - `value` + `unit` stay authoritative. Always NULL for metered gas (no normometers_nm3 input).';
452
461
  COMMENT ON COLUMN mv_enapo_om_consumption.internal_source_var IS
453
462
  'Which enapo_measurements.var produced the row; NULL for invoice and Porsenna rows. Provenance for debugging, not part of the public response.';
454
463
  COMMENT ON COLUMN mv_enapo_om_consumption.invoice_ids IS
@@ -9,10 +9,7 @@
9
9
  -- - Full refresh of mock rows only: rows are inserted with link_source = 'mock', so this
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
- -- preferring an active mapping (valid_to IS NULL) and then the newest valid_from. This script
13
- -- writes a single link_source ('mock'), so (place_id, gid) is enough here; the sync task
14
- -- (EnapoGidMappingSyncTask) brings several link_sources and therefore deduplicates on the full
15
- -- primary key (place_id, gid, link_source) and stores link_source lower-cased.
12
+ -- preferring an active mapping (valid_to IS NULL) and then the newest valid_from.
16
13
  -- - id_type / commodity are resolved from each other so a row survives when only one of the
17
14
  -- two columns is filled: an explicit value wins, the other column is the fallback.
18
15
  -- commodity uses EB codes ('1' -> electricity, '2' -> gas) as well as the DeD names.
@@ -7,12 +7,10 @@ const PpasAveApiDataSourceProvider_1 = require("../../commodity-providers/dataso
7
7
  const WorkerContainerToken_1 = require("../../commodity-providers/ioc/WorkerContainerToken");
8
8
  const Di_1 = require("@golemio/core/dist/integration-engine/ioc/Di");
9
9
  const EnoDatasourceFactory_1 = require("../datasources/eno/EnoDatasourceFactory");
10
- const EnapoGidMappingDataSource_1 = require("../datasources/gid-mapping/EnapoGidMappingDataSource");
11
10
  const PorsennaDataSourceProvider_1 = require("../datasources/porsenna/PorsennaDataSourceProvider");
12
11
  const PorsennaDataSource_1 = require("../datasources/porsenna/PorsennaDataSource");
13
12
  const PpasCommercialDatasource_1 = require("../datasources/ppas/commercial/PpasCommercialDatasource");
14
13
  const PpasDistributionDatasource_1 = require("../datasources/ppas/distribution/PpasDistributionDatasource");
15
- const EnapoGidMappingRepository_1 = require("../repositories/EnapoGidMappingRepository");
16
14
  const EnapoMeasurementsRepository_1 = require("../repositories/EnapoMeasurementsRepository");
17
15
  const PreIncomingDataLogRepository_1 = require("../repositories/PreIncomingDataLogRepository");
18
16
  const EnoAddressRepository_1 = require("../repositories/eno/EnoAddressRepository");
@@ -39,7 +37,6 @@ const PpasDistributionInvoiceDeviceRepository_1 = require("../repositories/ppas/
39
37
  const PpasDistributionInvoiceInstallationRepository_1 = require("../repositories/ppas/PpasDistributionInvoiceInstallationRepository");
40
38
  const PpasDistributionInvoicePriceRepository_1 = require("../repositories/ppas/PpasDistributionInvoicePriceRepository");
41
39
  const PpasDistributionInvoiceRepository_1 = require("../repositories/ppas/PpasDistributionInvoiceRepository");
42
- const EnapoGidMappingNormalizer_1 = require("../helpers/EnapoGidMappingNormalizer");
43
40
  const PPasMeasurementTransformation_1 = require("../transformations/PPasMeasurementTransformation");
44
41
  const EnoEJTransformation_1 = require("../transformations/eno/EnoEJTransformation");
45
42
  const EnoManagerTransformation_1 = require("../transformations/eno/EnoManagerTransformation");
@@ -52,7 +49,6 @@ const PpasDistributionTransformation_1 = require("../transformations/ppas/PpasDi
52
49
  const PreDailyMeasurementsTransformation_1 = require("../transformations/pre/PreDailyMeasurementsTransformation");
53
50
  const PreMeasurementsTransformation_1 = require("../transformations/pre/PreMeasurementsTransformation");
54
51
  const PreMetadataTransfromation_1 = require("../transformations/pre/PreMetadataTransfromation");
55
- const EnapoGidMappingSyncTask_1 = require("../workers/task/EnapoGidMappingSyncTask");
56
52
  const EnapoPpasCommercialTask_1 = require("../workers/task/EnapoPpasCommercialTask");
57
53
  const EnapoPpasDistributionTask_1 = require("../workers/task/EnapoPpasDistributionTask");
58
54
  const EnapoPpasTask_1 = require("../workers/task/EnapoPpasTask");
@@ -78,7 +74,6 @@ EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContaine
78
74
  EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoPpasCommercialDatasource, PpasCommercialDatasource_1.PpasCommercialDatasource);
79
75
  EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDatasource, PorsennaDataSource_1.PorsennaDataSource);
80
76
  EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDataSourceProvider, PorsennaDataSourceProvider_1.PorsennaDataSourceProvider);
81
- EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingDataSource, EnapoGidMappingDataSource_1.EnapoGidMappingDataSource);
82
77
  //#endregion
83
78
  //#region Repositories
84
79
  EnapoContainer.register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoMeasurementsRepository, EnapoMeasurementsRepository_1.EnapoMeasurementsRepository)
@@ -106,8 +101,7 @@ EnapoContainer.register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.En
106
101
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PpasCommercialInvoicePriceRepository, PpasCommercialInvoicePriceRepository_1.PpasCommercialInvoicePriceRepository)
107
102
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaBuildingsRepository, PorsennaBuildingsRepository_1.PorsennaBuildingsRepository)
108
103
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaConsumptionRepository, PorsennaConsumptionRepository_1.PorsennaConsumptionRepository)
109
- .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDevicesRepository, PorsennaDevicesRepository_1.PorsennaDevicesRepository)
110
- .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingRepository, EnapoGidMappingRepository_1.EnapoGidMappingRepository);
104
+ .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDevicesRepository, PorsennaDevicesRepository_1.PorsennaDevicesRepository);
111
105
  //#endregion
112
106
  //#region Transformation
113
107
  EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PPasMeasurementTransformation, PPasMeasurementTransformation_1.PPasMeasurementTransformation);
@@ -121,8 +115,7 @@ EnapoContainer.registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContaine
121
115
  .registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PpasDistributionTransformation, PpasDistributionTransformation_1.PpasDistributionTransformation)
122
116
  .registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PpasCommercialTransformation, PpasCommercialTransformation_1.PpasCommercialTransformation)
123
117
  .registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaGaugeTransformation, PorsennaGaugeTransformation_1.PorsennaGaugeTransformation)
124
- .registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaConsumptionTransformation, PorsennaConsumptionTransformation_1.PorsennaConsumptionTransformation)
125
- .registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingNormalizer, EnapoGidMappingNormalizer_1.EnapoGidMappingNormalizer);
118
+ .registerSingleton(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaConsumptionTransformation, PorsennaConsumptionTransformation_1.PorsennaConsumptionTransformation);
126
119
  //#endregion
127
120
  //#region Tasks
128
121
  EnapoContainer.register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoPpasTask, EnapoPpasTask_1.EnapoPpasTask);
@@ -135,6 +128,5 @@ EnapoContainer.register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.En
135
128
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoPpasCommercialTask, EnapoPpasCommercialTask_1.EnapoPpasCommercialTask)
136
129
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDistributionTask, PorsennaDistributionTask_1.PorsennaDistributionTask)
137
130
  .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.DedSearchIndexRefreshTask, DedSearchIndexRefreshTask_1.DedSearchIndexRefreshTask)
138
- .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoConsumptionHistoryRefreshTask, EnapoConsumptionHistoryRefreshTask_1.EnapoConsumptionHistoryRefreshTask)
139
- .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingSyncTask, EnapoGidMappingSyncTask_1.EnapoGidMappingSyncTask);
131
+ .register(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoConsumptionHistoryRefreshTask, EnapoConsumptionHistoryRefreshTask_1.EnapoConsumptionHistoryRefreshTask);
140
132
  //# 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,oGAAiG;AACjG,mGAAgG;AAChG,mFAAgF;AAChF,sGAAmG;AACnG,4GAAyG;AACzG,yFAAsF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ACtF,QAAQ,CAAC,qDAAyB,CAAC,yBAAyB,EAAE,qDAAyB,CAAC;KACxF,QAAQ,CAAC,qDAAyB,CAAC,kCAAkC,EAAE,uEAAkC,CAAC;KAC1G,QAAQ,CAAC,qDAAyB,CAAC,uBAAuB,EAAE,iDAAuB,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,mHAAgH;AAChH,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,2GAAwG;AACxG,iEAA8D;AAC9D,uEAAoE;AACpE,uFAAoF;AACpF,2EAAwE;AAExE,wBAAwB;AACxB,MAAM,cAAc,GAAwB,+BAA0B,CAAC,oBAAoB,E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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;KACtF,QAAQ,CAAC,qDAAyB,CAAC,yBAAyB,EAAE,qDAAyB,CAAC;KACxF,QAAQ,CAAC,qDAAyB,CAAC,kCAAkC,EAAE,uEAAkC,CAAC,CAAC"}
@@ -4,7 +4,6 @@ declare const EnapoWorkerContainerToken: {
4
4
  EnapoPpasCommercialDatasource: symbol;
5
5
  PorsennaDatasource: symbol;
6
6
  PorsennaDataSourceProvider: symbol;
7
- EnapoGidMappingDataSource: symbol;
8
7
  EnapoMeasurementsRepository: symbol;
9
8
  EnapoMetadataRepository: symbol;
10
9
  PreIncomingDataLogRepository: symbol;
@@ -19,7 +18,6 @@ declare const EnapoWorkerContainerToken: {
19
18
  PorsennaBuildingsRepository: symbol;
20
19
  PorsennaConsumptionRepository: symbol;
21
20
  PorsennaDevicesRepository: symbol;
22
- EnapoGidMappingRepository: symbol;
23
21
  PPasMeasurementTransformation: symbol;
24
22
  PreMeasurementsTransformation: symbol;
25
23
  PreDailyMeasurementsTransformation: symbol;
@@ -28,13 +26,11 @@ declare const EnapoWorkerContainerToken: {
28
26
  PpasCommercialTransformation: symbol;
29
27
  PorsennaGaugeTransformation: symbol;
30
28
  PorsennaConsumptionTransformation: symbol;
31
- EnapoGidMappingNormalizer: symbol;
32
29
  EnapoPpasTask: symbol;
33
30
  EnapoPrediTask: symbol;
34
31
  EnapoPpasDistributionTask: symbol;
35
32
  EnapoPpasCommercialTask: symbol;
36
33
  PorsennaDistributionTask: symbol;
37
- EnapoGidMappingSyncTask: symbol;
38
34
  EnoDatasourceFactory: symbol;
39
35
  EnoStructureTypeTransformation: symbol;
40
36
  EnoOrganizationTransformation: symbol;
@@ -8,7 +8,6 @@ const EnapoWorkerContainerToken = {
8
8
  EnapoPpasCommercialDatasource: Symbol(),
9
9
  PorsennaDatasource: Symbol(),
10
10
  PorsennaDataSourceProvider: Symbol(),
11
- EnapoGidMappingDataSource: Symbol(),
12
11
  //#endregion
13
12
  //#region Repositories
14
13
  EnapoMeasurementsRepository: Symbol(),
@@ -25,7 +24,6 @@ const EnapoWorkerContainerToken = {
25
24
  PorsennaBuildingsRepository: Symbol(),
26
25
  PorsennaConsumptionRepository: Symbol(),
27
26
  PorsennaDevicesRepository: Symbol(),
28
- EnapoGidMappingRepository: Symbol(),
29
27
  //#endregion
30
28
  //#region Transformations
31
29
  PPasMeasurementTransformation: Symbol(),
@@ -36,7 +34,6 @@ const EnapoWorkerContainerToken = {
36
34
  PpasCommercialTransformation: Symbol(),
37
35
  PorsennaGaugeTransformation: Symbol(),
38
36
  PorsennaConsumptionTransformation: Symbol(),
39
- EnapoGidMappingNormalizer: Symbol(),
40
37
  //#endregion
41
38
  //#region Tasks
42
39
  EnapoPpasTask: Symbol(),
@@ -44,7 +41,6 @@ const EnapoWorkerContainerToken = {
44
41
  EnapoPpasDistributionTask: Symbol(),
45
42
  EnapoPpasCommercialTask: Symbol(),
46
43
  PorsennaDistributionTask: Symbol(),
47
- EnapoGidMappingSyncTask: Symbol(),
48
44
  //#endregion
49
45
  //#region Eno
50
46
  EnoDatasourceFactory: Symbol(),
@@ -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,yBAAyB,EAAE,MAAM,EAAE;IACnC,YAAY;IAEZ,sB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A0B,EAAE,MAAM,EAAE;IACpC,yBAAyB,EAAE,MAAM,EAAE;IACnC,oBAAoB,EAAE,MAAM,EAAE;IAC9B,eAAe,EAAE,MAAM,EAAE;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;IAC/B,wBAAwB,EAAE,MAAM,EAAE;IAClC,sCAAsC,EAAE,MAAM,EAAE;IAEhD,aAAa,EAAE,MAAM,EAAE;IACvB,eAAe,EAAE,MAAM,EAAE;IACzB,gBAAgB,EAAE,MAAM,EAAE;IAC1B,eAAe,EAAE,MAAM,EAAE;IACzB,yBAAyB,EAAE,MAAM,EAAE;IACnC,kCAAkC,EAAE,MAAM,EAAE;IAC5C,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,+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MAAM,EAAE;IAC/B,wBAAwB,EAAE,MAAM,EAAE;IAClC,sCAAsC,EAAE,MAAM,EAAE;IAEhD,aAAa,EAAE,MAAM,EAAE;IACvB,eAAe,EAAE,MAAM,EAAE;IACzB,gBAAgB,EAAE,MAAM,EAAE;IAC1B,eAAe,EAAE,MAAM,EAAE;IACzB,yBAAyB,EAAE,MAAM,EAAE;IACnC,kCAAkC,EAAE,MAAM,EAAE;IAC5C,YAAY;CACf,CAAC;AAEO,8DAAyB"}
@@ -25,7 +25,6 @@ class EnapoWorker extends integration_engine_1.AbstractWorker {
25
25
  this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.PorsennaDistributionTask));
26
26
  this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.DedSearchIndexRefreshTask));
27
27
  this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoConsumptionHistoryRefreshTask));
28
- this.registerTask(Di_1.EnapoContainer.resolve(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingSyncTask));
29
28
  }
30
29
  }
31
30
  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;QAoB5B,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;QAlBE,iBAAiB;QACjB,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,CAAQ,qDAAyB,CAAC,wBAAwB,CAAC,CAAC,CAAC;QACrG,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,yBAAyB,CAAC,CAAC,CAAC;QACtG,IAAI,CAAC,YAAY,CAAC,mBAAc,CAAC,OAAO,CAAQ,qDAAyB,CAAC,kCAAkC,CAAC,CAAC,CAAC;IACnH,CAAC;CAMJ;AAxBD,kCAwBC"}
@@ -700,49 +700,15 @@ Task přegeneruje materializovaný pohled `mv_enapo_om_consumption`, ze kterého
700
700
  - unit testy
701
701
  - [EnapoConsumptionHistoryRefreshTask.test.ts](../test/integration-engine/enapo/task/EnapoConsumptionHistoryRefreshTask.test.ts)
702
702
 
703
- #### _task: EnapoGidMappingSyncTask_
704
-
705
- Task denně synchronizuje mapování odběrných míst (EAN/EIC) na GID budov z CSV exportu v blob storage do tabulky `energetics.enapo_gid_mapping`. Rozsah je elektřina a plyn; voda a teplo se filtrují jako mimo rozsah.
706
-
707
- - zdroj dat
708
- - CSV `ded_gid_mapping` v Azure Blob Storage, kontejner `golem-energetics` (prod) / `rabin-energetics` (rabin)
709
- - plná URL z configu `module.energetics.enapo.gidMapping.url` — jedna hodnota, ne base + path, aby unesla i SAS token v query stringu
710
- - CSV dodává datový tým (výstup z dbt), modul ho jen konzumuje; za obsah a denní obnovu odpovídá producent
711
- - formát: UTF-8, delimiter `,`, hlavička na prvním řádku
712
- - CSV kontrakt (sloupce = `enapo_gid_mapping` bez vody/tepla)
713
- - `place_id` (EAN/EIC, ≤ 50 znaků), `id_type` (`ean` = elektřina / `eic` = plyn), `commodity` (`electricity` / `gas`), `gid` (GID budovy/stavby), `is_first_gid` (bool), `link_source` (např. `eb_ean_eic`), `valid_from` a `valid_to` (date `YYYY-MM-DD`, případná časová část se zahazuje; u `valid_to` je `1900-01-01` nebo prázdno = nezrušeno = NULL)
714
- - normalizaci a validaci provádí [EnapoGidMappingNormalizer](../src/integration-engine/enapo/helpers/EnapoGidMappingNormalizer.ts) podle [ded_gid_mapping_mock_import.sql](../db/scripts/ded_gid_mapping_mock_import.sql): dopočet `id_type`↔`commodity`, zahození rozporných párů, `1900-01-01`→NULL, výběr aktivního a nejnovějšího mapování mezi duplicitami
715
- - proti mock SQL dedupuje na celý PK (`place_id`, `gid`, `link_source`) místo (`place_id`, `gid`) — sync přináší víc `link_source` na jedno místo — a `link_source` ukládá lowercase, protože je součástí PK
716
- - vstupní rabbitmq fronta
717
- - název: dataplatform.enapoenergetics.syncEnapoGidMapping
718
- - TTL: 30 minut (starší zpráva už je překonaná novější)
719
- - parametry: žádné — task vždy ingestuje celý export, takže není co validovat a `schema` je záměrně `undefined`
720
- - cron definice
721
- - cron.dataplatform.enapoenergetics.syncEnapoGidMapping — denní běh, nejlépe krátce po obnově CSV producentem
722
- - rabin `0 15 3 * * *`
723
- - prod `0 15 3 * * *`
724
- - samotná definice cronu je vedena mimo tento repozitář (deployment konfigurace); hodnoty výše jsou zamýšlený rozvrh
725
- - data modely
726
- - [EnapoGidMappingRepository](../src/integration-engine/enapo/repositories/EnapoGidMappingRepository.ts) — `savingType: "insertOrUpdate"` nad `enapo_gid_mapping` (PK `place_id` + `gid` + `link_source`)
727
- - funkce
728
- - **upsert-only, nic se nemaže**: nové mapování se vloží, existující aktualizuje, chybějící v tabulce zůstane. Opakovaný běh nad stejnými vstupy dá stejný výsledek bez duplicit
729
- - **robustní vůči nečistým datům**: producenta k čistému exportu nedonutíme, takže co task neumí zpracovat, přeskočí a **zaloguje warning** se souhrnem (počet a pár vzorků na každý důvod: `missing_required`, `place_id_too_long`, `link_source_too_long`, `invalid_date`, `contradicting_pair`, `unresolvable_commodity`). Jeden vadný řádek běh neshodí — délkové a datové limity chrání typované cílové sloupce před hodnotou, která by jinak shodila celou dávku
730
- - **voda a teplo nejsou chyba, jen mimo rozsah**: filtrují se jako první a pouze se spočítají. Jejich počet jde do `logger.info`, `logger.warn` zůstává vyhrazený pro skutečné defekty, aby velký očekávaný objem nepřehlušil pár reálných anomálií
731
- - zápis běží v jedné transakci po dávkách 5 000 řádků — jeden `INSERT` nad celým exportem by narazil na limit 65535 bind parametrů Postgresu. Dedup před zápisem je nutný i technicky (`insertOrUpdate` nesmí v jedné dávce zasáhnout stejný PK dvakrát); selhání kterékoli dávky rolluje celý běh
732
- - join na měření: `enapo_gid_mapping.place_id` je kód EAN/EIC (`enapo_measurements.place_id` je naopak interní PPAS place id — viz [Sémantika `var`](#sémantika-var-v-enapo_measurements-ověřeno-proti-produkci-2026-08-13))
733
- - unit testy
734
- - [EnapoGidMappingSyncTask.test.ts](../test/integration-engine/enapo/task/EnapoGidMappingSyncTask.test.ts)
735
- - [EnapoGidMappingNormalizer.test.ts](../test/integration-engine/enapo/helpers/EnapoGidMappingNormalizer.test.ts)
736
-
737
703
  #### _Sémantika `var` v `enapo_measurements` (ověřeno proti produkci 2026-08-13)_
738
704
 
739
705
  Sloupec `value` míchá **kumulativní stavy měřidla** a **rozdíly za interval**, rozlišené pouze podle `(source, var)`. Agregace bez tohoto rozlišení dává nesmysly.
740
706
 
741
707
  | `source` | komodita | `var` | granularita | význam | jednotka | agregace |
742
708
  | -------------- | ----------- | ---------------------------------- | ----------- | -------------------------------------------------- | -------- | --------------------------------------------------- |
743
- | `ppas_ave_api` | plyn | `corediff` | hodinová | **rozdíl** (`OperatingDifference`) | m³ | `sum` **primární** |
744
- | `ppas_ave_api` | plyn | `core2` | hodinová | **rozdíl**, přepočtený (`ConvertDifference`) | Nm³ | `sum`, ale v 81 % řádků nula → jen fallback |
745
- | `ppas_ave_api` | plyn | `core` | hodinová | **kumulativní** stav měřidla (`OperatingAmount`) | m³ | **nepoužívat** (viz níže) |
709
+ | `ppas_ave_api` | plyn | `corediff` | hodinová | **rozdíl** (`OperatingDifference`) | m³ | `sum`, jen registrace (viz níže) |
710
+ | `ppas_ave_api` | plyn | `core2` | hodinová | **rozdíl**, přepočtený (`ConvertDifference`) | Nm³ | `sum`, jen registrace (viz níže) |
711
+ | `ppas_ave_api` | plyn | `core` | hodinová | **kumulativní** stav měřidla (`OperatingAmount`) | m³ | rozdíl 1. dne měsíce a 1. dne dalšího ← **primární v `mv_enapo_om_consumption.gas_metered`** |
746
712
  | `predi_input` | elektřina | `EActi_VT_NT_DaySum` | denní | **odvozený součet** VT+NT | **kWh** | `sum` ← **primární** |
747
713
  | `predi_input` | elektřina | `EActi_VT_DaySum` / `_NT_DaySum` | denní | denní energie; NT je dnes všude nulové | **kWh** | `sum` (jen fallback) |
748
714
  | `predi_input` | elektřina | `EFwActi_VT` / `_NT` | 15 min | průměrný **výkon**, tedy 4× energie | kW | **nepoužívat** (`sum / 4` by byly kWh) |
@@ -757,7 +723,7 @@ Další ověřené vlastnosti dat, na které agregace spoléhá:
757
723
 
758
724
  - `id_type` **není spolehlivý** — v produkci je aspoň jedno elektroměrové EAN uložené s `id_type = 'eic'`, takže join na měření jde výhradně přes `enapo_measurements.id` a `id_type` se nefiltruje
759
725
  - `enapo_gid_mapping.place_id` je **kód EAN/EIC**, zatímco `enapo_measurements.place_id` je interní PPAS place id — join `place_id = place_id` vrací nula řádků a vypadá jako „nejsou data“
760
- - jedno EIC může mít několik `place_id`. Pokud jejich počet přesahuje počet různých `device_serial_number`, jde o dvě živé registrace jednoho fyzického měřidla a sečtení by spotřebu zdvojilo — agregace proto pracuje na granularitě `(id, device_serial_number)`. Ze stejného důvodu je `max(core) - min(core)` nepoužitelné: rozpětí mezi dvěma nesouvisejícími počítadly.
726
+ - jedno EIC může mít několik `place_id`. Pokud jejich počet přesahuje počet různých `device_serial_number`, jde o dvě živé registrace jednoho fyzického měřidla a sečtení by spotřebu zdvojilo — agregace proto pracuje na granularitě `(id, device_serial_number)`. `mv_enapo_om_consumption.gas_metered` proto nejdřív vybere aktivní registraci (CTE `gas_registration`, podle poslední aktivity v `corediff`/`core2`) a teprve pro tu spočítá `core(1. den dalšího měsíce) - core(1. den měsíce)`; napříč celým EIC (bez vazby na registraci) by `core` rozdíl byl rozpětím mezi dvěma nesouvisejícími počítadly.
761
727
 
762
728
  #### _PPAS Distribution API_
763
729
 
@@ -1023,8 +989,8 @@ Přehled endpointů a parametru `accessLimit`:
1023
989
  - `v_enapo_building_porsenna_devices` — měřidla Porsenny s budovou (`enapo_porsenna_devices` × `enapo_porsenna_buildings` přes `(source, building_id)`); slouží pro obohacení OM o blok `porsenna` (měřidlo + podružná měřidla) a pro blok `energy_management` na úrovni budovy; spotřeby Porsenny blok nenese — jdou přes `mv_enapo_om_consumption` do `consumption_history` daného OM, kde mají navíc pokrytí a počty přispěvatelů
1024
990
  - `enapo_ppas_distribution_invoice_device` / `_price`, `enapo_ppas_commercial_invoice_device` / `_price` — dotahované podle id faktury a filtrované podle `place_id` instalace (jedna faktura může účtovat více OM, bez filtru by se řádky mísily)
1025
991
  - mapovací tabulka `enapo_gid_mapping`
1026
- - vlastní kontrakt modulu; plněná denně synchronizačním taskem [EnapoGidMappingSyncTask](#task-enapogidmappingsynctask) z CSV exportu (`link_source = 'eb_ean_eic'` / `'seed_energy_eic_gid_ppas'`)
1027
- - mock data (`link_source = 'mock'`) z ruční přípravy zůstávají, dokud je sync nenahradí; sync a mock se nepřepisují, každý má vlastní `link_source`
992
+ - vlastní kontrakt modulu; aktuálně plněná mock daty (`link_source = 'mock'`)
993
+ - v budoucnu ji bude plnit synchronizační task z dbt výstupu datového týmu (`tmp.ded_gid_mapping`, `link_source = 'energobroker_kod_eno'`)
1028
994
  - sloupec `is_active` v pohledu je odvozený z `valid_to` (NULL nebo v budoucnu = aktivní); expirovaná mapování se vracejí s příznakem
1029
995
  - struktura odpovědi
1030
996
  - komoditně specifická data jsou vnořená pod klíči `electricity` / `gas` u každého OM; v odpovědi je pouze klíč odpovídající poli `commodity`, ostatní jsou zcela vynechány
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/energetics",
3
- "version": "1.13.1-dev.2791580222",
3
+ "version": "1.14.0",
4
4
  "description": "Golemio Energetics Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,53 +0,0 @@
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', '20260821090000-enapo-gid-mapping-sync-comment-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', '20260821090000-enapo-gid-mapping-sync-comment-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
- };
@@ -1,3 +0,0 @@
1
- -- Restores the comment as it was created by 20260807090000-enapo-gid-mapping-om-detail-up.sql.
2
-
3
- COMMENT ON TABLE enapo_gid_mapping IS 'Mapping of consumption points (EAN/EIC) to ENO building GIDs. Module-owned contract; currently seeded with mock data (link_source = ''mock''), the future sync task from the data-team dbt output (tmp.ded_gid_mapping) will use link_source = ''energobroker_kod_eno''.';
@@ -1,4 +0,0 @@
1
- -- The mapping table is no longer mock-only: EnapoGidMappingSyncTask fills it daily from the
2
- -- ded_gid_mapping CSV export. Only the table comment changes, no data or structure is touched.
3
-
4
- COMMENT ON TABLE enapo_gid_mapping IS 'Mapping of consumption points (EAN/EIC) to ENO building GIDs. Module-owned contract, filled daily by EnapoGidMappingSyncTask from the ded_gid_mapping CSV export (link_source = ''eb_ean_eic'' / ''seed_energy_eic_gid_ppas''); electricity and gas only, water/heat (''eb_cis_odb_mista'') is out of scope. Upsert-only: nothing is ever deleted, so a mapping missing from a later export stays. Rows from the manual mock import (link_source = ''mock'') coexist untouched.';
@@ -1,14 +0,0 @@
1
- import { IEnapoGidMappingCsvRow } from "../../../../schema-definitions/datasources/enapo/gid-mapping/interfaces/IEnapoGidMappingCsvRow";
2
- import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
3
- /**
4
- * Reads the ded_gid_mapping CSV export from blob storage over plain HTTP GET. The full blob URL comes
5
- * from config so golem and rabin point at their own containers. It is a single value (not base + path):
6
- * only one file is fetched, and a one-piece URL can carry a SAS token query string, which a
7
- * base-plus-path join would drop.
8
- */
9
- export declare class EnapoGidMappingDataSource {
10
- private config;
11
- private static readonly DATASOURCE_NAME;
12
- constructor(config: ISimpleConfig);
13
- getAll(): Promise<IEnapoGidMappingCsvRow[]>;
14
- }
@@ -1,56 +0,0 @@
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 EnapoGidMappingDataSource_1;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.EnapoGidMappingDataSource = void 0;
17
- const EnapoGidMappingCsvSchema_1 = require("../../../../schema-definitions/datasources/enapo/gid-mapping/EnapoGidMappingCsvSchema");
18
- const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
19
- const integration_engine_1 = require("@golemio/core/dist/integration-engine");
20
- const CSVDataTypeStrategy_1 = require("@golemio/core/dist/integration-engine/datasources/datatype-strategy/CSVDataTypeStrategy");
21
- const HTTPFetchProtocolStrategy_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy");
22
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
23
- const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
24
- /**
25
- * Reads the ded_gid_mapping CSV export from blob storage over plain HTTP GET. The full blob URL comes
26
- * from config so golem and rabin point at their own containers. It is a single value (not base + path):
27
- * only one file is fetched, and a one-piece URL can carry a SAS token query string, which a
28
- * base-plus-path join would drop.
29
- */
30
- let EnapoGidMappingDataSource = EnapoGidMappingDataSource_1 = class EnapoGidMappingDataSource {
31
- constructor(config) {
32
- this.config = config;
33
- }
34
- async getAll() {
35
- const url = this.config.getValue("module.energetics.enapo.gidMapping.url");
36
- const dataSource = new integration_engine_1.DataSource(EnapoGidMappingDataSource_1.DATASOURCE_NAME, new HTTPFetchProtocolStrategy_1.HTTPFetchProtocolStrategy({
37
- headers: { Accept: "text/csv" },
38
- method: "GET",
39
- responseType: "text",
40
- timeoutInSeconds: 30,
41
- url,
42
- }), new CSVDataTypeStrategy_1.CSVDataTypeStrategy({
43
- fastcsvParams: { headers: true, delimiter: "," },
44
- subscribe: (row) => row,
45
- }), new golemio_validator_1.JSONSchemaValidator(EnapoGidMappingDataSource_1.DATASOURCE_NAME, EnapoGidMappingCsvSchema_1.enapoGidMappingCsvSchema));
46
- return dataSource.getAll();
47
- }
48
- };
49
- exports.EnapoGidMappingDataSource = EnapoGidMappingDataSource;
50
- EnapoGidMappingDataSource.DATASOURCE_NAME = "EnapoGidMapping";
51
- exports.EnapoGidMappingDataSource = EnapoGidMappingDataSource = EnapoGidMappingDataSource_1 = __decorate([
52
- (0, tsyringe_1.injectable)(),
53
- __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
54
- __metadata("design:paramtypes", [Object])
55
- ], EnapoGidMappingDataSource);
56
- //# sourceMappingURL=EnapoGidMappingDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnapoGidMappingDataSource.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/datasources/gid-mapping/EnapoGidMappingDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oIAAuG;AAGvG,wEAAqE;AACrE,8EAAmE;AACnE,iIAA8H;AAC9H,6IAA0I;AAC1I,mFAAkF;AAClF,iEAAwE;AAExE;;;;;GAKG;AAEI,IAAM,yBAAyB,iCAA/B,MAAM,yBAAyB;IAGlC,YAAoD,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtE,KAAK,CAAC,MAAM;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAS,wCAAwC,CAAC,CAAC;QAEnF,MAAM,UAAU,GAAG,IAAI,+BAAU,CAC7B,2BAAyB,CAAC,eAAe,EACzC,IAAI,qDAAyB,CAAC;YAC1B,OAAO,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;YAC/B,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,MAAM;YACpB,gBAAgB,EAAE,EAAE;YACpB,GAAG;SACN,CAAC,EACF,IAAI,yCAAmB,CAAC;YACpB,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE;YAChD,SAAS,EAAE,CAAC,GAA2B,EAAE,EAAE,CAAC,GAAG;SAClD,CAAC,EACF,IAAI,uCAAmB,CAAC,2BAAyB,CAAC,eAAe,EAAE,mDAAwB,CAAC,CAC/F,CAAC;QAEF,OAAO,UAAU,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;;AAzBQ,8DAAyB;AACV,yCAAe,GAAG,iBAAiB,AAApB,CAAqB;oCADnD,yBAAyB;IADrC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GAHlC,yBAAyB,CA0BrC"}
@@ -1,43 +0,0 @@
1
- import { IEnapoGidMappingCsvRow } from "../../../schema-definitions/datasources/enapo/gid-mapping/interfaces/IEnapoGidMappingCsvRow";
2
- import { IEnapoGidMapping } from "../../../schema-definitions/models/enapo/interfaces/IEnapoGidMapping";
3
- type EnapoGidMappingSkipReason = "missing_required" | "place_id_too_long" | "link_source_too_long" | "invalid_date" | "contradicting_pair" | "unresolvable_commodity";
4
- export interface IEnapoGidMappingSkipReport {
5
- total: number;
6
- byReason: Record<EnapoGidMappingSkipReason, number>;
7
- samples: Record<EnapoGidMappingSkipReason, string[]>;
8
- }
9
- interface IEnapoGidMappingNormalizeResult {
10
- mappings: IEnapoGidMapping[];
11
- skipped: IEnapoGidMappingSkipReport;
12
- outOfScopeCount: number;
13
- }
14
- /**
15
- * Normalizes raw ded_gid_mapping CSV rows into rows written to energetics.enapo_gid_mapping. Deduplicates
16
- * across the whole dataset (a per-row map cannot), so it is a plain helper, not an AbstractTransformation.
17
- */
18
- export declare class EnapoGidMappingNormalizer {
19
- private static readonly EB_PLACEHOLDER_DATE;
20
- private static readonly MAX_PLACE_ID_LENGTH;
21
- private static readonly MAX_LINK_SOURCE_LENGTH;
22
- private static readonly ISO_DATE_PATTERN;
23
- private static readonly EXCLUDED_LINK_SOURCE;
24
- private static readonly ELECTRICITY_CODES;
25
- private static readonly GAS_CODES;
26
- private static readonly HEAT_WATER_CODES;
27
- private static readonly TRUE_VALUES;
28
- private static readonly MAX_SAMPLES_PER_REASON;
29
- private static readonly SKIP_REASONS;
30
- normalize(rows: IEnapoGidMappingCsvRow[]): IEnapoGidMappingNormalizeResult;
31
- private isOutOfScope;
32
- private normalizeRow;
33
- private describeMissing;
34
- private emptyReport;
35
- private skip;
36
- private resolveIdType;
37
- private resolveCommodity;
38
- private isConsistentPair;
39
- private parseDate;
40
- private isRealDate;
41
- private isPreferred;
42
- }
43
- export {};
@@ -1,203 +0,0 @@
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 EnapoGidMappingNormalizer_1;
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.EnapoGidMappingNormalizer = void 0;
11
- const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
12
- /**
13
- * Normalizes raw ded_gid_mapping CSV rows into rows written to energetics.enapo_gid_mapping. Deduplicates
14
- * across the whole dataset (a per-row map cannot), so it is a plain helper, not an AbstractTransformation.
15
- */
16
- let EnapoGidMappingNormalizer = EnapoGidMappingNormalizer_1 = class EnapoGidMappingNormalizer {
17
- normalize(rows) {
18
- const skipped = this.emptyReport();
19
- const byKey = new Map();
20
- let outOfScopeCount = 0;
21
- for (const row of rows) {
22
- if (this.isOutOfScope(row)) {
23
- outOfScopeCount += 1;
24
- continue;
25
- }
26
- const mapping = this.normalizeRow(row, skipped);
27
- if (!mapping) {
28
- continue;
29
- }
30
- const key = `${mapping.place_id}|${mapping.gid}|${mapping.link_source}`;
31
- const current = byKey.get(key);
32
- if (!current || this.isPreferred(mapping, current)) {
33
- byKey.set(key, mapping);
34
- }
35
- }
36
- return { mappings: [...byKey.values()], skipped, outOfScopeCount };
37
- }
38
- // Dropped before any other check so an out-of-scope row that is also malformed cannot inflate the defect counters.
39
- isOutOfScope(row) {
40
- const linkSource = (row.link_source ?? "").trim().toLowerCase();
41
- const commodity = (row.commodity ?? "").trim().toLowerCase();
42
- return (linkSource === EnapoGidMappingNormalizer_1.EXCLUDED_LINK_SOURCE ||
43
- EnapoGidMappingNormalizer_1.HEAT_WATER_CODES.includes(commodity));
44
- }
45
- normalizeRow(row, skipped) {
46
- const placeId = (row.place_id ?? "").trim();
47
- const gid = (row.gid ?? "").trim();
48
- // link_source is part of the primary key, so it is folded to lower case to keep casing from splitting one key into two.
49
- const linkSource = (row.link_source ?? "").trim().toLowerCase();
50
- if (!placeId || !gid || !linkSource) {
51
- return this.skip(skipped, "missing_required", this.describeMissing(placeId, gid, linkSource));
52
- }
53
- if (placeId.length > EnapoGidMappingNormalizer_1.MAX_PLACE_ID_LENGTH) {
54
- return this.skip(skipped, "place_id_too_long", placeId);
55
- }
56
- if (linkSource.length > EnapoGidMappingNormalizer_1.MAX_LINK_SOURCE_LENGTH) {
57
- return this.skip(skipped, "link_source_too_long", linkSource);
58
- }
59
- const idTypeRaw = (row.id_type ?? "").trim().toLowerCase();
60
- const commodityRaw = (row.commodity ?? "").trim().toLowerCase();
61
- const idType = this.resolveIdType(idTypeRaw, commodityRaw);
62
- const commodity = this.resolveCommodity(idTypeRaw, commodityRaw);
63
- if (!idType || !commodity) {
64
- return this.skip(skipped, "unresolvable_commodity", placeId);
65
- }
66
- // EAN is always electricity, EIC always gas, so a disagreeing pair is bad source data.
67
- if (!this.isConsistentPair(idType, commodity)) {
68
- return this.skip(skipped, "contradicting_pair", placeId);
69
- }
70
- const validFrom = this.parseDate(row.valid_from);
71
- const validTo = this.parseDate(row.valid_to);
72
- if (!validFrom.isValid || !validTo.isValid) {
73
- return this.skip(skipped, "invalid_date", `${placeId} (${row.valid_from ?? ""}/${row.valid_to ?? ""})`);
74
- }
75
- return {
76
- place_id: placeId,
77
- id_type: idType,
78
- commodity,
79
- gid,
80
- is_first_gid: EnapoGidMappingNormalizer_1.TRUE_VALUES.includes((row.is_first_gid ?? "").trim().toLowerCase()),
81
- link_source: linkSource,
82
- valid_from: validFrom.value,
83
- valid_to: validTo.value === EnapoGidMappingNormalizer_1.EB_PLACEHOLDER_DATE ? null : validTo.value,
84
- };
85
- }
86
- // Names the missing columns and keeps whatever identifier the row still has, so the logged sample says what is wrong.
87
- describeMissing(placeId, gid, linkSource) {
88
- const missing = [];
89
- if (!placeId) {
90
- missing.push("place_id");
91
- }
92
- if (!gid) {
93
- missing.push("gid");
94
- }
95
- if (!linkSource) {
96
- missing.push("link_source");
97
- }
98
- const present = [
99
- placeId ? `place_id=${placeId}` : null,
100
- gid ? `gid=${gid}` : null,
101
- linkSource ? `link_source=${linkSource}` : null,
102
- ].filter((part) => part !== null);
103
- return `missing ${missing.join("+")}${present.length > 0 ? ` (${present.join(", ")})` : ""}`;
104
- }
105
- emptyReport() {
106
- const byReason = {};
107
- const samples = {};
108
- for (const reason of EnapoGidMappingNormalizer_1.SKIP_REASONS) {
109
- byReason[reason] = 0;
110
- samples[reason] = [];
111
- }
112
- return { total: 0, byReason, samples };
113
- }
114
- skip(report, reason, sample) {
115
- report.total += 1;
116
- report.byReason[reason] += 1;
117
- if (report.samples[reason].length < EnapoGidMappingNormalizer_1.MAX_SAMPLES_PER_REASON && sample) {
118
- report.samples[reason].push(sample);
119
- }
120
- return null;
121
- }
122
- resolveIdType(idTypeRaw, commodityRaw) {
123
- if (idTypeRaw === "ean" || idTypeRaw === "eic") {
124
- return idTypeRaw;
125
- }
126
- if (EnapoGidMappingNormalizer_1.ELECTRICITY_CODES.includes(commodityRaw)) {
127
- return "ean";
128
- }
129
- if (EnapoGidMappingNormalizer_1.GAS_CODES.includes(commodityRaw)) {
130
- return "eic";
131
- }
132
- return null;
133
- }
134
- resolveCommodity(idTypeRaw, commodityRaw) {
135
- if (EnapoGidMappingNormalizer_1.ELECTRICITY_CODES.includes(commodityRaw)) {
136
- return "electricity";
137
- }
138
- if (EnapoGidMappingNormalizer_1.GAS_CODES.includes(commodityRaw)) {
139
- return "gas";
140
- }
141
- if (idTypeRaw === "ean") {
142
- return "electricity";
143
- }
144
- if (idTypeRaw === "eic") {
145
- return "gas";
146
- }
147
- return null;
148
- }
149
- isConsistentPair(idType, commodity) {
150
- return (idType === "ean" && commodity === "electricity") || (idType === "eic" && commodity === "gas");
151
- }
152
- // Empty cell is a valid null; a timestamp suffix is tolerated (only the date part is stored). Anything
153
- // that is not a real ISO calendar date is rejected, because the target columns are typed date.
154
- parseDate(raw) {
155
- const value = (raw ?? "").trim();
156
- if (!value) {
157
- return { isValid: true, value: null };
158
- }
159
- const datePart = value.slice(0, 10);
160
- if (!EnapoGidMappingNormalizer_1.ISO_DATE_PATTERN.test(datePart) || !this.isRealDate(datePart)) {
161
- return { isValid: false, value: null };
162
- }
163
- return { isValid: true, value: datePart };
164
- }
165
- // Guards against a well-shaped but non-existent date such as 2019-02-31 that the pattern alone lets through.
166
- isRealDate(isoDate) {
167
- const parsed = new Date(`${isoDate}T00:00:00Z`);
168
- return !Number.isNaN(parsed.getTime()) && parsed.toISOString().slice(0, 10) === isoDate;
169
- }
170
- isPreferred(candidate, current) {
171
- const candidateActive = candidate.valid_to === null;
172
- const currentActive = current.valid_to === null;
173
- if (candidateActive !== currentActive) {
174
- return candidateActive;
175
- }
176
- // Both dates are normalized to ISO, so a plain string comparison orders them correctly.
177
- return (candidate.valid_from ?? "") > (current.valid_from ?? "");
178
- }
179
- };
180
- exports.EnapoGidMappingNormalizer = EnapoGidMappingNormalizer;
181
- EnapoGidMappingNormalizer.EB_PLACEHOLDER_DATE = "1900-01-01";
182
- EnapoGidMappingNormalizer.MAX_PLACE_ID_LENGTH = 50;
183
- EnapoGidMappingNormalizer.MAX_LINK_SOURCE_LENGTH = 50;
184
- EnapoGidMappingNormalizer.ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
185
- // Water/heat mapping, out of scope until the source codes are cleaned up (separate issue).
186
- EnapoGidMappingNormalizer.EXCLUDED_LINK_SOURCE = "eb_cis_odb_mista";
187
- EnapoGidMappingNormalizer.ELECTRICITY_CODES = ["1", "electricity", "elektrina"];
188
- EnapoGidMappingNormalizer.GAS_CODES = ["2", "gas", "plyn"];
189
- EnapoGidMappingNormalizer.HEAT_WATER_CODES = ["3", "4", "heat", "teplo", "water", "voda"];
190
- EnapoGidMappingNormalizer.TRUE_VALUES = ["true", "1", "t", "yes"];
191
- EnapoGidMappingNormalizer.MAX_SAMPLES_PER_REASON = 5;
192
- EnapoGidMappingNormalizer.SKIP_REASONS = [
193
- "missing_required",
194
- "place_id_too_long",
195
- "link_source_too_long",
196
- "invalid_date",
197
- "contradicting_pair",
198
- "unresolvable_commodity",
199
- ];
200
- exports.EnapoGidMappingNormalizer = EnapoGidMappingNormalizer = EnapoGidMappingNormalizer_1 = __decorate([
201
- (0, tsyringe_1.injectable)()
202
- ], EnapoGidMappingNormalizer);
203
- //# sourceMappingURL=EnapoGidMappingNormalizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnapoGidMappingNormalizer.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/helpers/EnapoGidMappingNormalizer.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,iEAAgE;AA6BhE;;;GAGG;AAEI,IAAM,yBAAyB,iCAA/B,MAAM,yBAAyB;IAqB3B,SAAS,CAAC,IAA8B;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;QAClD,IAAI,eAAe,GAAG,CAAC,CAAC;QAExB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,eAAe,IAAI,CAAC,CAAC;gBACrB,SAAS;YACb,C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G,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;;AApNQ,8DAAyB;AACV,6CAAmB,GAAG,YAAY,AAAf,CAAgB;AACnC,6CAAmB,GAAG,EAAE,AAAL,CAAM;AACzB,gDAAsB,GAAG,EAAE,AAAL,CAAM;AAC5B,0CAAgB,GAAG,qBAAqB,AAAxB,CAAyB;AACjE,2FAA2F;AACnE,8CAAoB,GAAG,kBAAkB,AAArB,CAAsB;AAC1C,2CAAiB,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,WAAW,CAAC,AAApC,CAAqC;AACtD,mCAAS,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,AAAvB,CAAwB;AACjC,0CAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,AAA/C,CAAgD;AAChE,qCAAW,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,AAA5B,CAA6B;AACxC,gDAAsB,GAAG,CAAC,AAAJ,CAAK;AAC3B,sCAAY,GAAgC;IAChE,kBAAkB;IAClB,mBAAmB;IACnB,sBAAsB;IACtB,cAAc;IACd,oBAAoB;IACpB,wBAAwB;CAC3B,AAPmC,CAOlC;oCAnBO,yBAAyB;IADrC,IAAA,qBAAU,GAAE;GACA,yBAAyB,CAqNrC"}
@@ -1,13 +0,0 @@
1
- import { IModel } from "@golemio/core/dist/integration-engine/models/IModel";
2
- import { PostgresModel } from "@golemio/core/dist/integration-engine/models/PostgresModel";
3
- /**
4
- * Writes the ded_gid_mapping rows into energetics.enapo_gid_mapping. Uses insertOrUpdate so a run only
5
- * ever inserts new mappings or updates existing ones (keyed on place_id + gid + link_source) and never
6
- * deletes: a mapping that disappears from a later export stays in the table, and re-running over the same
7
- * input is idempotent.
8
- */
9
- export declare class EnapoGidMappingRepository extends PostgresModel implements IModel {
10
- static REPOSITORY_NAME: string;
11
- static JSON_SCHEMA_VALIDATOR_NAME: string;
12
- constructor();
13
- }
@@ -1,42 +0,0 @@
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 EnapoGidMappingRepository_1;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.EnapoGidMappingRepository = void 0;
14
- const _sch_1 = require("../../../schema-definitions");
15
- const EnapoGidMappingModel_1 = require("../../../schema-definitions/models/enapo/EnapoGidMappingModel");
16
- const PostgresModel_1 = require("@golemio/core/dist/integration-engine/models/PostgresModel");
17
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
18
- const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
19
- /**
20
- * Writes the ded_gid_mapping rows into energetics.enapo_gid_mapping. Uses insertOrUpdate so a run only
21
- * ever inserts new mappings or updates existing ones (keyed on place_id + gid + link_source) and never
22
- * deletes: a mapping that disappears from a later export stays in the table, and re-running over the same
23
- * input is idempotent.
24
- */
25
- let EnapoGidMappingRepository = EnapoGidMappingRepository_1 = class EnapoGidMappingRepository extends PostgresModel_1.PostgresModel {
26
- constructor() {
27
- super(EnapoGidMappingRepository_1.REPOSITORY_NAME, {
28
- pgTableName: EnapoGidMappingModel_1.EnapoGidMappingModel.TABLE_NAME,
29
- pgSchema: _sch_1.EnergeticsSchema.pgSchema,
30
- outputSequelizeAttributes: EnapoGidMappingModel_1.EnapoGidMappingModel.attributeModel,
31
- savingType: "insertOrUpdate",
32
- }, new golemio_validator_1.JSONSchemaValidator(EnapoGidMappingRepository_1.JSON_SCHEMA_VALIDATOR_NAME, EnapoGidMappingModel_1.EnapoGidMappingModel.jsonSchema));
33
- }
34
- };
35
- exports.EnapoGidMappingRepository = EnapoGidMappingRepository;
36
- EnapoGidMappingRepository.REPOSITORY_NAME = "EnapoGidMappingRepository";
37
- EnapoGidMappingRepository.JSON_SCHEMA_VALIDATOR_NAME = "EnapoGidMappingRepositoryValidator";
38
- exports.EnapoGidMappingRepository = EnapoGidMappingRepository = EnapoGidMappingRepository_1 = __decorate([
39
- (0, tsyringe_1.injectable)(),
40
- __metadata("design:paramtypes", [])
41
- ], EnapoGidMappingRepository);
42
- //# sourceMappingURL=EnapoGidMappingRepository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnapoGidMappingRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/enapo/repositories/EnapoGidMappingRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,sDAAwC;AACxC,wGAA8E;AAE9E,8FAA2F;AAC3F,mFAAkF;AAClF,iEAAgE;AAEhE;;;;;GAKG;AAEI,IAAM,yBAAyB,iCAA/B,MAAM,yBAA0B,SAAQ,6BAAa;IAIxD;QACI,KAAK,CACD,2BAAyB,CAAC,eAAe,EACzC;YACI,WAAW,EAAE,2CAAoB,CAAC,UAAU;YAC5C,QAAQ,EAAE,uBAAgB,CAAC,QAAQ;YACnC,yBAAyB,EAAE,2CAAoB,CAAC,cAAc;YAC9D,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,2BAAyB,CAAC,0BAA0B,EAAE,2CAAoB,CAAC,UAAU,CAAC,CACjH,CAAC;IACN,CAAC;;AAfQ,8DAAyB;AACpB,yCAAe,GAAG,2BAA2B,AAA9B,CAA+B;AAC9C,oDAA0B,GAAG,oCAAoC,AAAvC,CAAwC;oCAFvE,yBAAyB;IADrC,IAAA,qBAAU,GAAE;;GACA,yBAAyB,CAgBrC"}
@@ -1,45 +0,0 @@
1
- import { EnapoGidMappingDataSource } from "../../datasources/gid-mapping/EnapoGidMappingDataSource";
2
- import { EnapoGidMappingRepository } from "../../repositories/EnapoGidMappingRepository";
3
- import { EnapoGidMappingNormalizer } from "../../helpers/EnapoGidMappingNormalizer";
4
- import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector";
5
- import { ILogger } from "@golemio/core/dist/helpers/logger/LoggerProvider";
6
- import { AbstractTask } from "@golemio/core/dist/integration-engine";
7
- /**
8
- * Syncs the ded_gid_mapping CSV export (blob storage) into energetics.enapo_gid_mapping.
9
- *
10
- * Runs on a daily cron so a new consumption point or a changed mapping in the source reaches production
11
- * the next day at the latest. The write is upsert-only (never delete), so a mapping missing from a later
12
- * export stays in the table, and running twice over the same input yields the same result. The refresh
13
- * takes no parameters - it always ingests the whole export - so there is nothing to validate and the
14
- * schema is deliberately undefined.
15
- *
16
- * The producer delivers the full export (unsupported commodities and junk included) and cannot be forced
17
- * to clean it, so rows we cannot process are skipped and logged as a warning rather than failing the run.
18
- */
19
- export declare class EnapoGidMappingSyncTask extends AbstractTask<Record<string, never>> {
20
- private logger;
21
- private dbConnector;
22
- private datasource;
23
- private normalizer;
24
- private repository;
25
- queueName: string;
26
- queueTtl: number;
27
- protected schema: undefined;
28
- /**
29
- * The whole export goes in as a single insert per batch, so the batch has to stay below the Postgres
30
- * bind-parameter limit (65535); eight columns per row leave room for well over this many.
31
- */
32
- private static readonly SAVE_BATCH_SIZE;
33
- constructor(logger: ILogger, dbConnector: IDatabaseConnector, datasource: EnapoGidMappingDataSource, normalizer: EnapoGidMappingNormalizer, repository: EnapoGidMappingRepository);
34
- execute(): Promise<void>;
35
- /**
36
- * The routine outcome of a run, including the water/heat rows that are filtered out on purpose. This
37
- * is expected volume, so it never warns - it only has to stay visible.
38
- */
39
- private logOutcome;
40
- /**
41
- * Rows that should have been usable but were not. Kept separate from the out-of-scope count so a
42
- * large expected filter volume cannot hide a handful of real defects.
43
- */
44
- private logSkipped;
45
- }
@@ -1,121 +0,0 @@
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 EnapoGidMappingSyncTask_1;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.EnapoGidMappingSyncTask = void 0;
17
- const constants_1 = require("../../constants");
18
- const EnapoGidMappingDataSource_1 = require("../../datasources/gid-mapping/EnapoGidMappingDataSource");
19
- const Chunker_1 = require("../../helpers/Chunker");
20
- const EnapoWorkerContainerToken_1 = require("../../ioc/EnapoWorkerContainerToken");
21
- const EnapoGidMappingRepository_1 = require("../../repositories/EnapoGidMappingRepository");
22
- const EnapoGidMappingNormalizer_1 = require("../../helpers/EnapoGidMappingNormalizer");
23
- const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
24
- const integration_engine_1 = require("@golemio/core/dist/integration-engine");
25
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
26
- const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
27
- /**
28
- * Syncs the ded_gid_mapping CSV export (blob storage) into energetics.enapo_gid_mapping.
29
- *
30
- * Runs on a daily cron so a new consumption point or a changed mapping in the source reaches production
31
- * the next day at the latest. The write is upsert-only (never delete), so a mapping missing from a later
32
- * export stays in the table, and running twice over the same input yields the same result. The refresh
33
- * takes no parameters - it always ingests the whole export - so there is nothing to validate and the
34
- * schema is deliberately undefined.
35
- *
36
- * The producer delivers the full export (unsupported commodities and junk included) and cannot be forced
37
- * to clean it, so rows we cannot process are skipped and logged as a warning rather than failing the run.
38
- */
39
- let EnapoGidMappingSyncTask = EnapoGidMappingSyncTask_1 = class EnapoGidMappingSyncTask extends integration_engine_1.AbstractTask {
40
- constructor(logger, dbConnector, datasource, normalizer, repository) {
41
- super(constants_1.ENAPO_WORKER_NAME);
42
- this.logger = logger;
43
- this.dbConnector = dbConnector;
44
- this.datasource = datasource;
45
- this.normalizer = normalizer;
46
- this.repository = repository;
47
- this.queueName = "syncEnapoGidMapping";
48
- this.queueTtl = 30 * 60 * 1000;
49
- this.schema = undefined;
50
- }
51
- async execute() {
52
- try {
53
- const rawRows = await this.datasource.getAll();
54
- const { mappings, skipped, outOfScopeCount } = this.normalizer.normalize(rawRows);
55
- this.logOutcome(rawRows.length, mappings.length, outOfScopeCount);
56
- this.logSkipped(skipped);
57
- if (mappings.length === 0) {
58
- return;
59
- }
60
- const batches = Chunker_1.Slicer.chunkArray(mappings, EnapoGidMappingSyncTask_1.SAVE_BATCH_SIZE);
61
- const transaction = await this.dbConnector.getConnection().transaction();
62
- try {
63
- for (const batch of batches) {
64
- await this.repository.bulkSave(batch, undefined, undefined, undefined, transaction);
65
- }
66
- await transaction.commit();
67
- }
68
- catch (err) {
69
- await transaction.rollback();
70
- throw err;
71
- }
72
- }
73
- catch (err) {
74
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
75
- throw err;
76
- }
77
- throw new golemio_errors_1.GeneralError("Failed to sync the enapo gid mapping.", this.constructor.name, err);
78
- }
79
- }
80
- /**
81
- * The routine outcome of a run, including the water/heat rows that are filtered out on purpose. This
82
- * is expected volume, so it never warns - it only has to stay visible.
83
- */
84
- logOutcome(totalRows, savedRows, outOfScopeCount) {
85
- this.logger.info(`${this.constructor.name}: read ${totalRows} gid mapping rows, saving ${savedRows}, ` +
86
- `${outOfScopeCount} out of scope (water/heat).`);
87
- }
88
- /**
89
- * Rows that should have been usable but were not. Kept separate from the out-of-scope count so a
90
- * large expected filter volume cannot hide a handful of real defects.
91
- */
92
- logSkipped(skipped) {
93
- if (skipped.total === 0) {
94
- return;
95
- }
96
- const reasons = Object.keys(skipped.byReason);
97
- const detail = reasons
98
- .filter((reason) => skipped.byReason[reason] > 0)
99
- .map((reason) => `${reason}=${skipped.byReason[reason]} (e.g. ${skipped.samples[reason].join(", ") || "-"})`)
100
- .join("; ");
101
- this.logger.warn(`${this.constructor.name}: could not process ${skipped.total} gid mapping rows. ${detail}`);
102
- }
103
- };
104
- exports.EnapoGidMappingSyncTask = EnapoGidMappingSyncTask;
105
- /**
106
- * The whole export goes in as a single insert per batch, so the batch has to stay below the Postgres
107
- * bind-parameter limit (65535); eight columns per row leave room for well over this many.
108
- */
109
- EnapoGidMappingSyncTask.SAVE_BATCH_SIZE = 5000;
110
- exports.EnapoGidMappingSyncTask = EnapoGidMappingSyncTask = EnapoGidMappingSyncTask_1 = __decorate([
111
- (0, tsyringe_1.injectable)(),
112
- __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
113
- __param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.PostgresConnector)),
114
- __param(2, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingDataSource)),
115
- __param(3, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingNormalizer)),
116
- __param(4, (0, tsyringe_1.inject)(EnapoWorkerContainerToken_1.EnapoWorkerContainerToken.EnapoGidMappingRepository)),
117
- __metadata("design:paramtypes", [Object, Object, EnapoGidMappingDataSource_1.EnapoGidMappingDataSource,
118
- EnapoGidMappingNormalizer_1.EnapoGidMappingNormalizer,
119
- EnapoGidMappingRepository_1.EnapoGidMappingRepository])
120
- ], EnapoGidMappingSyncTask);
121
- //# sourceMappingURL=EnapoGidMappingSyncTask.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnapoGidMappingSyncTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/enapo/workers/task/EnapoGidMappingSyncTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAwD;AACxD,uGAAwG;AACxG,mDAAmD;AACnD,mFAAoF;AACpF,4FAA6F;AAC7F,uFAAoH;AAEpH,wEAAqE;AAErE,8EAAqE;AACrE,6EAA8F;AAC9F,iEAAwE;AAExE;;;;;;;;;;;GAWG;AAEI,IAAM,uBAAuB,+BAA7B,MAAM,uBAAwB,SAAQ,iCAAmC;IAW5E,YAC8B,MAAuB,EACZ,WAAuC,EACf,UAA6C,EAE1G,UAA6C,EACgB,UAA6C;QAE1G,KAAK,CAAC,6BAAiB,CAAC,CAAC;QAPS,WAAM,GAAN,MAAM,CAAS;QACJ,gBAAW,GAAX,WAAW,CAAoB;QACP,eAAU,GAAV,UAAU,CAA2B;QAElG,eAAU,GAAV,UAAU,CAA2B;QACwB,eAAU,GAAV,UAAU,CAA2B;QAhBvG,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACvB,WAAM,GAAG,SAAS,CAAC;IAiB7B,CAAC;IAEM,KAAK,CAAC,OAAO;QAChB,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC/C,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAElF,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;YAClE,IAA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apoGidMappingCsvRow";
3
- export declare const enapoGidMappingCsvSchema: JSONSchemaType<IEnapoGidMappingCsvRow[]>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enapoGidMappingCsvSchema = void 0;
4
- // Guards only the shape of the export contract: every column present as a string (CSV yields an empty
5
- // string for a blank cell). Value normalization and business rules live in the transformation.
6
- exports.enapoGidMappingCsvSchema = {
7
- type: "array",
8
- items: {
9
- type: "object",
10
- properties: {
11
- place_id: { type: "string" },
12
- id_type: { type: "string" },
13
- commodity: { type: "string" },
14
- gid: { type: "string" },
15
- is_first_gid: { type: "string" },
16
- link_source: { type: "string" },
17
- valid_from: { type: "string" },
18
- valid_to: { type: "string" },
19
- },
20
- required: ["place_id", "id_type", "commodity", "gid", "is_first_gid", "link_source", "valid_from", "valid_to"],
21
- },
22
- };
23
- //# sourceMappingURL=EnapoGidMappingCsvSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnapoGidMappingCsvSchema.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/datasources/enapo/gid-mapping/EnapoGidMappingCsvSchema.ts"],"names":[],"mappings":";;;AAGA,sGAAsG;AACtG,+FAA+F;AAClF,QAAA,wBAAwB,GAA6C;IAC9E,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC7B,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAChC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,CAAC;KACjH;CACJ,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Raw row of the ded_gid_mapping CSV export as delivered to blob storage by the data team.
3
- * Every value arrives as a string (or empty string for a missing value); normalization and typing
4
- * happen in the transformation, so the ingest never trusts the raw shape.
5
- */
6
- export interface IEnapoGidMappingCsvRow {
7
- place_id: string;
8
- id_type: string;
9
- commodity: string;
10
- gid: string;
11
- is_first_gid: string;
12
- link_source: string;
13
- valid_from: string;
14
- valid_to: string;
15
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IEnapoGidMappingCsvRow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IEnapoGidMappingCsvRow.js","sourceRoot":"","sources":["../../../../../../src/schema-definitions/datasources/enapo/gid-mapping/interfaces/IEnapoGidMappingCsvRow.ts"],"names":[],"mappings":""}