epb_view_models 1.0.16 → 1.0.17
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/presenter/rd_sap/hera.rb +35 -0
- data/lib/presenter/sap/hera.rb +32 -0
- data/lib/view_model/domestic_epc_view_model.rb +10 -0
- data/lib/view_model/rd_sap_schema_200/common_schema.rb +0 -4
- data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +0 -4
- data/lib/view_model/rd_sap_wrapper.rb +5 -0
- data/lib/view_model/sap_schema_1800/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_1900/common_schema.rb +0 -4
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +0 -4
- data/lib/view_model/sap_wrapper.rb +5 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dd0d9d3d0906689a919d76f7df73fddbccd8cc0eeaf97edee21ddead0b790b3
|
4
|
+
data.tar.gz: 6ded2596cf0adebfae41916318e561798d2aed7fd0c54a248d1751940865b54d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 434eac8a26a57b6658b6948d5fde772cf6cb4af70927bd736b96e8317d4f7046d3c32176f6b605f47ce2b3c7149494899182c8e2b67acfdd1656ba0519b76403
|
7
|
+
data.tar.gz: 4dc074660c6a3693440d653375b49a993b6eca0813ca574a5f68285de34d8f03f39471e00ac430d77a39101cc75f0b748a5cd3aa0db8d73a8e37532f3ebc60f6
|
data/lib/epb_view_models.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
module Presenter
|
2
|
+
module RdSap
|
3
|
+
class Hera
|
4
|
+
TYPE_OF_ASSESSMENT = "RdSAP".freeze
|
5
|
+
private_constant :TYPE_OF_ASSESSMENT
|
6
|
+
|
7
|
+
def initialize(view_model)
|
8
|
+
@view_model = view_model
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hera_hash
|
12
|
+
{
|
13
|
+
type_of_assessment: TYPE_OF_ASSESSMENT,
|
14
|
+
assessment_id: @view_model.assessment_id,
|
15
|
+
date_of_registration: @view_model.date_of_registration,
|
16
|
+
address: {
|
17
|
+
address_line1: @view_model.address_line1,
|
18
|
+
address_line2: @view_model.address_line2,
|
19
|
+
address_line3: @view_model.address_line3,
|
20
|
+
address_line4: @view_model.address_line4,
|
21
|
+
town: @view_model.town,
|
22
|
+
postcode: @view_model.postcode,
|
23
|
+
},
|
24
|
+
dwelling_type: @view_model.dwelling_type,
|
25
|
+
built_form: @view_model.built_form,
|
26
|
+
main_dwelling_construction_age_band_or_year: @view_model.main_dwelling_construction_age_band_or_year,
|
27
|
+
property_summary: @view_model.property_summary,
|
28
|
+
main_heating_category: @view_model.main_heating_category,
|
29
|
+
main_fuel_type: @view_model.main_fuel_type,
|
30
|
+
has_hot_water_cylinder: @view_model.has_hot_water_cylinder,
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Presenter
|
2
|
+
module Sap
|
3
|
+
class Hera
|
4
|
+
def initialize(view_model)
|
5
|
+
@view_model = view_model
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_hera_hash
|
9
|
+
{
|
10
|
+
type_of_assessment: @view_model.type_of_assessment,
|
11
|
+
assessment_id: @view_model.assessment_id,
|
12
|
+
date_of_registration: @view_model.date_of_registration,
|
13
|
+
address: {
|
14
|
+
address_line1: @view_model.address_line1,
|
15
|
+
address_line2: @view_model.address_line2,
|
16
|
+
address_line3: @view_model.address_line3,
|
17
|
+
address_line4: nil,
|
18
|
+
town: @view_model.town,
|
19
|
+
postcode: @view_model.postcode,
|
20
|
+
},
|
21
|
+
dwelling_type: @view_model.dwelling_type,
|
22
|
+
built_form: @view_model.built_form,
|
23
|
+
main_dwelling_construction_age_band_or_year: @view_model.main_dwelling_construction_age_band_or_year,
|
24
|
+
property_summary: @view_model.property_summary,
|
25
|
+
main_heating_category: @view_model.main_heating_category,
|
26
|
+
main_fuel_type: @view_model.main_fuel_type,
|
27
|
+
has_hot_water_cylinder: @view_model.has_hot_water_cylinder,
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -54,6 +54,16 @@ module ViewModel
|
|
54
54
|
xpath(%w[Water-Heating-Code])
|
55
55
|
end
|
56
56
|
|
57
|
+
def has_hot_water_cylinder
|
58
|
+
return "false" if xpath(%w[Has-Hot-Water-Cylinder]).nil?
|
59
|
+
|
60
|
+
xpath(%w[Has-Hot-Water-Cylinder])
|
61
|
+
end
|
62
|
+
|
63
|
+
def main_heating_category
|
64
|
+
xpath(%w[Main-Heating-Category])
|
65
|
+
end
|
66
|
+
|
57
67
|
private
|
58
68
|
|
59
69
|
def fetch_addendum_numbers
|
@@ -8,6 +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
12
|
end
|
12
13
|
|
13
14
|
def type
|
@@ -30,6 +31,10 @@ module ViewModel
|
|
30
31
|
@recommendation_report.to_hash
|
31
32
|
end
|
32
33
|
|
34
|
+
def to_hera_hash
|
35
|
+
@hera.to_hera_hash
|
36
|
+
end
|
37
|
+
|
33
38
|
def get_view_model
|
34
39
|
view_model
|
35
40
|
end
|
@@ -8,6 +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
12
|
end
|
12
13
|
|
13
14
|
def type
|
@@ -30,6 +31,10 @@ module ViewModel
|
|
30
31
|
@recommendation_report.to_hash
|
31
32
|
end
|
32
33
|
|
34
|
+
def to_hera_hash
|
35
|
+
@hera.to_hera_hash
|
36
|
+
end
|
37
|
+
|
33
38
|
def get_view_model
|
34
39
|
view_model
|
35
40
|
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.0.
|
4
|
+
version: 1.0.17
|
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-05-
|
11
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -1675,10 +1675,12 @@ files:
|
|
1675
1675
|
- lib/presenter/export/domestic.rb
|
1676
1676
|
- lib/presenter/export/statistics.rb
|
1677
1677
|
- lib/presenter/rd_sap/export_configuration.rb
|
1678
|
+
- lib/presenter/rd_sap/hera.rb
|
1678
1679
|
- lib/presenter/rd_sap/recommendation_report.rb
|
1679
1680
|
- lib/presenter/rd_sap/report.rb
|
1680
1681
|
- lib/presenter/rd_sap/summary.rb
|
1681
1682
|
- lib/presenter/sap/export_configuration.rb
|
1683
|
+
- lib/presenter/sap/hera.rb
|
1682
1684
|
- lib/presenter/sap/recommendation_report.rb
|
1683
1685
|
- lib/presenter/sap/report.rb
|
1684
1686
|
- lib/presenter/sap/summary.rb
|