Skip to content

Commit

Permalink
EPBR-5036: feat: Add gas and electricity smart meter information to R…
Browse files Browse the repository at this point in the history
…dSAP and SAP view models for use on the certificate
  • Loading branch information
al01010 committed Feb 23, 2024
1 parent d487df7 commit 3b50363
Show file tree
Hide file tree
Showing 49 changed files with 369 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/epb_view_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
loader.setup

module EpbViewModels
VERSION = "1.2.0"
VERSION = "1.3.0"
end

# Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
Expand Down
2 changes: 2 additions & 0 deletions lib/presenter/rd_sap/summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def to_hash
environmental_impact_potential:
@view_model.environmental_impact_potential,
addendum: @view_model.addendum,
gas_smart_meter_present: @view_model.gas_smart_meter_present,
electricity_smart_meter_present: @view_model.electricity_smart_meter_present,
}
end

Expand Down
2 changes: 2 additions & 0 deletions lib/presenter/sap/summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def to_hash
@view_model.extensions_count
end,
addendum: @view_model.addendum,
gas_smart_meter_present: @view_model.gas_smart_meter_present,
electricity_smart_meter_present: @view_model.electricity_smart_meter_present,
}
end

Expand Down
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_170/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_171/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_180/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_190/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_200/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_210/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
xpath(%w[Gas-Smart-Meter-Present])
end

def electricity_smart_meter_present
xpath(%w[Electricity-Smart-Meter-Present])
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_ni_173/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_ni_174/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_ni_180/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_ni_190/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/rd_sap_schema_ni_200/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,14 @@ def cylinder_size
def has_cylinder_thermostat
xpath(%w[Cylinder-Thermostat])
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_102/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,14 @@ def thermal_store
def ventilation_type
nil
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_110/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,14 @@ def all_main_heating_environmental_efficiency
.search("Main-Heating/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_112/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@ def main_dwelling_construction_age_band_or_year
end
nil
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_120/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,14 @@ def all_main_heating_environmental_efficiency
.search("Main-Heating/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_130/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def all_main_heating_controls_environmental_efficiency
.search("Main-Heating-Controls/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_140/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def all_main_heating_environmental_efficiency
.search("Main-Heating/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_141/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def all_main_heating_environmental_efficiency
.search("Main-Heating/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_142/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def all_main_heating_environmental_efficiency
.search("Main-Heating/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_150/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def all_main_heating_environmental_efficiency
.search("Main-Heating/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_160/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def all_floor_env_energy_efficiency_rating
.search("Property-Summary/Floor/Environmental-Efficiency-Rating")
.map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_161/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ def all_floor_env_energy_efficiency_rating
def floor_height
@xml_doc.search("Storey-Height").map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_162/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,14 @@ def all_floor_env_energy_efficiency_rating
def floor_height
@xml_doc.search("Storey-Height").map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
8 changes: 8 additions & 0 deletions lib/view_model/sap_schema_163/common_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,14 @@ def all_floor_env_energy_efficiency_rating
def floor_height
@xml_doc.search("Storey-Height").map(&:content)
end

def gas_smart_meter_present
nil
end

def electricity_smart_meter_present
nil
end
end
end
end
Loading

0 comments on commit 3b50363

Please sign in to comment.