@golemio/energetics 1.3.5-dev.1300360641 → 1.3.5-dev.1300843460

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 (174) hide show
  1. package/db/example/00_clear_test_data.sql +6 -0
  2. package/db/example/01_buildings.sql +206 -0
  3. package/db/example/02_organizations.sql +24 -0
  4. package/db/example/03_devices.sql +24 -0
  5. package/db/migrations/postgresql/.config.json +1 -1
  6. package/db/migrations/postgresql/20240514074033-buildings.js +53 -0
  7. package/db/migrations/postgresql/20240514111900-organizations.js +53 -0
  8. package/db/migrations/postgresql/sqls/20240514074033-buildings-down.sql +2 -0
  9. package/db/migrations/postgresql/sqls/20240514074033-buildings-up.sql +138 -0
  10. package/db/migrations/postgresql/sqls/20240514111900-organizations-down.sql +3 -0
  11. package/db/migrations/postgresql/sqls/20240514111900-organizations-up.sql +37 -0
  12. package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js +0 -2
  13. package/dist/integration-engine/tasks/oict-energetika/FetchDataTask.js.map +1 -1
  14. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js +0 -4
  15. package/dist/integration-engine/workers/oict-energetika/OictEnergetikaWorker.js.map +1 -1
  16. package/dist/output-gateway/constants/Links.d.ts +3 -0
  17. package/dist/output-gateway/constants/Links.js +7 -0
  18. package/dist/output-gateway/constants/Links.js.map +1 -0
  19. package/dist/output-gateway/constants/RouteVersion.d.ts +3 -0
  20. package/dist/output-gateway/constants/RouteVersion.js +8 -0
  21. package/dist/output-gateway/constants/RouteVersion.js.map +1 -0
  22. package/dist/output-gateway/controllers/v2/BuildingsController.d.ts +11 -0
  23. package/dist/output-gateway/controllers/v2/BuildingsController.js +74 -0
  24. package/dist/output-gateway/controllers/v2/BuildingsController.js.map +1 -0
  25. package/dist/output-gateway/controllers/v2/V2DevicesController.d.ts +11 -0
  26. package/dist/output-gateway/controllers/v2/V2DevicesController.js +67 -0
  27. package/dist/output-gateway/controllers/v2/V2DevicesController.js.map +1 -0
  28. package/dist/output-gateway/controllers/v2/V2OrganizationsController.d.ts +13 -0
  29. package/dist/output-gateway/controllers/v2/V2OrganizationsController.js +79 -0
  30. package/dist/output-gateway/controllers/v2/V2OrganizationsController.js.map +1 -0
  31. package/dist/output-gateway/helpers/CreateLinkHelper.d.ts +6 -0
  32. package/dist/output-gateway/helpers/CreateLinkHelper.js +32 -0
  33. package/dist/output-gateway/helpers/CreateLinkHelper.js.map +1 -0
  34. package/dist/output-gateway/index.d.ts +1 -0
  35. package/dist/output-gateway/index.js +10 -0
  36. package/dist/output-gateway/index.js.map +1 -0
  37. package/dist/output-gateway/ioc/Di.d.ts +3 -0
  38. package/dist/output-gateway/ioc/Di.js +51 -0
  39. package/dist/output-gateway/ioc/Di.js.map +1 -0
  40. package/dist/output-gateway/ioc/ModuleContainerToken.d.ts +22 -0
  41. package/dist/output-gateway/ioc/ModuleContainerToken.js +26 -0
  42. package/dist/output-gateway/ioc/ModuleContainerToken.js.map +1 -0
  43. package/dist/output-gateway/models/BuildingsPrimaryModel.d.ts +17 -0
  44. package/dist/output-gateway/models/BuildingsPrimaryModel.js +49 -0
  45. package/dist/output-gateway/models/BuildingsPrimaryModel.js.map +1 -0
  46. package/dist/output-gateway/models/BuildingsSecondaryModel.d.ts +124 -0
  47. package/dist/output-gateway/models/BuildingsSecondaryModel.js +338 -0
  48. package/dist/output-gateway/models/BuildingsSecondaryModel.js.map +1 -0
  49. package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.d.ts +6 -0
  50. package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.js +2 -0
  51. package/dist/output-gateway/models/interfaces/IBuildingsTransformationOutput.js.map +1 -0
  52. package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.d.ts +156 -0
  53. package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.js +3 -0
  54. package/dist/output-gateway/models/interfaces/IFullTransformationSchemaItem.js.map +1 -0
  55. package/dist/output-gateway/models/interfaces/IPrimaryBuildings.d.ts +10 -0
  56. package/dist/output-gateway/models/interfaces/IPrimaryBuildings.js +3 -0
  57. package/dist/output-gateway/models/interfaces/IPrimaryBuildings.js.map +1 -0
  58. package/dist/output-gateway/models/interfaces/ISecondaryBuildings.d.ts +114 -0
  59. package/dist/output-gateway/models/interfaces/ISecondaryBuildings.js +3 -0
  60. package/dist/output-gateway/models/interfaces/ISecondaryBuildings.js.map +1 -0
  61. package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.d.ts +117 -0
  62. package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.js +3 -0
  63. package/dist/output-gateway/models/interfaces/ISecondaryBuildingsOutput.js.map +1 -0
  64. package/dist/output-gateway/repositories/DevicesRepository.d.ts +8 -0
  65. package/dist/output-gateway/repositories/DevicesRepository.js +64 -0
  66. package/dist/output-gateway/repositories/DevicesRepository.js.map +1 -0
  67. package/dist/output-gateway/repositories/OrganizationBuildingsRepository.d.ts +6 -0
  68. package/dist/output-gateway/repositories/OrganizationBuildingsRepository.js +47 -0
  69. package/dist/output-gateway/repositories/OrganizationBuildingsRepository.js.map +1 -0
  70. package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.d.ts +6 -0
  71. package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.js +47 -0
  72. package/dist/output-gateway/repositories/OrganizationResponsibleUsersRepository.js.map +1 -0
  73. package/dist/output-gateway/repositories/OrganizationsRepository.d.ts +17 -0
  74. package/dist/output-gateway/repositories/OrganizationsRepository.js +133 -0
  75. package/dist/output-gateway/repositories/OrganizationsRepository.js.map +1 -0
  76. package/dist/output-gateway/repositories/PrimaryBuildingsRepository.d.ts +15 -0
  77. package/dist/output-gateway/repositories/PrimaryBuildingsRepository.js +86 -0
  78. package/dist/output-gateway/repositories/PrimaryBuildingsRepository.js.map +1 -0
  79. package/dist/output-gateway/repositories/SecondaryBuildingsRepository.d.ts +6 -0
  80. package/dist/output-gateway/repositories/SecondaryBuildingsRepository.js +33 -0
  81. package/dist/output-gateway/repositories/SecondaryBuildingsRepository.js.map +1 -0
  82. package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.d.ts +9 -0
  83. package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.js +47 -0
  84. package/dist/output-gateway/repositories/helpers/OrganizationsAssociations.js.map +1 -0
  85. package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.d.ts +5 -0
  86. package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.js +3 -0
  87. package/dist/output-gateway/repositories/interfaces/IOrganizationBuildingDto.js.map +1 -0
  88. package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.d.ts +18 -0
  89. package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.js +3 -0
  90. package/dist/output-gateway/repositories/interfaces/IOrganizationDetailDto.js.map +1 -0
  91. package/dist/output-gateway/repositories/interfaces/IOrganizationDto.d.ts +4 -0
  92. package/dist/output-gateway/repositories/interfaces/IOrganizationDto.js +3 -0
  93. package/dist/output-gateway/repositories/interfaces/IOrganizationDto.js.map +1 -0
  94. package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.d.ts +8 -0
  95. package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.js +3 -0
  96. package/dist/output-gateway/repositories/interfaces/IOrganizationResponsibleUserDto.js.map +1 -0
  97. package/dist/output-gateway/routers/helpers/parseParams.d.ts +4 -0
  98. package/dist/output-gateway/routers/helpers/parseParams.js +17 -0
  99. package/dist/output-gateway/routers/helpers/parseParams.js.map +1 -0
  100. package/dist/output-gateway/routers/interfaces/IDeviceResponse.d.ts +6 -0
  101. package/dist/output-gateway/routers/interfaces/IDeviceResponse.js +3 -0
  102. package/dist/output-gateway/routers/interfaces/IDeviceResponse.js.map +1 -0
  103. package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.d.ts +34 -0
  104. package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.js +3 -0
  105. package/dist/output-gateway/routers/interfaces/IOrganizationDetailResponse.js.map +1 -0
  106. package/dist/output-gateway/routers/interfaces/IOrganizationResponse.d.ts +4 -0
  107. package/dist/output-gateway/routers/interfaces/IOrganizationResponse.js +3 -0
  108. package/dist/output-gateway/routers/interfaces/IOrganizationResponse.js.map +1 -0
  109. package/dist/output-gateway/routers/interfaces/IPaginationParams.d.ts +4 -0
  110. package/dist/output-gateway/routers/interfaces/IPaginationParams.js +3 -0
  111. package/dist/output-gateway/routers/interfaces/IPaginationParams.js.map +1 -0
  112. package/dist/output-gateway/routers/v2/BuildingsRouter.d.ts +10 -0
  113. package/dist/output-gateway/routers/v2/BuildingsRouter.js +26 -0
  114. package/dist/output-gateway/routers/v2/BuildingsRouter.js.map +1 -0
  115. package/dist/output-gateway/routers/v2/V2DevicesRouter.d.ts +7 -0
  116. package/dist/output-gateway/routers/v2/V2DevicesRouter.js +41 -0
  117. package/dist/output-gateway/routers/v2/V2DevicesRouter.js.map +1 -0
  118. package/dist/output-gateway/routers/v2/V2OrganizationsRouter.d.ts +7 -0
  119. package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js +41 -0
  120. package/dist/output-gateway/routers/v2/V2OrganizationsRouter.js.map +1 -0
  121. package/dist/output-gateway/transformations/BuildingTransformationFull.d.ts +14 -0
  122. package/dist/output-gateway/transformations/BuildingTransformationFull.js +215 -0
  123. package/dist/output-gateway/transformations/BuildingTransformationFull.js.map +1 -0
  124. package/dist/output-gateway/transformations/BuildingsTransformation.d.ts +8 -0
  125. package/dist/output-gateway/transformations/BuildingsTransformation.js +38 -0
  126. package/dist/output-gateway/transformations/BuildingsTransformation.js.map +1 -0
  127. package/dist/output-gateway/transformations/DeviceDtoTransformation.d.ts +8 -0
  128. package/dist/output-gateway/transformations/DeviceDtoTransformation.js +43 -0
  129. package/dist/output-gateway/transformations/DeviceDtoTransformation.js.map +1 -0
  130. package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.d.ts +9 -0
  131. package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.js +64 -0
  132. package/dist/output-gateway/transformations/OrganizationDetailDtoTransformation.js.map +1 -0
  133. package/dist/output-gateway/transformations/OrganizationDtoTransformation.d.ts +9 -0
  134. package/dist/output-gateway/transformations/OrganizationDtoTransformation.js +36 -0
  135. package/dist/output-gateway/transformations/OrganizationDtoTransformation.js.map +1 -0
  136. package/dist/schema-definitions/models/OrganizationBuildingModel.d.ts +10 -0
  137. package/dist/schema-definitions/models/OrganizationBuildingModel.js +33 -0
  138. package/dist/schema-definitions/models/OrganizationBuildingModel.js.map +1 -0
  139. package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.d.ts +16 -0
  140. package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.js +44 -0
  141. package/dist/schema-definitions/models/OrganizationResponsibleUsersModel.js.map +1 -0
  142. package/dist/schema-definitions/models/OrganizationsModel.d.ts +21 -0
  143. package/dist/schema-definitions/models/OrganizationsModel.js +59 -0
  144. package/dist/schema-definitions/models/OrganizationsModel.js.map +1 -0
  145. package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.d.ts +4 -0
  146. package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.js +3 -0
  147. package/dist/schema-definitions/models/interfaces/IOrganizationBuildingsModel.js.map +1 -0
  148. package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.d.ts +10 -0
  149. package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.js +3 -0
  150. package/dist/schema-definitions/models/interfaces/IOrganizationResponsibleUsersModel.js.map +1 -0
  151. package/dist/schema-definitions/models/interfaces/IOrganizationsModel.d.ts +15 -0
  152. package/dist/schema-definitions/models/interfaces/IOrganizationsModel.js +3 -0
  153. package/dist/schema-definitions/models/interfaces/IOrganizationsModel.js.map +1 -0
  154. package/docs/implementation_documentation.md +41 -41
  155. package/docs/openapi-output.yaml +834 -0
  156. package/package.json +4 -2
  157. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.d.ts +0 -4
  158. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js +0 -19
  159. package/dist/integration-engine/repositories/oict-energetika/BuildingsRepository.js.map +0 -1
  160. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.d.ts +0 -4
  161. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js +0 -19
  162. package/dist/integration-engine/repositories/oict-energetika/DevicesRepository.js.map +0 -1
  163. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.d.ts +0 -9
  164. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js +0 -44
  165. package/dist/integration-engine/tasks/oict-energetika/FetchBuildingsTask.js.map +0 -1
  166. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.d.ts +0 -9
  167. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js +0 -44
  168. package/dist/integration-engine/tasks/oict-energetika/FetchDevicesTask.js.map +0 -1
  169. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.d.ts +0 -7
  170. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js +0 -166
  171. package/dist/integration-engine/transformations/oict-energetika/BuildingsTransformation.js.map +0 -1
  172. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.d.ts +0 -7
  173. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js +0 -41
  174. package/dist/integration-engine/transformations/oict-energetika/DevicesTransformation.js.map +0 -1
@@ -1,2 +1,8 @@
1
1
  truncate commodity_static_meter_settings;
2
2
  truncate consumption_energy_measurements;
3
+ truncate consumption_energy_buildings_primary;
4
+ truncate consumption_energy_buildings_secondary;
5
+ truncate consumption_energy_devices;
6
+ truncate organization_responsible_users;
7
+ truncate organizations_buildings;
8
+ truncate organizations;
@@ -0,0 +1,206 @@
1
+ INSERT INTO consumption_energy_buildings_primary (id,description,building_name,building_address_code,building_label,main_use,secondary_use,year_of_construction,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
2
+ (7, 'Hlavní budova', 'SŠAI Weilova', '2.1', 'SŠAI', 'Budova pro vzdělávání', 'Budova užívaná orgánem veřejné moci', null, NULL, '2023-01-06 15:20:34.708', NULL, NULL, '2024-05-20 13:30:02.235', NULL),
3
+ (10, '', 'Gymnázium Na Vítězné pláni', '2.2', 'GVP', 'budova pro vzdělávání', 'budova pro vzdělávání', 1961, NULL, '2023-01-06 15:20:34.709', NULL, NULL, '2024-05-20 13:30:02.235', NULL),
4
+ (11, '', 'Gymnázium a Hudební škola hlavního města Prahy', '2.3', 'GYHU', 'budova pro vzdělávání', 'bytový dům, budova pro vzdělávání', null, NULL, '2023-01-06 15:20:34.709', NULL, NULL, '2024-05-20 13:30:02.235', NULL),
5
+ (36, 'Školní autoservis – Bohdalec', 'SŠAI Weilova – Bohdalec', '2.1.2', 'SŠAI', 'Budova pro vzdělávání', 'Budova užívaná orgánem veřejné moci', null, NULL, '2023-01-06 15:20:34.730', NULL, NULL, '2024-05-20 13:30:02.237', NULL),
6
+ (37, 'Školní autoservis – Libuš', 'SŠAI Weilova – Libuš', '2.1.3', 'SŠAI', 'Budova pro obchodní účely', 'Budova užívaná orgánem veřejné moci', null, NULL, '2023-01-06 15:20:34.730', NULL, NULL, '2024-05-20 13:30:02.237', NULL),
7
+ (38, 'Školní chata', 'SŠAI Weilova - Školní chata', '2.1.4', 'SŠAI', 'Budova pro ubytování a stravování', 'Budova užívaná orgánem veřejné moci', 1910, NULL, '2023-01-06 15:20:34.729', NULL, NULL, '2024-05-20 13:30:02.237', NULL),
8
+ (100,'Správa služeb hlavního města Prahy - K Sádkám','K sádkám č.p. 141','3.31.3','Administrativní budova','Administrativní budova','Administrativní budova',1987,NULL,NULL,NULL,NULL,NULL,NULL);
9
+
10
+ INSERT INTO consumption_energy_buildings_secondary (
11
+ id,
12
+ address_house_number,
13
+ address_city,
14
+ address_country,
15
+ address_mail,
16
+ address_phone,
17
+ address_web_address,
18
+ penb_penbnumber,
19
+ penb_issue_date,
20
+ penb_total_building_envelope_area,
21
+ penb_volume_factor_of_avshape,
22
+ penb_total_energy_reference_area,
23
+ penb_total_provided_energy,
24
+ penb_total_provided_energy_category,
25
+ penb_primary_non_renewable_energy,
26
+ penb_primary_non_renewable_energy_category,
27
+ penb_building_envelope,
28
+ penb_building_envelope_category,
29
+ penb_heating,
30
+ penb_heating_category,
31
+ penb_cooling,
32
+ penb_cooling_category,
33
+ penb_ventilation,
34
+ penb_ventilation_category,
35
+ penb_humidity_adjustment,
36
+ penb_humidity_adjustment_category,
37
+ penb_warm_water,
38
+ penb_warm_water_category,
39
+ penb_lighting,
40
+ penb_lighting_category,
41
+ energy_audits_energy_audit,
42
+ energy_audits_earegistration_number,
43
+ energy_audits_created_at,
44
+ building_envelope_side_wall_prevailing_construction,
45
+ building_envelope_side_wall_area,
46
+ building_envelope_side_wall_heat_insulation,
47
+ building_envelope_side_wall_year_of_adjustment,
48
+ building_envelope_side_wall_technical_condition,
49
+ building_envelope_filling_of_hole_construction,
50
+ building_envelope_filling_of_hole_area,
51
+ building_envelope_filling_of_hole_year_of_adjustment,
52
+ building_envelope_filling_of_hole_technical_condition,
53
+ building_envelope_roof_construction,
54
+ building_envelope_roof_area,
55
+ building_envelope_roof_thermal_insulation,
56
+ building_envelope_roof_year_of_adjustment,
57
+ building_envelope_roof_technical_condition,
58
+ building_envelope_floor_of_the_lowest_heated_floor_construction,
59
+ building_envelope_floor_of_the_lowest_heated_floor_area,
60
+ floor_of_the_lowest_heated_floor_thermal_insulation,
61
+ building_envelope_floor_of_the_lowest_heated_floor_year_of_adju,
62
+ floor_of_the_lowest_heated_floor_technical_condition,
63
+ fuel_and_energy_coal,
64
+ fuel_and_energy_gas,
65
+ fuel_and_energy_electricity,
66
+ fuel_and_energy_czt,
67
+ fuel_and_energy_oze,
68
+ fuel_and_energy_other,
69
+ technical_equipment_heating_main_source_of_heat,
70
+ technical_equipment_heating_heat_percentage,
71
+ technical_equipment_heating_secondary_source_of_heat,
72
+ technical_equipment_heating_heating_system,
73
+ technical_equipment_heating_year,
74
+ technical_equipment_heating_technical_condition,
75
+ technical_equipment_cooling_cooling_system,
76
+ technical_equipment_cooling_cooling_area_percentage,
77
+ technical_equipment_cooling_year,
78
+ technical_equipment_cooling_technical_condition,
79
+ technical_equipment_ventilation_ventilation,
80
+ technical_equipment_ventilation_year,
81
+ technical_equipment_ventilation_technical_condition,
82
+ technical_equipment_humidity_adjustment_humidity_adjustment,
83
+ technical_equipment_humidity_adjustment_year,
84
+ technical_equipment_humidity_adjustment_technical_condition,
85
+ technical_equipment_hot_water_predominant_way_of_heating_tv,
86
+ technical_equipment_hot_water_hot_water_source,
87
+ technical_equipment_hot_water_year,
88
+ technical_equipment_hot_water_technical_condition,
89
+ technical_equipment_lighting_lighting,
90
+ technical_equipment_lighting_year,
91
+ technical_equipment_lighting_technical_condition,
92
+ technical_equipment_lighting_other_technological_elements,
93
+ technical_equipment_lighting_measurement_method,
94
+ oze_energy_production_solar_energy_photovoltaic,
95
+ oze_energy_production_solar_energy_photothermal,
96
+ oze_energy_production_integrated_turbines_wind_energy,
97
+ oze_energy_production_heat_pump,
98
+ waste_and_emissions_solid_waste_production,
99
+ waste_and_emissions_tied_co2_emissions,
100
+ waste_and_emissions_sox_emissions,
101
+ waste_and_emissions_operating_co_2emissions,
102
+ create_batch_id,
103
+ created_at,
104
+ created_by,
105
+ update_batch_id,
106
+ updated_at,
107
+ updated_by
108
+ ) VALUES (
109
+ 100,
110
+ 'house_number_value',
111
+ 'city_value',
112
+ 'country_value',
113
+ 'mail_value',
114
+ 'phone_value',
115
+ 'web_address_value',
116
+ 123,
117
+ '2022-01-01 00:00:00',
118
+ 100.5,
119
+ 'volume_factor_value',
120
+ 200.5,
121
+ 300.5,
122
+ 'provided_energy_category_value',
123
+ 400.5,
124
+ 'non_renewable_energy_category_value',
125
+ 500.5,
126
+ 'building_envelope_category_value',
127
+ 600.5,
128
+ 'heating_category_value',
129
+ 700.5,
130
+ 'cooling_category_value',
131
+ 800.5,
132
+ 'ventilation_category_value',
133
+ 900.5,
134
+ 'humidity_adjustment_category_value',
135
+ 1000.5,
136
+ 'warm_water_category_value',
137
+ 1100.5,
138
+ 'lighting_category_value',
139
+ 'energy_audit_value',
140
+ 1234,
141
+ '2022-01-01 00:00:00',
142
+ 'side_wall_construction_value',
143
+ 1200.5,
144
+ 'side_wall_heat_insulation_value',
145
+ 'side_wall_year_value',
146
+ 'side_wall_technical_condition_value',
147
+ 'filling_of_hole_construction_value',
148
+ 1300.5,
149
+ 'filling_of_hole_year_value',
150
+ 'filling_of_hole_technical_condition_value',
151
+ 'roof_construction_value',
152
+ 1400.5,
153
+ 'roof_thermal_insulation_value',
154
+ 'roof_year_value',
155
+ 'roof_technical_condition_value',
156
+ 'floor_construction_value',
157
+ 1500.5,
158
+ 'floor_thermal_insulation_value',
159
+ 'floor_year_value',
160
+ 'floor_technical_condition_value',
161
+ true,
162
+ true,
163
+ true,
164
+ true,
165
+ true,
166
+ true,
167
+ 'heating_source_value',
168
+ 80,
169
+ 'secondary_heat_source_value',
170
+ 'heating_system_value',
171
+ 'heating_year_value',
172
+ 'heating_technical_condition_value',
173
+ 'cooling_system_value',
174
+ 70,
175
+ 'cooling_year_value',
176
+ 'cooling_technical_condition_value',
177
+ 'ventilation_value',
178
+ 'ventilation_year_value',
179
+ 'ventilation_technical_condition_value',
180
+ 'humidity_adjustment_value',
181
+ 'humidity_adjustment_year_value',
182
+ 'humidity_adjustment_technical_condition_value',
183
+ 'hot_water_heating_value',
184
+ 'hot_water_source_value',
185
+ 'hot_water_year_value',
186
+ 'hot_water_technical_condition_value',
187
+ 'lighting_value',
188
+ 'lighting_year_value',
189
+ 'lighting_technical_condition_value',
190
+ 'other_technological_elements_value',
191
+ 'measurement_method_value',
192
+ 'solar_photovoltaic_value',
193
+ 'solar_photothermal_value',
194
+ 'wind_energy_value',
195
+ 'heat_pump_value',
196
+ 'solid_waste_production_value',
197
+ 'tied_co2_emissions_value',
198
+ 'sox_emissions_value',
199
+ 'operating_co2_emissions_value',
200
+ 1,
201
+ '2022-01-01 00:00:00',
202
+ 'created_by_value',
203
+ 2,
204
+ '2022-01-02 00:00:00',
205
+ 'updated_by_value'
206
+ );
@@ -0,0 +1,24 @@
1
+ INSERT INTO organization_responsible_users (id, first_name, last_name, "position", phone, mail, company, organization_id) VALUES
2
+ (1, 'Milan', 'Vorel', 'ředitel', NULL, 'milan.vorel@skolahostivar.cz', NULL, 1),
3
+ (2, 'Zdeněk', 'Kočárek', 'vedoucí technické správy', NULL, 'zdenek.kocarek@skolahostivar.cz', NULL, 1),
4
+ (3, 'Jaroslav', 'Malý', 'správa budov', NULL, 'jaroslav.maly@skolahostivar.cz', NULL, 1),
5
+ (4, 'Jaroslav', 'Mervínský', 'ředitel', NULL, 'reditel@gvp.cz', NULL, 2),
6
+ (5, 'Martin', 'Horyna', 'zástupce ředitele', NULL, 'horyna@gvp.cz', NULL, 2),
7
+ (6, 'Milan', 'Slanina', 'školník', NULL, 'slanina@gvp.cz', NULL, 2),
8
+ (7, 'Filip', 'Magram', 'ředitel', NULL, 'reditel@gmhs.cz', NULL, 3),
9
+ (8, 'Zuzana', 'Koutníková', 'ekonomka školy', NULL, 'ekonom@gmhs.cz', NULL, 3),
10
+ (9, 'Blanka', 'Blahová', 'správa budov', NULL, 'spravce@gmhs.cz', NULL, 3),
11
+ (10, 'Julius', 'Olšiak', 'referent správy budov (školník)', NULL, NULL, NULL, 3);
12
+
13
+ INSERT INTO organizations (id, "name", "label", address_street, address_house_number, address_city, address_country, address_mail, address_phone, address_web_address, category, created_by_id, grafana_url) VALUES
14
+ (1, 'SŠAI Weilova', 'SO01 SŠAI', 'Weilova', '12704', 'Praha 10 - Hostivař', 'Česká Republika', 'mailbox@skolahostivar.cz', '242 456 100', 'http://www.skolahostivar.cz', 'Školství', 64, 'http://10.200.0.73:3000/d/l8OJLI2ik/01-ss-automobilni-a-informatiky-weilova?orgId=2'),
15
+ (2, 'Gymnázium Na Vítězné pláni', 'SO02 GVP', 'Na Vítězné pláni', '1160', 'Praha 4, 140 00', 'Česká Republika', 'mail@gvp.cz', '261 109 611', 'http://www.gvp.cz/', 'Školství', 64, 'http://10.200.0.73:3000/d/e7zcnRYmk/02-gymnazium-na-vitezne-plani?orgId=2'),
16
+ (3, 'Gymnázium a Hudební škola hlavního města Prahy ', 'SO03 GYHU', 'Komenského náměstí ', '400', 'Praha 3, 130 00', 'Česká Republika', 'sekretariat@gmhs.cz', '221 434 711', 'http://www.gmhs.cz/', 'Školství', 64, 'http://10.200.0.73:3000/d/2um5VgYik/03-gymnazium-a-hudebni-skola-hlavniho-mesta-prahy?orgId=2');
17
+
18
+ INSERT INTO organizations_buildings (organization_id, building_id) VALUES
19
+ (1, 7),
20
+ (1, 38),
21
+ (1, 37),
22
+ (1, 36),
23
+ (2, 10),
24
+ (3, 11);
@@ -0,0 +1,24 @@
1
+ INSERT INTO consumption_energy_devices (id,addr,description,meter_number,meter_index,location_number,location_description,include_in_evaluation,meter_type,category,unit,replaced_meter_id,deleted,building_id,create_batch_id,created_at,created_by,update_batch_id,updated_at,updated_by) VALUES
2
+ (16,'/2.2/PF1','Fakturační plynoměr škola','743037','1','27ZG100Z00008560','Škola','true','Plynoměr','Hlavní (fakturační)','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
3
+ (17,'/2.2/PF2','Fakturační plynoměr kuchyně','26033503','2','27ZG100Z00008560','Kuchyně','true','Plynoměr','Hlavní (fakturační)','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
4
+ (18,'/2.2/PF3','Fakturační plynoměr laboratoře','26033504','3','27ZG100Z00008560','Laboratoře','true','Plynoměr','Hlavní (fakturační)','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
5
+ (19,'/2.2/TVP1','TV byt školníka','03360876','1','','TV byt školníka','false','Vodoměr','Podružný','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
6
+ (20,'/2.2/EF1','Fakturační elektroměr škola','50838771','1','859182400305337226','Škola','true','Elektroměr','Hlavní (fakturační)','kWh','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
7
+ (21,'/2.2/EF2','Fakturační elektroměr kuchyně','50838773','2','859182400305337486','kuchyně','true','Elektroměr','Hlavní (fakturační)','kWh','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
8
+ (22,'/2.2/EP1','Podružný elektroměr byt školníka','25718070072','3','','byt školníka','true','Elektroměr','Podružný','kWh','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
9
+ (23,'/2.2/EP2','Podružný elektroměr bufet','25718070073','4','','Bufet','true','Elektroměr','Podružný','kWh','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
10
+ (24,'/2.2/VF1','Fakturační vodoměr škola','5038170010','2','302502-46-V1','Škola','true','Vodoměr','Hlavní (fakturační)','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
11
+ (25,'/2.2/VF2','Fakturační vodoměr kuchyně','18BA317996','3','302502-45-V1','Kuchyně','true','Vodoměr','Hlavní (fakturační)','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
12
+ (26,'/2.2/VP1','Podružný vodoměr byt školníka','04946912','4','','Byt školníka','true','Vodoměr','Podružný','m^3','','false',10,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
13
+ (27,'/2.3/PF1','Fakturační plynoměr kotelna','9312989','1','27ZG100Z0001191L','Kotelna','true','Plynoměr','Hlavní (fakturační)','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
14
+ (29,'/2.3/TVP1','Podružné měření byt','18372914','1','','Podružné měření byt','true','Vodoměr','Podružný','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
15
+ (30,'/2.3/EF1','Fakturační elektroměr škola','85535937','1','859182400300019356','Škola','true','Elektroměr','Hlavní (fakturační)','kWh','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
16
+ (31,'/2.3/EP1','Podružný elektroměr kuchyně','26018040915','2','','Kuchyně','true','Elektroměr','Podružný','kWh','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
17
+ (32,'/2.3/EP2','Podružný elektroměr bazén','25718070076','3','','Bazén','true','Elektroměr','Podružný','kWh','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
18
+ (33,'/2.3/EP3','Podružný elektroměr byt','25718070078','4','','Byt ','true','Elektroměr','Podružný','kWh','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
19
+ (34,'/2.3/VF1','Fakturační vodoměr škola','18BF011549','2','300135-189-V1','Škola','true','Vodoměr','Hlavní (fakturační)','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
20
+ (35,'/2.3/VP1','Měření na studené vodě pro TV kuchyně','42 011 531 860','3','','TV kuchyň','true','Vodoměr','Podružný','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
21
+ (36,'/2.3/VP2','Podružné měření kuchyně','5090290001','4','','Kuchyně','true','Vodoměr','Podružný','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
22
+ (37,'/2.3/VP3','Podružné měření byt','18372914','5','','Byt','true','Vodoměr','Podružný','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
23
+ (38,'/2.3/VP4','Podružné měření bazén','01TE060034','6','','Bazén','true','Vodoměr','Podružný','m^3','','false',11,NULL,'2023-01-06 15:20:34.359',NULL,NULL,'2024-05-20 17:30:01.138',NULL),
24
+ (136,'/2.3/PF1','Fakturační plynoměr kotelna','9512360','2','27ZG100Z0001191L','Kotelna','true','Plynoměr','Hlavní (fakturační)','m^3','27','false',11,NULL,'2023-01-06 15:20:34.36',NULL,NULL,'2024-05-20 17:30:01.139',NULL);
@@ -1,3 +1,3 @@
1
1
  {
2
- "schema": "energetics"
2
+ "schema": "energetics, public"
3
3
  }
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var dbm;
4
+ var type;
5
+ var seed;
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+ var Promise;
9
+
10
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20240514074033-buildings-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', '20240514074033-buildings-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var dbm;
4
+ var type;
5
+ var seed;
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+ var Promise;
9
+
10
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20240514111900-organizations-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', '20240514111900-organizations-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,2 @@
1
+ drop table consumption_energy_buildings_primary;
2
+ drop table consumption_energy_buildings_secondary;
@@ -0,0 +1,138 @@
1
+ CREATE TABLE consumption_energy_buildings_primary (
2
+ id int4 NOT NULL,
3
+ description varchar(100) ,
4
+ building_name varchar(100) ,
5
+ building_address_code varchar(100) ,
6
+ building_label varchar(100) ,
7
+ main_use varchar(100) ,
8
+ secondary_use varchar(100) ,
9
+ year_of_construction int2 ,
10
+ create_batch_id int8 NULL,
11
+ created_at timestamp NULL,
12
+ created_by varchar(150) NULL,
13
+ update_batch_id int8 NULL,
14
+ updated_at timestamp NULL,
15
+ updated_by varchar(150) NULL,
16
+ CONSTRAINT consumption_primary_energy_buildings_pkey PRIMARY KEY (id)
17
+ );
18
+
19
+ CREATE TABLE consumption_energy_buildings_secondary (
20
+ id int4 NOT NULL,
21
+ building_address_code varchar(100) ,
22
+ building_label varchar(100) ,
23
+ current_note varchar(100) ,
24
+ method_of_protection varchar(100) ,
25
+ built_up_area real , --n
26
+ heated_bulding_volume int8 ,
27
+ students_count int8 , --n
28
+ employees_count int8 ,--n
29
+ classrooms_count int4 ,--n
30
+ beds_count int8 ,--n
31
+ eno_id varchar(100) ,
32
+ csu_code varchar(100) ,
33
+ ku_code varchar(100) ,
34
+ allotment_number real ,--n
35
+ registration_unit varchar(100) ,
36
+ energetic_management varchar(100) ,
37
+ opening_hours varchar(100) ,
38
+ weekend_opening_hours varchar(100) ,
39
+ location geometry, -- lat and long
40
+ address_street varchar(100) ,
41
+ address_house_number varchar(100) ,
42
+ address_city varchar(100) ,
43
+ address_country varchar(100) ,
44
+ address_mail varchar(100) ,
45
+ address_phone varchar(100) ,
46
+ address_web_address varchar(100) ,
47
+ penb_penbnumber int4 ,--n
48
+ penb_issue_date timestamp,
49
+ penb_total_building_envelope_area real ,--n
50
+ penb_volume_factor_of_avshape varchar(100) ,
51
+ penb_total_energy_reference_area real ,--n
52
+ penb_total_provided_energy real ,--n
53
+ penb_total_provided_energy_category varchar(50) ,
54
+ penb_primary_non_renewable_energy real,--n
55
+ penb_primary_non_renewable_energy_category varchar(50) ,
56
+ penb_building_envelope real ,--n
57
+ penb_building_envelope_category varchar(100) ,
58
+ penb_heating real ,--n
59
+ penb_heating_category varchar(50) ,
60
+ penb_cooling real ,--n
61
+ penb_cooling_category varchar(50) ,
62
+ penb_ventilation real ,--n
63
+ penb_ventilation_category varchar(50) ,
64
+ penb_humidity_adjustment real ,--n
65
+ penb_humidity_adjustment_category varchar(100) ,
66
+ penb_warm_water real ,--n
67
+ penb_warm_water_category varchar(50) ,
68
+ penb_lighting real ,--n
69
+ penb_lighting_category varchar(50) ,
70
+ energy_audits_energy_audit varchar(100) ,
71
+ energy_audits_earegistration_number int4 ,--n
72
+ energy_audits_created_at timestamp ,
73
+ building_envelope_side_wall_prevailing_construction varchar(100) ,
74
+ building_envelope_side_wall_area real ,--n
75
+ building_envelope_side_wall_heat_insulation varchar(50) ,
76
+ building_envelope_side_wall_year_of_adjustment varchar(50) , --year but its text (po roce xxxx)
77
+ building_envelope_side_wall_technical_condition varchar(50) ,
78
+ building_envelope_filling_of_hole_construction varchar(100) ,
79
+ building_envelope_filling_of_hole_area real ,--n
80
+ building_envelope_filling_of_hole_year_of_adjustment varchar(50) ,
81
+ building_envelope_filling_of_hole_technical_condition varchar(50) ,
82
+ building_envelope_roof_construction varchar(50) ,
83
+ building_envelope_roof_area real ,--n
84
+ building_envelope_roof_thermal_insulation varchar(50) ,
85
+ building_envelope_roof_year_of_adjustment varchar(50) ,
86
+ building_envelope_roof_technical_condition varchar(50) ,
87
+ building_envelope_floor_of_the_lowest_heated_floor_construction varchar(100) ,
88
+ building_envelope_floor_of_the_lowest_heated_floor_area real ,--n
89
+ floor_of_the_lowest_heated_floor_thermal_insulation varchar(50) ,
90
+ building_envelope_floor_of_the_lowest_heated_floor_year_of_adju varchar(100) ,
91
+ floor_of_the_lowest_heated_floor_technical_condition varchar(50) ,
92
+ fuel_and_energy_coal boolean ,
93
+ fuel_and_energy_gas boolean ,
94
+ fuel_and_energy_electricity boolean ,
95
+ fuel_and_energy_czt boolean ,
96
+ fuel_and_energy_oze boolean ,
97
+ fuel_and_energy_other boolean ,
98
+ technical_equipment_heating_main_source_of_heat varchar(100) ,
99
+ technical_equipment_heating_heat_percentage int2 ,--n
100
+ technical_equipment_heating_secondary_source_of_heat varchar(100) ,
101
+ technical_equipment_heating_heating_system varchar(100) ,
102
+ technical_equipment_heating_year varchar(50) , --year but its text (po roce xxxx)
103
+ technical_equipment_heating_technical_condition varchar(100) ,
104
+ technical_equipment_cooling_cooling_system varchar(100) ,
105
+ technical_equipment_cooling_cooling_area_percentage int2,
106
+ technical_equipment_cooling_year varchar(50) ,
107
+ technical_equipment_cooling_technical_condition varchar(100) ,
108
+ technical_equipment_ventilation_ventilation varchar(100) ,
109
+ technical_equipment_ventilation_year varchar(50) ,
110
+ technical_equipment_ventilation_technical_condition varchar(100) ,
111
+ technical_equipment_humidity_adjustment_humidity_adjustment varchar(100) ,
112
+ technical_equipment_humidity_adjustment_year varchar(100) ,
113
+ technical_equipment_humidity_adjustment_technical_condition varchar(100) ,
114
+ technical_equipment_hot_water_predominant_way_of_heating_tv varchar(100) ,
115
+ technical_equipment_hot_water_hot_water_source varchar(100) ,
116
+ technical_equipment_hot_water_year varchar(50) ,
117
+ technical_equipment_hot_water_technical_condition varchar(100) ,
118
+ technical_equipment_lighting_lighting varchar(100) ,
119
+ technical_equipment_lighting_year varchar(50) ,
120
+ technical_equipment_lighting_technical_condition varchar(100) ,
121
+ technical_equipment_lighting_other_technological_elements varchar(100) ,
122
+ technical_equipment_lighting_measurement_method varchar(100) ,
123
+ oze_energy_production_solar_energy_photovoltaic varchar(100) ,
124
+ oze_energy_production_solar_energy_photothermal varchar(100) ,
125
+ oze_energy_production_integrated_turbines_wind_energy varchar(100) ,
126
+ oze_energy_production_heat_pump varchar(100) ,
127
+ waste_and_emissions_solid_waste_production varchar(100) ,
128
+ waste_and_emissions_tied_co2_emissions varchar(100) ,
129
+ waste_and_emissions_sox_emissions varchar(100) ,
130
+ waste_and_emissions_operating_co_2emissions varchar(100) ,
131
+ create_batch_id int8 NULL,
132
+ created_at timestamp NULL,
133
+ created_by varchar(150) NULL,
134
+ update_batch_id int8 NULL,
135
+ updated_at timestamp NULL,
136
+ updated_by varchar(150) NULL,
137
+ CONSTRAINT consumption_secondary_energy_buildings_pkey PRIMARY KEY (id)
138
+ );
@@ -0,0 +1,3 @@
1
+ drop table organization_responsible_users;
2
+ drop table organizations_buildings;
3
+ drop table organizations;
@@ -0,0 +1,37 @@
1
+ create table organizations (
2
+ id int4 not null,
3
+ name varchar(100) null,
4
+ label varchar(50) null,
5
+ address_street varchar(100) null,
6
+ address_house_number varchar(100) null,
7
+ address_city varchar(100) null,
8
+ address_country varchar(100) null,
9
+ address_mail varchar(100) null,
10
+ address_phone varchar(50) null,
11
+ address_web_address varchar(100) null,
12
+ category varchar(80) null,
13
+ created_by_id int4 null,
14
+ grafana_url varchar(255) null,
15
+
16
+ CONSTRAINT organizations_pk PRIMARY KEY (id)
17
+ );
18
+
19
+ create table organizations_buildings (
20
+ organization_id int4 not null,
21
+ building_id int4 not null,
22
+
23
+ CONSTRAINT organizations_buildings_pk PRIMARY KEY (organization_id, building_id)
24
+ );
25
+
26
+ create table organization_responsible_users (
27
+ id int4 not null,
28
+ organization_id int4 not null,
29
+ first_name varchar(100) null,
30
+ last_name varchar(100) null,
31
+ position varchar(100) null,
32
+ phone varchar(50) null,
33
+ mail varchar(50) null,
34
+ company varchar(100) null,
35
+
36
+ CONSTRAINT organization_responsible_users_pk PRIMARY KEY (id)
37
+ );
@@ -23,8 +23,6 @@ class FetchDataTask extends workers_1.AbstractTask {
23
23
  }
24
24
  execute({ targetDays }) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
- yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "fetchBuildings", {});
27
- yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "fetchDevices", {});
28
26
  for (const dateParams of this.generateDateParams(targetDays)) {
29
27
  yield queueprocessors_1.QueueManager.sendMessageToExchange(this.queuePrefix, "fetchConsumption", dateParams);
30
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FetchDataTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/tasks/oict-energetika/FetchDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kFAAuF;AACvF,2FAAqF;AACrF,2EAA6E;AAC7E,2DAAqE;AAErE,MAAa,aAAc,SAAQ,sBAA6B;IAK5D,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QALP,cAAS,GAAG,WAAW,CAAC;QACxB,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QACxC,WAAM,GAAG,2CAAyB,CAAC;IAInD,CAAC;IAEe,OAAO,CAAC,EAAE,UAAU,EAAmB;;YACnD,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;YACjF,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;YAE/E,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE;gBAC1D,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;IAEO,CAAC,kBAAkB,CAAC,UAAkB;QAC1C,MAAM,WAAW,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,gBAAQ,CAAC,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAE5F,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAC9B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAExC,MAAM;gBACF,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE;gBAC3B,MAAM,EAAE,GAAG,CAAC,SAAS,EAAE;aAC1B,CAAC;SACL;IACL,CAAC;CACJ;AAjCD,sCAiCC"}
1
+ {"version":3,"file":"FetchDataTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/tasks/oict-energetika/FetchDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kFAAuF;AACvF,2FAAqF;AACrF,2EAA6E;AAC7E,2DAAqE;AAErE,MAAa,aAAc,SAAQ,sBAA6B;IAK5D,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QALP,cAAS,GAAG,WAAW,CAAC;QACxB,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QACxC,WAAM,GAAG,2CAAyB,CAAC;IAInD,CAAC;IAEe,OAAO,CAAC,EAAE,UAAU,EAAmB;;YACnD,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE;gBAC1D,MAAM,8BAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;IAEO,CAAC,kBAAkB,CAAC,UAAkB;QAC1C,MAAM,WAAW,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,gBAAQ,CAAC,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAE5F,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAC9B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAExC,MAAM;gBACF,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE;gBAC3B,MAAM,EAAE,GAAG,CAAC,SAAS,EAAE;aAC1B,CAAC;SACL;IACL,CAAC;CACJ;AA9BD,sCA8BC"}
@@ -3,17 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OictEnergetikaWorker = void 0;
4
4
  const FetchConsumptionTask_1 = require("../../tasks/oict-energetika/FetchConsumptionTask");
5
5
  const FetchDataTask_1 = require("../../tasks/oict-energetika/FetchDataTask");
6
- const FetchDevicesTask_1 = require("../../tasks/oict-energetika/FetchDevicesTask");
7
6
  const AbstractWorker_1 = require("@golemio/core/dist/integration-engine/workers/AbstractWorker");
8
- const FetchBuildingsTask_1 = require("../../tasks/oict-energetika/FetchBuildingsTask");
9
7
  class OictEnergetikaWorker extends AbstractWorker_1.AbstractWorker {
10
8
  constructor() {
11
9
  super();
12
10
  this.name = "energeticsOICT";
13
11
  // Register tasks
14
12
  this.registerTask(new FetchDataTask_1.FetchDataTask(this.getQueuePrefix()));
15
- this.registerTask(new FetchBuildingsTask_1.FetchBuildingsTask(this.getQueuePrefix()));
16
- this.registerTask(new FetchDevicesTask_1.FetchDevicesTask(this.getQueuePrefix()));
17
13
  this.registerTask(new FetchConsumptionTask_1.FetchConsumptionTask(this.getQueuePrefix()));
18
14
  }
19
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OictEnergetikaWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/oict-energetika/OictEnergetikaWorker.ts"],"names":[],"mappings":";;;AAAA,2FAAsF;AACtF,6EAAwE;AACxE,mFAA8E;AAC9E,iGAA8F;AAC9F,uFAAoF;AAEpF,MAAa,oBAAqB,SAAQ,+BAAc;IAGpD;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,gBAAgB,CAAC;QAK9B,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,6BAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,IAAI,uCAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,YAAY,CAAC,IAAI,mCAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ;AAZD,oDAYC"}
1
+ {"version":3,"file":"OictEnergetikaWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/oict-energetika/OictEnergetikaWorker.ts"],"names":[],"mappings":";;;AAAA,2FAAsF;AACtF,6EAAwE;AACxE,iGAA8F;AAE9F,MAAa,oBAAqB,SAAQ,+BAAc;IAGpD;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,gBAAgB,CAAC;QAK9B,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,6BAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ;AAVD,oDAUC"}
@@ -0,0 +1,3 @@
1
+ export declare const ORGANIZATION_PATH = "energetics/organizations";
2
+ export declare const BUILDING_PATH = "energetics/buildings";
3
+ export declare const DEVICES_PATH = "energetics/devices";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEVICES_PATH = exports.BUILDING_PATH = exports.ORGANIZATION_PATH = void 0;
4
+ exports.ORGANIZATION_PATH = `energetics/organizations`;
5
+ exports.BUILDING_PATH = `energetics/buildings`;
6
+ exports.DEVICES_PATH = `energetics/devices`;
7
+ //# sourceMappingURL=Links.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export declare enum RouteVersion {
2
+ v2 = "v2"
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RouteVersion = void 0;
4
+ var RouteVersion;
5
+ (function (RouteVersion) {
6
+ RouteVersion["v2"] = "v2";
7
+ })(RouteVersion || (exports.RouteVersion = RouteVersion = {}));
8
+ //# sourceMappingURL=RouteVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteVersion.js","sourceRoot":"","sources":["../../../src/output-gateway/constants/RouteVersion.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAEX;AAFD,WAAY,YAAY;IACpB,yBAAS,CAAA;AACb,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB"}