epb_view_models 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epb_view_models.rb +1 -1
- data/lib/helper/xml_enums_to_output.rb +20 -0
- data/lib/presenter/rd_sap/hera.rb +12 -5
- data/lib/presenter/sap/hera.rb +12 -5
- data/lib/view_model/rd_sap_wrapper.rb +1 -1
- data/lib/view_model/sap_wrapper.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: 21ae4bba2efbc28d42200e7a331a4111b76071399e0a1f901313c2d57035196a
|
4
|
+
data.tar.gz: 0e244cf4dec75c6213a3c3e8bac4aa2fea2c02f44c9958419d5bf9b9bb2f4f38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2e9785b8c3141d8eaf2b1bf5c1cd647efe67022417b5922e94e44af3b57ce157dab168f4499d4a1b1bce1a6092d8aa87ef954a8ab09cc03335b5bc0a1417571
|
7
|
+
data.tar.gz: dcf95783220f96004c33f270bd844dd22de531f57136d7f9d230e7244a42b880c310088ca070b60aaedaf78dfb2f766f7f783098603302ca5cb2085b1afbc03f
|
data/lib/epb_view_models.rb
CHANGED
@@ -274,6 +274,20 @@ module Helper
|
|
274
274
|
"76" => "bioethanol from any biomass source",
|
275
275
|
"99" => "Community heating schemes: special fuel",
|
276
276
|
}.freeze
|
277
|
+
MAIN_HEATING_CATEGORY = {
|
278
|
+
"1" => "none",
|
279
|
+
"2" => "boiler with radiators or underfloor heating",
|
280
|
+
"3" => "micro-cogeneration",
|
281
|
+
"4" => "heat pump with radiators or underfloor heating",
|
282
|
+
"5" => "heat pump with warm air distribution",
|
283
|
+
"6" => "community heating system",
|
284
|
+
"7" => "electric storage heaters",
|
285
|
+
"8" => "electric underfloor heating",
|
286
|
+
"9" => "warm air system (not heat pump)",
|
287
|
+
"10" => "room heaters",
|
288
|
+
"11" => "other system",
|
289
|
+
"12" => "not recorded",
|
290
|
+
}.freeze
|
277
291
|
|
278
292
|
def self.built_form_string(number)
|
279
293
|
BUILT_FORM[number]
|
@@ -358,6 +372,7 @@ module Helper
|
|
358
372
|
]
|
359
373
|
|
360
374
|
schemes_that_use_l = %i[
|
375
|
+
SAP-Schema-19.0.0
|
361
376
|
SAP-Schema-18.0.0
|
362
377
|
SAP-Schema-17.1
|
363
378
|
SAP-Schema-17.0
|
@@ -561,6 +576,7 @@ module Helper
|
|
561
576
|
]
|
562
577
|
|
563
578
|
sap = %i[
|
579
|
+
SAP-Schema-19.0.0
|
564
580
|
SAP-Schema-18.0.0
|
565
581
|
SAP-Schema-17.1
|
566
582
|
SAP-Schema-17.0
|
@@ -611,6 +627,10 @@ module Helper
|
|
611
627
|
end
|
612
628
|
end
|
613
629
|
|
630
|
+
def self.main_heating_category(value:)
|
631
|
+
MAIN_HEATING_CATEGORY[value] || value
|
632
|
+
end
|
633
|
+
|
614
634
|
private_class_method :is_rdsap, :is_sap
|
615
635
|
end
|
616
636
|
end
|
@@ -4,8 +4,9 @@ module Presenter
|
|
4
4
|
TYPE_OF_ASSESSMENT = "RdSAP".freeze
|
5
5
|
private_constant :TYPE_OF_ASSESSMENT
|
6
6
|
|
7
|
-
def initialize(view_model)
|
7
|
+
def initialize(view_model, schema_type)
|
8
8
|
@view_model = view_model
|
9
|
+
@schema_type = schema_type
|
9
10
|
end
|
10
11
|
|
11
12
|
def to_hera_hash
|
@@ -22,11 +23,17 @@ module Presenter
|
|
22
23
|
postcode: @view_model.postcode,
|
23
24
|
},
|
24
25
|
dwelling_type: @view_model.dwelling_type,
|
25
|
-
built_form: @view_model.built_form,
|
26
|
-
main_dwelling_construction_age_band_or_year:
|
26
|
+
built_form: Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
27
|
+
main_dwelling_construction_age_band_or_year: Helper::XmlEnumsToOutput.construction_age_band_lookup(
|
28
|
+
@view_model.main_dwelling_construction_age_band_or_year,
|
29
|
+
@schema_type,
|
30
|
+
@view_model.report_type,
|
31
|
+
),
|
27
32
|
property_summary: @view_model.property_summary,
|
28
|
-
main_heating_category: @view_model.main_heating_category,
|
29
|
-
main_fuel_type: @view_model.main_fuel_type,
|
33
|
+
main_heating_category: Helper::XmlEnumsToOutput.main_heating_category(value: @view_model.main_heating_category),
|
34
|
+
main_fuel_type: Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
35
|
+
@schema_type,
|
36
|
+
@view_model.report_type),
|
30
37
|
has_hot_water_cylinder: @view_model.has_hot_water_cylinder,
|
31
38
|
}
|
32
39
|
end
|
data/lib/presenter/sap/hera.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Presenter
|
2
2
|
module Sap
|
3
3
|
class Hera
|
4
|
-
def initialize(view_model)
|
4
|
+
def initialize(view_model, schema_type)
|
5
5
|
@view_model = view_model
|
6
|
+
@schema_type = schema_type
|
6
7
|
end
|
7
8
|
|
8
9
|
def to_hera_hash
|
@@ -19,11 +20,17 @@ module Presenter
|
|
19
20
|
postcode: @view_model.postcode,
|
20
21
|
},
|
21
22
|
dwelling_type: @view_model.dwelling_type,
|
22
|
-
built_form: @view_model.built_form,
|
23
|
-
main_dwelling_construction_age_band_or_year:
|
23
|
+
built_form: Helper::XmlEnumsToOutput.built_form_string(@view_model.built_form),
|
24
|
+
main_dwelling_construction_age_band_or_year: Helper::XmlEnumsToOutput.construction_age_band_lookup(
|
25
|
+
@view_model.main_dwelling_construction_age_band_or_year,
|
26
|
+
@schema_type,
|
27
|
+
@view_model.report_type,
|
28
|
+
),
|
24
29
|
property_summary: @view_model.property_summary,
|
25
|
-
main_heating_category: @view_model.main_heating_category,
|
26
|
-
main_fuel_type: @view_model.main_fuel_type,
|
30
|
+
main_heating_category: Helper::XmlEnumsToOutput.main_heating_category(value: @view_model.main_heating_category),
|
31
|
+
main_fuel_type: Helper::XmlEnumsToOutput.fuel_type(@view_model.main_fuel_type,
|
32
|
+
@schema_type,
|
33
|
+
@view_model.report_type),
|
27
34
|
has_hot_water_cylinder: @view_model.has_hot_water_cylinder,
|
28
35
|
}
|
29
36
|
end
|
@@ -8,7 +8,7 @@ module ViewModel
|
|
8
8
|
@summary = Presenter::RdSap::Summary.new(view_model)
|
9
9
|
@report = Presenter::RdSap::Report.new(view_model, schema_type, additional_data)
|
10
10
|
@recommendation_report = Presenter::RdSap::RecommendationReport.new(view_model)
|
11
|
-
@hera = Presenter::RdSap::Hera.new(view_model)
|
11
|
+
@hera = Presenter::RdSap::Hera.new(view_model, schema_type)
|
12
12
|
end
|
13
13
|
|
14
14
|
def type
|
@@ -8,7 +8,7 @@ module ViewModel
|
|
8
8
|
@summary = Presenter::Sap::Summary.new(view_model)
|
9
9
|
@report = Presenter::Sap::Report.new(view_model, schema_type, additional_data)
|
10
10
|
@recommendation_report = Presenter::Sap::RecommendationReport.new(view_model)
|
11
|
-
@hera = Presenter::Sap::Hera.new(view_model)
|
11
|
+
@hera = Presenter::Sap::Hera.new(view_model, schema_type)
|
12
12
|
end
|
13
13
|
|
14
14
|
def type
|
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.18
|
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: 2022-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|