epb_view_models 2.0.4 → 2.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17a71b40dc0180b1d1a57a523310aad15194a9eb36f3294308834913ed738b0e
4
- data.tar.gz: 9f5809ec294a584d9cb2e98c33765106ed3ee72d6fc16ee037ae03a828b7fbb2
3
+ metadata.gz: 070de28c2ff5b0887b065ab4c1223f094be93db67b1a5524c6602071606484d8
4
+ data.tar.gz: 9eb22208a968d88510302ebda40511bf289bed66205d889753cceca4524f409f
5
5
  SHA512:
6
- metadata.gz: 642347a583549d71b62ca6395bfb816df36e682cb4a1f011329b9f02d3fcabd4f0f7eab933bc892d5be671602a12d6c82aa1d5169b70ded447a390ca0c5e6a74
7
- data.tar.gz: 450162cffd2115bfbdcdd5f16f5190fdd32fc7dec78a9d22e9c263e9bc63e968f16a9f7451ea964d6f895fa9705a907b6447ed76fc00af1138a1699ded4439e5
6
+ metadata.gz: d1c78fb53e73d2ef0b1544df616d043107595683b80b0f4e378f931d9d7e06e8d03a7bdd1f4fb82e3ef7f923b0ae11f41c94e318a5b516705b7696114c0bee88
7
+ data.tar.gz: b12893871ed115e1d2d91338fd1560aa031b5eab62edf276accefc2f082d588ffbfbd1621e57c63349a95e17f9c9be8ae7c4e3f82f5d568f41a05a5402350da6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.2
1
+ 3.3.4
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ruby ">=2.7", "< 3.4"
3
+ ruby "3.3.4"
4
4
 
5
5
  source "https://rubygems.org"
6
6
 
@@ -10,6 +10,6 @@ group :test do
10
10
  gem "rubocop-govuk", "~> 4.7.0", require: false
11
11
  end
12
12
 
13
- gem "nokogiri", "~> 1.16"
14
- gem "rexml", "~> 3.2", ">= 3.2.5"
13
+ gem "nokogiri", "~> 1.16", ">= 1.16.5"
14
+ gem "rexml", ">= 3.3.9"
15
15
  gem "zeitwerk", "~> 2.6"
data/Gemfile.lock CHANGED
@@ -21,11 +21,9 @@ GEM
21
21
  i18n (1.14.4)
22
22
  concurrent-ruby (~> 1.0)
23
23
  json (2.7.1)
24
- mini_portile2 (2.8.5)
25
24
  minitest (5.22.2)
26
25
  mutex_m (0.2.0)
27
- nokogiri (1.16.2)
28
- mini_portile2 (~> 2.8.2)
26
+ nokogiri (1.18.1-arm64-darwin)
29
27
  racc (~> 1.4)
30
28
  parallel (1.24.0)
31
29
  parser (3.3.0.5)
@@ -36,7 +34,7 @@ GEM
36
34
  rainbow (3.1.1)
37
35
  rake (13.0.6)
38
36
  regexp_parser (2.9.0)
39
- rexml (3.2.6)
37
+ rexml (3.4.0)
40
38
  rspec (3.13.0)
41
39
  rspec-core (~> 3.13.0)
42
40
  rspec-expectations (~> 3.13.0)
@@ -86,15 +84,15 @@ PLATFORMS
86
84
  ruby
87
85
 
88
86
  DEPENDENCIES
89
- nokogiri (~> 1.16)
87
+ nokogiri (~> 1.16, >= 1.16.5)
90
88
  rake (~> 13.0.6)
91
- rexml (~> 3.2, >= 3.2.5)
89
+ rexml (>= 3.3.9)
92
90
  rspec (~> 3.0)
93
91
  rubocop-govuk (~> 4.7.0)
94
92
  zeitwerk (~> 2.6)
95
93
 
96
94
  RUBY VERSION
97
- ruby 3.3.2p78
95
+ ruby 3.3.4p94
98
96
 
99
97
  BUNDLED WITH
100
98
  2.3.15
@@ -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.4"
8
+ VERSION = "2.0.6"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -0,0 +1,100 @@
1
+ module Presenter
2
+ module RdSap
3
+ class CertificateSummary
4
+ TYPE_OF_ASSESSMENT = "RdSAP".freeze
5
+ private_constant :TYPE_OF_ASSESSMENT
6
+
7
+ def initialize(view_model)
8
+ @view_model = view_model
9
+ end
10
+
11
+ def to_certificate_summary
12
+ estimated_energy_cost =
13
+ Helper::EstimatedCostPotentialSavingHelper.new.estimated_cost(
14
+ @view_model.heating_cost_current,
15
+ @view_model.hot_water_cost_current,
16
+ @view_model.lighting_cost_current,
17
+ )
18
+ {
19
+ type_of_assessment: TYPE_OF_ASSESSMENT,
20
+ assessment_id: @view_model.assessment_id,
21
+ date_of_expiry: @view_model.date_of_expiry,
22
+ date_of_assessment: @view_model.date_of_assessment,
23
+ date_of_registration: @view_model.date_of_registration,
24
+ address: {
25
+ address_line1: @view_model.address_line1,
26
+ address_line2: @view_model.address_line2,
27
+ address_line3: @view_model.address_line3,
28
+ address_line4: nil,
29
+ town: @view_model.town,
30
+ postcode: @view_model.postcode,
31
+ },
32
+ assessor: {
33
+ scheme_assessor_id: @view_model.scheme_assessor_id,
34
+ name: @view_model.assessor_name,
35
+ contact_details: {
36
+ email: @view_model.assessor_email,
37
+ telephone: @view_model.assessor_telephone,
38
+ },
39
+ },
40
+ current_carbon_emission:
41
+ convert_to_big_decimal(@view_model.current_carbon_emission),
42
+ current_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.current_energy_rating),
43
+ current_energy_efficiency_rating: @view_model.current_energy_rating,
44
+ dwelling_type: @view_model.dwelling_type,
45
+ estimated_energy_cost:,
46
+ heat_demand: {
47
+ current_space_heating_demand:
48
+ @view_model.current_space_heating_demand&.to_i,
49
+ current_water_heating_demand:
50
+ @view_model.current_water_heating_demand&.to_i
51
+ },
52
+ heating_cost_current: @view_model.heating_cost_current,
53
+ heating_cost_potential: @view_model.heating_cost_potential,
54
+ hot_water_cost_current: @view_model.hot_water_cost_current,
55
+ hot_water_cost_potential: @view_model.hot_water_cost_potential,
56
+ lighting_cost_current: @view_model.lighting_cost_current,
57
+ lighting_cost_potential: @view_model.lighting_cost_potential,
58
+ potential_carbon_emission:
59
+ convert_to_big_decimal(@view_model.potential_carbon_emission),
60
+ potential_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.potential_energy_rating),
61
+ potential_energy_efficiency_rating: @view_model.potential_energy_rating,
62
+ potential_energy_saving:
63
+ Helper::EstimatedCostPotentialSavingHelper.new.potential_saving(
64
+ @view_model.heating_cost_potential,
65
+ @view_model.hot_water_cost_potential,
66
+ @view_model.lighting_cost_potential,
67
+ estimated_energy_cost,
68
+ ),
69
+ property_summary: @view_model.property_summary,
70
+ recommended_improvements:
71
+ @view_model.improvements.map do |improvement|
72
+ improvement[:energy_performance_band_improvement] =
73
+ Helper::EnergyBandCalculator.domestic(improvement[:energy_performance_rating_improvement])
74
+ improvement
75
+ end,
76
+ lzc_energy_sources: @view_model.lzc_energy_sources,
77
+ related_party_disclosure_number: @view_model.respond_to?(:related_party_disclosure_number) ? @view_model.related_party_disclosure_number : nil,
78
+ related_party_disclosure_text:
79
+ @view_model.related_party_disclosure_text,
80
+ total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
81
+ status: @view_model.status,
82
+ co2_emissions_current_per_floor_area:
83
+ @view_model.co2_emissions_current_per_floor_area,
84
+ addendum: @view_model.addendum,
85
+ gas_smart_meter_present: @view_model.respond_to?(:gas_smart_meter_present) ? @view_model.gas_smart_meter_present : nil,
86
+ 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
+ end
90
+
91
+ private
92
+
93
+ def convert_to_big_decimal(node)
94
+ return "" unless node
95
+
96
+ BigDecimal(node, 0)
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,153 @@
1
+ module Presenter
2
+ module Sap
3
+ class CertificateDetails
4
+ def initialize(view_model)
5
+ @view_model = view_model
6
+ end
7
+
8
+ def to_hash
9
+ estimated_energy_cost =
10
+ Helper::EstimatedCostPotentialSavingHelper.new.estimated_cost(
11
+ @view_model.heating_cost_current,
12
+ @view_model.hot_water_cost_current,
13
+ @view_model.lighting_cost_current,
14
+ )
15
+ {
16
+ type_of_assessment: @view_model.type_of_assessment,
17
+ assessment_id: @view_model.assessment_id,
18
+ date_of_expiry: @view_model.date_of_expiry,
19
+ date_of_assessment: @view_model.date_of_assessment,
20
+ date_of_registration: @view_model.date_of_registration,
21
+ date_registered: @view_model.date_of_registration,
22
+ address_id: @view_model.address_id,
23
+ address_line1: @view_model.address_line1,
24
+ address_line2: @view_model.address_line2,
25
+ address_line3: @view_model.address_line3,
26
+ address_line4: nil,
27
+ town: @view_model.town,
28
+ postcode: @view_model.postcode,
29
+ assessor: {
30
+ scheme_assessor_id: @view_model.scheme_assessor_id,
31
+ name: @view_model.assessor_name,
32
+ contact_details: {
33
+ email: @view_model.assessor_email,
34
+ telephone: @view_model.assessor_telephone,
35
+ },
36
+ },
37
+ current_carbon_emission:
38
+ convert_to_big_decimal(@view_model.current_carbon_emission),
39
+ current_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.current_energy_rating),
40
+ current_energy_efficiency_rating: @view_model.current_energy_rating,
41
+ dwelling_type: @view_model.dwelling_type,
42
+ estimated_energy_cost:,
43
+ main_fuel_type: @view_model.main_fuel_type,
44
+ heat_demand: {
45
+ current_space_heating_demand:
46
+ @view_model.current_space_heating_demand&.to_i,
47
+ current_water_heating_demand:
48
+ @view_model.current_water_heating_demand&.to_i,
49
+ impact_of_cavity_insulation: @view_model.respond_to?(:impact_of_cavity_insulation) ? @view_model.impact_of_cavity_insulation : nil,
50
+ impact_of_loft_insulation: @view_model.respond_to?(:impact_of_loft_insulation) ? @view_model.impact_of_loft_insulation : nil,
51
+ impact_of_solid_wall_insulation: @view_model.respond_to?(:impact_of_solid_wall_insulation) ? @view_model.impact_of_solid_wall_insulation : nil,
52
+ },
53
+ heating_cost_current: @view_model.heating_cost_current,
54
+ heating_cost_potential: @view_model.heating_cost_potential,
55
+ hot_water_cost_current: @view_model.hot_water_cost_current,
56
+ hot_water_cost_potential: @view_model.hot_water_cost_potential,
57
+ lighting_cost_current: @view_model.lighting_cost_current,
58
+ lighting_cost_potential: @view_model.lighting_cost_potential,
59
+ potential_carbon_emission:
60
+ convert_to_big_decimal(@view_model.potential_carbon_emission),
61
+ potential_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.potential_energy_rating),
62
+ potential_energy_efficiency_rating: @view_model.potential_energy_rating,
63
+ potential_energy_saving:
64
+ Helper::EstimatedCostPotentialSavingHelper.new.potential_saving(
65
+ @view_model.heating_cost_potential,
66
+ @view_model.hot_water_cost_potential,
67
+ @view_model.lighting_cost_potential,
68
+ estimated_energy_cost,
69
+ ),
70
+ primary_energy_use: @view_model.respond_to?(:primary_energy_use) ? @view_model.primary_energy_use : nil,
71
+ energy_consumption_potential: @view_model.energy_consumption_potential,
72
+ property_age_band: @view_model.respond_to?(:property_age_band) ? @view_model.property_age_band : nil,
73
+ property_summary: @view_model.property_summary,
74
+ recommended_improvements:
75
+ @view_model.improvements.map do |improvement|
76
+ improvement[:energy_performance_band_improvement] =
77
+ Helper::EnergyBandCalculator.domestic(improvement[:energy_performance_rating_improvement])
78
+ improvement
79
+ end,
80
+ lzc_energy_sources: @view_model.lzc_energy_sources,
81
+ related_party_disclosure_number: @view_model.respond_to?(:related_party_disclosure_number) ? @view_model.related_party_disclosure_number : nil,
82
+ related_party_disclosure_text:
83
+ @view_model.related_party_disclosure_text,
84
+ tenure: @view_model.respond_to?(:tenure) ? @view_model.tenure : nil,
85
+ transaction_type: @view_model.respond_to?(:transaction_type) ? @view_model.transaction_type : nil,
86
+ total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
87
+ total_roof_area: @view_model.respond_to?(:total_roof_area) ? @view_model.total_roof_area : nil,
88
+ status: @view_model.status,
89
+ environmental_impact_current: @view_model.environmental_impact_current,
90
+ environmental_impact_potential:
91
+ @view_model.environmental_impact_potential,
92
+ co2_emissions_current_per_floor_area:
93
+ @view_model.co2_emissions_current_per_floor_area,
94
+ mains_gas: @view_model.respond_to?(:mains_gas) ? @view_model.mains_gas : nil,
95
+ level: @view_model.level,
96
+ top_storey: @view_model.top_storey,
97
+ storey_count: @view_model.respond_to?(:storey_count) ? @view_model.storey_count : nil,
98
+ main_heating_controls: @view_model.main_heating_controls,
99
+ multiple_glazed_proportion: @view_model.respond_to?(:multiple_glazed_proportion) ? @view_model.multiple_glazed_proportion : nil,
100
+ glazed_area: @view_model.respond_to?(:glazed_area) ? @view_model.glazed_area : nil,
101
+ habitable_room_count: @view_model.respond_to?(:habitable_room_count) ? @view_model.habitable_room_count : nil,
102
+ heated_room_count: @view_model.respond_to?(:heated_room_count) ? @view_model.heated_room_count : nil,
103
+ low_energy_lighting: @view_model.respond_to?(:low_energy_lighting) ? @view_model.low_energy_lighting : nil,
104
+ fixed_lighting_outlets_count: @view_model.respond_to?(:fixed_lighting_outlets_count) ? @view_model.fixed_lighting_outlets_count : nil,
105
+ low_energy_fixed_lighting_outlets_count:
106
+ @view_model.respond_to?(:low_energy_fixed_lighting_outlets_count) ? @view_model.low_energy_fixed_lighting_outlets_count : nil,
107
+ open_fireplaces_count: @view_model.respond_to?(:open_fireplaces_count) ? @view_model.open_fireplaces_count : nil,
108
+ hot_water_description: @view_model.hot_water_description,
109
+ hot_water_energy_efficiency_rating:
110
+ @view_model.hot_water_energy_efficiency_rating,
111
+ hot_water_environmental_efficiency_rating:
112
+ @view_model.hot_water_environmental_efficiency_rating,
113
+ window_description: @view_model.window_description,
114
+ window_energy_efficiency_rating:
115
+ @view_model.window_energy_efficiency_rating,
116
+ window_environmental_efficiency_rating:
117
+ @view_model.window_environmental_efficiency_rating,
118
+ secondary_heating_description:
119
+ @view_model.secondary_heating_description,
120
+ secondary_heating_energy_efficiency_rating:
121
+ @view_model.secondary_heating_energy_efficiency_rating,
122
+ secondary_heating_environmental_efficiency_rating:
123
+ @view_model.secondary_heating_environmental_efficiency_rating,
124
+ lighting_description: @view_model.lighting_description,
125
+ lighting_energy_efficiency_rating:
126
+ @view_model.lighting_energy_efficiency_rating,
127
+ lighting_environmental_efficiency_rating:
128
+ @view_model.lighting_environmental_efficiency_rating,
129
+ photovoltaic_roof_area_percent: @view_model.respond_to?(:photovoltaic_roof_area_percent) ? @view_model.photovoltaic_roof_area_percent : nil,
130
+ heat_loss_corridor: @view_model.respond_to?(:heat_loss_corridor) ? @view_model.heat_loss_corridor : nil,
131
+ wind_turbine_count: @view_model.wind_turbine_count,
132
+ unheated_corridor_length: @view_model.respond_to?(:unheated_corridor_length) ? @view_model.unheated_corridor_length : nil,
133
+ built_form:
134
+ Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
135
+ main_heat_description:
136
+ @view_model.all_main_heating_descriptions.join(", "),
137
+ extensions_count: @view_model.respond_to?(:extensions_count) ? @view_model.extensions_count : nil,
138
+ addendum: @view_model.addendum,
139
+ gas_smart_meter_present: @view_model.respond_to?(:gas_smart_meter_present) ? @view_model.gas_smart_meter_present : nil,
140
+ electricity_smart_meter_present: @view_model.respond_to?(:electricity_smart_meter_present) ? @view_model.electricity_smart_meter_present : nil,
141
+ }
142
+ end
143
+
144
+ private
145
+
146
+ def convert_to_big_decimal(node)
147
+ return "" unless node
148
+
149
+ BigDecimal(node, 0)
150
+ end
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,97 @@
1
+ module Presenter
2
+ module Sap
3
+ class CertificateSummary
4
+ def initialize(view_model)
5
+ @view_model = view_model
6
+ end
7
+
8
+ def to_certificate_summary
9
+ estimated_energy_cost =
10
+ Helper::EstimatedCostPotentialSavingHelper.new.estimated_cost(
11
+ @view_model.heating_cost_current,
12
+ @view_model.hot_water_cost_current,
13
+ @view_model.lighting_cost_current,
14
+ )
15
+ {
16
+ type_of_assessment: @view_model.type_of_assessment,
17
+ assessment_id: @view_model.assessment_id,
18
+ date_of_expiry: @view_model.date_of_expiry,
19
+ date_of_assessment: @view_model.date_of_assessment,
20
+ date_of_registration: @view_model.date_of_registration,
21
+ address: {
22
+ address_line1: @view_model.address_line1,
23
+ address_line2: @view_model.address_line2,
24
+ address_line3: @view_model.address_line3,
25
+ address_line4: nil,
26
+ town: @view_model.town,
27
+ postcode: @view_model.postcode,
28
+ },
29
+ assessor: {
30
+ scheme_assessor_id: @view_model.scheme_assessor_id,
31
+ name: @view_model.assessor_name,
32
+ contact_details: {
33
+ email: @view_model.assessor_email,
34
+ telephone: @view_model.assessor_telephone,
35
+ },
36
+ },
37
+ current_carbon_emission:
38
+ convert_to_big_decimal(@view_model.current_carbon_emission),
39
+ current_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.current_energy_rating),
40
+ current_energy_efficiency_rating: @view_model.current_energy_rating,
41
+ dwelling_type: @view_model.dwelling_type,
42
+ estimated_energy_cost:,
43
+ heat_demand: {
44
+ current_space_heating_demand:
45
+ @view_model.current_space_heating_demand&.to_i,
46
+ current_water_heating_demand:
47
+ @view_model.current_water_heating_demand&.to_i
48
+ },
49
+ heating_cost_current: @view_model.heating_cost_current,
50
+ heating_cost_potential: @view_model.heating_cost_potential,
51
+ hot_water_cost_current: @view_model.hot_water_cost_current,
52
+ hot_water_cost_potential: @view_model.hot_water_cost_potential,
53
+ lighting_cost_current: @view_model.lighting_cost_current,
54
+ lighting_cost_potential: @view_model.lighting_cost_potential,
55
+ potential_carbon_emission:
56
+ convert_to_big_decimal(@view_model.potential_carbon_emission),
57
+ potential_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.potential_energy_rating),
58
+ potential_energy_efficiency_rating: @view_model.potential_energy_rating,
59
+ potential_energy_saving:
60
+ Helper::EstimatedCostPotentialSavingHelper.new.potential_saving(
61
+ @view_model.heating_cost_potential,
62
+ @view_model.hot_water_cost_potential,
63
+ @view_model.lighting_cost_potential,
64
+ estimated_energy_cost,
65
+ ),
66
+ property_summary: @view_model.property_summary,
67
+ recommended_improvements:
68
+ @view_model.improvements.map do |improvement|
69
+ improvement[:energy_performance_band_improvement] =
70
+ Helper::EnergyBandCalculator.domestic(improvement[:energy_performance_rating_improvement])
71
+ improvement
72
+ end,
73
+ lzc_energy_sources: @view_model.lzc_energy_sources,
74
+ related_party_disclosure_number: @view_model.respond_to?(:related_party_disclosure_number) ? @view_model.related_party_disclosure_number : nil,
75
+ related_party_disclosure_text:
76
+ @view_model.related_party_disclosure_text,
77
+ total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
78
+ status: @view_model.status,
79
+ co2_emissions_current_per_floor_area:
80
+ @view_model.co2_emissions_current_per_floor_area,
81
+ addendum: @view_model.addendum,
82
+ gas_smart_meter_present: @view_model.respond_to?(:gas_smart_meter_present) ? @view_model.gas_smart_meter_present : nil,
83
+ 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
+ end
87
+
88
+ private
89
+
90
+ def convert_to_big_decimal(node)
91
+ return "" unless node
92
+
93
+ BigDecimal(node, 0)
94
+ end
95
+ end
96
+ end
97
+ end
@@ -6,6 +6,7 @@ module ViewModel
6
6
  @schema_type = schema_type
7
7
  @view_model = build_view_model(xml_doc, schema_type)
8
8
  @summary = Presenter::RdSap::Summary.new(view_model)
9
+ @certificate_summary = Presenter::RdSap::CertificateSummary.new(view_model)
9
10
  @report = Presenter::RdSap::Report.new(view_model, schema_type, additional_data)
10
11
  @recommendation_report = Presenter::RdSap::RecommendationReport.new(view_model)
11
12
  @domestic_digest = Presenter::RdSap::DomesticDigest.new(view_model, schema_type)
@@ -19,6 +20,10 @@ module ViewModel
19
20
  @summary.to_hash
20
21
  end
21
22
 
23
+ def to_certificate_summary
24
+ @certificate_summary.to_certificate_summary
25
+ end
26
+
22
27
  def to_hash_ni
23
28
  @report.to_hash_ni
24
29
  end
@@ -6,6 +6,7 @@ module ViewModel
6
6
  @schema_type = schema_type
7
7
  @view_model = build_view_model(xml_doc, schema_type, report_type)
8
8
  @summary = Presenter::Sap::Summary.new(view_model)
9
+ @certificate_summary = Presenter::Sap::CertificateSummary.new(view_model)
9
10
  @report = Presenter::Sap::Report.new(view_model, schema_type, additional_data)
10
11
  @recommendation_report = Presenter::Sap::RecommendationReport.new(view_model)
11
12
  @domestic_digest = Presenter::Sap::DomesticDigest.new(view_model, schema_type)
@@ -19,6 +20,10 @@ module ViewModel
19
20
  @summary.to_hash
20
21
  end
21
22
 
23
+ def to_certificate_summary
24
+ @certificate_summary.to_certificate_summary
25
+ end
26
+
22
27
  def to_hash_ni
23
28
  @report.to_hash_ni
24
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epb_view_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DLUHC Energy Performance of Buildings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-24 00:00:00.000000000 Z
11
+ date: 2025-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -1697,11 +1697,14 @@ files:
1697
1697
  - lib/presenter/export/commercial.rb
1698
1698
  - lib/presenter/export/domestic.rb
1699
1699
  - lib/presenter/export/statistics.rb
1700
+ - lib/presenter/rd_sap/certificate_summary.rb
1700
1701
  - lib/presenter/rd_sap/domestic_digest.rb
1701
1702
  - lib/presenter/rd_sap/export_configuration.rb
1702
1703
  - lib/presenter/rd_sap/recommendation_report.rb
1703
1704
  - lib/presenter/rd_sap/report.rb
1704
1705
  - lib/presenter/rd_sap/summary.rb
1706
+ - lib/presenter/sap/certificate_details.rb
1707
+ - lib/presenter/sap/certificate_summary.rb
1705
1708
  - lib/presenter/sap/domestic_digest.rb
1706
1709
  - lib/presenter/sap/export_configuration.rb
1707
1710
  - lib/presenter/sap/recommendation_report.rb
@@ -1895,7 +1898,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1895
1898
  - !ruby/object:Gem::Version
1896
1899
  version: '0'
1897
1900
  requirements: []
1898
- rubygems_version: 3.5.9
1901
+ rubygems_version: 3.5.11
1899
1902
  signing_key:
1900
1903
  specification_version: 4
1901
1904
  summary: Library used to parse Energy Performance Certificates (EPC)