epb_view_models 1.2.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +38 -28
- data/epb_view_models.gemspec +1 -1
- data/lib/epb_view_models.rb +1 -1
- data/lib/presenter/cepc/report.rb +11 -15
- data/lib/presenter/cepc/summary.rb +5 -14
- data/lib/presenter/dec/report.rb +5 -9
- data/lib/presenter/dec/summary.rb +3 -11
- data/lib/presenter/dec/xml_summary.rb +2 -2
- data/lib/presenter/export/base.rb +4 -4
- data/lib/presenter/export/commercial.rb +16 -27
- data/lib/presenter/export/domestic.rb +30 -39
- data/lib/presenter/rd_sap/domestic_digest.rb +2 -4
- data/lib/presenter/rd_sap/report.rb +47 -57
- data/lib/presenter/rd_sap/summary.rb +13 -21
- data/lib/presenter/sap/domestic_digest.rb +2 -4
- data/lib/presenter/sap/report.rb +49 -59
- data/lib/presenter/sap/summary.rb +27 -41
- data/lib/view_model/cepc31/cepc.rb +4 -44
- data/lib/view_model/cepc31/common_schema.rb +1 -1
- data/lib/view_model/cepc31/dec.rb +14 -34
- data/lib/view_model/cepc40/ac_report.rb +1 -1
- data/lib/view_model/cepc40/cepc.rb +6 -30
- data/lib/view_model/cepc40/common_schema.rb +1 -1
- data/lib/view_model/cepc40/dec.rb +16 -16
- data/lib/view_model/cepc50/ac_report.rb +1 -1
- data/lib/view_model/cepc50/cepc.rb +6 -10
- data/lib/view_model/cepc50/common_schema.rb +1 -1
- data/lib/view_model/cepc50/dec.rb +16 -16
- data/lib/view_model/cepc51/ac_report.rb +1 -1
- data/lib/view_model/cepc51/cepc.rb +6 -6
- data/lib/view_model/cepc51/common_schema.rb +1 -1
- data/lib/view_model/cepc51/dec.rb +16 -16
- data/lib/view_model/cepc60/ac_report.rb +1 -1
- data/lib/view_model/cepc60/cepc.rb +6 -10
- data/lib/view_model/cepc60/common_schema.rb +1 -1
- data/lib/view_model/cepc60/dec.rb +17 -17
- data/lib/view_model/cepc70/ac_cert.rb +3 -3
- data/lib/view_model/cepc70/ac_report.rb +1 -1
- data/lib/view_model/cepc70/cepc.rb +6 -10
- data/lib/view_model/cepc70/common_schema.rb +1 -1
- data/lib/view_model/cepc70/dec.rb +17 -17
- data/lib/view_model/cepc71/ac_cert.rb +3 -3
- data/lib/view_model/cepc71/ac_report.rb +1 -1
- data/lib/view_model/cepc71/cepc.rb +6 -6
- data/lib/view_model/cepc71/common_schema.rb +1 -1
- data/lib/view_model/cepc71/dec.rb +17 -17
- data/lib/view_model/cepc800/ac_cert.rb +3 -3
- data/lib/view_model/cepc800/ac_report.rb +1 -1
- data/lib/view_model/cepc800/cepc.rb +6 -11
- data/lib/view_model/cepc800/common_schema.rb +1 -1
- data/lib/view_model/cepc800/dec.rb +17 -17
- data/lib/view_model/cepc_ni800/ac_cert.rb +3 -3
- data/lib/view_model/cepc_ni800/ac_report.rb +1 -1
- data/lib/view_model/cepc_ni800/cepc.rb +6 -10
- data/lib/view_model/cepc_ni800/common_schema.rb +1 -1
- data/lib/view_model/cepc_ni800/dec.rb +17 -17
- data/lib/view_model/rd_sap_schema_170/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_171/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_180/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_190/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_200/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_210/common_schema.rb +14 -34
- data/lib/view_model/rd_sap_schema_ni_173/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_174/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_180/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_190/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +17 -25
- data/lib/view_model/sap_schema_102/common_schema.rb +13 -85
- data/lib/view_model/sap_schema_102/rdsap.rb +3 -3
- data/lib/view_model/sap_schema_110/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_110/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_110/sap.rb +1 -1
- data/lib/view_model/sap_schema_112/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_112/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_112/sap.rb +1 -1
- data/lib/view_model/sap_schema_120/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_120/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_120/sap.rb +1 -1
- data/lib/view_model/sap_schema_130/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_130/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_130/sap.rb +1 -1
- data/lib/view_model/sap_schema_140/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_140/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_140/sap.rb +1 -1
- data/lib/view_model/sap_schema_141/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_141/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_141/sap.rb +1 -1
- data/lib/view_model/sap_schema_142/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_142/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_142/sap.rb +1 -1
- data/lib/view_model/sap_schema_150/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_150/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_150/sap.rb +1 -1
- data/lib/view_model/sap_schema_160/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_160/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_160/sap.rb +1 -1
- data/lib/view_model/sap_schema_161/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_161/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_161/sap.rb +1 -1
- data/lib/view_model/sap_schema_162/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_162/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_162/sap.rb +1 -1
- data/lib/view_model/sap_schema_163/common_schema.rb +13 -53
- data/lib/view_model/sap_schema_163/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_163/sap.rb +1 -1
- data/lib/view_model/sap_schema_170/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_171/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_1800/common_schema.rb +12 -64
- data/lib/view_model/sap_schema_1900/common_schema.rb +10 -50
- data/lib/view_model/sap_schema_1910/common_schema.rb +10 -50
- data/lib/view_model/sap_schema_ni_112/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_ni_112/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_112/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_120/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_ni_120/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_120/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_130/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_ni_130/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_130/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_140/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_140/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_140/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_141/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_141/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_141/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_142/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_142/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_142/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_150/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_150/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_150/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_160/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_160/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_160/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_161/common_schema.rb +14 -50
- data/lib/view_model/sap_schema_ni_161/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_161/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_170/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_170/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_170/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_171/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_171/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_171/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_172/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_172/rdsap.rb +3 -23
- data/lib/view_model/sap_schema_ni_172/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_173/common_schema.rb +10 -78
- data/lib/view_model/sap_schema_ni_174/common_schema.rb +10 -78
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +10 -78
- metadata +4 -4
|
@@ -45,10 +45,7 @@ module Presenter
|
|
|
45
45
|
},
|
|
46
46
|
current_carbon_emission:
|
|
47
47
|
convert_to_big_decimal(@view_model.current_carbon_emission),
|
|
48
|
-
current_energy_efficiency_band:
|
|
49
|
-
Helper::EnergyBandCalculator.domestic(
|
|
50
|
-
@view_model.current_energy_rating,
|
|
51
|
-
),
|
|
48
|
+
current_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.current_energy_rating),
|
|
52
49
|
current_energy_efficiency_rating: @view_model.current_energy_rating,
|
|
53
50
|
dwelling_type: @view_model.dwelling_type,
|
|
54
51
|
estimated_energy_cost:,
|
|
@@ -58,10 +55,9 @@ module Presenter
|
|
|
58
55
|
@view_model.current_space_heating_demand&.to_i,
|
|
59
56
|
current_water_heating_demand:
|
|
60
57
|
@view_model.current_water_heating_demand&.to_i,
|
|
61
|
-
impact_of_cavity_insulation: @view_model.impact_of_cavity_insulation,
|
|
62
|
-
impact_of_loft_insulation: @view_model.impact_of_loft_insulation,
|
|
63
|
-
impact_of_solid_wall_insulation:
|
|
64
|
-
@view_model.impact_of_solid_wall_insulation,
|
|
58
|
+
impact_of_cavity_insulation: @view_model.respond_to?(:impact_of_cavity_insulation) ? @view_model.impact_of_cavity_insulation : nil,
|
|
59
|
+
impact_of_loft_insulation: @view_model.respond_to?(:impact_of_loft_insulation) ? @view_model.impact_of_loft_insulation : nil,
|
|
60
|
+
impact_of_solid_wall_insulation: @view_model.respond_to?(:impact_of_solid_wall_insulation) ? @view_model.impact_of_solid_wall_insulation : nil,
|
|
65
61
|
},
|
|
66
62
|
heating_cost_current: @view_model.heating_cost_current,
|
|
67
63
|
heating_cost_potential: @view_model.heating_cost_potential,
|
|
@@ -71,10 +67,7 @@ module Presenter
|
|
|
71
67
|
lighting_cost_potential: @view_model.lighting_cost_potential,
|
|
72
68
|
potential_carbon_emission:
|
|
73
69
|
convert_to_big_decimal(@view_model.potential_carbon_emission),
|
|
74
|
-
potential_energy_efficiency_band:
|
|
75
|
-
Helper::EnergyBandCalculator.domestic(
|
|
76
|
-
@view_model.potential_energy_rating,
|
|
77
|
-
),
|
|
70
|
+
potential_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.potential_energy_rating),
|
|
78
71
|
potential_energy_efficiency_rating: @view_model.potential_energy_rating,
|
|
79
72
|
potential_energy_saving:
|
|
80
73
|
Helper::EstimatedCostPotentialSavingHelper.new.potential_saving(
|
|
@@ -83,25 +76,22 @@ module Presenter
|
|
|
83
76
|
@view_model.lighting_cost_potential,
|
|
84
77
|
estimated_energy_cost,
|
|
85
78
|
),
|
|
86
|
-
primary_energy_use: @view_model.primary_energy_use,
|
|
79
|
+
primary_energy_use: @view_model.respond_to?(:primary_energy_use) ? @view_model.primary_energy_use : nil,
|
|
87
80
|
energy_consumption_potential: @view_model.energy_consumption_potential,
|
|
88
|
-
property_age_band: @view_model.property_age_band,
|
|
81
|
+
property_age_band: @view_model.respond_to?(:property_age_band) ? @view_model.property_age_band : nil,
|
|
89
82
|
property_summary: @view_model.property_summary,
|
|
90
83
|
recommended_improvements:
|
|
91
84
|
@view_model.improvements.map do |improvement|
|
|
92
85
|
improvement[:energy_performance_band_improvement] =
|
|
93
|
-
Helper::EnergyBandCalculator.domestic(
|
|
94
|
-
improvement[:energy_performance_rating_improvement],
|
|
95
|
-
)
|
|
86
|
+
Helper::EnergyBandCalculator.domestic(improvement[:energy_performance_rating_improvement])
|
|
96
87
|
improvement
|
|
97
88
|
end,
|
|
98
89
|
lzc_energy_sources: @view_model.lzc_energy_sources,
|
|
99
|
-
related_party_disclosure_number:
|
|
100
|
-
@view_model.related_party_disclosure_number,
|
|
90
|
+
related_party_disclosure_number: @view_model.respond_to?(:related_party_disclosure_number) ? @view_model.related_party_disclosure_number : nil,
|
|
101
91
|
related_party_disclosure_text:
|
|
102
92
|
@view_model.related_party_disclosure_text,
|
|
103
|
-
tenure: @view_model.tenure,
|
|
104
|
-
transaction_type: @view_model.transaction_type,
|
|
93
|
+
tenure: @view_model.respond_to?(:tenure) ? @view_model.tenure : nil,
|
|
94
|
+
transaction_type: @view_model.respond_to?(:transaction_type) ? @view_model.transaction_type : nil,
|
|
105
95
|
total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
|
|
106
96
|
total_roof_area: @view_model.respond_to?(:total_roof_area) ? @view_model.total_roof_area : nil,
|
|
107
97
|
status: @view_model.status,
|
|
@@ -110,20 +100,20 @@ module Presenter
|
|
|
110
100
|
@view_model.environmental_impact_potential,
|
|
111
101
|
co2_emissions_current_per_floor_area:
|
|
112
102
|
@view_model.co2_emissions_current_per_floor_area,
|
|
113
|
-
mains_gas: @view_model.mains_gas,
|
|
103
|
+
mains_gas: @view_model.respond_to?(:mains_gas) ? @view_model.mains_gas : nil,
|
|
114
104
|
level: @view_model.level,
|
|
115
105
|
top_storey: @view_model.top_storey,
|
|
116
|
-
storey_count: @view_model.storey_count,
|
|
106
|
+
storey_count: @view_model.respond_to?(:storey_count) ? @view_model.storey_count : nil,
|
|
117
107
|
main_heating_controls: @view_model.main_heating_controls,
|
|
118
|
-
multiple_glazed_proportion: @view_model.multiple_glazed_proportion,
|
|
119
|
-
glazed_area: @view_model.glazed_area,
|
|
120
|
-
habitable_room_count: @view_model.habitable_room_count,
|
|
121
|
-
heated_room_count: @view_model.heated_room_count,
|
|
122
|
-
low_energy_lighting: @view_model.low_energy_lighting,
|
|
123
|
-
fixed_lighting_outlets_count: @view_model.fixed_lighting_outlets_count,
|
|
108
|
+
multiple_glazed_proportion: @view_model.respond_to?(:multiple_glazed_proportion) ? @view_model.multiple_glazed_proportion : nil,
|
|
109
|
+
glazed_area: @view_model.respond_to?(:glazed_area) ? @view_model.glazed_area : nil,
|
|
110
|
+
habitable_room_count: @view_model.respond_to?(:habitable_room_count) ? @view_model.habitable_room_count : nil,
|
|
111
|
+
heated_room_count: @view_model.respond_to?(:heated_room_count) ? @view_model.heated_room_count : nil,
|
|
112
|
+
low_energy_lighting: @view_model.respond_to?(:low_energy_lighting) ? @view_model.low_energy_lighting : nil,
|
|
113
|
+
fixed_lighting_outlets_count: @view_model.respond_to?(:fixed_lighting_outlets_count) ? @view_model.fixed_lighting_outlets_count : nil,
|
|
124
114
|
low_energy_fixed_lighting_outlets_count:
|
|
125
|
-
@view_model.low_energy_fixed_lighting_outlets_count,
|
|
126
|
-
open_fireplaces_count: @view_model.open_fireplaces_count,
|
|
115
|
+
@view_model.respond_to?(:low_energy_fixed_lighting_outlets_count) ? @view_model.low_energy_fixed_lighting_outlets_count : nil,
|
|
116
|
+
open_fireplaces_count: @view_model.respond_to?(:open_fireplaces_count) ? @view_model.open_fireplaces_count : nil,
|
|
127
117
|
hot_water_description: @view_model.hot_water_description,
|
|
128
118
|
hot_water_energy_efficiency_rating:
|
|
129
119
|
@view_model.hot_water_energy_efficiency_rating,
|
|
@@ -145,22 +135,18 @@ module Presenter
|
|
|
145
135
|
@view_model.lighting_energy_efficiency_rating,
|
|
146
136
|
lighting_environmental_efficiency_rating:
|
|
147
137
|
@view_model.lighting_environmental_efficiency_rating,
|
|
148
|
-
photovoltaic_roof_area_percent:
|
|
149
|
-
|
|
150
|
-
heat_loss_corridor: @view_model.heat_loss_corridor,
|
|
138
|
+
photovoltaic_roof_area_percent: @view_model.respond_to?(:photovoltaic_roof_area_percent) ? @view_model.photovoltaic_roof_area_percent : nil,
|
|
139
|
+
heat_loss_corridor: @view_model.respond_to?(:heat_loss_corridor) ? @view_model.heat_loss_corridor : nil,
|
|
151
140
|
wind_turbine_count: @view_model.wind_turbine_count,
|
|
152
|
-
unheated_corridor_length: @view_model.unheated_corridor_length,
|
|
141
|
+
unheated_corridor_length: @view_model.respond_to?(:unheated_corridor_length) ? @view_model.unheated_corridor_length : nil,
|
|
153
142
|
built_form:
|
|
154
143
|
Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
|
155
144
|
mainheat_description:
|
|
156
145
|
@view_model.all_main_heating_descriptions.join(", "),
|
|
157
|
-
extensions_count:
|
|
158
|
-
if @view_model.respond_to?(:extensions_count)
|
|
159
|
-
@view_model.extensions_count
|
|
160
|
-
end,
|
|
146
|
+
extensions_count: @view_model.respond_to?(:extensions_count) ? @view_model.extensions_count : nil,
|
|
161
147
|
addendum: @view_model.addendum,
|
|
162
|
-
gas_smart_meter_present: @view_model.gas_smart_meter_present,
|
|
163
|
-
electricity_smart_meter_present: @view_model.electricity_smart_meter_present,
|
|
148
|
+
gas_smart_meter_present: @view_model.respond_to?(:gas_smart_meter_present) ? @view_model.gas_smart_meter_present : nil,
|
|
149
|
+
electricity_smart_meter_present: @view_model.respond_to?(:electricity_smart_meter_present) ? @view_model.electricity_smart_meter_present : nil,
|
|
164
150
|
country_code: @view_model.country_code,
|
|
165
151
|
}
|
|
166
152
|
end
|
|
@@ -1,48 +1,24 @@
|
|
|
1
1
|
module ViewModel
|
|
2
2
|
module Cepc31
|
|
3
3
|
class Cepc < ViewModel::Cepc31::CommonSchema
|
|
4
|
-
def ac_inspection_commissioned
|
|
5
|
-
nil
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def ac_kw_rating
|
|
9
|
-
nil
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def ac_present
|
|
13
|
-
nil
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def building_emission_rate
|
|
17
|
-
nil
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def building_emission
|
|
21
|
-
nil
|
|
22
|
-
end
|
|
23
|
-
|
|
24
4
|
def building_environment
|
|
25
5
|
xpath(%w[Building-Environment])
|
|
26
6
|
end
|
|
27
7
|
|
|
28
8
|
def building_level
|
|
29
|
-
xpath(%w[Building-Level])
|
|
9
|
+
xpath(%w[Building-Level])&.to_i
|
|
30
10
|
end
|
|
31
11
|
|
|
32
12
|
def energy_efficiency_rating
|
|
33
|
-
xpath(%w[Asset-Rating])
|
|
13
|
+
xpath(%w[Asset-Rating])&.to_i
|
|
34
14
|
end
|
|
35
15
|
|
|
36
16
|
def epc_related_party_disclosure
|
|
37
17
|
xpath(%w[Related-Party-Disclosure])
|
|
38
18
|
end
|
|
39
19
|
|
|
40
|
-
def estimated_ac_kw_rating
|
|
41
|
-
nil
|
|
42
|
-
end
|
|
43
|
-
|
|
44
20
|
def existing_build_rating
|
|
45
|
-
xpath(%w[Existing-Stock-Benchmark])
|
|
21
|
+
xpath(%w[Existing-Stock-Benchmark])&.to_i
|
|
46
22
|
end
|
|
47
23
|
|
|
48
24
|
def floor_area
|
|
@@ -54,7 +30,7 @@ module ViewModel
|
|
|
54
30
|
end
|
|
55
31
|
|
|
56
32
|
def new_build_rating
|
|
57
|
-
xpath(%w[New-Build-Benchmark])
|
|
33
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
|
58
34
|
end
|
|
59
35
|
|
|
60
36
|
def other_fuel_description
|
|
@@ -77,22 +53,6 @@ module ViewModel
|
|
|
77
53
|
xpath(%w[Special-Energy-Uses])
|
|
78
54
|
end
|
|
79
55
|
|
|
80
|
-
def standard_emissions
|
|
81
|
-
nil
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def target_emissions
|
|
85
|
-
nil
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def transaction_type
|
|
89
|
-
nil
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
def typical_emissions
|
|
93
|
-
nil
|
|
94
|
-
end
|
|
95
|
-
|
|
96
56
|
def renewable_sources
|
|
97
57
|
xpath(%w[Renewable-Sources])
|
|
98
58
|
end
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
module ViewModel
|
|
2
2
|
module Cepc31
|
|
3
3
|
class Dec < ViewModel::Cepc31::CommonSchema
|
|
4
|
-
def estimated_ac_kw_rating
|
|
5
|
-
nil
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def ac_present
|
|
9
|
-
nil
|
|
10
|
-
end
|
|
11
|
-
|
|
12
4
|
def main_benchmark
|
|
13
5
|
xpath(%w[OR-Benchmark-Data Main-Benchmark])
|
|
14
6
|
end
|
|
@@ -30,7 +22,7 @@ module ViewModel
|
|
|
30
22
|
end
|
|
31
23
|
|
|
32
24
|
def energy_efficiency_rating
|
|
33
|
-
xpath(%w[This-Assessment Energy-Rating])
|
|
25
|
+
xpath(%w[This-Assessment Energy-Rating])&.to_i
|
|
34
26
|
end
|
|
35
27
|
|
|
36
28
|
def current_assessment_date
|
|
@@ -38,15 +30,15 @@ module ViewModel
|
|
|
38
30
|
end
|
|
39
31
|
|
|
40
32
|
def current_heating_co2
|
|
41
|
-
xpath(%w[This-Assessment Heating-CO2])
|
|
33
|
+
xpath(%w[This-Assessment Heating-CO2])&.to_i
|
|
42
34
|
end
|
|
43
35
|
|
|
44
36
|
def current_electricity_co2
|
|
45
|
-
xpath(%w[This-Assessment Electricity-CO2])
|
|
37
|
+
xpath(%w[This-Assessment Electricity-CO2])&.to_i
|
|
46
38
|
end
|
|
47
39
|
|
|
48
40
|
def current_renewables_co2
|
|
49
|
-
xpath(%w[This-Assessment Renewables-CO2])
|
|
41
|
+
xpath(%w[This-Assessment Renewables-CO2])&.to_i
|
|
50
42
|
end
|
|
51
43
|
|
|
52
44
|
def year1_assessment_date
|
|
@@ -54,19 +46,19 @@ module ViewModel
|
|
|
54
46
|
end
|
|
55
47
|
|
|
56
48
|
def year1_heating_co2
|
|
57
|
-
xpath(%w[Year1-Assessment Heating-CO2])
|
|
49
|
+
xpath(%w[Year1-Assessment Heating-CO2])&.to_i
|
|
58
50
|
end
|
|
59
51
|
|
|
60
52
|
def year1_electricity_co2
|
|
61
|
-
xpath(%w[Year1-Assessment Electricity-CO2])
|
|
53
|
+
xpath(%w[Year1-Assessment Electricity-CO2])&.to_i
|
|
62
54
|
end
|
|
63
55
|
|
|
64
56
|
def year1_renewables_co2
|
|
65
|
-
xpath(%w[Year1-Assessment Renewables-CO2])
|
|
57
|
+
xpath(%w[Year1-Assessment Renewables-CO2])&.to_i
|
|
66
58
|
end
|
|
67
59
|
|
|
68
60
|
def year1_energy_efficiency_rating
|
|
69
|
-
xpath(%w[Year1-Assessment Energy-Rating])
|
|
61
|
+
xpath(%w[Year1-Assessment Energy-Rating])&.to_i
|
|
70
62
|
end
|
|
71
63
|
|
|
72
64
|
def year2_assessment_date
|
|
@@ -74,19 +66,19 @@ module ViewModel
|
|
|
74
66
|
end
|
|
75
67
|
|
|
76
68
|
def year2_heating_co2
|
|
77
|
-
xpath(%w[Year2-Assessment Heating-CO2])
|
|
69
|
+
xpath(%w[Year2-Assessment Heating-CO2])&.to_i
|
|
78
70
|
end
|
|
79
71
|
|
|
80
72
|
def year2_electricity_co2
|
|
81
|
-
xpath(%w[Year2-Assessment Electricity-CO2])
|
|
73
|
+
xpath(%w[Year2-Assessment Electricity-CO2])&.to_i
|
|
82
74
|
end
|
|
83
75
|
|
|
84
76
|
def year2_renewables_co2
|
|
85
|
-
xpath(%w[Year2-Assessment Renewables-CO2])
|
|
77
|
+
xpath(%w[Year2-Assessment Renewables-CO2])&.to_i
|
|
86
78
|
end
|
|
87
79
|
|
|
88
80
|
def year2_energy_efficiency_rating
|
|
89
|
-
xpath(%w[Year2-Assessment Energy-Rating])
|
|
81
|
+
xpath(%w[Year2-Assessment Energy-Rating])&.to_i
|
|
90
82
|
end
|
|
91
83
|
|
|
92
84
|
def main_heating_fuel
|
|
@@ -110,7 +102,7 @@ module ViewModel
|
|
|
110
102
|
end
|
|
111
103
|
|
|
112
104
|
def asset_rating
|
|
113
|
-
xpath(%w[OR-Previous-Data Asset-Rating])
|
|
105
|
+
xpath(%w[OR-Previous-Data Asset-Rating])&.to_i
|
|
114
106
|
end
|
|
115
107
|
|
|
116
108
|
def property_type
|
|
@@ -141,10 +133,6 @@ module ViewModel
|
|
|
141
133
|
xpath(%w[DEC-Annual-Energy-Summary Renewables-Electrical])
|
|
142
134
|
end
|
|
143
135
|
|
|
144
|
-
def dec_status
|
|
145
|
-
nil
|
|
146
|
-
end
|
|
147
|
-
|
|
148
136
|
def dec_related_party_disclosure
|
|
149
137
|
xpath(%w[Related-Party-Disclosure])
|
|
150
138
|
end
|
|
@@ -173,14 +161,6 @@ module ViewModel
|
|
|
173
161
|
[]
|
|
174
162
|
end
|
|
175
163
|
|
|
176
|
-
def ac_kw_rating
|
|
177
|
-
nil
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
def ac_inspection_commissioned
|
|
181
|
-
nil
|
|
182
|
-
end
|
|
183
|
-
|
|
184
164
|
def or_energy_consumption
|
|
185
165
|
@xml_doc
|
|
186
166
|
.search("OR-Energy-Consumption")
|
|
@@ -191,7 +171,7 @@ module ViewModel
|
|
|
191
171
|
consumption: xpath(%w[Consumption], node),
|
|
192
172
|
start_date: xpath(%w[Start-Date], node),
|
|
193
173
|
end_date: xpath(%w[End-Date], node),
|
|
194
|
-
estimate: xpath(%w[Estimate], node),
|
|
174
|
+
estimate: xpath(%w[Estimate], node)&.to_i,
|
|
195
175
|
name: node.name,
|
|
196
176
|
}
|
|
197
177
|
end
|
|
@@ -13,7 +13,7 @@ module ViewModel
|
|
|
13
13
|
nodes.filter_map do |node|
|
|
14
14
|
unless node.at("Text").content.nil? || node.at("Text").content.empty?
|
|
15
15
|
{
|
|
16
|
-
sequence: node.at("Seq-Number").content,
|
|
16
|
+
sequence: node.at("Seq-Number").content&.to_i,
|
|
17
17
|
text: node.at("Text").content,
|
|
18
18
|
}
|
|
19
19
|
end
|
|
@@ -6,31 +6,23 @@ module ViewModel
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def ac_kw_rating
|
|
9
|
-
xpath(%w[AC-kW-Rating])
|
|
9
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def ac_present
|
|
13
13
|
xpath(%w[AC-Present])
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def building_emission_rate
|
|
17
|
-
nil
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def building_emission
|
|
21
|
-
nil
|
|
22
|
-
end
|
|
23
|
-
|
|
24
16
|
def building_environment
|
|
25
17
|
xpath(%w[Building-Environment])
|
|
26
18
|
end
|
|
27
19
|
|
|
28
20
|
def building_level
|
|
29
|
-
xpath(%w[Building-Level])
|
|
21
|
+
xpath(%w[Building-Level])&.to_i
|
|
30
22
|
end
|
|
31
23
|
|
|
32
24
|
def energy_efficiency_rating
|
|
33
|
-
xpath(%w[Asset-Rating])
|
|
25
|
+
xpath(%w[Asset-Rating])&.to_i
|
|
34
26
|
end
|
|
35
27
|
|
|
36
28
|
def epc_related_party_disclosure
|
|
@@ -38,11 +30,11 @@ module ViewModel
|
|
|
38
30
|
end
|
|
39
31
|
|
|
40
32
|
def estimated_ac_kw_rating
|
|
41
|
-
xpath(%w[AC-Estimated-Output])
|
|
33
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
|
42
34
|
end
|
|
43
35
|
|
|
44
36
|
def existing_build_rating
|
|
45
|
-
xpath(%w[Existing-Stock-Benchmark])
|
|
37
|
+
xpath(%w[Existing-Stock-Benchmark])&.to_i
|
|
46
38
|
end
|
|
47
39
|
|
|
48
40
|
def floor_area
|
|
@@ -54,7 +46,7 @@ module ViewModel
|
|
|
54
46
|
end
|
|
55
47
|
|
|
56
48
|
def new_build_rating
|
|
57
|
-
xpath(%w[New-Build-Benchmark])
|
|
49
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
|
58
50
|
end
|
|
59
51
|
|
|
60
52
|
def other_fuel_description
|
|
@@ -77,22 +69,6 @@ module ViewModel
|
|
|
77
69
|
xpath(%w[Special-Energy-Uses])
|
|
78
70
|
end
|
|
79
71
|
|
|
80
|
-
def standard_emissions
|
|
81
|
-
nil
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def target_emissions
|
|
85
|
-
nil
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def transaction_type
|
|
89
|
-
nil
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
def typical_emissions
|
|
93
|
-
nil
|
|
94
|
-
end
|
|
95
|
-
|
|
96
72
|
def renewable_sources
|
|
97
73
|
xpath(%w[Renewable-Sources])
|
|
98
74
|
end
|
|
@@ -18,7 +18,7 @@ module ViewModel
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def energy_efficiency_rating
|
|
21
|
-
xpath(%w[This-Assessment Energy-Rating])
|
|
21
|
+
xpath(%w[This-Assessment Energy-Rating])&.to_i
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def current_assessment_date
|
|
@@ -26,15 +26,15 @@ module ViewModel
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def current_heating_co2
|
|
29
|
-
xpath(%w[This-Assessment Heating-CO2])
|
|
29
|
+
xpath(%w[This-Assessment Heating-CO2])&.to_i
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def current_electricity_co2
|
|
33
|
-
xpath(%w[This-Assessment Electricity-CO2])
|
|
33
|
+
xpath(%w[This-Assessment Electricity-CO2])&.to_i
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def current_renewables_co2
|
|
37
|
-
xpath(%w[This-Assessment Renewables-CO2])
|
|
37
|
+
xpath(%w[This-Assessment Renewables-CO2])&.to_i
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def year1_assessment_date
|
|
@@ -42,19 +42,19 @@ module ViewModel
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def year1_heating_co2
|
|
45
|
-
xpath(%w[Year1-Assessment Heating-CO2])
|
|
45
|
+
xpath(%w[Year1-Assessment Heating-CO2])&.to_i
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def year1_electricity_co2
|
|
49
|
-
xpath(%w[Year1-Assessment Electricity-CO2])
|
|
49
|
+
xpath(%w[Year1-Assessment Electricity-CO2])&.to_i
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def year1_renewables_co2
|
|
53
|
-
xpath(%w[Year1-Assessment Renewables-CO2])
|
|
53
|
+
xpath(%w[Year1-Assessment Renewables-CO2])&.to_i
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def year1_energy_efficiency_rating
|
|
57
|
-
xpath(%w[Year1-Assessment Energy-Rating])
|
|
57
|
+
xpath(%w[Year1-Assessment Energy-Rating])&.to_i
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def year2_assessment_date
|
|
@@ -62,19 +62,19 @@ module ViewModel
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def year2_heating_co2
|
|
65
|
-
xpath(%w[Year2-Assessment Heating-CO2])
|
|
65
|
+
xpath(%w[Year2-Assessment Heating-CO2])&.to_i
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def year2_electricity_co2
|
|
69
|
-
xpath(%w[Year2-Assessment Electricity-CO2])
|
|
69
|
+
xpath(%w[Year2-Assessment Electricity-CO2])&.to_i
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def year2_renewables_co2
|
|
73
|
-
xpath(%w[Year2-Assessment Renewables-CO2])
|
|
73
|
+
xpath(%w[Year2-Assessment Renewables-CO2])&.to_i
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def year2_energy_efficiency_rating
|
|
77
|
-
xpath(%w[Year2-Assessment Energy-Rating])
|
|
77
|
+
xpath(%w[Year2-Assessment Energy-Rating])&.to_i
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def main_heating_fuel
|
|
@@ -90,7 +90,7 @@ module ViewModel
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def asset_rating
|
|
93
|
-
xpath(%w[OR-Previous-Data Asset-Rating])
|
|
93
|
+
xpath(%w[OR-Previous-Data Asset-Rating])&.to_i
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def annual_energy_use_fuel_thermal
|
|
@@ -159,7 +159,7 @@ module ViewModel
|
|
|
159
159
|
consumption: xpath(%w[Consumption], node),
|
|
160
160
|
start_date: xpath(%w[Start-Date], node),
|
|
161
161
|
end_date: xpath(%w[End-Date], node),
|
|
162
|
-
estimate: xpath(%w[Estimate], node),
|
|
162
|
+
estimate: xpath(%w[Estimate], node)&.to_i,
|
|
163
163
|
name: node.name,
|
|
164
164
|
}
|
|
165
165
|
end
|
|
@@ -202,11 +202,11 @@ module ViewModel
|
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
def ac_kw_rating
|
|
205
|
-
xpath(%w[AC-kW-Rating])
|
|
205
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
def estimated_ac_kw_rating
|
|
209
|
-
xpath(%w[AC-Estimated-Output])
|
|
209
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
|
210
210
|
end
|
|
211
211
|
|
|
212
212
|
def building_category
|
|
@@ -13,7 +13,7 @@ module ViewModel
|
|
|
13
13
|
nodes.filter_map do |node|
|
|
14
14
|
unless node.at("Text").content.nil? || node.at("Text").content.empty?
|
|
15
15
|
{
|
|
16
|
-
sequence: node.at("Seq-Number").content,
|
|
16
|
+
sequence: node.at("Seq-Number").content&.to_i,
|
|
17
17
|
text: node.at("Text").content,
|
|
18
18
|
}
|
|
19
19
|
end
|
|
@@ -6,7 +6,7 @@ module ViewModel
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def ac_kw_rating
|
|
9
|
-
xpath(%w[AC-kW-Rating])
|
|
9
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def ac_present
|
|
@@ -18,7 +18,7 @@ module ViewModel
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def building_level
|
|
21
|
-
xpath(%w[Building-Level])
|
|
21
|
+
xpath(%w[Building-Level])&.to_i
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def building_emission_rate
|
|
@@ -26,7 +26,7 @@ module ViewModel
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def energy_efficiency_rating
|
|
29
|
-
xpath(%w[Asset-Rating])
|
|
29
|
+
xpath(%w[Asset-Rating])&.to_i
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def epc_related_party_disclosure
|
|
@@ -34,11 +34,11 @@ module ViewModel
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def estimated_ac_kw_rating
|
|
37
|
-
xpath(%w[AC-Estimated-Output])
|
|
37
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def existing_build_rating
|
|
41
|
-
xpath(%w[Existing-Stock-Benchmark])
|
|
41
|
+
xpath(%w[Existing-Stock-Benchmark])&.to_i
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def floor_area
|
|
@@ -50,17 +50,13 @@ module ViewModel
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def new_build_rating
|
|
53
|
-
xpath(%w[New-Build-Benchmark])
|
|
53
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def other_fuel_description
|
|
57
57
|
xpath(%w[Other-Fuel-Description])
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
def primary_energy_use
|
|
61
|
-
nil
|
|
62
|
-
end
|
|
63
|
-
|
|
64
60
|
def property_type
|
|
65
61
|
xpath(%w[Property-Type])
|
|
66
62
|
end
|