epb_view_models 1.1.4 → 1.1.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 +4 -4
- data/api/schemas/data/orchestrate.json +4 -0
- 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 +399 -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 +1 -2
- data/lib/helper/xml_enums_to_output.rb +45 -2
- data/lib/view_model/factory.rb +1 -0
- data/lib/view_model/rd_sap_schema_210/common_schema.rb +587 -0
- data/lib/view_model/rd_sap_wrapper.rb +2 -0
- data/lib/view_model/sap_schema_110/sap.rb +1 -1
- data/lib/view_model/sap_schema_112/sap.rb +1 -1
- data/lib/view_model/sap_schema_120/sap.rb +1 -1
- data/lib/view_model/sap_schema_130/sap.rb +1 -1
- data/lib/view_model/sap_schema_140/sap.rb +1 -1
- data/lib/view_model/sap_schema_141/sap.rb +1 -1
- data/lib/view_model/sap_schema_142/sap.rb +1 -1
- data/lib/view_model/sap_schema_150/sap.rb +1 -1
- data/lib/view_model/sap_schema_160/sap.rb +1 -1
- data/lib/view_model/sap_schema_161/sap.rb +1 -1
- data/lib/view_model/sap_schema_162/sap.rb +1 -1
- data/lib/view_model/sap_schema_163/sap.rb +1 -1
- data/lib/view_model/sap_schema_170/common_schema.rb +1 -1
- data/lib/view_model/sap_schema_171/common_schema.rb +1 -1
- data/lib/view_model/sap_schema_1800/common_schema.rb +1 -1
- data/lib/view_model/sap_schema_1900/common_schema.rb +1 -1
- data/lib/view_model/sap_schema_1910/common_schema.rb +1 -1
- metadata +13 -3
data/lib/epb_view_models.rb
CHANGED
@@ -5,10 +5,9 @@ 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.6"
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
11
|
# Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
|
13
12
|
# Source: http://jeffgardner.org/2011/08/04/rails-string-to-boolean-method/
|
14
13
|
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,11 @@ 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
|
340
|
+
|
315
341
|
RDSAP_GLAZED_TYPE[value]
|
316
342
|
end
|
317
343
|
|
@@ -396,6 +422,7 @@ module Helper
|
|
396
422
|
SAP-Schema-13.0
|
397
423
|
SAP-Schema-12.0
|
398
424
|
RdSAP-Schema-20.0.0
|
425
|
+
RdSAP-Schema-21.0.0
|
399
426
|
RdSAP-Schema-19.0
|
400
427
|
RdSAP-Schema-18.0
|
401
428
|
RdSAP-Schema-17.1
|
@@ -461,6 +488,10 @@ module Helper
|
|
461
488
|
return value
|
462
489
|
end
|
463
490
|
|
491
|
+
if value == "L" && schemas_post_20.include?(schema_type)
|
492
|
+
return CONSTRUCTION_AGE_BAND["L-post-20"]
|
493
|
+
end
|
494
|
+
|
464
495
|
return value if value == "L" && !schemes_that_use_l.include?(schema_type)
|
465
496
|
|
466
497
|
if value == "0" &&
|
@@ -486,10 +517,15 @@ module Helper
|
|
486
517
|
SAP-Schema-10.2
|
487
518
|
SAP-Schema-NI-11.2
|
488
519
|
].freeze
|
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
|
|
@@ -533,6 +569,7 @@ module Helper
|
|
533
569
|
|
534
570
|
def self.fuel_type(value, schema_type = "", report_type = "2")
|
535
571
|
rdsap = %i[
|
572
|
+
RdSAP-Schema-21.0.0
|
536
573
|
RdSAP-Schema-20.0.0
|
537
574
|
RdSAP-Schema-19.0
|
538
575
|
RdSAP-Schema-18.0
|
@@ -633,6 +670,12 @@ module Helper
|
|
633
670
|
MAIN_HEATING_CATEGORY[value] || value
|
634
671
|
end
|
635
672
|
|
636
|
-
|
673
|
+
def self.schemas_post_20
|
674
|
+
%i[
|
675
|
+
RdSAP-Schema-21.0.0
|
676
|
+
]
|
677
|
+
end
|
678
|
+
|
679
|
+
private_class_method :is_rdsap, :is_sap, :schemas_post_20
|
637
680
|
end
|
638
681
|
end
|