epb_view_models 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/api/schemas/xml/RdSAP-Schema-NI-19.0/RdSAP/Templates/EPC-CollectedData.xsd +13 -12
- data/lib/epb_view_models.rb +1 -1
- data/lib/helper/energy_band_calculator.rb +1 -1
- data/lib/helper/xml_enums_to_output.rb +264 -114
- data/lib/presenter/export/domestic.rb +1 -1
- data/lib/presenter/rd_sap/report.rb +21 -11
- data/lib/presenter/sap/report.rb +19 -7
- data/lib/presenter/sap/summary.rb +1 -1
- data/lib/view_model/domestic_epc_view_model.rb +4 -0
- data/lib/view_model/rd_sap_schema_200/common_schema.rb +0 -4
- data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_102/common_schema.rb +5 -6
- data/lib/view_model/sap_schema_102/rdsap.rb +4 -0
- data/lib/view_model/sap_schema_110/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_110/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_110/sap.rb +8 -0
- data/lib/view_model/sap_schema_112/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_112/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_112/sap.rb +8 -0
- data/lib/view_model/sap_schema_120/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_120/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_120/sap.rb +8 -0
- data/lib/view_model/sap_schema_130/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_130/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_130/sap.rb +8 -0
- data/lib/view_model/sap_schema_140/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_140/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_140/sap.rb +8 -0
- data/lib/view_model/sap_schema_141/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_141/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_141/sap.rb +8 -0
- data/lib/view_model/sap_schema_142/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_142/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_142/sap.rb +8 -0
- data/lib/view_model/sap_schema_150/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_150/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_150/sap.rb +8 -0
- data/lib/view_model/sap_schema_160/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_160/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_160/sap.rb +8 -0
- data/lib/view_model/sap_schema_161/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_161/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_161/sap.rb +8 -0
- data/lib/view_model/sap_schema_162/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_162/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_162/sap.rb +8 -0
- data/lib/view_model/sap_schema_163/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_163/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_163/sap.rb +8 -0
- data/lib/view_model/sap_schema_170/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_171/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_1800/common_schema.rb +4 -4
- data/lib/view_model/sap_schema_ni_112/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_112/rdsap.rb +13 -0
- data/lib/view_model/sap_schema_ni_112/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_120/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_120/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_120/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_130/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_130/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_130/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_140/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_140/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_140/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_141/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_141/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_141/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_142/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_142/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_142/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_150/common_schema.rb +1 -5
- data/lib/view_model/sap_schema_ni_150/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_150/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_160/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_160/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_160/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_161/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_161/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_161/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_170/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_170/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_170/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_171/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_171/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_171/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_172/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_172/rdsap.rb +8 -0
- data/lib/view_model/sap_schema_ni_172/sap.rb +8 -0
- data/lib/view_model/sap_schema_ni_173/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_ni_174/common_schema.rb +4 -0
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +4 -4
- metadata +2 -3
- data/.DS_Store +0 -0
|
@@ -7,7 +7,7 @@ module Presenter::Export
|
|
|
7
7
|
view[:assessment_id] = @view_model.assessment_id
|
|
8
8
|
view[:assessor] = assessor
|
|
9
9
|
view[:built_form] =
|
|
10
|
-
enum_value(:
|
|
10
|
+
enum_value(:built_form_string, @view_model.built_form)
|
|
11
11
|
view[:co2_emissions_current_per_floor_area] =
|
|
12
12
|
@view_model.co2_emissions_current_per_floor_area.to_i
|
|
13
13
|
view[:construction_age_band] =
|
|
@@ -24,7 +24,7 @@ module Presenter
|
|
|
24
24
|
address2: @view_model.address_line2,
|
|
25
25
|
address3: @view_model.address_line3,
|
|
26
26
|
built_form:
|
|
27
|
-
Helper::XmlEnumsToOutput.
|
|
27
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
|
28
28
|
co2_emiss_curr_per_floor_area:
|
|
29
29
|
@view_model.co2_emissions_current_per_floor_area,
|
|
30
30
|
co2_emissions_current: @view_model.current_carbon_emission,
|
|
@@ -40,7 +40,7 @@ module Presenter
|
|
|
40
40
|
Helper::EnergyBandCalculator.domestic(
|
|
41
41
|
@view_model.current_energy_rating,
|
|
42
42
|
),
|
|
43
|
-
cylinder_insul_thickness: @view_model.cylinder_insul_thickness,
|
|
43
|
+
cylinder_insul_thickness: Helper::XmlEnumsToOutput.cylinder_insulation_thickness(@view_model.cylinder_insul_thickness),
|
|
44
44
|
cylinder_insulation_type: @view_model.cylinder_insulation_type,
|
|
45
45
|
cylinder_size: @view_model.cylinder_size,
|
|
46
46
|
has_cylinder_thermostat: @view_model.has_cylinder_thermostat == "Y" ? "true" : "false",
|
|
@@ -101,14 +101,13 @@ module Presenter
|
|
|
101
101
|
@view_model.lighting_energy_efficiency_rating,
|
|
102
102
|
),
|
|
103
103
|
lighting_env_eff:
|
|
104
|
-
Helper::XmlEnumsToOutput.energy_rating_string(
|
|
105
|
-
@view_model.lighting_environmental_efficiency_rating,
|
|
106
|
-
),
|
|
104
|
+
Helper::XmlEnumsToOutput.energy_rating_string(@view_model.lighting_environmental_efficiency_rating),
|
|
107
105
|
low_energy_lighting: @view_model.low_energy_lighting,
|
|
108
|
-
|
|
106
|
+
low_energy_fixed_lighting_count:
|
|
109
107
|
@view_model.low_energy_fixed_lighting_outlets_count,
|
|
110
|
-
main_fuel:
|
|
111
|
-
|
|
108
|
+
main_fuel: Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
|
109
|
+
@schema_type,
|
|
110
|
+
@view_model.report_type),
|
|
112
111
|
mainheat_description:
|
|
113
112
|
@view_model.all_main_heating_descriptions.join(", "),
|
|
114
113
|
mainheat_energy_eff:
|
|
@@ -134,7 +133,7 @@ module Presenter
|
|
|
134
133
|
Helper::XmlEnumsToOutput.mechanical_ventilation(
|
|
135
134
|
@view_model.mechanical_ventilation,
|
|
136
135
|
@schema_type,
|
|
137
|
-
@report_type,
|
|
136
|
+
@view_model.report_type,
|
|
138
137
|
),
|
|
139
138
|
mech_vent_sys_index_number: nil,
|
|
140
139
|
mechanical_vent_data_source: nil,
|
|
@@ -179,8 +178,11 @@ module Presenter
|
|
|
179
178
|
transaction_type:
|
|
180
179
|
Helper::XmlEnumsToOutput.transaction_type(
|
|
181
180
|
@view_model.transaction_type,
|
|
181
|
+
@view_model.report_type,
|
|
182
|
+
@schema_type,
|
|
182
183
|
),
|
|
183
184
|
unheated_corridor_length: @view_model.unheated_corridor_length,
|
|
185
|
+
ventilation_type: nil,
|
|
184
186
|
walls_description: @view_model.all_wall_descriptions.first,
|
|
185
187
|
walls_energy_eff:
|
|
186
188
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
|
@@ -190,6 +192,12 @@ module Presenter
|
|
|
190
192
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
|
191
193
|
@view_model.all_wall_env_energy_efficiency_rating.first,
|
|
192
194
|
),
|
|
195
|
+
water_heating_code: @view_model.water_heating_code,
|
|
196
|
+
water_heating_fuel: Helper::XmlEnumsToOutput.fuel_type(
|
|
197
|
+
@view_model.water_heating_fuel,
|
|
198
|
+
@schema_type,
|
|
199
|
+
@view_model.report_type,
|
|
200
|
+
),
|
|
193
201
|
wind_turbine_count: @view_model.wind_turbine_count,
|
|
194
202
|
windows_description: @view_model.window_description,
|
|
195
203
|
windows_energy_eff:
|
|
@@ -311,7 +319,7 @@ module Presenter
|
|
|
311
319
|
),
|
|
312
320
|
photo_supply: @view_model.photovoltaic_roof_area_percent,
|
|
313
321
|
built_form:
|
|
314
|
-
Helper::XmlEnumsToOutput.
|
|
322
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
|
315
323
|
mainheat_description:
|
|
316
324
|
@view_model.all_main_heating_descriptions.join(", "),
|
|
317
325
|
mainheat_energy_eff:
|
|
@@ -359,7 +367,9 @@ module Presenter
|
|
|
359
367
|
),
|
|
360
368
|
floor_height: @view_model.floor_height.first,
|
|
361
369
|
main_fuel:
|
|
362
|
-
Helper::XmlEnumsToOutput.
|
|
370
|
+
Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
|
371
|
+
@schema_type,
|
|
372
|
+
@view_model.report_type),
|
|
363
373
|
floor_description: @view_model.all_floor_descriptions.first,
|
|
364
374
|
floor_energy_eff:
|
|
365
375
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
data/lib/presenter/sap/report.rb
CHANGED
|
@@ -24,8 +24,8 @@ module Presenter
|
|
|
24
24
|
address2: @view_model.address_line2,
|
|
25
25
|
address3: @view_model.address_line3,
|
|
26
26
|
built_form:
|
|
27
|
-
Helper::XmlEnumsToOutput.
|
|
28
|
-
|
|
27
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
|
28
|
+
co2_emiss_curr_per_floor_area:
|
|
29
29
|
@view_model.co2_emissions_current_per_floor_area,
|
|
30
30
|
co2_emissions_current: @view_model.current_carbon_emission,
|
|
31
31
|
co2_emissions_potential: @view_model.potential_carbon_emission,
|
|
@@ -40,7 +40,7 @@ module Presenter
|
|
|
40
40
|
Helper::EnergyBandCalculator.domestic(
|
|
41
41
|
@view_model.current_energy_rating,
|
|
42
42
|
),
|
|
43
|
-
cylinder_insul_thickness: @view_model.cylinder_insul_thickness,
|
|
43
|
+
cylinder_insul_thickness: Helper::XmlEnumsToOutput.cylinder_insulation_thickness(@view_model.cylinder_insul_thickness, @view_model.report_type),
|
|
44
44
|
cylinder_insulation_type: @view_model.cylinder_insulation_type,
|
|
45
45
|
cylinder_size: @view_model.cylinder_size,
|
|
46
46
|
has_cylinder_thermostat: @view_model.has_cylinder_thermostat,
|
|
@@ -108,10 +108,12 @@ module Presenter
|
|
|
108
108
|
@view_model.lighting_environmental_efficiency_rating,
|
|
109
109
|
),
|
|
110
110
|
low_energy_lighting: @view_model.low_energy_lighting,
|
|
111
|
-
|
|
111
|
+
low_energy_fixed_lighting_count:
|
|
112
112
|
@view_model.low_energy_fixed_lighting_outlets_count,
|
|
113
113
|
main_fuel:
|
|
114
|
-
Helper::XmlEnumsToOutput.
|
|
114
|
+
Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
|
115
|
+
@schema_type,
|
|
116
|
+
@view_model.report_type),
|
|
115
117
|
mainheat_description:
|
|
116
118
|
@view_model.all_main_heating_descriptions.join(", "),
|
|
117
119
|
mainheat_energy_eff:
|
|
@@ -184,8 +186,11 @@ module Presenter
|
|
|
184
186
|
Helper::XmlEnumsToOutput.transaction_type(
|
|
185
187
|
@view_model.transaction_type,
|
|
186
188
|
@view_model.report_type,
|
|
189
|
+
@schema_type,
|
|
187
190
|
),
|
|
191
|
+
ventilation_type: Helper::XmlEnumsToOutput.ventilation_type(@view_model.ventilation_type, @schema_type),
|
|
188
192
|
unheated_corridor_length: @view_model.unheated_corridor_length,
|
|
193
|
+
water_heating_code: @view_model.water_heating_code,
|
|
189
194
|
walls_description: @view_model.all_wall_descriptions.first,
|
|
190
195
|
walls_energy_eff:
|
|
191
196
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
|
@@ -195,6 +200,11 @@ module Presenter
|
|
|
195
200
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
|
196
201
|
@view_model.all_wall_env_energy_efficiency_rating.first,
|
|
197
202
|
),
|
|
203
|
+
water_heating_fuel: Helper::XmlEnumsToOutput.fuel_type(
|
|
204
|
+
@view_model.water_heating_fuel,
|
|
205
|
+
@schema_type,
|
|
206
|
+
@view_model.report_type,
|
|
207
|
+
),
|
|
198
208
|
wind_turbine_count: @view_model.wind_turbine_count,
|
|
199
209
|
windows_description: @view_model.window_description,
|
|
200
210
|
windows_energy_eff:
|
|
@@ -317,7 +327,7 @@ module Presenter
|
|
|
317
327
|
),
|
|
318
328
|
photo_supply: @view_model.photovoltaic_roof_area_percent,
|
|
319
329
|
built_form:
|
|
320
|
-
Helper::XmlEnumsToOutput.
|
|
330
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
|
321
331
|
mainheat_description:
|
|
322
332
|
@view_model.all_main_heating_descriptions.join(", "),
|
|
323
333
|
report_type: @view_model.report_type,
|
|
@@ -368,7 +378,9 @@ module Presenter
|
|
|
368
378
|
@view_model.floor_height.first
|
|
369
379
|
end,
|
|
370
380
|
main_fuel:
|
|
371
|
-
Helper::XmlEnumsToOutput.
|
|
381
|
+
Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
|
382
|
+
@schema_type,
|
|
383
|
+
@view_model.report_type),
|
|
372
384
|
floor_description: @view_model.all_floor_descriptions.first,
|
|
373
385
|
floor_energy_eff:
|
|
374
386
|
Helper::XmlEnumsToOutput.energy_rating_string(
|
|
@@ -150,7 +150,7 @@ module Presenter
|
|
|
150
150
|
wind_turbine_count: @view_model.wind_turbine_count,
|
|
151
151
|
unheated_corridor_length: @view_model.unheated_corridor_length,
|
|
152
152
|
built_form:
|
|
153
|
-
Helper::XmlEnumsToOutput.
|
|
153
|
+
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
|
154
154
|
mainheat_description:
|
|
155
155
|
@view_model.all_main_heating_descriptions.join(", "),
|
|
156
156
|
extensions_count:
|
|
@@ -244,10 +244,6 @@ module ViewModel
|
|
|
244
244
|
xpath(%w[Secondary-Fuel-Type])
|
|
245
245
|
end
|
|
246
246
|
|
|
247
|
-
def water_heating_fuel
|
|
248
|
-
xpath(%w[Water-Fuel-Type])
|
|
249
|
-
end
|
|
250
|
-
|
|
251
247
|
def type_of_assessment
|
|
252
248
|
case xpath(%w[Report-Type]).to_i
|
|
253
249
|
when 1
|
|
@@ -377,8 +373,7 @@ module ViewModel
|
|
|
377
373
|
end
|
|
378
374
|
|
|
379
375
|
def built_form
|
|
380
|
-
|
|
381
|
-
Helper::XmlEnumsToOutput.xml_value_to_string(built_form_value)
|
|
376
|
+
xpath(%w[Built-Form])
|
|
382
377
|
end
|
|
383
378
|
|
|
384
379
|
def unheated_corridor_length
|
|
@@ -514,6 +509,10 @@ module ViewModel
|
|
|
514
509
|
def thermal_store
|
|
515
510
|
nil
|
|
516
511
|
end
|
|
512
|
+
|
|
513
|
+
def ventilation_type
|
|
514
|
+
nil
|
|
515
|
+
end
|
|
517
516
|
end
|
|
518
517
|
end
|
|
519
518
|
end
|