epb_view_models 2.2.7 → 2.2.8

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/api/schemas/xml/CEPC-S-7.1/Reports/BaseDataTypes.xsd +300 -300
  3. data/api/schemas/xml/CEPC-S-7.1/Reports/CEPC-Reports.xsd +66 -66
  4. data/api/schemas/xml/CEPC-S-7.1/Reports/Input-Data.xsd +34 -34
  5. data/api/schemas/xml/CEPC-S-7.1/Reports/Performance-Summary.xsd +125 -125
  6. data/api/schemas/xml/CEPC-S-7.1/Reports/Performance-Summary.xsd.bak +123 -123
  7. data/api/schemas/xml/CEPC-S-7.1/Reports/Property.xsd +67 -67
  8. data/api/schemas/xml/CEPC-S-7.1/Reports/Report-Header.xsd +178 -178
  9. data/api/schemas/xml/CEPC-S-7.1/Reports/Reported-Data.xsd +406 -406
  10. data/api/schemas/xml/CEPC-S-7.1/Reports/UserManagement.xsd +174 -174
  11. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/ExternalDefinitions.xsd +261 -261
  12. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/AssessorManagement.xsd +213 -213
  13. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/EPC-Certificate.xsd +400 -400
  14. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/EPC-CollectedData.xsd +1051 -1051
  15. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/Property.xsd +66 -66
  16. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/RdSAP-Report.xsd +176 -176
  17. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/ReportList.xsd +26 -26
  18. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/UDT/EPC-Domains.xsd +858 -858
  19. data/api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/UDT/SAP-Domains.xsd +2684 -2684
  20. data/lib/epb_view_models.rb +1 -1
  21. data/lib/presenter/cepc/certificate_summary.rb +3 -3
  22. data/lib/presenter/dec/certificate_summary.rb +2 -2
  23. data/lib/presenter/dec_rr/certificate_summary.rb +1 -1
  24. data/lib/presenter/rd_sap/certificate_summary.rb +1 -1
  25. data/lib/presenter/sap/certificate_summary.rb +1 -1
  26. data/lib/view_model/dec_rr_wrapper.rb +1 -1
  27. data/lib/view_model/dec_wrapper.rb +1 -1
  28. data/lib/view_model/decar_s_70/dec.rb +7 -7
  29. data/lib/view_model/decar_s_70/dec_rr.rb +2 -2
  30. data/lib/view_model/rd_sap_schema_s_190/common_schema.rb +3 -3
  31. data/lib/view_model/sap_schema_s_1900/common_schema.rb +4 -4
  32. metadata +1 -1
@@ -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.2.7"
8
+ VERSION = "2.2.8"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -63,9 +63,9 @@ module Presenter
63
63
  date_of_registration: @view_model.date_of_registration,
64
64
  address: {
65
65
  address_line1: @view_model.address_line1,
66
- address_line2: @view_model.address_line2,
67
- address_line3: @view_model.address_line3,
68
- address_line4: @view_model.address_line4,
66
+ address_line2: @view_model.address_line2.to_s,
67
+ address_line3: @view_model.address_line3.to_s,
68
+ address_line4: @view_model.address_line4.to_s,
69
69
  town: @view_model.town,
70
70
  postcode: @view_model.postcode,
71
71
  },
@@ -8,7 +8,7 @@ module Presenter
8
8
  @schema_type = schema_type.to_s
9
9
  end
10
10
 
11
- def to_hash
11
+ def to_certificate_summary
12
12
  {
13
13
  assessment_id: @view_model.assessment_id,
14
14
  date_of_assessment: @view_model.date_of_assessment,
@@ -24,7 +24,7 @@ module Presenter
24
24
  postcode: @view_model.postcode,
25
25
  },
26
26
  type_of_assessment: TYPE_OF_ASSESSMENT,
27
- schema_version: @schema_type.gsub(/[a-zA-Z-]/, "").to_f,
27
+ schema_version: @schema_type.gsub(/[a-zA-Z-]/, ""),
28
28
  report_type: @view_model.report_type,
29
29
  current_assessment: {
30
30
  date: @view_model.current_assessment_date,
@@ -5,7 +5,7 @@ module Presenter
5
5
  @view_model = view_model
6
6
  end
7
7
 
8
- def to_hash
8
+ def to_certificate_summary
9
9
  {
10
10
  type_of_assessment: @view_model&.type_of_assessment,
11
11
  assessment_id: @view_model.assessment_id,
@@ -25,7 +25,7 @@ module Presenter
25
25
  address_line1: @view_model.address_line1,
26
26
  address_line2: @view_model.address_line2,
27
27
  address_line3: @view_model.address_line3,
28
- address_line4: nil,
28
+ address_line4: "",
29
29
  town: @view_model.town,
30
30
  postcode: @view_model.postcode,
31
31
  },
@@ -22,7 +22,7 @@ module Presenter
22
22
  address_line1: @view_model.address_line1,
23
23
  address_line2: @view_model.address_line2,
24
24
  address_line3: @view_model.address_line3,
25
- address_line4: nil,
25
+ address_line4: "",
26
26
  town: @view_model.town,
27
27
  postcode: @view_model.postcode,
28
28
  },
@@ -23,7 +23,7 @@ module ViewModel
23
23
  end
24
24
 
25
25
  def to_certificate_summary
26
- @certificate_summary.to_hash
26
+ @certificate_summary.to_certificate_summary
27
27
  end
28
28
 
29
29
  def get_view_model
@@ -24,7 +24,7 @@ module ViewModel
24
24
  end
25
25
 
26
26
  def to_certificate_summary
27
- @certificate_summary.to_hash
27
+ @certificate_summary.to_certificate_summary
28
28
  end
29
29
 
30
30
  def get_view_model
@@ -88,7 +88,7 @@ module ViewModel
88
88
  end
89
89
 
90
90
  def floor_area
91
- xpath(%w[Technical-Information Floor-Area])
91
+ xpath(%w[Technical-Information Floor-Area])&.to_f
92
92
  end
93
93
 
94
94
  def asset_rating
@@ -96,27 +96,27 @@ module ViewModel
96
96
  end
97
97
 
98
98
  def annual_energy_use_fuel_thermal
99
- xpath(%w[Annual-Energy-Use-Fuel-Thermal])
99
+ xpath(%w[Annual-Energy-Use-Fuel-Thermal])&.to_i
100
100
  end
101
101
 
102
102
  def annual_energy_use_electrical
103
- xpath(%w[DEC-Annual-Energy-Summary Annual-Energy-Use-Electrical])
103
+ xpath(%w[DEC-Annual-Energy-Summary Annual-Energy-Use-Electrical])&.to_i
104
104
  end
105
105
 
106
106
  def typical_thermal_use
107
- xpath(%w[DEC-Annual-Energy-Summary Typical-Thermal-Use])
107
+ xpath(%w[DEC-Annual-Energy-Summary Typical-Thermal-Use])&.to_i
108
108
  end
109
109
 
110
110
  def typical_electrical_use
111
- xpath(%w[DEC-Annual-Energy-Summary Typical-Electrical-Use])
111
+ xpath(%w[DEC-Annual-Energy-Summary Typical-Electrical-Use])&.to_i
112
112
  end
113
113
 
114
114
  def renewables_fuel_thermal
115
- xpath(%w[DEC-Annual-Energy-Summary Renewables-Fuel-Thermal])
115
+ xpath(%w[DEC-Annual-Energy-Summary Renewables-Fuel-Thermal])&.to_i
116
116
  end
117
117
 
118
118
  def renewables_electrical
119
- xpath(%w[DEC-Annual-Energy-Summary Renewables-Electrical])
119
+ xpath(%w[DEC-Annual-Energy-Summary Renewables-Electrical])&.to_i
120
120
  end
121
121
 
122
122
  def dec_status
@@ -38,7 +38,7 @@ module ViewModel
38
38
  {
39
39
  description:
40
40
  @xml_doc.at("Site-Services/#{service}/Description").content,
41
- quantity: @xml_doc.at("Site-Services/#{service}/Quantity").content,
41
+ quantity: @xml_doc.at("Site-Services/#{service}/Quantity").content&.to_i,
42
42
  }
43
43
  end
44
44
 
@@ -71,7 +71,7 @@ module ViewModel
71
71
  end
72
72
 
73
73
  def floor_area
74
- xpath(%w[Advisory-Report Technical-Information Floor-Area])
74
+ xpath(%w[Advisory-Report Technical-Information Floor-Area])&.to_f
75
75
  end
76
76
 
77
77
  def building_environment
@@ -238,11 +238,11 @@ module ViewModel
238
238
  end
239
239
 
240
240
  def primary_energy_use
241
- xpath(%w[Energy-Consumption-Current])
241
+ xpath(%w[Energy-Consumption-Current])&.to_f
242
242
  end
243
243
 
244
244
  def energy_consumption_potential
245
- xpath(%w[Energy-Consumption-Potential])
245
+ xpath(%w[Energy-Consumption-Potential])&.to_f
246
246
  end
247
247
 
248
248
  def all_roof_descriptions
@@ -308,7 +308,7 @@ module ViewModel
308
308
  end
309
309
 
310
310
  def co2_emissions_current_per_floor_area
311
- xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
311
+ xpath(%w[CO2-Emissions-Current-Per-Floor-Area])&.to_f
312
312
  end
313
313
 
314
314
  def mains_gas
@@ -171,17 +171,17 @@ module ViewModel
171
171
  end
172
172
 
173
173
  def primary_energy_use
174
- xpath(%w[Energy-Consumption-Current])
174
+ xpath(%w[Energy-Consumption-Current])&.to_f
175
175
  end
176
176
 
177
177
  def energy_consumption_potential
178
- xpath(%w[Energy-Consumption-Potential])
178
+ xpath(%w[Energy-Consumption-Potential])&.to_f
179
179
  end
180
180
 
181
181
  def estimated_energy_cost; end
182
182
 
183
183
  def total_floor_area
184
- xpath(%w[Property-Summary Total-Floor-Area])&.to_i
184
+ xpath(%w[Property-Summary Total-Floor-Area])&.to_f
185
185
  end
186
186
 
187
187
  def total_roof_area
@@ -352,7 +352,7 @@ module ViewModel
352
352
  end
353
353
 
354
354
  def co2_emissions_current_per_floor_area
355
- xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
355
+ xpath(%w[CO2-Emissions-Current-Per-Floor-Area])&.to_f
356
356
  end
357
357
 
358
358
  def main_heating_controls
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epb_view_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.7
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - MHCLG Energy Performance of Buildings