epb_view_models 2.2.17 → 2.2.19
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 +7 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/BaseDataTypes.xsd +296 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/CEPC-Reports.xsd +63 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/Input-Data.xsd +34 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/Performance-Summary.xsd +120 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/Property.xsd +67 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/Report-Header.xsd +178 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/Reported-Data.xsd +391 -0
- data/api/schemas/xml/CEPC-S-7.0/Reports/UserManagement.xsd +171 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/ExternalDefinitions.xml +1456 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/ExternalDefinitions.xsd +236 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/All-HIP.xsd +25 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/AssessorManagement.xsd +16 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/EPC-Certificate.xsd +388 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/EPC-CollectedData.xsd +784 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/HCR-FeaturesExternal.xsd +283 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/HCR-FeaturesGrounds.xsd +222 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/HCR-FeaturesInternal.xsd +205 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/HCR-FeaturesServices.xsd +311 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/HCR-PropertyDetails.xsd +380 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/HCR-RiskAssessment.xsd +298 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/Property.xsd +67 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/SAP-Reports.xsd +201 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/Templates/UserManagement.xsd +259 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/UDT/BaseDataTypes.xsd +176 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/UDT/EPC-Domains.xsd +881 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/UDT/HCR-Domains.xsd +1779 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/UDT/SAP-Domains.xsd +1650 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/UDT/SharedDomains.xsd +768 -0
- data/api/schemas/xml/RdSAP-Schema-S-16.1/RdSAP/UDT/TypeDefinitions.xsd +19 -0
- data/api/schemas/xml/RdSAP-Schema-S-17.00/RdSAP/Templates/RdSAP-Report.xsd +6 -1
- data/lib/epb_view_models.rb +1 -1
- data/lib/presenter/xsd.rb +1 -8
- data/lib/view_model/cepc_s_70/cepc.rb +184 -0
- data/lib/view_model/cepc_wrapper.rb +2 -0
- data/lib/view_model/factory.rb +2 -0
- data/lib/view_model/rd_sap_schema_s_161/common_schema.rb +556 -0
- data/lib/view_model/rd_sap_schema_s_1700/common_schema.rb +15 -0
- data/lib/view_model/rd_sap_schema_s_180/common_schema.rb +15 -0
- data/lib/view_model/rd_sap_schema_s_190/common_schema.rb +15 -0
- data/lib/view_model/rd_sap_schema_s_210/common_schema.rb +15 -0
- data/lib/view_model/rd_sap_wrapper.rb +2 -0
- metadata +32 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.est.org.uk/epc/estcrV1/DCLG-HIP" xmlns:HIP="http://www.est.org.uk/epc/estcrV1/DCLG-HIP" xmlns:pfdt="http://www.est.org.uk/epc/estcrV1/DCLG-HIP/BaseDataTypes" targetNamespace="http://www.est.org.uk/epc/estcrV1/DCLG-HIP" elementFormDefault="qualified" version="LIG-16.1">
|
|
3
|
+
<xs:annotation>
|
|
4
|
+
<xs:documentation>© Department of Communities and Local Government. © Crown copyright, 2007. The Home Condition Report logo and associated wording is a registered trade mark - any unlicensed use is not permitted. Copyright in the typographical arrangement of this document rests with the Crown. This publication, excluding logos, may be reproduced free of charge in any format or medium for research, private study, for internal circulation within an organisation or by registered scheme users. This is subject to it being reproduced accurately and not used in a misleading context.
|
|
5
|
+
|
|
6
|
+
Type Definitions (TypeDefinitions.xsd) are constrained variants of a primitive datatype whose allowed values must meet some predefined rules
|
|
7
|
+
|
|
8
|
+
Exactly what is a type definition is a bit subjective because it is generally up to the data modeller to make the decision between what is a Value-Type and what is an Entity-Type.
|
|
9
|
+
|
|
10
|
+
For example in some contexts an Address (House Number, Street, Town, Postcode) may be declared as a composite datatype where the value of each Address is recorded against the Addressable Entity but in another context the Address (where there are details to be gathered about the Address itself) it could be a defined referenced Business Entity instead.
|
|
11
|
+
|
|
12
|
+
However, even allowing for some fuzziness at the boundary, a general rule of thumb is that a Type Definition is a data-item that is generally defined outside of the domain and it is not within the domains authority to extend or redefine. There is also only ever one definition in force at any time.
|
|
13
|
+
</xs:documentation>
|
|
14
|
+
</xs:annotation>
|
|
15
|
+
<xs:element name="UValue" type="UValue"/>
|
|
16
|
+
<xs:complexType name="UValue">
|
|
17
|
+
<xs:sequence/>
|
|
18
|
+
</xs:complexType>
|
|
19
|
+
</xs:schema>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!-- edited with XMLSpy v2006 rel. 3 U (http://www.altova.com) by Jim Bowery (Landmark Information Group Ltd.) -->
|
|
3
|
-
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
3
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
4
|
+
xmlns="http://www.epcregister.com/xsd/rdsap"
|
|
5
|
+
targetNamespace="http://www.epcregister.com/xsd/rdsap"
|
|
6
|
+
elementFormDefault="qualified"
|
|
7
|
+
attributeFormDefault="unqualified"
|
|
8
|
+
version="LIG-17.00">
|
|
4
9
|
<xs:annotation>
|
|
5
10
|
<xs:documentation>© Department of Communities and Local Government. © Crown copyright, 2007. The Home Condition Report logo and associated wording is a registered trade mark - any unlicensed use is not permitted. Copyright in the typographical arrangement of this document rests with the Crown. This publication, excluding logos, may be reproduced free of charge in any format or medium for research, private study, for internal circulation within an organisation or by registered scheme users. This is subject to it being reproduced accurately and not used in a misleading context.</xs:documentation>
|
|
6
11
|
</xs:annotation>
|
data/lib/epb_view_models.rb
CHANGED
data/lib/presenter/xsd.rb
CHANGED
|
@@ -25,15 +25,8 @@ module Presenter
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def unique_enums(domain_arguments)
|
|
28
|
-
uniq_enums = []
|
|
29
28
|
enums = get_enums_by_type(domain_arguments).values
|
|
30
|
-
|
|
31
|
-
enums.each_with_index do |_hash, i|
|
|
32
|
-
if i.positive? && (enums[i].to_a != enums[i + 1].to_a)
|
|
33
|
-
uniq_enums << enums[i]
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
uniq_enums
|
|
29
|
+
enums.group_by(&:inspect).values.map(&:first)
|
|
37
30
|
end
|
|
38
31
|
|
|
39
32
|
def variation_between_schema_versions?(enums_hash)
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
module ViewModel
|
|
2
|
+
module CepcS70
|
|
3
|
+
class Cepc < ViewModel::Cepc71::CommonSchema
|
|
4
|
+
def date_of_expiry
|
|
5
|
+
expires_at = (Date.parse(date_of_registration) - 1) >> 12 * 10
|
|
6
|
+
|
|
7
|
+
expires_at.to_s
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def building_environment
|
|
11
|
+
xpath(%w[Building-Environment])
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def energy_efficiency_rating
|
|
15
|
+
xpath(%w[Asset-Rating])&.to_i
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def current_energy_efficiency_band
|
|
19
|
+
xpath(%w[Energy-Band])
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def potential_energy_rating
|
|
23
|
+
xpath(%w[Potential-Rating])&.to_i
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def potential_energy_band
|
|
27
|
+
xpath(%w[Potential-Band])
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def new_build_benchmark_band
|
|
31
|
+
xpath(%w[New-Build-Benchmark-Band])
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def comparative_asset_rating
|
|
35
|
+
xpath(%w[Comparative-Asset-Rating])&.to_i
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def comparative_asset_band
|
|
39
|
+
xpath(%w[Comparative-Energy-Band])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def epc_rating_ber
|
|
43
|
+
xpath(%w[BER])&.to_f
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def approximate_energy_use
|
|
47
|
+
xpath(%w[Approximate-Energry-Use])&.to_i
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def floor_area
|
|
51
|
+
xpath(%w[Technical-Information Floor-Area])&.to_i
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def main_heating_fuel
|
|
55
|
+
xpath(%w[Main-Heating-Fuel])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def property_type
|
|
59
|
+
xpath(%w[Property-Type Long-Description])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def property_long_description
|
|
63
|
+
xpath(%w[Property-Type Long-Description])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def property_short_description
|
|
67
|
+
xpath(%w[Property-Type Short-Description])
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def compliant_2002
|
|
71
|
+
nil
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def renewable_energy_sources
|
|
75
|
+
@xml_doc.search("Renewable-Energy-Sources").children.search("Renewable-Energy-Source").map(&:content)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def electricity_sources
|
|
79
|
+
@xml_doc.search("Electricity-Sources").children.search("Electricity-Source").map(&:content)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def primary_energy_indicator
|
|
83
|
+
xpath(%w[Primary-Energry-Indicator])&.to_i
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def calculation_tool
|
|
87
|
+
xpath(%w[Calculation-Tool])
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def ter_2002
|
|
91
|
+
nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def ter
|
|
95
|
+
xpath(%w[TER])&.to_f
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def recommendations(payback = "")
|
|
99
|
+
if payback.empty?
|
|
100
|
+
# return an enumerable of all nodes
|
|
101
|
+
@xml_doc.xpath "Recommendations-Report RR-Recommendations"
|
|
102
|
+
else
|
|
103
|
+
@xml_doc
|
|
104
|
+
.search("Recommendations-Report RR-Recommendations/#{payback}")
|
|
105
|
+
.map do |node|
|
|
106
|
+
{
|
|
107
|
+
code: node.at("Recommendation-Code").content,
|
|
108
|
+
text: node.at("Recommendation").content,
|
|
109
|
+
cO2Impact: node.at("CO2-Impact").content,
|
|
110
|
+
}
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def short_payback_recommendations
|
|
116
|
+
recommendations("Short-Payback")
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def medium_payback_recommendations
|
|
120
|
+
recommendations("Medium-Payback")
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def long_payback_recommendations
|
|
124
|
+
recommendations("Long-Payback")
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def other_payback_recommendations
|
|
128
|
+
recommendations("Other-Payback")
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def related_rrn
|
|
132
|
+
nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def new_build_rating
|
|
136
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def existing_build_rating
|
|
140
|
+
nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def epc_related_party_disclosure
|
|
144
|
+
nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def trading_address
|
|
148
|
+
xpath(%w[Trading-Address])
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def company_name
|
|
152
|
+
xpath(%w[Company-Name])
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def insurer
|
|
156
|
+
xpath(%w[Insurer])
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def policy_no
|
|
160
|
+
xpath(%w[Policy-No])
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def insurer_effective_date
|
|
164
|
+
xpath(%w[Effective-Date])
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def insurer_expiry_date
|
|
168
|
+
xpath(%w[Expiry-Date])
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def insurer_pi_limit
|
|
172
|
+
xpath(%w[PI-Limit])
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def inspection_date
|
|
176
|
+
xpath(%w[Inspection-Date])
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def completion_date
|
|
180
|
+
xpath(%w[Completion-Date])
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
data/lib/view_model/factory.rb
CHANGED
|
@@ -18,6 +18,7 @@ module ViewModel
|
|
|
18
18
|
CEPC-5.0
|
|
19
19
|
CEPC-4.0
|
|
20
20
|
CEPC-3.1
|
|
21
|
+
CEPC-S-7.0
|
|
21
22
|
CEPC-S-7.1
|
|
22
23
|
].freeze
|
|
23
24
|
TYPES_OF_RD_SAP = %i[
|
|
@@ -39,6 +40,7 @@ module ViewModel
|
|
|
39
40
|
RdSAP-Schema-S-21.0
|
|
40
41
|
RdSAP-Schema-S-18.0
|
|
41
42
|
RdSAP-Schema-S-17.00
|
|
43
|
+
RdSAP-Schema-S-16.1
|
|
42
44
|
].freeze
|
|
43
45
|
TYPES_OF_SAP = %i[
|
|
44
46
|
SAP-Schema-19.2.0
|