epb_view_models 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/ExternalDefinitions.xml +1627 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/ExternalDefinitions.xsd +267 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/AssessorManagement.xsd +212 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/EPC-Certificate.xsd +398 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/EPC-CollectedData.xsd +1385 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/Property.xsd +67 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/RdSAP-Report.xsd +179 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/UDT/EPC-Domains.xsd +885 -0
- data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/UDT/SAP-Domains.xsd +3330 -0
- data/lib/epb_view_models.rb +2 -1
- data/lib/helper/xml_enums_to_output.rb +46 -2
- data/lib/presenter/sap/summary.rb +1 -0
- data/lib/view_model/sap_schema_110/sap.rb +12 -0
- data/lib/view_model/sap_schema_112/sap.rb +12 -0
- data/lib/view_model/sap_schema_120/sap.rb +12 -0
- data/lib/view_model/sap_schema_130/sap.rb +12 -0
- data/lib/view_model/sap_schema_140/sap.rb +12 -0
- data/lib/view_model/sap_schema_141/sap.rb +12 -0
- data/lib/view_model/sap_schema_142/sap.rb +12 -0
- data/lib/view_model/sap_schema_150/sap.rb +12 -0
- data/lib/view_model/sap_schema_160/sap.rb +12 -0
- data/lib/view_model/sap_schema_161/sap.rb +12 -0
- data/lib/view_model/sap_schema_162/sap.rb +12 -0
- data/lib/view_model/sap_schema_163/sap.rb +12 -0
- data/lib/view_model/sap_schema_170/common_schema.rb +12 -0
- data/lib/view_model/sap_schema_171/common_schema.rb +12 -0
- data/lib/view_model/sap_schema_1800/common_schema.rb +12 -0
- data/lib/view_model/sap_schema_1900/common_schema.rb +12 -0
- data/lib/view_model/sap_schema_1910/common_schema.rb +12 -0
- metadata +11 -2
data/lib/epb_view_models.rb
CHANGED
@@ -5,9 +5,10 @@ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
|
|
5
5
|
loader.setup
|
6
6
|
|
7
7
|
module EpbViewModels
|
8
|
-
VERSION = "1.1.
|
8
|
+
VERSION = "1.1.5"
|
9
9
|
end
|
10
10
|
|
11
|
+
|
11
12
|
# Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
|
12
13
|
# Source: http://jeffgardner.org/2011/08/04/rails-string-to-boolean-method/
|
13
14
|
class String
|
@@ -31,6 +31,7 @@ module Helper
|
|
31
31
|
"3" => "Unknown",
|
32
32
|
"4" => "dual (24 hour)",
|
33
33
|
"5" => "off-peak 18 hour",
|
34
|
+
"6" => "off-peak 10 hour",
|
34
35
|
}.freeze
|
35
36
|
RDSAP_GLAZED_TYPE = {
|
36
37
|
"1" => "double glazing installed before 2002",
|
@@ -42,6 +43,14 @@ module Helper
|
|
42
43
|
"7" => "double, known data",
|
43
44
|
"8" => "triple, known data",
|
44
45
|
"ND" => "not defined",
|
46
|
+
"6-post20" => "triple glazing, unknown install date",
|
47
|
+
"9" => "triple glazing, installed between 2002-2022 in EAW, 2003-2023 in SCT, 2006-2022 NI",
|
48
|
+
"10" => "triple glazing, installed before 2002 in EAW, 2003 in SCT, 2006 NI",
|
49
|
+
"11" => "secondary glazing, normal emissivity",
|
50
|
+
"12" => "secondary glazing, low emissivity",
|
51
|
+
"13" => "double glazing, installed during or after 2022 in EAW, 2023 in SCT, 2022 NI",
|
52
|
+
"14" => "triple glazing, installed during or after 2022 in EAW, 2023 in SCT, 2022 NI",
|
53
|
+
|
45
54
|
}.freeze
|
46
55
|
RDSAP_GLAZED_AREA = {
|
47
56
|
"1" => "Normal",
|
@@ -78,6 +87,9 @@ module Helper
|
|
78
87
|
"12RdSAP" => "RHI application",
|
79
88
|
"13RdSAP" => "ECO assessment",
|
80
89
|
"14RdSAP" => "Stock condition survey",
|
90
|
+
"15RdSAP" => "Grant scheme (ECO, RHI, etc.)",
|
91
|
+
"16RdSAP" => "Non-grant scheme (e.g. MEES)",
|
92
|
+
"17RdSAP" => "re-mortgaging",
|
81
93
|
}.freeze
|
82
94
|
CONSTRUCTION_AGE_BAND = {
|
83
95
|
"A" => "England and Wales: before 1900",
|
@@ -94,6 +106,8 @@ module Helper
|
|
94
106
|
"K-pre-17.0" => "England and Wales: 2007 onwards",
|
95
107
|
"K-12.0" => "Post-2006",
|
96
108
|
"L" => "England and Wales: 2012 onwards",
|
109
|
+
"L-post-20" => "England and Wales: 2012-2021",
|
110
|
+
"M" => "England and Wales: 2022 onwards",
|
97
111
|
"0" => "Not applicable",
|
98
112
|
"NR" => "Not recorded",
|
99
113
|
}.freeze
|
@@ -136,6 +150,7 @@ module Helper
|
|
136
150
|
"0" => "no corridor",
|
137
151
|
"1" => "heated corridor",
|
138
152
|
"2" => "unheated corridor",
|
153
|
+
"3" => "stairwell",
|
139
154
|
}.freeze
|
140
155
|
MECHANICAL_VENTILATION = {
|
141
156
|
"0" => "natural",
|
@@ -144,6 +159,12 @@ module Helper
|
|
144
159
|
"0-pre12.0" => "none",
|
145
160
|
"1-pre12.0" => "mechanical - heat recovering",
|
146
161
|
"2-pre12.0" => "mechanical - non recovering",
|
162
|
+
"1-post20" => "mechanical ventilation without heat recovery (MV)",
|
163
|
+
"2-post20" => "mechanical extract, decentralised (MEV dc)",
|
164
|
+
"3-post20" => "mechanical extract, centralised (MEV c)",
|
165
|
+
"4-post20" => "mechanical ventilation with heat recovery (MVHR)",
|
166
|
+
"5-post20" => "positive input from loft",
|
167
|
+
"6-post20" => "positive input from outside",
|
147
168
|
}.freeze
|
148
169
|
CEPC_TRANSACTION_TYPE = {
|
149
170
|
"1" => "Mandatory issue (Marketed sale)",
|
@@ -167,6 +188,7 @@ module Helper
|
|
167
188
|
"10" => "natural with intermittent extract fans and passive vents",
|
168
189
|
}.freeze
|
169
190
|
CYLINDER_INSULATION_THICKNESS = {
|
191
|
+
"0" => "0 mm",
|
170
192
|
"12" => "12 mm",
|
171
193
|
"25" => "25 mm",
|
172
194
|
"38" => "38 mm",
|
@@ -311,7 +333,10 @@ module Helper
|
|
311
333
|
RDSAP_GLAZED_AREA[value]
|
312
334
|
end
|
313
335
|
|
314
|
-
def self.glazed_type_rdsap(value)
|
336
|
+
def self.glazed_type_rdsap(value, schema_type = "")
|
337
|
+
if value =="6" && schemas_post_20.include?(schema_type)
|
338
|
+
return RDSAP_GLAZED_TYPE["#{value}-post20"]
|
339
|
+
end
|
315
340
|
RDSAP_GLAZED_TYPE[value]
|
316
341
|
end
|
317
342
|
|
@@ -396,6 +421,7 @@ module Helper
|
|
396
421
|
SAP-Schema-13.0
|
397
422
|
SAP-Schema-12.0
|
398
423
|
RdSAP-Schema-20.0.0
|
424
|
+
RdSAP-Schema-21.0.0
|
399
425
|
RdSAP-Schema-19.0
|
400
426
|
RdSAP-Schema-18.0
|
401
427
|
RdSAP-Schema-17.1
|
@@ -461,6 +487,10 @@ module Helper
|
|
461
487
|
return value
|
462
488
|
end
|
463
489
|
|
490
|
+
if value == "L" && schemas_post_20.include?(schema_type)
|
491
|
+
return CONSTRUCTION_AGE_BAND["L-post-20"]
|
492
|
+
end
|
493
|
+
|
464
494
|
return value if value == "L" && !schemes_that_use_l.include?(schema_type)
|
465
495
|
|
466
496
|
if value == "0" &&
|
@@ -486,10 +516,16 @@ module Helper
|
|
486
516
|
SAP-Schema-10.2
|
487
517
|
SAP-Schema-NI-11.2
|
488
518
|
].freeze
|
519
|
+
|
520
|
+
|
489
521
|
if types_of_sap_pre12.include?(schema_type) && is_rdsap(report_type)
|
490
522
|
return MECHANICAL_VENTILATION["#{value}-pre12.0"]
|
491
523
|
end
|
492
524
|
|
525
|
+
if schemas_post_20.include?(schema_type) && is_rdsap(report_type)
|
526
|
+
return MECHANICAL_VENTILATION["#{value}-post20"]
|
527
|
+
end
|
528
|
+
|
493
529
|
MECHANICAL_VENTILATION[value] || value
|
494
530
|
end
|
495
531
|
|
@@ -633,6 +669,14 @@ module Helper
|
|
633
669
|
MAIN_HEATING_CATEGORY[value] || value
|
634
670
|
end
|
635
671
|
|
636
|
-
|
672
|
+
def self.schemas_post_20
|
673
|
+
%i[
|
674
|
+
RdSAP-Schema-21.0.0
|
675
|
+
]
|
676
|
+
end
|
677
|
+
|
678
|
+
private_class_method :is_rdsap, :is_sap, :schemas_post_20
|
679
|
+
|
680
|
+
|
637
681
|
end
|
638
682
|
end
|
@@ -103,6 +103,7 @@ module Presenter
|
|
103
103
|
tenure: @view_model.tenure,
|
104
104
|
transaction_type: @view_model.transaction_type,
|
105
105
|
total_floor_area: convert_to_big_decimal(@view_model.total_floor_area),
|
106
|
+
total_roof_area: @view_model.respond_to?(:total_roof_area) ? @view_model.total_roof_area : nil,
|
106
107
|
status: @view_model.status,
|
107
108
|
environmental_impact_current: @view_model.environmental_impact_current,
|
108
109
|
environmental_impact_potential:
|
@@ -56,6 +56,18 @@ module ViewModel
|
|
56
56
|
def water_heating_fuel
|
57
57
|
xpath(%w[Water-Fuel-Type])
|
58
58
|
end
|
59
|
+
|
60
|
+
def total_roof_area
|
61
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
62
|
+
return nil if roofs.count == 0
|
63
|
+
|
64
|
+
total_roof_area = 0
|
65
|
+
roofs.each do |roof|
|
66
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
67
|
+
total_roof_area += roof_area
|
68
|
+
end
|
69
|
+
total_roof_area
|
70
|
+
end
|
59
71
|
end
|
60
72
|
end
|
61
73
|
end
|
@@ -62,6 +62,18 @@ module ViewModel
|
|
62
62
|
def water_heating_fuel
|
63
63
|
xpath(%w[Water-Fuel-Type])
|
64
64
|
end
|
65
|
+
|
66
|
+
def total_roof_area
|
67
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
68
|
+
return nil if roofs.count == 0
|
69
|
+
|
70
|
+
total_roof_area = 0
|
71
|
+
roofs.each do |roof|
|
72
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
73
|
+
total_roof_area += roof_area
|
74
|
+
end
|
75
|
+
total_roof_area
|
76
|
+
end
|
65
77
|
end
|
66
78
|
end
|
67
79
|
end
|
@@ -44,6 +44,18 @@ module ViewModel
|
|
44
44
|
def water_heating_fuel
|
45
45
|
xpath(%w[Water-Fuel-Type])
|
46
46
|
end
|
47
|
+
|
48
|
+
def total_roof_area
|
49
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
50
|
+
return nil if roofs.count == 0
|
51
|
+
|
52
|
+
total_roof_area = 0
|
53
|
+
roofs.each do |roof|
|
54
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
55
|
+
total_roof_area += roof_area
|
56
|
+
end
|
57
|
+
total_roof_area
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -44,6 +44,18 @@ module ViewModel
|
|
44
44
|
def water_heating_fuel
|
45
45
|
xpath(%w[Water-Fuel-Type])
|
46
46
|
end
|
47
|
+
|
48
|
+
def total_roof_area
|
49
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
50
|
+
return nil if roofs.count == 0
|
51
|
+
|
52
|
+
total_roof_area = 0
|
53
|
+
roofs.each do |roof|
|
54
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
55
|
+
total_roof_area += roof_area
|
56
|
+
end
|
57
|
+
total_roof_area
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -44,6 +44,18 @@ module ViewModel
|
|
44
44
|
def water_heating_fuel
|
45
45
|
xpath(%w[Water-Fuel-Type])
|
46
46
|
end
|
47
|
+
|
48
|
+
def total_roof_area
|
49
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
50
|
+
return nil if roofs.count == 0
|
51
|
+
|
52
|
+
total_roof_area = 0
|
53
|
+
roofs.each do |roof|
|
54
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
55
|
+
total_roof_area += roof_area
|
56
|
+
end
|
57
|
+
total_roof_area
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -44,6 +44,18 @@ module ViewModel
|
|
44
44
|
def water_heating_fuel
|
45
45
|
xpath(%w[Water-Fuel-Type])
|
46
46
|
end
|
47
|
+
|
48
|
+
def total_roof_area
|
49
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
50
|
+
return nil if roofs.count == 0
|
51
|
+
|
52
|
+
total_roof_area = 0
|
53
|
+
roofs.each do |roof|
|
54
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
55
|
+
total_roof_area += roof_area
|
56
|
+
end
|
57
|
+
total_roof_area
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -44,6 +44,18 @@ module ViewModel
|
|
44
44
|
def water_heating_fuel
|
45
45
|
xpath(%w[Water-Fuel-Type])
|
46
46
|
end
|
47
|
+
|
48
|
+
def total_roof_area
|
49
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
50
|
+
return nil if roofs.count == 0
|
51
|
+
|
52
|
+
total_roof_area = 0
|
53
|
+
roofs.each do |roof|
|
54
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
55
|
+
total_roof_area += roof_area
|
56
|
+
end
|
57
|
+
total_roof_area
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -44,6 +44,18 @@ module ViewModel
|
|
44
44
|
def water_heating_fuel
|
45
45
|
xpath(%w[Water-Fuel-Type])
|
46
46
|
end
|
47
|
+
|
48
|
+
def total_roof_area
|
49
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
50
|
+
return nil if roofs.count == 0
|
51
|
+
|
52
|
+
total_roof_area = 0
|
53
|
+
roofs.each do |roof|
|
54
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
55
|
+
total_roof_area += roof_area
|
56
|
+
end
|
57
|
+
total_roof_area
|
58
|
+
end
|
47
59
|
end
|
48
60
|
end
|
49
61
|
end
|
@@ -53,6 +53,18 @@ module ViewModel
|
|
53
53
|
def water_heating_fuel
|
54
54
|
xpath(%w[Water-Fuel-Type])
|
55
55
|
end
|
56
|
+
|
57
|
+
def total_roof_area
|
58
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
59
|
+
return nil if roofs.count == 0
|
60
|
+
|
61
|
+
total_roof_area = 0
|
62
|
+
roofs.each do |roof|
|
63
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
64
|
+
total_roof_area += roof_area
|
65
|
+
end
|
66
|
+
total_roof_area
|
67
|
+
end
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
@@ -53,6 +53,18 @@ module ViewModel
|
|
53
53
|
def water_heating_fuel
|
54
54
|
xpath(%w[Water-Fuel-Type])
|
55
55
|
end
|
56
|
+
|
57
|
+
def total_roof_area
|
58
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
59
|
+
return nil if roofs.count == 0
|
60
|
+
|
61
|
+
total_roof_area = 0
|
62
|
+
roofs.each do |roof|
|
63
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
64
|
+
total_roof_area += roof_area
|
65
|
+
end
|
66
|
+
total_roof_area
|
67
|
+
end
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
@@ -53,6 +53,18 @@ module ViewModel
|
|
53
53
|
def water_heating_fuel
|
54
54
|
xpath(%w[Water-Fuel-Type])
|
55
55
|
end
|
56
|
+
|
57
|
+
def total_roof_area
|
58
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
59
|
+
return nil if roofs.count == 0
|
60
|
+
|
61
|
+
total_roof_area = 0
|
62
|
+
roofs.each do |roof|
|
63
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
64
|
+
total_roof_area += roof_area
|
65
|
+
end
|
66
|
+
total_roof_area
|
67
|
+
end
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
@@ -53,6 +53,18 @@ module ViewModel
|
|
53
53
|
def water_heating_fuel
|
54
54
|
xpath(%w[Water-Fuel-Type])
|
55
55
|
end
|
56
|
+
|
57
|
+
def total_roof_area
|
58
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
59
|
+
return nil if roofs.count == 0
|
60
|
+
|
61
|
+
total_roof_area = 0
|
62
|
+
roofs.each do |roof|
|
63
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
64
|
+
total_roof_area += roof_area
|
65
|
+
end
|
66
|
+
total_roof_area
|
67
|
+
end
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
@@ -180,6 +180,18 @@ module ViewModel
|
|
180
180
|
xpath(%w[Property-Summary Total-Floor-Area])
|
181
181
|
end
|
182
182
|
|
183
|
+
def total_roof_area
|
184
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
185
|
+
return nil if roofs.count == 0
|
186
|
+
|
187
|
+
total_roof_area = 0
|
188
|
+
roofs.each do |roof|
|
189
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
190
|
+
total_roof_area += roof_area
|
191
|
+
end
|
192
|
+
total_roof_area
|
193
|
+
end
|
194
|
+
|
183
195
|
def dwelling_type
|
184
196
|
xpath(%w[Dwelling-Type])
|
185
197
|
end
|
@@ -180,6 +180,18 @@ module ViewModel
|
|
180
180
|
xpath(%w[Property-Summary Total-Floor-Area])
|
181
181
|
end
|
182
182
|
|
183
|
+
def total_roof_area
|
184
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
185
|
+
return nil if roofs.count == 0
|
186
|
+
|
187
|
+
total_roof_area = 0
|
188
|
+
roofs.each do |roof|
|
189
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
190
|
+
total_roof_area += roof_area
|
191
|
+
end
|
192
|
+
total_roof_area
|
193
|
+
end
|
194
|
+
|
183
195
|
def dwelling_type
|
184
196
|
xpath(%w[Dwelling-Type])
|
185
197
|
end
|
@@ -182,6 +182,18 @@ module ViewModel
|
|
182
182
|
xpath(%w[Property-Summary Total-Floor-Area])
|
183
183
|
end
|
184
184
|
|
185
|
+
def total_roof_area
|
186
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
187
|
+
return nil if roofs.count == 0
|
188
|
+
|
189
|
+
total_roof_area = 0
|
190
|
+
roofs.each do |roof|
|
191
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
192
|
+
total_roof_area += roof_area
|
193
|
+
end
|
194
|
+
total_roof_area
|
195
|
+
end
|
196
|
+
|
185
197
|
def dwelling_type
|
186
198
|
xpath(%w[Dwelling-Type])
|
187
199
|
end
|
@@ -184,6 +184,18 @@ module ViewModel
|
|
184
184
|
xpath(%w[Property-Summary Total-Floor-Area]).to_i
|
185
185
|
end
|
186
186
|
|
187
|
+
def total_roof_area
|
188
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
189
|
+
return nil if roofs.count == 0
|
190
|
+
|
191
|
+
total_roof_area = 0
|
192
|
+
roofs.each do |roof|
|
193
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
194
|
+
total_roof_area += roof_area
|
195
|
+
end
|
196
|
+
total_roof_area
|
197
|
+
end
|
198
|
+
|
187
199
|
def dwelling_type
|
188
200
|
xpath(%w[Dwelling-Type])
|
189
201
|
end
|
@@ -184,6 +184,18 @@ module ViewModel
|
|
184
184
|
xpath(%w[Property-Summary Total-Floor-Area]).to_i
|
185
185
|
end
|
186
186
|
|
187
|
+
def total_roof_area
|
188
|
+
roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
|
189
|
+
return nil if roofs.count == 0
|
190
|
+
|
191
|
+
total_roof_area = 0
|
192
|
+
roofs.each do |roof|
|
193
|
+
roof_area = roof.at("Total-Roof-Area")&.content.to_i
|
194
|
+
total_roof_area += roof_area
|
195
|
+
end
|
196
|
+
total_roof_area
|
197
|
+
end
|
198
|
+
|
187
199
|
def dwelling_type
|
188
200
|
xpath(%w[Dwelling-Type])
|
189
201
|
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: 1.1.
|
4
|
+
version: 1.1.5
|
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:
|
11
|
+
date: 2024-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -216,6 +216,15 @@ files:
|
|
216
216
|
- api/schemas/xml/RdSAP-Schema-20.0.0/RdSAP/Templates/RdSAP-Report.xsd
|
217
217
|
- api/schemas/xml/RdSAP-Schema-20.0.0/RdSAP/UDT/EPC-Domains.xsd
|
218
218
|
- api/schemas/xml/RdSAP-Schema-20.0.0/RdSAP/UDT/SAP-Domains.xsd
|
219
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/ExternalDefinitions.xml
|
220
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/ExternalDefinitions.xsd
|
221
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/AssessorManagement.xsd
|
222
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/EPC-Certificate.xsd
|
223
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/EPC-CollectedData.xsd
|
224
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/Property.xsd
|
225
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/RdSAP-Report.xsd
|
226
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/UDT/EPC-Domains.xsd
|
227
|
+
- api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/UDT/SAP-Domains.xsd
|
219
228
|
- api/schemas/xml/RdSAP-Schema-NI-17.3/RdSAP/ExternalDefinitions.xml
|
220
229
|
- api/schemas/xml/RdSAP-Schema-NI-17.3/RdSAP/ExternalDefinitions.xsd
|
221
230
|
- api/schemas/xml/RdSAP-Schema-NI-17.3/RdSAP/Templates/AssessorManagement.xsd
|