epb_view_models 1.0.4 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/epb_view_models.rb +1 -1
- data/lib/helper/xml_enums_to_output.rb +82 -23
- data/lib/presenter/rd_sap/report.rb +2 -2
- data/lib/presenter/sap/report.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59d79d9f281a39f02dbee9c2951c691175b3dfc89f0bf3e3f907aa3210e07e8a
|
|
4
|
+
data.tar.gz: 648c87f4d9ad0b4f23eaf859969665ec413b4a62fd7fc621d764cd2211231eb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40c679fd072c9fea3087edcfc7e04d289f1bf4c653c60cb2f1c25fb114aa3cbf9d4ef1d4a3ac9c17220bd6b3f876d133b29e8d58bda62acf642e6fa16eef9977
|
|
7
|
+
data.tar.gz: a754bf7fe7e9a8fb144ae351fa1e7af1591ee572370d384a23fb857f254133c5087a313951dd77757dea1b38baaffb45c973de651a971a0f2bb941f1027ac4c3
|
data/lib/epb_view_models.rb
CHANGED
|
@@ -97,6 +97,34 @@ module Helper
|
|
|
97
97
|
"0" => "Not applicable",
|
|
98
98
|
"NR" => "Not recorded",
|
|
99
99
|
}.freeze
|
|
100
|
+
CONSTRUCTION_AGE_BAND_NI = {
|
|
101
|
+
"A" => "Northern Ireland: before 1919",
|
|
102
|
+
"A-12.0" => "Pre-1900",
|
|
103
|
+
"B" => "Northern Ireland: 1919-1929",
|
|
104
|
+
"B-12.0" => "1900-1929",
|
|
105
|
+
"C" => "Northern Ireland: 1930-1949",
|
|
106
|
+
"C-12.0" => "1930-1949",
|
|
107
|
+
"D" => "Northern Ireland: 1950-1973",
|
|
108
|
+
"D-12.0" => "1950-1966",
|
|
109
|
+
"E" => "Northern Ireland: 1974-1977",
|
|
110
|
+
"E-12.0" => "1967-1975",
|
|
111
|
+
"F" => "Northern Ireland: 1978-1985",
|
|
112
|
+
"F-12.0" => "1976-1982",
|
|
113
|
+
"G" => "Northern Ireland: 1986-1991",
|
|
114
|
+
"G-12.0" => "1983-1990",
|
|
115
|
+
"H" => "Northern Ireland: 1992-1999",
|
|
116
|
+
"H-12.0" => "1991-1995",
|
|
117
|
+
"I" => "Northern Ireland: 2000-2006",
|
|
118
|
+
"I-12.0" => "1996-2002",
|
|
119
|
+
"J" => "Northern Ireland: not applicable",
|
|
120
|
+
"J-12.0" => "2003-2006",
|
|
121
|
+
"K-RdSAP-NI" => "Northern Ireland: 2007-2013",
|
|
122
|
+
"K-SAP-NI" => "Northern Ireland: 2007 onwards",
|
|
123
|
+
"K-12.0" => "Post-2006",
|
|
124
|
+
"L" => "Northern Ireland: 2014 onwards",
|
|
125
|
+
"0" => "Not applicable",
|
|
126
|
+
"NR" => "Not recorded",
|
|
127
|
+
}.freeze
|
|
100
128
|
PROPERTY_TYPE = {
|
|
101
129
|
"0" => "House",
|
|
102
130
|
"1" => "Bungalow",
|
|
@@ -135,7 +163,7 @@ module Helper
|
|
|
135
163
|
"6" => "mechanical extract, decentralised (MEV dc)",
|
|
136
164
|
"7" => "balanced without heat recovery (MV)",
|
|
137
165
|
"8" => "balanced with heat recovery (MVHR)",
|
|
138
|
-
"9" => "natural with intermittent extract fans and/or passive vents.
|
|
166
|
+
"9" => "natural with intermittent extract fans and/or passive vents. For backwards compatibility only, do not use.",
|
|
139
167
|
"10" => "natural with intermittent extract fans and passive vents",
|
|
140
168
|
}.freeze
|
|
141
169
|
CYLINDER_INSULATION_THICKNESS = {
|
|
@@ -278,7 +306,7 @@ module Helper
|
|
|
278
306
|
end
|
|
279
307
|
|
|
280
308
|
def self.transaction_type(value, report_type = "2", schema_type = "")
|
|
281
|
-
types_of_ni = %
|
|
309
|
+
types_of_ni = %i[
|
|
282
310
|
RdSAP-Schema-NI-20.0.0
|
|
283
311
|
RdSAP-Schema-NI-19.0
|
|
284
312
|
RdSAP-Schema-NI-18.0
|
|
@@ -303,7 +331,7 @@ module Helper
|
|
|
303
331
|
end
|
|
304
332
|
|
|
305
333
|
def self.construction_age_band_lookup(value, schema_type, report_type)
|
|
306
|
-
types_of_sap_pre17 = %
|
|
334
|
+
types_of_sap_pre17 = %i[
|
|
307
335
|
SAP-Schema-16.3
|
|
308
336
|
SAP-Schema-16.2
|
|
309
337
|
SAP-Schema-16.1
|
|
@@ -318,7 +346,7 @@ module Helper
|
|
|
318
346
|
SAP-Schema-11.0
|
|
319
347
|
].freeze
|
|
320
348
|
|
|
321
|
-
schemes_that_use_not_recorded = %
|
|
349
|
+
schemes_that_use_not_recorded = %i[
|
|
322
350
|
SAP-Schema-16.3
|
|
323
351
|
SAP-Schema-16.2
|
|
324
352
|
SAP-Schema-16.1
|
|
@@ -327,14 +355,9 @@ module Helper
|
|
|
327
355
|
RdSAP-Schema-18.0
|
|
328
356
|
RdSAP-Schema-17.1
|
|
329
357
|
RdSAP-Schema-17.0
|
|
330
|
-
RdSAP-Schema-NI-20.0.0
|
|
331
|
-
RdSAP-Schema-NI-19.0
|
|
332
|
-
RdSAP-Schema-NI-18.0
|
|
333
|
-
RdSAP-Schema-NI-17.4
|
|
334
|
-
RdSAP-Schema-NI-17.3
|
|
335
358
|
]
|
|
336
359
|
|
|
337
|
-
schemes_that_use_l = %
|
|
360
|
+
schemes_that_use_l = %i[
|
|
338
361
|
SAP-Schema-18.0.0
|
|
339
362
|
SAP-Schema-17.1
|
|
340
363
|
SAP-Schema-17.0
|
|
@@ -343,14 +366,9 @@ module Helper
|
|
|
343
366
|
RdSAP-Schema-18.0
|
|
344
367
|
RdSAP-Schema-17.1
|
|
345
368
|
RdSAP-Schema-17.0
|
|
346
|
-
RdSAP-Schema-NI-20.0.0
|
|
347
|
-
RdSAP-Schema-NI-19.0
|
|
348
|
-
RdSAP-Schema-NI-18.0
|
|
349
|
-
RdSAP-Schema-NI-17.4
|
|
350
|
-
RdSAP-Schema-NI-17.3
|
|
351
369
|
]
|
|
352
370
|
|
|
353
|
-
schemes_that_use_0 = %
|
|
371
|
+
schemes_that_use_0 = %i[
|
|
354
372
|
SAP-Schema-16.3
|
|
355
373
|
SAP-Schema-16.2
|
|
356
374
|
SAP-Schema-16.1
|
|
@@ -366,6 +384,25 @@ module Helper
|
|
|
366
384
|
RdSAP-Schema-18.0
|
|
367
385
|
RdSAP-Schema-17.1
|
|
368
386
|
RdSAP-Schema-17.0
|
|
387
|
+
]
|
|
388
|
+
|
|
389
|
+
sap_schemas_ni = %i[
|
|
390
|
+
SAP-Schema-NI-18.0.0
|
|
391
|
+
SAP-Schema-NI-17.4
|
|
392
|
+
SAP-Schema-NI-17.3
|
|
393
|
+
SAP-Schema-NI-17.2
|
|
394
|
+
SAP-Schema-NI-17.1
|
|
395
|
+
SAP-Schema-NI-17.0
|
|
396
|
+
SAP-Schema-NI-16.1
|
|
397
|
+
SAP-Schema-NI-16.0
|
|
398
|
+
SAP-Schema-NI-15.0
|
|
399
|
+
SAP-Schema-NI-14.2
|
|
400
|
+
SAP-Schema-NI-14.1
|
|
401
|
+
SAP-Schema-NI-14.0
|
|
402
|
+
SAP-Schema-NI-13.0
|
|
403
|
+
]
|
|
404
|
+
|
|
405
|
+
rdsap_schemas_ni = %i[
|
|
369
406
|
RdSAP-Schema-NI-20.0.0
|
|
370
407
|
RdSAP-Schema-NI-19.0
|
|
371
408
|
RdSAP-Schema-NI-18.0
|
|
@@ -373,7 +410,29 @@ module Helper
|
|
|
373
410
|
RdSAP-Schema-NI-17.3
|
|
374
411
|
]
|
|
375
412
|
|
|
376
|
-
|
|
413
|
+
ni_schemas_pre_12 = %i[
|
|
414
|
+
SAP-Schema-NI-12.0
|
|
415
|
+
SAP-Schema-NI-11.2
|
|
416
|
+
]
|
|
417
|
+
|
|
418
|
+
if value == "K" && rdsap_schemas_ni.include?(schema_type)
|
|
419
|
+
return CONSTRUCTION_AGE_BAND_NI["K-RdSAP-NI"] || value
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
if value == "K" && sap_schemas_ni.include?(schema_type)
|
|
423
|
+
return CONSTRUCTION_AGE_BAND_NI["K-SAP-NI"] || value
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
if ni_schemas_pre_12.include?(schema_type)
|
|
427
|
+
key = (value == "0" ? value : "#{value}-12.0")
|
|
428
|
+
return CONSTRUCTION_AGE_BAND_NI[key] || value
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
if sap_schemas_ni.include?(schema_type) || rdsap_schemas_ni.include?(schema_type)
|
|
432
|
+
return CONSTRUCTION_AGE_BAND_NI[value] || value
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
if value == "K" && schema_type == :"SAP-Schema-12.0" && is_rdsap(report_type)
|
|
377
436
|
return CONSTRUCTION_AGE_BAND["K-12.0"]
|
|
378
437
|
end
|
|
379
438
|
|
|
@@ -405,14 +464,13 @@ module Helper
|
|
|
405
464
|
end
|
|
406
465
|
|
|
407
466
|
def self.mechanical_ventilation(value, schema_type, report_type)
|
|
408
|
-
types_of_sap_pre12 = %
|
|
467
|
+
types_of_sap_pre12 = %i[
|
|
409
468
|
SAP-Schema-11.2
|
|
410
469
|
SAP-Schema-11.0
|
|
411
470
|
SAP-Schema-10.2
|
|
412
471
|
SAP-Schema-NI-11.2
|
|
413
472
|
].freeze
|
|
414
|
-
|
|
415
|
-
if types_of_sap_pre12.include?(schema_type.to_s) && is_rdsap(report_type)
|
|
473
|
+
if types_of_sap_pre12.include?(schema_type) && is_rdsap(report_type)
|
|
416
474
|
return MECHANICAL_VENTILATION["#{value}-pre12.0"]
|
|
417
475
|
end
|
|
418
476
|
|
|
@@ -440,7 +498,7 @@ module Helper
|
|
|
440
498
|
end
|
|
441
499
|
|
|
442
500
|
def self.ventilation_type(value, schema_type = "")
|
|
443
|
-
ni_sap = %
|
|
501
|
+
ni_sap = %i[
|
|
444
502
|
SAP-Schema-NI-16.1
|
|
445
503
|
SAP-Schema-NI-16.0
|
|
446
504
|
SAP-Schema-NI-15.0
|
|
@@ -539,13 +597,14 @@ module Helper
|
|
|
539
597
|
if rdsap.include?(schema_type)
|
|
540
598
|
RDSAP_FUEL_TYPE[value]
|
|
541
599
|
elsif sap.include?(schema_type) && is_sap(report_type)
|
|
542
|
-
|
|
600
|
+
SAP_FUEL_TYPE[value]
|
|
543
601
|
elsif sap.include?(schema_type) && is_rdsap(report_type)
|
|
544
602
|
if includes_rapeseed_oil.include?(schema_type) && value == "36"
|
|
545
603
|
return RDSAP_FUEL_TYPE["#{value}-rapeseed-oil"]
|
|
546
604
|
end
|
|
605
|
+
|
|
547
606
|
if pre143_sap.include?(schema_type)
|
|
548
|
-
|
|
607
|
+
RDSAP_FUEL_TYPE_PRE_143["#{value}-pre14.3-sap"] || RDSAP_FUEL_TYPE[value]
|
|
549
608
|
else
|
|
550
609
|
RDSAP_FUEL_TYPE[value]
|
|
551
610
|
end
|
|
@@ -31,7 +31,7 @@ module Presenter
|
|
|
31
31
|
co2_emissions_potential: @view_model.potential_carbon_emission,
|
|
32
32
|
construction_age_band:
|
|
33
33
|
Helper::XmlEnumsToOutput.construction_age_band_lookup(
|
|
34
|
-
@view_model.
|
|
34
|
+
@view_model.main_dwelling_construction_age_band_or_year,
|
|
35
35
|
@schema_type,
|
|
36
36
|
@view_model.report_type,
|
|
37
37
|
),
|
|
@@ -40,7 +40,7 @@ module Presenter
|
|
|
40
40
|
Helper::EnergyBandCalculator.domestic(
|
|
41
41
|
@view_model.current_energy_rating,
|
|
42
42
|
),
|
|
43
|
-
cylinder_insul_thickness:
|
|
43
|
+
cylinder_insul_thickness: @view_model.cylinder_insul_thickness,
|
|
44
44
|
cylinder_insulation_type: @view_model.cylinder_insulation_type,
|
|
45
45
|
cylinder_size: @view_model.cylinder_size,
|
|
46
46
|
has_cylinder_thermostat: @view_model.has_cylinder_thermostat == "Y" ? "true" : "false",
|
data/lib/presenter/sap/report.rb
CHANGED
|
@@ -40,7 +40,7 @@ module Presenter
|
|
|
40
40
|
Helper::EnergyBandCalculator.domestic(
|
|
41
41
|
@view_model.current_energy_rating,
|
|
42
42
|
),
|
|
43
|
-
cylinder_insul_thickness:
|
|
43
|
+
cylinder_insul_thickness: @view_model.cylinder_insul_thickness,
|
|
44
44
|
cylinder_insulation_type: @view_model.cylinder_insulation_type,
|
|
45
45
|
cylinder_size: @view_model.cylinder_size,
|
|
46
46
|
has_cylinder_thermostat: @view_model.has_cylinder_thermostat,
|
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.0.
|
|
4
|
+
version: 1.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MHCLG Energy Performance of Buildings
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-09-
|
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|