epb_view_models 1.0.14 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +10 -10
- data/Gemfile.lock +32 -39
- data/api/schemas/data/orchestrate.json +4 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/ExternalDefinitions.xml +1352 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/ExternalDefinitions.xsd +236 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/AssessorManagement.xsd +207 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/EPC-Certificate.xsd +476 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/ExceptionList.xsd +18 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/Property.xsd +71 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/ReportList.xsd +25 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/SAP-CollectedData.xsd +1793 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/SAP-Compliance-Report.xsd +36 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/Templates/SAP-Report.xsd +196 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/UDT/EPC-Domains.xsd +558 -0
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/UDT/SAP-Domains.xsd +3127 -0
- data/lib/epb_view_models.rb +1 -1
- data/lib/presenter/ac_cert/export_configuration.rb +7 -0
- data/lib/presenter/ac_report/export_configuration.rb +7 -0
- data/lib/presenter/cepc/export_configuration.rb +7 -0
- data/lib/presenter/cepc_rr/export_configuration.rb +7 -0
- data/lib/presenter/dec/export_configuration.rb +7 -0
- data/lib/presenter/dec_rr/export_configuration.rb +7 -0
- data/lib/presenter/export/statistics.rb +3 -14
- data/lib/presenter/rd_sap/export_configuration.rb +57 -1
- data/lib/presenter/sap/export_configuration.rb +7 -0
- data/lib/presenter/xml/parser.rb +6 -0
- data/lib/view_model/factory.rb +1 -0
- data/lib/view_model/sap_schema_1900/common_schema.rb +587 -0
- data/lib/view_model/sap_wrapper.rb +2 -0
- metadata +22 -2
data/lib/epb_view_models.rb
CHANGED
@@ -7,23 +7,12 @@ module Presenter::Export
|
|
7
7
|
|
8
8
|
def build
|
9
9
|
{
|
10
|
-
current_energy_rating: current_energy_rating,
|
11
10
|
transaction_type: @view_model.transaction_type,
|
12
11
|
}
|
13
12
|
rescue NoMethodError
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def current_energy_rating
|
20
|
-
view_model_type = @view_model.class.to_s.split("::")[1].downcase
|
21
|
-
|
22
|
-
if view_model_type.include?("sapschema")
|
23
|
-
@view_model.current_energy_rating
|
24
|
-
elsif view_model_type.include?("cepc")
|
25
|
-
@view_model.energy_efficiency_rating
|
26
|
-
end
|
13
|
+
{
|
14
|
+
transaction_type: 0,
|
15
|
+
}
|
27
16
|
end
|
28
17
|
end
|
29
18
|
end
|
@@ -1 +1,57 @@
|
|
1
|
-
|
1
|
+
module Presenter
|
2
|
+
module RdSap
|
3
|
+
class ExportConfiguration < Presenter::ToWarehouse::BaseConfiguration
|
4
|
+
excludes %w[
|
5
|
+
ExternalDefinitions-Revision-Number
|
6
|
+
User-Interface-Name
|
7
|
+
User-Interface-Version
|
8
|
+
PCDF-Revision-Number
|
9
|
+
Related-Party-Disclosure
|
10
|
+
Insurance-Details
|
11
|
+
Previous-EPC-Check
|
12
|
+
Green-Deal-Package
|
13
|
+
Energy-Assessor
|
14
|
+
Green-Deal-Category
|
15
|
+
RRN
|
16
|
+
]
|
17
|
+
includes %w[
|
18
|
+
Certificate-Number
|
19
|
+
]
|
20
|
+
bases %w[
|
21
|
+
Report-Header
|
22
|
+
Energy-Assessment
|
23
|
+
Property-Summary
|
24
|
+
Energy-Use
|
25
|
+
SAP-Data
|
26
|
+
SAP-Property-Details
|
27
|
+
Identification-Number
|
28
|
+
Property
|
29
|
+
Address
|
30
|
+
]
|
31
|
+
preferred_keys({
|
32
|
+
"Certificate-Number" => "scheme_assessor_id",
|
33
|
+
})
|
34
|
+
list_nodes %w[
|
35
|
+
SAP-Floor-Dimensions
|
36
|
+
LZC-Energy-Source
|
37
|
+
ImprovementTexts
|
38
|
+
SAP-Building-Parts
|
39
|
+
SAP-Windows
|
40
|
+
SAP-Deselected-Improvements
|
41
|
+
Main-Heating-Details
|
42
|
+
Storage-Heaters
|
43
|
+
SAP-Special-Features
|
44
|
+
Air-Change-Rates
|
45
|
+
PV-Arrays
|
46
|
+
]
|
47
|
+
rootless_list_nodes({
|
48
|
+
"Wall" => "walls",
|
49
|
+
"Roof" => "roofs",
|
50
|
+
"Floor" => { parents: %w[Property-Summary], key: "floors" },
|
51
|
+
"Main-Heating" => { parents: %w[Property-Summary], key: "main-heating" },
|
52
|
+
"Main-Heating-Controls" => "main_heating_controls",
|
53
|
+
"Addendum-Number" => "addendum_numbers",
|
54
|
+
})
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/presenter/xml/parser.rb
CHANGED
@@ -124,6 +124,7 @@ module Presenter
|
|
124
124
|
def set_value_with_keys(value, keys)
|
125
125
|
prepare_hash keys
|
126
126
|
*key, last = keys
|
127
|
+
|
127
128
|
key.inject(@output, :fetch)[last] = value
|
128
129
|
end
|
129
130
|
|
@@ -151,7 +152,12 @@ module Presenter
|
|
151
152
|
false
|
152
153
|
end
|
153
154
|
|
155
|
+
def is_bool?(string)
|
156
|
+
string == true || string == false || string =~ (/(true|false)$/i) ? true : false
|
157
|
+
end
|
158
|
+
|
154
159
|
def try_as_number(string)
|
160
|
+
return string if is_bool?(string)
|
155
161
|
return string unless is_numeric?(string)
|
156
162
|
|
157
163
|
if string.include?(".")
|