@golemio/energetics 1.12.1 → 1.12.2-dev.2727447026
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/db/example/00_clear_test_data.sql +13 -0
- package/db/example/06_eno.sql +25 -0
- package/db/example/07_enapo_om_detail.sql +131 -0
- package/db/migrations/postgresql/20260729100000-enapo-gid-mapping-om-detail.js +53 -0
- package/db/migrations/postgresql/20260730120000-enapo-om-detail-porsenna.js +53 -0
- package/db/migrations/postgresql/sqls/20260729100000-enapo-gid-mapping-om-detail-down.sql +3 -0
- package/db/migrations/postgresql/sqls/20260729100000-enapo-gid-mapping-om-detail-up.sql +179 -0
- package/db/migrations/postgresql/sqls/20260730120000-enapo-om-detail-porsenna-down.sql +132 -0
- package/db/migrations/postgresql/sqls/20260730120000-enapo-om-detail-porsenna-up.sql +287 -0
- package/db/scripts/ded_gid_mapping_mock_import.sql +48 -0
- package/dist/output-gateway/constants/Links.d.ts +1 -0
- package/dist/output-gateway/constants/Links.js +2 -1
- package/dist/output-gateway/constants/Links.js.map +1 -1
- package/dist/output-gateway/controllers/v2/EnoBuildingsController.d.ts +11 -0
- package/dist/output-gateway/controllers/v2/EnoBuildingsController.js +53 -0
- package/dist/output-gateway/controllers/v2/EnoBuildingsController.js.map +1 -0
- package/dist/output-gateway/helpers/objectMappers.d.ts +10 -0
- package/dist/output-gateway/helpers/objectMappers.js +37 -0
- package/dist/output-gateway/helpers/objectMappers.js.map +1 -0
- package/dist/output-gateway/index.js +8 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/ioc/Di.js +9 -1
- package/dist/output-gateway/ioc/Di.js.map +1 -1
- package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +4 -0
- package/dist/output-gateway/ioc/ModuleContainerToken.js +4 -0
- package/dist/output-gateway/ioc/ModuleContainerToken.js.map +1 -1
- package/dist/output-gateway/models/EnoBuildingDetailViewModel.d.ts +35 -0
- package/dist/output-gateway/models/EnoBuildingDetailViewModel.js +43 -0
- package/dist/output-gateway/models/EnoBuildingDetailViewModel.js.map +1 -0
- package/dist/output-gateway/models/EnoConsumptionPointViewModel.d.ts +105 -0
- package/dist/output-gateway/models/EnoConsumptionPointViewModel.js +118 -0
- package/dist/output-gateway/models/EnoConsumptionPointViewModel.js.map +1 -0
- package/dist/output-gateway/models/EnoPorsennaDeviceViewModel.d.ts +27 -0
- package/dist/output-gateway/models/EnoPorsennaDeviceViewModel.js +41 -0
- package/dist/output-gateway/models/EnoPorsennaDeviceViewModel.js.map +1 -0
- package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.d.ts +30 -0
- package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.js +3 -0
- package/dist/output-gateway/models/interfaces/IEnoBuildingDetailView.js.map +1 -0
- package/dist/output-gateway/models/interfaces/IEnoConsumptionPointView.d.ts +104 -0
- package/dist/output-gateway/models/interfaces/IEnoConsumptionPointView.js +3 -0
- package/dist/output-gateway/models/interfaces/IEnoConsumptionPointView.js.map +1 -0
- package/dist/output-gateway/models/interfaces/IEnoPorsennaDeviceView.d.ts +22 -0
- package/dist/output-gateway/models/interfaces/IEnoPorsennaDeviceView.js +3 -0
- package/dist/output-gateway/models/interfaces/IEnoPorsennaDeviceView.js.map +1 -0
- package/dist/output-gateway/repositories/AbstractNumericParsingRepository.d.ts +12 -0
- package/dist/output-gateway/repositories/AbstractNumericParsingRepository.js +41 -0
- package/dist/output-gateway/repositories/AbstractNumericParsingRepository.js.map +1 -0
- package/dist/output-gateway/repositories/EnoBuildingAddressesRepository.d.ts +8 -0
- package/dist/output-gateway/repositories/EnoBuildingAddressesRepository.js +62 -0
- package/dist/output-gateway/repositories/EnoBuildingAddressesRepository.js.map +1 -0
- package/dist/output-gateway/repositories/EnoBuildingDetailRepository.d.ts +18 -0
- package/dist/output-gateway/repositories/EnoBuildingDetailRepository.js +100 -0
- package/dist/output-gateway/repositories/EnoBuildingDetailRepository.js.map +1 -0
- package/dist/output-gateway/repositories/EnoConsumptionPointsRepository.d.ts +8 -0
- package/dist/output-gateway/repositories/EnoConsumptionPointsRepository.js +51 -0
- package/dist/output-gateway/repositories/EnoConsumptionPointsRepository.js.map +1 -0
- package/dist/output-gateway/repositories/EnoPorsennaDevicesRepository.d.ts +8 -0
- package/dist/output-gateway/repositories/EnoPorsennaDevicesRepository.js +51 -0
- package/dist/output-gateway/repositories/EnoPorsennaDevicesRepository.js.map +1 -0
- package/dist/output-gateway/repositories/PorsennaConsumptionsRepository.d.ts +8 -0
- package/dist/output-gateway/repositories/PorsennaConsumptionsRepository.js +52 -0
- package/dist/output-gateway/repositories/PorsennaConsumptionsRepository.js.map +1 -0
- package/dist/output-gateway/repositories/PpasInvoiceChildRepository.d.ts +13 -0
- package/dist/output-gateway/repositories/PpasInvoiceChildRepository.js +39 -0
- package/dist/output-gateway/repositories/PpasInvoiceChildRepository.js.map +1 -0
- package/dist/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.d.ts +22 -0
- package/dist/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.js +3 -0
- package/dist/output-gateway/repositories/interfaces/IEnoBuildingDetailAggregate.js.map +1 -0
- package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.d.ts +106 -0
- package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.js +3 -0
- package/dist/output-gateway/routers/interfaces/IEnoBuildingDetailResponse.js.map +1 -0
- package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.d.ts +9 -0
- package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js +40 -0
- package/dist/output-gateway/routers/v2/V2EnoBuildingsRouter.js.map +1 -0
- package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.d.ts +14 -0
- package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js +149 -0
- package/dist/output-gateway/transformations/EnoBuildingDetailTransformation.js.map +1 -0
- package/dist/schema-definitions/models/enapo/EnapoGidMappingModel.d.ts +17 -0
- package/dist/schema-definitions/models/enapo/EnapoGidMappingModel.js +63 -0
- package/dist/schema-definitions/models/enapo/EnapoGidMappingModel.js.map +1 -0
- package/dist/schema-definitions/models/enapo/interfaces/IEnapoGidMapping.d.ts +11 -0
- package/dist/schema-definitions/models/enapo/interfaces/IEnapoGidMapping.js +3 -0
- package/dist/schema-definitions/models/enapo/interfaces/IEnapoGidMapping.js.map +1 -0
- package/dist/schema-definitions/models/eno/AddressModel.d.ts +1 -1
- package/dist/schema-definitions/models/eno/AddressModel.js +1 -1
- package/dist/schema-definitions/models/eno/AddressModel.js.map +1 -1
- package/dist/schema-definitions/models/eno/interfaces/IAddress.d.ts +1 -1
- package/docs/implementation_documentation.md +41 -2
- package/docs/openapi-output.yaml +260 -1
- package/package.json +1 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
CREATE OR REPLACE VIEW v_enapo_building_porsenna_devices AS
|
|
2
|
+
SELECT
|
|
3
|
+
pb.gid,
|
|
4
|
+
d.source,
|
|
5
|
+
d.id AS device_id,
|
|
6
|
+
d.parent_device_id,
|
|
7
|
+
d.identifier,
|
|
8
|
+
d."type",
|
|
9
|
+
d."level",
|
|
10
|
+
d.name,
|
|
11
|
+
d.measurement_target,
|
|
12
|
+
d.meter_number,
|
|
13
|
+
d.supply_point_number,
|
|
14
|
+
d.disabled_at,
|
|
15
|
+
d.show_in_output,
|
|
16
|
+
pb.id AS building_id,
|
|
17
|
+
pb.name AS building_name,
|
|
18
|
+
pb.street AS building_street,
|
|
19
|
+
pb.house_number AS building_house_number,
|
|
20
|
+
pb.street_number AS building_street_number,
|
|
21
|
+
pb.city AS building_city,
|
|
22
|
+
pb.postcode AS building_postcode
|
|
23
|
+
FROM enapo_porsenna_devices d
|
|
24
|
+
INNER JOIN enapo_porsenna_buildings pb
|
|
25
|
+
ON pb.source = d.source AND pb.id = d.building_id
|
|
26
|
+
WHERE pb.gid IS NOT NULL;
|
|
27
|
+
|
|
28
|
+
DROP VIEW IF EXISTS v_enapo_building_consumption_points;
|
|
29
|
+
|
|
30
|
+
CREATE VIEW v_enapo_building_consumption_points AS
|
|
31
|
+
SELECT
|
|
32
|
+
m.gid,
|
|
33
|
+
m.place_id,
|
|
34
|
+
m.id_type,
|
|
35
|
+
m.commodity,
|
|
36
|
+
m.is_first_gid,
|
|
37
|
+
m.link_source,
|
|
38
|
+
m.valid_from,
|
|
39
|
+
m.valid_to,
|
|
40
|
+
(m.valid_to IS NULL OR m.valid_to >= CURRENT_DATE) AS is_active,
|
|
41
|
+
pm.*,
|
|
42
|
+
di.*,
|
|
43
|
+
ci.*
|
|
44
|
+
FROM enapo_gid_mapping m
|
|
45
|
+
LEFT JOIN LATERAL (
|
|
46
|
+
SELECT
|
|
47
|
+
h."year" AS md_year,
|
|
48
|
+
h."month" AS md_month,
|
|
49
|
+
h.month_name AS md_month_name,
|
|
50
|
+
h.days_in_stored_month AS md_days_in_stored_month,
|
|
51
|
+
h.consumption_point AS md_consumption_point,
|
|
52
|
+
h.address AS md_address,
|
|
53
|
+
h.location_type AS md_location_type,
|
|
54
|
+
h.company_name AS md_company_name,
|
|
55
|
+
h.company_id AS md_company_id,
|
|
56
|
+
h.tarif_type AS md_tarif_type,
|
|
57
|
+
h.tarif_1t2t AS md_tarif_1t2t,
|
|
58
|
+
h.phases AS md_phases,
|
|
59
|
+
h.circuit_breaker AS md_circuit_breaker,
|
|
60
|
+
h.type_b_meter AS md_type_b_meter,
|
|
61
|
+
h.meter_replaced AS md_meter_replaced
|
|
62
|
+
FROM enapo_pre_metadata_history h
|
|
63
|
+
WHERE h.ean = m.place_id
|
|
64
|
+
ORDER BY h."year" DESC, h."month" DESC
|
|
65
|
+
LIMIT 1
|
|
66
|
+
) pm ON m.id_type = 'ean'
|
|
67
|
+
LEFT JOIN LATERAL (
|
|
68
|
+
SELECT
|
|
69
|
+
i.id AS di_id,
|
|
70
|
+
i.preceding_id AS di_preceding_id,
|
|
71
|
+
i.customer_id AS di_customer_id,
|
|
72
|
+
i.customer_company_id AS di_customer_company_id,
|
|
73
|
+
i.customer_name AS di_customer_name,
|
|
74
|
+
i.customer_contract_account_id AS di_customer_contract_account_id,
|
|
75
|
+
i.customer_address_street AS di_customer_address_street,
|
|
76
|
+
i.customer_address_house_number AS di_customer_address_house_number,
|
|
77
|
+
i.customer_address_house_org_number AS di_customer_address_house_org_number,
|
|
78
|
+
i.customer_address_city AS di_customer_address_city,
|
|
79
|
+
i.customer_address_city_part AS di_customer_address_city_part,
|
|
80
|
+
i.customer_address_post_code AS di_customer_address_post_code,
|
|
81
|
+
i.customer_address_country AS di_customer_address_country,
|
|
82
|
+
i.customer_address_ruian_id AS di_customer_address_ruian_id,
|
|
83
|
+
i.facts_doc_date AS di_facts_doc_date,
|
|
84
|
+
i.facts_net_date AS di_facts_net_date,
|
|
85
|
+
i.facts_billing_transaction AS di_facts_billing_transaction,
|
|
86
|
+
i.facts_to_pay_amount AS di_facts_to_pay_amount,
|
|
87
|
+
i.facts_currency AS di_facts_currency,
|
|
88
|
+
i.facts_price_brutto AS di_facts_price_brutto,
|
|
89
|
+
i.is_canceled AS di_is_canceled,
|
|
90
|
+
i.canceled_reason AS di_canceled_reason,
|
|
91
|
+
i.installations_billing_class AS di_installations_billing_class,
|
|
92
|
+
i.installations_measurement_type AS di_installations_measurement_type,
|
|
93
|
+
i.installations_contract_contract_id AS di_installations_contract_contract_id,
|
|
94
|
+
i.installations_contract_move_in_date AS di_installations_contract_move_in_date,
|
|
95
|
+
i.installations_contract_move_out_date AS di_installations_contract_move_out_date,
|
|
96
|
+
i.installations_tdd_class AS di_installations_tdd_class,
|
|
97
|
+
i.installations_address_street AS di_installations_address_street,
|
|
98
|
+
i.installations_address_house_number AS di_installations_address_house_number,
|
|
99
|
+
i.installations_address_house_org_number AS di_installations_address_house_org_number,
|
|
100
|
+
i.installations_address_city AS di_installations_address_city,
|
|
101
|
+
i.installations_address_city_part AS di_installations_address_city_part,
|
|
102
|
+
i.installations_address_post_code AS di_installations_address_post_code,
|
|
103
|
+
i.installations_address_country AS di_installations_address_country,
|
|
104
|
+
i.installations_address_ruian_id AS di_installations_address_ruian_id
|
|
105
|
+
FROM enapo_ppas_distribution_invoice i
|
|
106
|
+
WHERE i.eic = m.place_id
|
|
107
|
+
AND COALESCE(i.is_canceled, false) = false
|
|
108
|
+
ORDER BY i.facts_doc_date DESC
|
|
109
|
+
LIMIT 1
|
|
110
|
+
) di ON m.id_type = 'eic'
|
|
111
|
+
LEFT JOIN LATERAL (
|
|
112
|
+
SELECT
|
|
113
|
+
i.id AS ci_id,
|
|
114
|
+
i.preceding_id AS ci_preceding_id,
|
|
115
|
+
i.customer_id AS ci_customer_id,
|
|
116
|
+
i.customer_company_id AS ci_customer_company_id,
|
|
117
|
+
i.customer_name AS ci_customer_name,
|
|
118
|
+
i.customer_contract_account_id AS ci_customer_contract_account_id,
|
|
119
|
+
i.customer_address_street AS ci_customer_address_street,
|
|
120
|
+
i.customer_address_house_number AS ci_customer_address_house_number,
|
|
121
|
+
i.customer_address_house_org_number AS ci_customer_address_house_org_number,
|
|
122
|
+
i.customer_address_city AS ci_customer_address_city,
|
|
123
|
+
i.customer_address_city_part AS ci_customer_address_city_part,
|
|
124
|
+
i.customer_address_post_code AS ci_customer_address_post_code,
|
|
125
|
+
i.customer_address_country AS ci_customer_address_country,
|
|
126
|
+
i.customer_address_ruian_id AS ci_customer_address_ruian_id,
|
|
127
|
+
i.facts_doc_date AS ci_facts_doc_date,
|
|
128
|
+
i.facts_net_date AS ci_facts_net_date,
|
|
129
|
+
i.facts_billing_transaction AS ci_facts_billing_transaction,
|
|
130
|
+
i.facts_to_pay_amount AS ci_facts_to_pay_amount,
|
|
131
|
+
i.facts_currency AS ci_facts_currency,
|
|
132
|
+
i.facts_price_brutto AS ci_facts_price_brutto,
|
|
133
|
+
i.is_canceled AS ci_is_canceled,
|
|
134
|
+
i.canceled_reason AS ci_canceled_reason,
|
|
135
|
+
ins.place_id AS cii_place_id,
|
|
136
|
+
ins.billing_class AS cii_billing_class,
|
|
137
|
+
ins.measurement_type AS cii_measurement_type,
|
|
138
|
+
ins.contract_contract_id AS cii_contract_contract_id,
|
|
139
|
+
ins.contract_move_in_date AS cii_contract_move_in_date,
|
|
140
|
+
ins.contract_move_out_date AS cii_contract_move_out_date,
|
|
141
|
+
ins.tdd_class AS cii_tdd_class,
|
|
142
|
+
ins.address_street AS cii_address_street,
|
|
143
|
+
ins.address_house_number AS cii_address_house_number,
|
|
144
|
+
ins.address_house_org_number AS cii_address_house_org_number,
|
|
145
|
+
ins.address_city AS cii_address_city,
|
|
146
|
+
ins.address_city_part AS cii_address_city_part,
|
|
147
|
+
ins.address_post_code AS cii_address_post_code,
|
|
148
|
+
ins.address_country AS cii_address_country,
|
|
149
|
+
ins.address_ruian_id AS cii_address_ruian_id
|
|
150
|
+
FROM enapo_ppas_commercial_invoice_installations ins
|
|
151
|
+
INNER JOIN enapo_ppas_commercial_invoice i
|
|
152
|
+
ON i.id = ins.invoice_id AND i.customer_id = ins.customer_id
|
|
153
|
+
WHERE ins.eic = m.place_id
|
|
154
|
+
AND COALESCE(i.is_canceled, false) = false
|
|
155
|
+
ORDER BY i.facts_doc_date DESC
|
|
156
|
+
LIMIT 1
|
|
157
|
+
) ci ON m.id_type = 'eic'
|
|
158
|
+
|
|
159
|
+
UNION ALL
|
|
160
|
+
|
|
161
|
+
-- Consumption points known only to Porsenna (e-manazer): any commodity whose identifier
|
|
162
|
+
-- is not already mapped to this building by enapo_gid_mapping. One row per main-level device;
|
|
163
|
+
-- sub-meters and consumption are served as enrichment, not as separate points.
|
|
164
|
+
SELECT
|
|
165
|
+
pd.gid,
|
|
166
|
+
pd.identifier AS place_id,
|
|
167
|
+
-- EAN exists only for electricity and EIC only for gas; heat/water have no standard identifier
|
|
168
|
+
CASE c.commodity
|
|
169
|
+
WHEN 'electricity' THEN 'ean'
|
|
170
|
+
WHEN 'gas' THEN 'eic'
|
|
171
|
+
ELSE 'om'
|
|
172
|
+
END AS id_type,
|
|
173
|
+
c.commodity,
|
|
174
|
+
true AS is_first_gid,
|
|
175
|
+
'porsenna' AS link_source,
|
|
176
|
+
NULL AS valid_from,
|
|
177
|
+
pd.disabled_at::date AS valid_to,
|
|
178
|
+
(pd.disabled_at IS NULL) AS is_active,
|
|
179
|
+
-- PRE metadata (md_*); aliases document the positional mapping to the first UNION branch
|
|
180
|
+
NULL AS md_year,
|
|
181
|
+
NULL AS md_month,
|
|
182
|
+
NULL AS md_month_name,
|
|
183
|
+
NULL AS md_days_in_stored_month,
|
|
184
|
+
NULL AS md_consumption_point,
|
|
185
|
+
NULL AS md_address,
|
|
186
|
+
NULL AS md_location_type,
|
|
187
|
+
NULL AS md_company_name,
|
|
188
|
+
NULL AS md_company_id,
|
|
189
|
+
NULL AS md_tarif_type,
|
|
190
|
+
NULL AS md_tarif_1t2t,
|
|
191
|
+
NULL AS md_phases,
|
|
192
|
+
NULL AS md_circuit_breaker,
|
|
193
|
+
NULL AS md_type_b_meter,
|
|
194
|
+
NULL AS md_meter_replaced,
|
|
195
|
+
-- distribution invoice (di_*)
|
|
196
|
+
NULL AS di_id,
|
|
197
|
+
NULL AS di_preceding_id,
|
|
198
|
+
NULL AS di_customer_id,
|
|
199
|
+
NULL AS di_customer_company_id,
|
|
200
|
+
NULL AS di_customer_name,
|
|
201
|
+
NULL AS di_customer_contract_account_id,
|
|
202
|
+
NULL AS di_customer_address_street,
|
|
203
|
+
NULL AS di_customer_address_house_number,
|
|
204
|
+
NULL AS di_customer_address_house_org_number,
|
|
205
|
+
NULL AS di_customer_address_city,
|
|
206
|
+
NULL AS di_customer_address_city_part,
|
|
207
|
+
NULL AS di_customer_address_post_code,
|
|
208
|
+
NULL AS di_customer_address_country,
|
|
209
|
+
NULL AS di_customer_address_ruian_id,
|
|
210
|
+
NULL AS di_facts_doc_date,
|
|
211
|
+
NULL AS di_facts_net_date,
|
|
212
|
+
NULL AS di_facts_billing_transaction,
|
|
213
|
+
NULL AS di_facts_to_pay_amount,
|
|
214
|
+
NULL AS di_facts_currency,
|
|
215
|
+
NULL AS di_facts_price_brutto,
|
|
216
|
+
NULL AS di_is_canceled,
|
|
217
|
+
NULL AS di_canceled_reason,
|
|
218
|
+
NULL AS di_installations_billing_class,
|
|
219
|
+
NULL AS di_installations_measurement_type,
|
|
220
|
+
NULL AS di_installations_contract_contract_id,
|
|
221
|
+
NULL AS di_installations_contract_move_in_date,
|
|
222
|
+
NULL AS di_installations_contract_move_out_date,
|
|
223
|
+
NULL AS di_installations_tdd_class,
|
|
224
|
+
NULL AS di_installations_address_street,
|
|
225
|
+
NULL AS di_installations_address_house_number,
|
|
226
|
+
NULL AS di_installations_address_house_org_number,
|
|
227
|
+
NULL AS di_installations_address_city,
|
|
228
|
+
NULL AS di_installations_address_city_part,
|
|
229
|
+
NULL AS di_installations_address_post_code,
|
|
230
|
+
NULL AS di_installations_address_country,
|
|
231
|
+
NULL AS di_installations_address_ruian_id,
|
|
232
|
+
-- commercial invoice (ci_*)
|
|
233
|
+
NULL AS ci_id,
|
|
234
|
+
NULL AS ci_preceding_id,
|
|
235
|
+
NULL AS ci_customer_id,
|
|
236
|
+
NULL AS ci_customer_company_id,
|
|
237
|
+
NULL AS ci_customer_name,
|
|
238
|
+
NULL AS ci_customer_contract_account_id,
|
|
239
|
+
NULL AS ci_customer_address_street,
|
|
240
|
+
NULL AS ci_customer_address_house_number,
|
|
241
|
+
NULL AS ci_customer_address_house_org_number,
|
|
242
|
+
NULL AS ci_customer_address_city,
|
|
243
|
+
NULL AS ci_customer_address_city_part,
|
|
244
|
+
NULL AS ci_customer_address_post_code,
|
|
245
|
+
NULL AS ci_customer_address_country,
|
|
246
|
+
NULL AS ci_customer_address_ruian_id,
|
|
247
|
+
NULL AS ci_facts_doc_date,
|
|
248
|
+
NULL AS ci_facts_net_date,
|
|
249
|
+
NULL AS ci_facts_billing_transaction,
|
|
250
|
+
NULL AS ci_facts_to_pay_amount,
|
|
251
|
+
NULL AS ci_facts_currency,
|
|
252
|
+
NULL AS ci_facts_price_brutto,
|
|
253
|
+
NULL AS ci_is_canceled,
|
|
254
|
+
NULL AS ci_canceled_reason,
|
|
255
|
+
-- commercial installation (cii_*)
|
|
256
|
+
NULL AS cii_place_id,
|
|
257
|
+
NULL AS cii_billing_class,
|
|
258
|
+
NULL AS cii_measurement_type,
|
|
259
|
+
NULL AS cii_contract_contract_id,
|
|
260
|
+
NULL AS cii_contract_move_in_date,
|
|
261
|
+
NULL AS cii_contract_move_out_date,
|
|
262
|
+
NULL AS cii_tdd_class,
|
|
263
|
+
NULL AS cii_address_street,
|
|
264
|
+
NULL AS cii_address_house_number,
|
|
265
|
+
NULL AS cii_address_house_org_number,
|
|
266
|
+
NULL AS cii_address_city,
|
|
267
|
+
NULL AS cii_address_city_part,
|
|
268
|
+
NULL AS cii_address_post_code,
|
|
269
|
+
NULL AS cii_address_country,
|
|
270
|
+
NULL AS cii_address_ruian_id
|
|
271
|
+
FROM v_enapo_building_porsenna_devices pd
|
|
272
|
+
CROSS JOIN LATERAL (
|
|
273
|
+
SELECT CASE pd."type"
|
|
274
|
+
WHEN 'electricity_meter' THEN 'electricity'
|
|
275
|
+
WHEN 'gasometer' THEN 'gas'
|
|
276
|
+
WHEN 'heat_meter' THEN 'heat'
|
|
277
|
+
WHEN 'water_meter' THEN 'water'
|
|
278
|
+
END AS commodity
|
|
279
|
+
) c
|
|
280
|
+
WHERE pd."type" IN ('electricity_meter', 'gasometer', 'heat_meter', 'water_meter')
|
|
281
|
+
AND (pd."level" IS NULL OR pd."level" = 'main')
|
|
282
|
+
AND pd.identifier IS NOT NULL
|
|
283
|
+
AND NOT EXISTS (
|
|
284
|
+
SELECT 1
|
|
285
|
+
FROM enapo_gid_mapping m
|
|
286
|
+
WHERE m.place_id = pd.identifier AND m.gid = pd.gid
|
|
287
|
+
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
-- Copies the data-team dbt output (ded_gid_mapping) into the module-owned mock table
|
|
2
|
+
-- energetics.enapo_gid_mapping.
|
|
3
|
+
--
|
|
4
|
+
-- Source table location differs per environment:
|
|
5
|
+
-- - rabin: analytic_dbt.ded_gid_mapping (used below)
|
|
6
|
+
-- - golem: tmp.ded_gid_mapping (replace the schema in the FROM clause)
|
|
7
|
+
--
|
|
8
|
+
-- Notes:
|
|
9
|
+
-- - Full refresh of mock rows only: rows are inserted with link_source = 'mock', so this
|
|
10
|
+
-- script can be re-run any time and never touches future non-mock (sync task) rows.
|
|
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.
|
|
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.
|
|
15
|
+
-- - valid_to = 1900-01-01 is the EB placeholder for "not canceled" and is converted to NULL
|
|
16
|
+
-- (dbt should already do this — the NULLIF is a defensive guard).
|
|
17
|
+
|
|
18
|
+
BEGIN;
|
|
19
|
+
|
|
20
|
+
DELETE FROM energetics.enapo_gid_mapping WHERE link_source = 'mock';
|
|
21
|
+
|
|
22
|
+
INSERT INTO energetics.enapo_gid_mapping
|
|
23
|
+
(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),
|
|
35
|
+
'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')
|
|
42
|
+
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;
|
|
47
|
+
|
|
48
|
+
COMMIT;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const ORGANIZATION_PATH = "energetics/organizations";
|
|
2
2
|
export declare const BUILDING_PATH = "energetics/buildings";
|
|
3
|
+
export declare const DED_BUILDING_PATH = "energetics/ded/buildings";
|
|
3
4
|
export declare const DEVICES_PATH = "energetics/devices";
|
|
4
5
|
export declare const MEASUREMENTS_PATH = "energetics/measurements";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MEASUREMENTS_PATH = exports.DEVICES_PATH = exports.BUILDING_PATH = exports.ORGANIZATION_PATH = void 0;
|
|
3
|
+
exports.MEASUREMENTS_PATH = exports.DEVICES_PATH = exports.DED_BUILDING_PATH = exports.BUILDING_PATH = exports.ORGANIZATION_PATH = void 0;
|
|
4
4
|
exports.ORGANIZATION_PATH = `energetics/organizations`;
|
|
5
5
|
exports.BUILDING_PATH = `energetics/buildings`;
|
|
6
|
+
exports.DED_BUILDING_PATH = `energetics/ded/buildings`;
|
|
6
7
|
exports.DEVICES_PATH = `energetics/devices`;
|
|
7
8
|
exports.MEASUREMENTS_PATH = `energetics/measurements`;
|
|
8
9
|
//# sourceMappingURL=Links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Links.js","sourceRoot":"","sources":["../../../src/output-gateway/constants/Links.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,0BAA0B,CAAC;AAC/C,QAAA,aAAa,GAAG,sBAAsB,CAAC;AACvC,QAAA,YAAY,GAAG,oBAAoB,CAAC;AACpC,QAAA,iBAAiB,GAAG,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Links.js","sourceRoot":"","sources":["../../../src/output-gateway/constants/Links.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,0BAA0B,CAAC;AAC/C,QAAA,aAAa,GAAG,sBAAsB,CAAC;AACvC,QAAA,iBAAiB,GAAG,0BAA0B,CAAC;AAC/C,QAAA,YAAY,GAAG,oBAAoB,CAAC;AACpC,QAAA,iBAAiB,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccessLimitationRepository } from "../../repositories/AccessLimitationRepository";
|
|
2
|
+
import { EnoBuildingDetailRepository } from "../../repositories/EnoBuildingDetailRepository";
|
|
3
|
+
import { EnoBuildingDetailTransformation } from "../../transformations/EnoBuildingDetailTransformation";
|
|
4
|
+
import { NextFunction, Request, Response } from "@golemio/core/dist/shared/express";
|
|
5
|
+
import { AbstractController } from "./AbstractController";
|
|
6
|
+
export declare class EnoBuildingsController extends AbstractController {
|
|
7
|
+
private detailRepository;
|
|
8
|
+
private transformation;
|
|
9
|
+
constructor(accessLimitationRepository: AccessLimitationRepository, detailRepository: EnoBuildingDetailRepository, transformation: EnoBuildingDetailTransformation);
|
|
10
|
+
getOne: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.EnoBuildingsController = void 0;
|
|
16
|
+
const ModuleContainerToken_1 = require("../../ioc/ModuleContainerToken");
|
|
17
|
+
const AccessLimitationRepository_1 = require("../../repositories/AccessLimitationRepository");
|
|
18
|
+
const EnoBuildingDetailRepository_1 = require("../../repositories/EnoBuildingDetailRepository");
|
|
19
|
+
const EnoBuildingDetailTransformation_1 = require("../../transformations/EnoBuildingDetailTransformation");
|
|
20
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
21
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
22
|
+
const AbstractController_1 = require("./AbstractController");
|
|
23
|
+
let EnoBuildingsController = class EnoBuildingsController extends AbstractController_1.AbstractController {
|
|
24
|
+
constructor(accessLimitationRepository, detailRepository, transformation) {
|
|
25
|
+
super(accessLimitationRepository);
|
|
26
|
+
this.detailRepository = detailRepository;
|
|
27
|
+
this.transformation = transformation;
|
|
28
|
+
this.getOne = async (req, res, next) => {
|
|
29
|
+
try {
|
|
30
|
+
const paramGid = Array.isArray(req.params.gid) ? req.params.gid[0] : req.params.gid;
|
|
31
|
+
const result = await this.detailRepository.GetDetail(paramGid);
|
|
32
|
+
if (result === null) {
|
|
33
|
+
throw new golemio_errors_1.GeneralError("not_found", "EnoBuildingsController", undefined, 404);
|
|
34
|
+
}
|
|
35
|
+
res.json(this.transformation.transformElement(result));
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
next(err);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.EnoBuildingsController = EnoBuildingsController;
|
|
44
|
+
exports.EnoBuildingsController = EnoBuildingsController = __decorate([
|
|
45
|
+
(0, tsyringe_1.injectable)(),
|
|
46
|
+
__param(0, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.AccessLimitationRepository)),
|
|
47
|
+
__param(1, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailRepository)),
|
|
48
|
+
__param(2, (0, tsyringe_1.inject)(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailTransformation)),
|
|
49
|
+
__metadata("design:paramtypes", [AccessLimitationRepository_1.AccessLimitationRepository,
|
|
50
|
+
EnoBuildingDetailRepository_1.EnoBuildingDetailRepository,
|
|
51
|
+
EnoBuildingDetailTransformation_1.EnoBuildingDetailTransformation])
|
|
52
|
+
], EnoBuildingsController);
|
|
53
|
+
//# sourceMappingURL=EnoBuildingsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnoBuildingsController.js","sourceRoot":"","sources":["../../../../src/output-gateway/controllers/v2/EnoBuildingsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yEAAoE;AACpE,8FAAyF;AACzF,gGAA2F;AAC3F,2GAAsG;AAEtG,6EAAwE;AACxE,iEAAwE;AACxE,6DAA0D;AAGnD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,uCAAkB;IAC1D,YAC6D,0BAAsD,EACrD,gBAAqD,EACjD,cAAuD;QAErH,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAHgC,qBAAgB,GAAhB,gBAAgB,CAA6B;QACzC,mBAA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
|
+
};
|
|
4
|
+
export declare const stripPrefix: <T extends object, P extends string>(row: T, prefix: P) => StripPrefix<T, P>;
|
|
5
|
+
export declare const omitKeys: <T extends object, K extends keyof T>(obj: T, keys: K[]) => Omit<T, K>;
|
|
6
|
+
/**
|
|
7
|
+
* pg returns NUMERIC/DECIMAL and BIGINT columns as strings despite the model typing —
|
|
8
|
+
* coerces the listed fields back to numbers, preserving null and undefined values.
|
|
9
|
+
*/
|
|
10
|
+
export declare const parseNumericFields: <T extends object>(row: T, keys: ReadonlyArray<keyof T>) => T;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseNumericFields = exports.omitKeys = exports.stripPrefix = void 0;
|
|
4
|
+
const stripPrefix = (row, prefix) => {
|
|
5
|
+
const result = {};
|
|
6
|
+
for (const [key, value] of Object.entries(row)) {
|
|
7
|
+
if (key.startsWith(prefix)) {
|
|
8
|
+
result[key.slice(prefix.length)] = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
};
|
|
13
|
+
exports.stripPrefix = stripPrefix;
|
|
14
|
+
const omitKeys = (obj, keys) => {
|
|
15
|
+
const result = { ...obj };
|
|
16
|
+
for (const key of keys) {
|
|
17
|
+
delete result[key];
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
exports.omitKeys = omitKeys;
|
|
22
|
+
/**
|
|
23
|
+
* pg returns NUMERIC/DECIMAL and BIGINT columns as strings despite the model typing —
|
|
24
|
+
* coerces the listed fields back to numbers, preserving null and undefined values.
|
|
25
|
+
*/
|
|
26
|
+
const parseNumericFields = (row, keys) => {
|
|
27
|
+
const result = { ...row };
|
|
28
|
+
for (const key of keys) {
|
|
29
|
+
const value = result[key];
|
|
30
|
+
if (value !== null && value !== undefined) {
|
|
31
|
+
result[key] = Number(value);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
exports.parseNumericFields = parseNumericFields;
|
|
37
|
+
//# sourceMappingURL=objectMappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectMappers.js","sourceRoot":"","sources":["../../../src/output-gateway/helpers/objectMappers.ts"],"names":[],"mappings":";;;AAIO,MAAM,WAAW,GAAG,CAAqC,GAAM,EAAE,MAAS,EAAqB,EAAE;IACpG,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC;QAC7C,CAAC;IACL,CAAC;IACD,OAAO,MAA2B,CAAC;AACvC,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB;AAEK,MAAM,QAAQ,GAAG,CAAsC,GAAM,EAAE,IAAS,EAAc,EAAE;IAC3F,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAmB,GAAM,EAAE,IAA4B,EAAK,EAAE;IAC5F,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,KAAK,GAAY,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAe,CAAC;QAC9C,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B"}
|
|
@@ -4,8 +4,15 @@ exports.routers = void 0;
|
|
|
4
4
|
const ModuleContainerToken_1 = require("./ioc/ModuleContainerToken");
|
|
5
5
|
const Di_1 = require("./ioc/Di");
|
|
6
6
|
const v2BuildingsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2BuildingsRouter);
|
|
7
|
+
const v2EnoBuildingsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2EnoBuildingsRouter);
|
|
7
8
|
const v2OrganizationsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsRouter);
|
|
8
9
|
const v2DevicesRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2DevicesRouter);
|
|
9
10
|
const v2MeasurementsRouter = Di_1.OGEnergeticsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.V2MeasurementsRouter);
|
|
10
|
-
exports.routers = [
|
|
11
|
+
exports.routers = [
|
|
12
|
+
v2BuildingsRouter,
|
|
13
|
+
v2EnoBuildingsRouter,
|
|
14
|
+
v2OrganizationsRouter,
|
|
15
|
+
v2DevicesRouter,
|
|
16
|
+
v2MeasurementsRouter,
|
|
17
|
+
];
|
|
11
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AACpE,iCAAmD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;AAAA,qEAAoE;AACpE,iCAAmD;AAOnD,MAAM,iBAAiB,GAAG,0BAAqB,CAAC,OAAO,CAAoB,2CAAoB,CAAC,iBAAiB,CAAC,CAAC;AACnH,MAAM,oBAAoB,GAAG,0BAAqB,CAAC,OAAO,CAAuB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;AAC5H,MAAM,qBAAqB,GAAG,0BAAqB,CAAC,OAAO,CAAwB,2CAAoB,CAAC,qBAAqB,CAAC,CAAC;AAC/H,MAAM,eAAe,GAAG,0BAAqB,CAAC,OAAO,CAAwB,2CAAoB,CAAC,eAAe,CAAC,CAAC;AACnH,MAAM,oBAAoB,GAAG,0BAAqB,CAAC,OAAO,CAAuB,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;AAE/G,QAAA,OAAO,GAAqB;IACrC,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,oBAAoB;CACvB,CAAC"}
|
|
@@ -25,6 +25,10 @@ const V2BuildingsRouter_1 = require("../routers/v2/V2BuildingsRouter");
|
|
|
25
25
|
const AccessLimitationRepository_1 = require("../repositories/AccessLimitationRepository");
|
|
26
26
|
const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
|
|
27
27
|
const BuildingsController_1 = require("../controllers/v2/BuildingsController");
|
|
28
|
+
const EnoBuildingDetailRepository_1 = require("../repositories/EnoBuildingDetailRepository");
|
|
29
|
+
const EnoBuildingDetailTransformation_1 = require("../transformations/EnoBuildingDetailTransformation");
|
|
30
|
+
const EnoBuildingsController_1 = require("../controllers/v2/EnoBuildingsController");
|
|
31
|
+
const V2EnoBuildingsRouter_1 = require("../routers/v2/V2EnoBuildingsRouter");
|
|
28
32
|
//#region Initialization
|
|
29
33
|
const energeticsContainer = ioc_1.OutputGatewayContainer.createChildContainer();
|
|
30
34
|
exports.OGEnergeticsContainer = energeticsContainer;
|
|
@@ -34,7 +38,8 @@ energeticsContainer
|
|
|
34
38
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.OrganizationDtoTransformation, OrganizationDtoTransformation_1.OrganizationDtoTransformation)
|
|
35
39
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.OrganizationDetailDtoTransformation, OrganizationDetailDtoTransformation_1.OrganizationDetailDtoTransformation)
|
|
36
40
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.DeviceDtoTransformation, DeviceDtoTransformation_1.DeviceDtoTransformation)
|
|
37
|
-
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.BuildingTransformationFull, BuildingTransformationFull_1.BuildingTransformationFull)
|
|
41
|
+
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.BuildingTransformationFull, BuildingTransformationFull_1.BuildingTransformationFull)
|
|
42
|
+
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailTransformation, EnoBuildingDetailTransformation_1.EnoBuildingDetailTransformation);
|
|
38
43
|
//#endregion
|
|
39
44
|
//#region Repositories
|
|
40
45
|
energeticsContainer
|
|
@@ -44,6 +49,7 @@ energeticsContainer
|
|
|
44
49
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.OrganizationResponsibleUsersRepository, OrganizationResponsibleUsersRepository_1.OrganizationResponsibleUsersRepository)
|
|
45
50
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.DevicesRepository, DevicesRepository_1.DevicesRepository)
|
|
46
51
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.MeasurementRepository, MeasurementRepository_1.MeasurementRepository)
|
|
52
|
+
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingDetailRepository, EnoBuildingDetailRepository_1.EnoBuildingDetailRepository)
|
|
47
53
|
.register(ModuleContainerToken_1.ModuleContainerToken.AccessLimitationRepository, {
|
|
48
54
|
useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => new AccessLimitationRepository_1.AccessLimitationRepository(c.resolve(CoreToken_1.CoreToken.PostgresConnector), c.resolve(CoreToken_1.CoreToken.Logger))),
|
|
49
55
|
});
|
|
@@ -51,6 +57,7 @@ energeticsContainer
|
|
|
51
57
|
//#region Controllers
|
|
52
58
|
energeticsContainer
|
|
53
59
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.BuildingsController, BuildingsController_1.BuildingsController)
|
|
60
|
+
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.EnoBuildingsController, EnoBuildingsController_1.EnoBuildingsController)
|
|
54
61
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsController, V2OrganizationsController_1.V2OrganizationsController)
|
|
55
62
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2DevicesController, V2DevicesController_1.V2DevicesController)
|
|
56
63
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2MeasurementsController, V2MeasurementsController_1.V2MeasurementsController);
|
|
@@ -58,6 +65,7 @@ energeticsContainer
|
|
|
58
65
|
//#region Routers
|
|
59
66
|
energeticsContainer
|
|
60
67
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2BuildingsRouter, V2BuildingsRouter_1.V2BuildingsRouter)
|
|
68
|
+
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2EnoBuildingsRouter, V2EnoBuildingsRouter_1.V2EnoBuildingsRouter)
|
|
61
69
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2OrganizationsRouter, V2OrganizationsRouter_1.V2OrganizationsRouter)
|
|
62
70
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2DevicesRouter, V2DevicesRouter_1.V2DevicesRouter)
|
|
63
71
|
.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.V2MeasurementsRouter, V2MeasurementsRouter_1.V2MeasurementsRouter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iEAAoE;AACpE,iEAAiG;AACjG,+DAA+E;AAC/E,qFAAmF;AAC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CAAoB,2CAAoB,CAAC,iBAAiB,EAAE,qCAAiB,CAAC;KAC/F,iBAAiB,CAAuB,2CAAoB,CAAC,oBAAoB,EAAE,2CAAoB,CAAC;KACxG,iBAAiB,CAAwB,2CAAoB,CAAC,qBAAqB,EAAE,6CAAqB,CAAC;KAC3G,iBAAiB,CAAkB,2CAAoB,CAAC,eAAe,EAAE,iCAAe,CAAC;KACzF,iBAAiB,CAAuB,2CAAoB,CAAC,oBAAoB,EAAE,2CAAoB,CAAC,CAAC;AAC9G,YAAY;AAEZ,iBAAiB;AACjB,mBAAmB,CAAC,iBAAiB,CAAmB,2CAAoB,CAAC,gBAAgB,EAAE,mCAAgB,CAAC,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare const ModuleContainerToken: {
|
|
|
4
4
|
OrganizationDetailDtoTransformation: symbol;
|
|
5
5
|
DeviceDtoTransformation: symbol;
|
|
6
6
|
BuildingTransformationFull: symbol;
|
|
7
|
+
EnoBuildingDetailTransformation: symbol;
|
|
7
8
|
/** repositories */
|
|
8
9
|
PrimaryBuildingsRepository: symbol;
|
|
9
10
|
OrganizationsRepository: symbol;
|
|
@@ -11,14 +12,17 @@ declare const ModuleContainerToken: {
|
|
|
11
12
|
OrganizationResponsibleUsersRepository: symbol;
|
|
12
13
|
DevicesRepository: symbol;
|
|
13
14
|
MeasurementRepository: symbol;
|
|
15
|
+
EnoBuildingDetailRepository: symbol;
|
|
14
16
|
AccessLimitationRepository: symbol;
|
|
15
17
|
/** controllers */
|
|
16
18
|
BuildingsController: symbol;
|
|
19
|
+
EnoBuildingsController: symbol;
|
|
17
20
|
V2OrganizationsController: symbol;
|
|
18
21
|
V2DevicesController: symbol;
|
|
19
22
|
V2MeasurementsController: symbol;
|
|
20
23
|
/** routers */
|
|
21
24
|
V2BuildingsRouter: symbol;
|
|
25
|
+
V2EnoBuildingsRouter: symbol;
|
|
22
26
|
V2OrganizationsRouter: symbol;
|
|
23
27
|
V2DevicesRouter: symbol;
|
|
24
28
|
V2MeasurementsRouter: symbol;
|
|
@@ -7,6 +7,7 @@ const ModuleContainerToken = {
|
|
|
7
7
|
OrganizationDetailDtoTransformation: Symbol("OrganizationDetailDtoTransformation"),
|
|
8
8
|
DeviceDtoTransformation: Symbol("DeviceDtoTransformation"),
|
|
9
9
|
BuildingTransformationFull: Symbol("BuildingTransformationFull"),
|
|
10
|
+
EnoBuildingDetailTransformation: Symbol("EnoBuildingDetailTransformation"),
|
|
10
11
|
/** repositories */
|
|
11
12
|
PrimaryBuildingsRepository: Symbol("PrimaryBuildingsRepository"),
|
|
12
13
|
OrganizationsRepository: Symbol("OrganizationsRepository"),
|
|
@@ -14,14 +15,17 @@ const ModuleContainerToken = {
|
|
|
14
15
|
OrganizationResponsibleUsersRepository: Symbol("OrganizationResponsibleUsersRepository"),
|
|
15
16
|
DevicesRepository: Symbol("DevicesRepository"),
|
|
16
17
|
MeasurementRepository: Symbol("MeasurementRepository"),
|
|
18
|
+
EnoBuildingDetailRepository: Symbol("EnoBuildingDetailRepository"),
|
|
17
19
|
AccessLimitationRepository: Symbol(),
|
|
18
20
|
/** controllers */
|
|
19
21
|
BuildingsController: Symbol("BuildingController"),
|
|
22
|
+
EnoBuildingsController: Symbol("EnoBuildingsController"),
|
|
20
23
|
V2OrganizationsController: Symbol("V2OrganizationsController"),
|
|
21
24
|
V2DevicesController: Symbol("V2DevicesController"),
|
|
22
25
|
V2MeasurementsController: Symbol("V2MeasurementsController"),
|
|
23
26
|
/** routers */
|
|
24
27
|
V2BuildingsRouter: Symbol("V2BuildingsRouter"),
|
|
28
|
+
V2EnoBuildingsRouter: Symbol("V2EnoBuildingsRouter"),
|
|
25
29
|
V2OrganizationsRouter: Symbol("V2OrganizationsRouter"),
|
|
26
30
|
V2DevicesRouter: Symbol("V2DevicesRouter"),
|
|
27
31
|
V2MeasurementsRouter: Symbol("V2MeasurementsRouter"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleContainerToken.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/ModuleContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG;IACzB,sBAAsB;IACtB,6BAA6B,EAAE,MAAM,CAAC,+BAA+B,CAAC;IACtE,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,mBAAmB;IACnB,0BAA0B,EAAE,MAAM,CAAC,4BAA4B,CAAC;IAChE,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAAC;IAC1D,+BAA+B,EAAE,MAAM,CAAC,iCAAiC,CAAC;IAC1E,sCAAsC,EAAE,MAAM,CAAC,wCAAwC,CAAC;IACxF,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,0BAA0B,EAAE,MAAM,EAAE;IACpC,kBAAkB;IAClB,mBAAmB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IACjD,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B,CAAC;IAC5D,cAAc;IACd,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,qBAAqB,EAAE,MAAM,CAAC,uBAAuB,CAAC;IACtD,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACpD,cAAc;IACd,gBAAgB,EAAE,MAAM,CAAC,0BAA0B,CAAC;CACvD,CAAC;AAEO,oDAAoB"}
|
|
1
|
+
{"version":3,"file":"ModuleContainerToken.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/ModuleContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAA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