epb_view_models 2.0.10 → 2.0.12

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.
@@ -5,7 +5,7 @@ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
5
5
  loader.setup
6
6
 
7
7
  module EpbViewModels
8
- VERSION = "2.0.10"
8
+ VERSION = "2.0.12"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -136,6 +136,7 @@ module Helper
136
136
  "K-SAP-NI" => "Northern Ireland: 2007 onwards",
137
137
  "K-12.0" => "Post-2006",
138
138
  "L" => "Northern Ireland: 2014 onwards",
139
+ "M" => "Northern Ireland: 2022 onwards",
139
140
  "0" => "Not applicable",
140
141
  "NR" => "Not recorded",
141
142
  }.freeze
@@ -347,6 +348,7 @@ module Helper
347
348
 
348
349
  def self.transaction_type(value, report_type = "2", schema_type = "")
349
350
  types_of_ni = %i[
351
+ RdSAP-Schema-NI-21.0.0
350
352
  RdSAP-Schema-NI-20.0.0
351
353
  RdSAP-Schema-NI-19.0
352
354
  RdSAP-Schema-NI-18.0
@@ -446,6 +448,7 @@ module Helper
446
448
  ]
447
449
 
448
450
  rdsap_schemas_ni = %i[
451
+ RdSAP-Schema-NI-21.0.0
449
452
  RdSAP-Schema-NI-20.0.0
450
453
  RdSAP-Schema-NI-19.0
451
454
  RdSAP-Schema-NI-18.0
@@ -575,6 +578,7 @@ module Helper
575
578
  RdSAP-Schema-18.0
576
579
  RdSAP-Schema-17.1
577
580
  RdSAP-Schema-17.0
581
+ RdSAP-Schema-NI-21.0.0
578
582
  RdSAP-Schema-NI-20.0.0
579
583
  RdSAP-Schema-NI-19.0
580
584
  RdSAP-Schema-NI-18.0
@@ -673,6 +677,7 @@ module Helper
673
677
  def self.schemas_post_20
674
678
  %i[
675
679
  RdSAP-Schema-21.0.0
680
+ RdSAP-Schema-NI-21.0.0
676
681
  ]
677
682
  end
678
683
 
@@ -47,7 +47,7 @@ module Presenter
47
47
  current_space_heating_demand:
48
48
  @view_model.current_space_heating_demand&.to_i,
49
49
  current_water_heating_demand:
50
- @view_model.current_water_heating_demand&.to_i
50
+ @view_model.current_water_heating_demand&.to_i,
51
51
  },
52
52
  heating_cost_current: @view_model.heating_cost_current,
53
53
  heating_cost_potential: @view_model.heating_cost_potential,
@@ -79,12 +79,13 @@ module Presenter
79
79
  @view_model.related_party_disclosure_text,
80
80
  total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
81
81
  status: @view_model.status,
82
- co2_emissions_current_per_floor_area:
83
- @view_model.co2_emissions_current_per_floor_area,
82
+ environmental_impact_current: @view_model.environmental_impact_current,
83
+ environmental_impact_potential:
84
+ @view_model.environmental_impact_potential,
85
+ primary_energy_use: @view_model.respond_to?(:primary_energy_use) ? @view_model.primary_energy_use : nil,
84
86
  addendum: @view_model.addendum,
85
87
  gas_smart_meter_present: @view_model.respond_to?(:gas_smart_meter_present) ? @view_model.gas_smart_meter_present : nil,
86
88
  electricity_smart_meter_present: @view_model.respond_to?(:electricity_smart_meter_present) ? @view_model.electricity_smart_meter_present : nil,
87
- country_code: @view_model.country_code,
88
89
  }
89
90
  end
90
91
 
@@ -46,7 +46,7 @@ module Presenter
46
46
  improvement
47
47
  end,
48
48
  photo_supply: @view_model.respond_to?(:photovoltaic_roof_area_percent) && !@view_model.photovoltaic_roof_area_percent.nil? ? @view_model.photovoltaic_roof_area_percent.to_i : nil,
49
- main_heating_controls: @view_model.all_main_heating_controls_descriptions
49
+ main_heating_controls: @view_model.all_main_heating_controls_descriptions,
50
50
  }
51
51
  end
52
52
  end
@@ -44,7 +44,7 @@ module Presenter
44
44
  current_space_heating_demand:
45
45
  @view_model.current_space_heating_demand&.to_i,
46
46
  current_water_heating_demand:
47
- @view_model.current_water_heating_demand&.to_i
47
+ @view_model.current_water_heating_demand&.to_i,
48
48
  },
49
49
  heating_cost_current: @view_model.heating_cost_current,
50
50
  heating_cost_potential: @view_model.heating_cost_potential,
@@ -76,12 +76,13 @@ module Presenter
76
76
  @view_model.related_party_disclosure_text,
77
77
  total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
78
78
  status: @view_model.status,
79
- co2_emissions_current_per_floor_area:
80
- @view_model.co2_emissions_current_per_floor_area,
79
+ environmental_impact_current: @view_model.environmental_impact_current,
80
+ environmental_impact_potential:
81
+ @view_model.environmental_impact_potential,
82
+ primary_energy_use: @view_model.respond_to?(:primary_energy_use) ? @view_model.primary_energy_use : nil,
81
83
  addendum: @view_model.addendum,
82
84
  gas_smart_meter_present: @view_model.respond_to?(:gas_smart_meter_present) ? @view_model.gas_smart_meter_present : nil,
83
85
  electricity_smart_meter_present: @view_model.respond_to?(:electricity_smart_meter_present) ? @view_model.electricity_smart_meter_present : nil,
84
- country_code: @view_model.country_code,
85
86
  }
86
87
  end
87
88
 
@@ -43,7 +43,7 @@ module Presenter
43
43
  improvement
44
44
  end,
45
45
  photo_supply: @view_model.respond_to?(:photovoltaic_roof_area_percent) && !@view_model.photovoltaic_roof_area_percent.nil? ? @view_model.photovoltaic_roof_area_percent.to_i : nil,
46
- main_heating_controls: @view_model.all_main_heating_controls_descriptions
46
+ main_heating_controls: @view_model.all_main_heating_controls_descriptions,
47
47
  }
48
48
  end
49
49
  end
@@ -83,7 +83,7 @@ module Presenter
83
83
  end
84
84
 
85
85
  stripped = string.strip
86
- if stripped.length.zero?
86
+ if stripped.empty?
87
87
  return
88
88
  end
89
89
 
@@ -20,6 +20,7 @@ module ViewModel
20
20
  RdSAP-Schema-18.0
21
21
  RdSAP-Schema-17.1
22
22
  RdSAP-Schema-17.0
23
+ RdSAP-Schema-NI-21.0.0
23
24
  RdSAP-Schema-NI-20.0.0
24
25
  RdSAP-Schema-NI-19.0
25
26
  RdSAP-Schema-NI-18.0