epb_view_models 2.2.2 → 2.2.3

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/api/schemas/data/orchestrate.json +3 -0
  3. data/api/schemas/xml/DECAR-S-7.0/CommonFiles/CommonStructures.xsd +24 -0
  4. data/api/schemas/xml/DECAR-S-7.0/CommonFiles/Exceptions.xsd +69 -0
  5. data/api/schemas/xml/DECAR-S-7.0/Messages/LodgeReportRequest.xsd +14 -0
  6. data/api/schemas/xml/DECAR-S-7.0/Reports/BaseDataTypes.xsd +181 -0
  7. data/api/schemas/xml/DECAR-S-7.0/Reports/CEPC-Reports.xsd +66 -0
  8. data/api/schemas/xml/DECAR-S-7.0/Reports/Input-Data.xsd +307 -0
  9. data/api/schemas/xml/DECAR-S-7.0/Reports/Performance-Summary.xsd +105 -0
  10. data/api/schemas/xml/DECAR-S-7.0/Reports/Report-Header.xsd +449 -0
  11. data/api/schemas/xml/DECAR-S-7.0/Reports/Reported-Data.xsd +403 -0
  12. data/lib/epb_view_models.rb +1 -1
  13. data/lib/presenter/dec_rr/summary.rb +1 -3
  14. data/lib/view_model/cepc31/dec_rr.rb +4 -0
  15. data/lib/view_model/cepc40/dec_rr.rb +4 -0
  16. data/lib/view_model/cepc50/dec_rr.rb +4 -0
  17. data/lib/view_model/cepc51/dec_rr.rb +4 -0
  18. data/lib/view_model/cepc60/dec_rr.rb +4 -0
  19. data/lib/view_model/cepc70/dec_rr.rb +4 -0
  20. data/lib/view_model/cepc71/dec_rr.rb +4 -0
  21. data/lib/view_model/cepc800/dec_rr.rb +4 -0
  22. data/lib/view_model/cepc_ni800/dec_rr.rb +4 -0
  23. data/lib/view_model/dec_rr_wrapper.rb +2 -0
  24. data/lib/view_model/dec_summary_wrapper.rb +2 -0
  25. data/lib/view_model/dec_wrapper.rb +2 -0
  26. data/lib/view_model/decar_s_70/common_schema.rb +109 -0
  27. data/lib/view_model/decar_s_70/dec.rb +235 -0
  28. data/lib/view_model/decar_s_70/dec_rr.rb +102 -0
  29. data/lib/view_model/factory.rb +4 -1
  30. metadata +13 -1
@@ -0,0 +1,403 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSpy v2007 rel. 3 sp1 (http://www.altova.com) by Niall Horgan (Bridgeall Technology) -->
3
+ <xs:schema xmlns="DCLG-CEPC" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:UDT="DCLG-CEPC" xmlns:CEPC="DCLG-CEPC" targetNamespace="DCLG-CEPC" elementFormDefault="qualified" version="LIG-CEPC-7.0">
4
+ <xs:include schemaLocation="../Reports/BaseDataTypes.xsd"/>
5
+ <xs:element name="Report-Data" type="Report-Data"/>
6
+ <xs:complexType name="Report-Data" abstract="true">
7
+ <xs:all/>
8
+ </xs:complexType>
9
+ <xs:element name="Technical-Information" type="Technical-Information"/>
10
+ <xs:complexType name="Technical-Information">
11
+ <xs:all>
12
+ <xs:element name="Main-Heating-Fuel" type="HeatingFuelTypeCode" minOccurs="0">
13
+ <xs:annotation>
14
+ <xs:documentation>Main Heating Fuel used in the building. This is onl;y required for a Display Energy Certificate or Energy Performance Certificate and doesn't appear on the Recommendations Report or Advisory Report.</xs:documentation>
15
+ </xs:annotation>
16
+ </xs:element>
17
+ <xs:element name="Other-Fuel-Description" type="xs:string" minOccurs="0">
18
+ <xs:annotation>
19
+ <xs:documentation>Text description of unspecified fuel type if Other is selected for Main-Heating-Fuel.</xs:documentation>
20
+ </xs:annotation>
21
+ </xs:element>
22
+ <xs:element name="Building-Environment" type="BuildingEnvironmentCode">
23
+ <xs:annotation>
24
+ <xs:documentation>Services</xs:documentation>
25
+ </xs:annotation>
26
+ </xs:element>
27
+ <xs:element name="Floor-Area" type="xs:decimal">
28
+ <xs:annotation>
29
+ <xs:documentation>Total Useful Floor Area (M^2)</xs:documentation>
30
+ </xs:annotation>
31
+ </xs:element>
32
+ <xs:element name="Building-Level" type="xs:int" minOccurs="0">
33
+ <xs:annotation>
34
+ <xs:documentation>Building Complexity Level. This is onl;y required for an Energy Performance Certificate and doesn't appear on the Recommendations Report or Advisory Report or Display Energy Certificate.</xs:documentation>
35
+ </xs:annotation>
36
+ </xs:element>
37
+ <xs:element name="Special-Energy-Uses" type="xs:string" minOccurs="0">
38
+ <xs:annotation>
39
+ <xs:documentation>Special energy uses discounted. This only appears on the advisory Report.</xs:documentation>
40
+ </xs:annotation>
41
+ </xs:element>
42
+ <xs:element name="Renewable-Sources" type="xs:string" minOccurs="0">
43
+ <xs:annotation>
44
+ <xs:documentation>On-site renewable energy sources. This only appears on the Advisory Report.</xs:documentation>
45
+ </xs:annotation>
46
+ </xs:element>
47
+ <xs:element name="OR-Availability-Date" type="xs:date" minOccurs="0">
48
+ <xs:annotation>
49
+ <xs:documentation>The date that the Operational Rating will be available if its not already.</xs:documentation>
50
+ </xs:annotation>
51
+ </xs:element>
52
+ <xs:element name="Separately-Metered-Electric-Heating" type="xs:boolean" minOccurs="0"/>
53
+ </xs:all>
54
+ </xs:complexType>
55
+ <xs:simpleType name="BuildingEnvironmentCode">
56
+ <xs:restriction base="xs:string">
57
+ <xs:enumeration value="Air Conditioning">
58
+ <xs:annotation>
59
+ <xs:documentation>Air Conditioned</xs:documentation>
60
+ </xs:annotation>
61
+ </xs:enumeration>
62
+ <xs:enumeration value="Heating and Natural Ventilation"/>
63
+ <xs:enumeration value="Heating and Mechanical Ventilation"/>
64
+ <xs:enumeration value="Mixed-mode with Natural Ventilation"/>
65
+ <xs:enumeration value="Mixed-mode with Mechanical Ventilation"/>
66
+ <xs:enumeration value="Unconditioned"/>
67
+ <xs:enumeration value="Natural Ventilation Only"/>
68
+ <xs:enumeration value="Mechanical Ventilation Only"/>
69
+ </xs:restriction>
70
+ </xs:simpleType>
71
+ <xs:element name="DEC-Annual-Energy-Summary" type="DEC-Annual-Energy-Summary"/>
72
+ <xs:complexType name="DEC-Annual-Energy-Summary">
73
+ <xs:all>
74
+ <xs:element name="Annual-Energy-Use-Fuel-Thermal" type="xs:int">
75
+ <xs:annotation>
76
+ <xs:documentation>Annual Energy Use (kWh/m2 p.a)</xs:documentation>
77
+ </xs:annotation>
78
+ </xs:element>
79
+ <xs:element name="Annual-Energy-Use-Electrical" type="xs:int">
80
+ <xs:annotation>
81
+ <xs:documentation>Annual Energy Use (kWh/m2 p.a)</xs:documentation>
82
+ </xs:annotation>
83
+ </xs:element>
84
+ <xs:element name="Renewables-Fuel-Thermal" type="Percentage">
85
+ <xs:annotation>
86
+ <xs:documentation>Energy from on-site renewable sources</xs:documentation>
87
+ </xs:annotation>
88
+ </xs:element>
89
+ <xs:element name="Renewables-Electrical" type="Percentage">
90
+ <xs:annotation>
91
+ <xs:documentation>Energy from on-site renewable sources</xs:documentation>
92
+ </xs:annotation>
93
+ </xs:element>
94
+ <xs:element name="Typical-Thermal-Use" type="xs:int">
95
+ <xs:annotation>
96
+ <xs:documentation>Benchmark (kWh/m2 p.a)</xs:documentation>
97
+ </xs:annotation>
98
+ </xs:element>
99
+ <xs:element name="Typical-Electrical-Use" type="xs:int">
100
+ <xs:annotation>
101
+ <xs:documentation>Benchmark (kWh/m2 p.a)</xs:documentation>
102
+ </xs:annotation>
103
+ </xs:element>
104
+ </xs:all>
105
+ </xs:complexType>
106
+ <xs:element name="AR-Recommendation" type="AR-Recommendation"/>
107
+ <xs:complexType name="AR-Recommendation">
108
+ <xs:all>
109
+ <xs:element name="Recommendation-Code" type="xs:string"/>
110
+ <xs:element name="Recommendation" type="xs:string">
111
+ <xs:annotation>
112
+ <xs:documentation>Recommendation</xs:documentation>
113
+ </xs:annotation>
114
+ </xs:element>
115
+ <xs:element name="CO2-Impact" type="CO2ImpactCode">
116
+ <xs:annotation>
117
+ <xs:documentation>Potential impact on CO2 emmissions if the change is carried out.</xs:documentation>
118
+ </xs:annotation>
119
+ </xs:element>
120
+ </xs:all>
121
+ </xs:complexType>
122
+ <xs:element name="Advisory-Report" type="Advisory-Report"/>
123
+ <xs:complexType name="Advisory-Report">
124
+ <xs:all>
125
+ <xs:element name="AR-Recommendations" type="AR-Recommendations" minOccurs="0"/>
126
+ <xs:element name="Technical-Information" type="Technical-Information"/>
127
+ <xs:element name="Site-Services" type="Site-Services"/>
128
+ </xs:all>
129
+ </xs:complexType>
130
+ <xs:element name="AR-Recommendations" type="AR-Recommendations"/>
131
+ <xs:complexType name="AR-Recommendations">
132
+ <xs:sequence>
133
+ <xs:element name="Short-Payback" type="AR-Recommendation" minOccurs="0" maxOccurs="15">
134
+ <xs:annotation>
135
+ <xs:documentation>Short Payback Recommendations</xs:documentation>
136
+ </xs:annotation>
137
+ </xs:element>
138
+ <xs:element name="Medium-Payback" type="AR-Recommendation" minOccurs="0" maxOccurs="10">
139
+ <xs:annotation>
140
+ <xs:documentation>Medium Payback Recommendations</xs:documentation>
141
+ </xs:annotation>
142
+ </xs:element>
143
+ <xs:element name="Long-Payback" type="AR-Recommendation" minOccurs="0" maxOccurs="5">
144
+ <xs:annotation>
145
+ <xs:documentation>Long Payback Recommendations</xs:documentation>
146
+ </xs:annotation>
147
+ </xs:element>
148
+ <xs:element name="Other-Payback" type="AR-Recommendation" minOccurs="0" maxOccurs="10">
149
+ <xs:annotation>
150
+ <xs:documentation>Other Payback Recommendations</xs:documentation>
151
+ </xs:annotation>
152
+ </xs:element>
153
+ </xs:sequence>
154
+ </xs:complexType>
155
+ <xs:simpleType name="CO2ImpactCode">
156
+ <xs:restriction base="xs:string">
157
+ <xs:enumeration value="HIGH"/>
158
+ <xs:enumeration value="MEDIUM"/>
159
+ <xs:enumeration value="LOW"/>
160
+ </xs:restriction>
161
+ </xs:simpleType>
162
+ <xs:element name="Site-Services" type="Site-Services"/>
163
+ <xs:complexType name="Site-Services">
164
+ <xs:all>
165
+ <xs:element name="Service-1" type="Site-Service">
166
+ <xs:annotation>
167
+ <xs:documentation>Details of Site Services 1</xs:documentation>
168
+ </xs:annotation>
169
+ </xs:element>
170
+ <xs:element name="Service-2" type="Site-Service">
171
+ <xs:annotation>
172
+ <xs:documentation>Details of Site Services 2</xs:documentation>
173
+ </xs:annotation>
174
+ </xs:element>
175
+ <xs:element name="Service-3" type="Site-Service">
176
+ <xs:annotation>
177
+ <xs:documentation>Details of Site Services 3</xs:documentation>
178
+ </xs:annotation>
179
+ </xs:element>
180
+ </xs:all>
181
+ </xs:complexType>
182
+ <xs:element name="Site-Service" type="Site-Service"/>
183
+ <xs:complexType name="Site-Service">
184
+ <xs:all>
185
+ <xs:element name="Description" type="xs:string"/>
186
+ <xs:element name="Quantity" type="xs:int"/>
187
+ </xs:all>
188
+ </xs:complexType>
189
+ <xs:element name="DEC-Energy-Assessment" type="DEC-Energy-Assessment"/>
190
+ <xs:complexType name="DEC-Energy-Assessment">
191
+ <xs:all>
192
+ <xs:element name="Nominated-Date" type="xs:date">
193
+ <xs:annotation>
194
+ <xs:documentation>Nominated date for DEC 1. Display as MMM-YYYY.</xs:documentation>
195
+ </xs:annotation>
196
+ </xs:element>
197
+ <xs:element name="Energy-Rating" type="EnergyRatingType">
198
+ <xs:annotation>
199
+ <xs:documentation>Energy-Rating</xs:documentation>
200
+ </xs:annotation>
201
+ </xs:element>
202
+ <xs:element name="Electricity-CO2" type="xs:int">
203
+ <xs:annotation>
204
+ <xs:documentation>Total CO2 emissions from Electricity</xs:documentation>
205
+ </xs:annotation>
206
+ </xs:element>
207
+ <xs:element name="Heating-CO2" type="xs:int">
208
+ <xs:annotation>
209
+ <xs:documentation>Total CO2 emissions from Heating</xs:documentation>
210
+ </xs:annotation>
211
+ </xs:element>
212
+ <xs:element name="Renewables-CO2" type="xs:int" minOccurs="0">
213
+ <xs:annotation>
214
+ <xs:documentation>Total CO2 emissions from Renewable sources</xs:documentation>
215
+ </xs:annotation>
216
+ </xs:element>
217
+ </xs:all>
218
+ </xs:complexType>
219
+ <xs:element name="Display-Certificate" type="Display-Certificate"/>
220
+ <xs:complexType name="Display-Certificate">
221
+ <xs:all>
222
+ <xs:element name="DEC-Status" type="DECStatusCode" minOccurs="0"/>
223
+ <xs:element name="Reason-Type" type="ReasonType"/>
224
+ <xs:element name="DEC-Related-Party-Disclosure" type="DECDisclosureCode">
225
+ <xs:annotation>
226
+ <xs:documentation>Code indicating any potential conflicts of interest or commercial relationships with other parties.</xs:documentation>
227
+ </xs:annotation>
228
+ </xs:element>
229
+ <xs:element name="This-Assessment" type="DEC-Energy-Assessment"/>
230
+ <xs:element name="Technical-Information" type="Technical-Information"/>
231
+ <xs:element name="DEC-Annual-Energy-Summary" type="DEC-Annual-Energy-Summary"/>
232
+ <xs:element name="Year1-Assessment" type="DEC-Energy-Assessment" minOccurs="0"/>
233
+ <xs:element name="Year2-Assessment" type="DEC-Energy-Assessment" minOccurs="0"/>
234
+ <xs:element name="AC-Questionnaire" type="AC-Questionnaire" minOccurs="0"/>
235
+ </xs:all>
236
+ </xs:complexType>
237
+ <xs:simpleType name="EnergyRatingType">
238
+ <xs:restriction base="xs:int"/>
239
+ </xs:simpleType>
240
+ <xs:simpleType name="HeatingFuelTypeCode">
241
+ <xs:restriction base="xs:string">
242
+ <xs:enumeration value="Natural Gas"/>
243
+ <xs:enumeration value="LPG">
244
+ <xs:annotation>
245
+ <xs:documentation>LPG</xs:documentation>
246
+ </xs:annotation>
247
+ </xs:enumeration>
248
+ <xs:enumeration value="Biogas">
249
+ <xs:annotation>
250
+ <xs:documentation>biogas - landfill</xs:documentation>
251
+ </xs:annotation>
252
+ </xs:enumeration>
253
+ <xs:enumeration value="Oil">
254
+ <xs:annotation>
255
+ <xs:documentation>oil</xs:documentation>
256
+ </xs:annotation>
257
+ </xs:enumeration>
258
+ <xs:enumeration value="Coal">
259
+ <xs:annotation>
260
+ <xs:documentation>house coal</xs:documentation>
261
+ </xs:annotation>
262
+ </xs:enumeration>
263
+ <xs:enumeration value="Anthracite">
264
+ <xs:annotation>
265
+ <xs:documentation>anthracite</xs:documentation>
266
+ </xs:annotation>
267
+ </xs:enumeration>
268
+ <xs:enumeration value="Smokeless Fuel (inc Coke)">
269
+ <xs:annotation>
270
+ <xs:documentation>Smokeless Fuel including Coke</xs:documentation>
271
+ </xs:annotation>
272
+ </xs:enumeration>
273
+ <xs:enumeration value="Dual Fuel Appliances (Mineral + Wood)">
274
+ <xs:annotation>
275
+ <xs:documentation>dual fuel - mineral + wood</xs:documentation>
276
+ </xs:annotation>
277
+ </xs:enumeration>
278
+ <xs:enumeration value="Biomass">
279
+ <xs:annotation>
280
+ <xs:documentation>biomass</xs:documentation>
281
+ </xs:annotation>
282
+ </xs:enumeration>
283
+ <xs:enumeration value="Grid Supplied Electricity">
284
+ <xs:annotation>
285
+ <xs:documentation>Mains Electricity</xs:documentation>
286
+ </xs:annotation>
287
+ </xs:enumeration>
288
+ <xs:enumeration value="Grid Displaced Electricity"/>
289
+ <xs:enumeration value="Waste Heat"/>
290
+ <xs:enumeration value="District Cooling"/>
291
+ <xs:enumeration value="District Heating"/>
292
+ <xs:enumeration value="Other"/>
293
+ </xs:restriction>
294
+ </xs:simpleType>
295
+ <xs:element name="AC-Questionnaire" type="AC-Questionnaire"/>
296
+ <xs:complexType name="AC-Questionnaire">
297
+ <xs:sequence>
298
+ <xs:element name="AC-Present" type="YN_Flag">
299
+ <xs:annotation>
300
+ <xs:documentation>Does the building have an air conditioning system?</xs:documentation>
301
+ </xs:annotation>
302
+ </xs:element>
303
+ <xs:element name="AC-Rated-Output" type="ACRatedOuput">
304
+ <xs:annotation>
305
+ <xs:documentation>What is the total effective rated output in kW if known</xs:documentation>
306
+ </xs:annotation>
307
+ </xs:element>
308
+ <xs:element name="AC-Estimated-Output" type="ACEstimatedOutput" minOccurs="0">
309
+ <xs:annotation>
310
+ <xs:documentation>If exact rating unknown, what is the estimated total effective output rating of the air conditioning system</xs:documentation>
311
+ </xs:annotation>
312
+ </xs:element>
313
+ <xs:element name="AC-Inspection-Commissioned" type="ACInspectionCommissioned">
314
+ <xs:annotation>
315
+ <xs:documentation>Has an air conditioning inspection been commissioned?</xs:documentation>
316
+ </xs:annotation>
317
+ </xs:element>
318
+ </xs:sequence>
319
+ </xs:complexType>
320
+ <xs:simpleType name="ReasonType">
321
+ <xs:restriction base="xs:string">
322
+ <xs:enumeration value="1">
323
+ <xs:annotation>
324
+ <xs:documentation>Mandatory issue (occupier and building qualify under Energy Performance of Buildings regulations)</xs:documentation>
325
+ </xs:annotation>
326
+ </xs:enumeration>
327
+ <xs:enumeration value="2">
328
+ <xs:annotation>
329
+ <xs:documentation>Mandatory issue (DEC based on disaggregated site data, occupier and building qualify under Energy Performance of Buildings regulations) </xs:documentation>
330
+ </xs:annotation>
331
+ </xs:enumeration>
332
+ <xs:enumeration value="3">
333
+ <xs:annotation>
334
+ <xs:documentation>Voluntary (occupier qualifies under Energy Performance of Buildings regulations, building is below area threshold) </xs:documentation>
335
+ </xs:annotation>
336
+ </xs:enumeration>
337
+ <xs:enumeration value="4">
338
+ <xs:annotation>
339
+ <xs:documentation>Voluntary (occupier does not qualify under Energy Performance of Buildings regulations)</xs:documentation>
340
+ </xs:annotation>
341
+ </xs:enumeration>
342
+ <xs:enumeration value="5">
343
+ <xs:annotation>
344
+ <xs:documentation>Voluntary site-wide DEC (provided by occupier who qualifies under the Energy Performance of Buildings regulations, in addition to the building DECs)</xs:documentation>
345
+ </xs:annotation>
346
+ </xs:enumeration>
347
+ <xs:enumeration value="6">
348
+ <xs:annotation>
349
+ <xs:documentation>Voluntary site-wide DEC (provided by occupier who does not qualify under Energy Performance of Buildings regulations)</xs:documentation>
350
+ </xs:annotation>
351
+ </xs:enumeration>
352
+ <xs:enumeration value="7">
353
+ <xs:annotation>
354
+ <xs:documentation>Not recorded</xs:documentation>
355
+ </xs:annotation>
356
+ </xs:enumeration>
357
+ </xs:restriction>
358
+ </xs:simpleType>
359
+ <xs:simpleType name="DECDisclosureCode">
360
+ <xs:restriction base="xs:string">
361
+ <xs:enumeration value="1">
362
+ <xs:annotation>
363
+ <xs:documentation>Not related to the occupier.</xs:documentation>
364
+ </xs:annotation>
365
+ </xs:enumeration>
366
+ <xs:enumeration value="2">
367
+ <xs:annotation>
368
+ <xs:documentation>Employed by the occupier.</xs:documentation>
369
+ </xs:annotation>
370
+ </xs:enumeration>
371
+ <xs:enumeration value="3">
372
+ <xs:annotation>
373
+ <xs:documentation>Contractor to the occupier for Section 63 services only.</xs:documentation>
374
+ </xs:annotation>
375
+ </xs:enumeration>
376
+ <xs:enumeration value="4">
377
+ <xs:annotation>
378
+ <xs:documentation>Contractor to the occupier for non-Section 63 services.</xs:documentation>
379
+ </xs:annotation>
380
+ </xs:enumeration>
381
+ <xs:enumeration value="5">
382
+ <xs:annotation>
383
+ <xs:documentation>Indirect relation to the occupier.</xs:documentation>
384
+ </xs:annotation>
385
+ </xs:enumeration>
386
+ <xs:enumeration value="6">
387
+ <xs:annotation>
388
+ <xs:documentation>Financial interest in the occupier and/or property.</xs:documentation>
389
+ </xs:annotation>
390
+ </xs:enumeration>
391
+ <xs:enumeration value="7">
392
+ <xs:annotation>
393
+ <xs:documentation>Previous relation to the occupier.</xs:documentation>
394
+ </xs:annotation>
395
+ </xs:enumeration>
396
+ <xs:enumeration value="8">
397
+ <xs:annotation>
398
+ <xs:documentation>Not recorded.</xs:documentation>
399
+ </xs:annotation>
400
+ </xs:enumeration>
401
+ </xs:restriction>
402
+ </xs:simpleType>
403
+ </xs:schema>
@@ -5,7 +5,7 @@ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
5
5
  loader.setup
6
6
 
7
7
  module EpbViewModels
8
- VERSION = "2.2.2"
8
+ VERSION = "2.2.3"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -1,15 +1,13 @@
1
1
  module Presenter
2
2
  module DecRr
3
3
  class Summary
4
- TYPE_OF_ASSESSMENT = "DEC-RR".freeze
5
-
6
4
  def initialize(view_model)
7
5
  @view_model = view_model
8
6
  end
9
7
 
10
8
  def to_hash
11
9
  {
12
- type_of_assessment: TYPE_OF_ASSESSMENT,
10
+ type_of_assessment: @view_model&.type_of_assessment,
13
11
  assessment_id: @view_model.assessment_id,
14
12
  report_type: @view_model.report_type,
15
13
  date_of_assessment: @view_model.date_of_assessment,
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc31
3
3
  class DecRr < ViewModel::Cepc31::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc40
3
3
  class DecRr < ViewModel::Cepc40::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc50
3
3
  class DecRr < ViewModel::Cepc50::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc51
3
3
  class DecRr < ViewModel::Cepc51::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc60
3
3
  class DecRr < ViewModel::Cepc60::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc70
3
3
  class DecRr < ViewModel::Cepc70::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module Cepc71
3
3
  class DecRr < ViewModel::Cepc71::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
6
10
 
@@ -3,6 +3,10 @@ require "date"
3
3
  module ViewModel
4
4
  module Cepc800
5
5
  class DecRr < ViewModel::Cepc800::CommonSchema
6
+ def type_of_assessment
7
+ "DEC-RR"
8
+ end
9
+
6
10
  def date_of_expiry
7
11
  floor_area = xpath(%w[Advisory-Report Technical-Information Floor-Area])
8
12
 
@@ -1,6 +1,10 @@
1
1
  module ViewModel
2
2
  module CepcNi800
3
3
  class DecRr < ViewModel::CepcNi800::CommonSchema
4
+ def type_of_assessment
5
+ "DEC-RR"
6
+ end
7
+
4
8
  def date_of_expiry
5
9
  expiry_date = (Date.parse(date_of_issue) - 1).next_year 7
6
10
 
@@ -29,6 +29,8 @@ module ViewModel
29
29
 
30
30
  def build_view_model(xml_doc, schema_type)
31
31
  case schema_type
32
+ when :"DECAR-S-7.0"
33
+ ViewModel::DecarS70::DecRr.new xml_doc
32
34
  when :"CEPC-8.0.0"
33
35
  ViewModel::Cepc800::DecRr.new xml_doc
34
36
  when :"CEPC-NI-8.0.0"
@@ -29,6 +29,8 @@ module ViewModel
29
29
 
30
30
  def build_view_model(xml_doc, schema_type)
31
31
  case schema_type
32
+ when :"DECAR-S-7.0"
33
+ ViewModel::DecarS70::Dec.new xml_doc
32
34
  when :"CEPC-8.0.0"
33
35
  ViewModel::Cepc800::Dec.new xml_doc
34
36
  when :"CEPC-NI-8.0.0"
@@ -30,6 +30,8 @@ module ViewModel
30
30
 
31
31
  def build_view_model(xml_doc, schema_type)
32
32
  case schema_type
33
+ when :"DECAR-S-7.0"
34
+ ViewModel::DecarS70::Dec.new xml_doc
33
35
  when :"CEPC-8.0.0"
34
36
  ViewModel::Cepc800::Dec.new xml_doc
35
37
  when :"CEPC-NI-8.0.0"
@@ -0,0 +1,109 @@
1
+ module ViewModel
2
+ module DecarS70
3
+ class CommonSchema < ViewModel::BaseViewModel
4
+ def assessment_id
5
+ xpath(%w[RRN])
6
+ end
7
+
8
+ def date_of_expiry
9
+ xpath(%w[Valid-Until])
10
+ end
11
+
12
+ def report_type
13
+ xpath(%w[Report-Type])
14
+ end
15
+
16
+ def address_line1
17
+ xpath(%w[Property-Address Address-Line-1])
18
+ end
19
+
20
+ def address_line2
21
+ xpath(%w[Property-Address Address-Line-2])
22
+ end
23
+
24
+ def address_line3
25
+ xpath(%w[Property-Address Address-Line-3])
26
+ end
27
+
28
+ def address_line4
29
+ xpath(%w[Property-Address Address-Line-4])
30
+ end
31
+
32
+ def town
33
+ xpath(%w[Property-Address Post-Town])
34
+ end
35
+
36
+ def postcode
37
+ xpath(%w[Property-Address Postcode])
38
+ end
39
+
40
+ def scheme_assessor_id
41
+ xpath(%w[Certificate-Number])
42
+ end
43
+
44
+ def assessor_name
45
+ xpath(%w[Energy-Assessor Name])
46
+ end
47
+
48
+ def assessor_email
49
+ xpath(%w[Energy-Assessor E-Mail])
50
+ end
51
+
52
+ def assessor_telephone
53
+ xpath(%w[Energy-Assessor Telephone-Number])
54
+ end
55
+
56
+ def company_name
57
+ xpath(%w[Energy-Assessor Company-Name])
58
+ end
59
+
60
+ def company_address
61
+ xpath(%w[Energy-Assessor Trading-Address])
62
+ end
63
+
64
+ def date_of_assessment
65
+ xpath(%w[Inspection-Date])
66
+ end
67
+
68
+ def date_of_registration
69
+ xpath(%w[Registration-Date])
70
+ end
71
+
72
+ def date_of_issue
73
+ xpath(%w[Issue-Date])
74
+ end
75
+
76
+ def address_id
77
+ xpath(%w[UPRN])
78
+ end
79
+
80
+ def all_start_dates
81
+ @xml_doc.search("Start-Date").map(&:content)
82
+ end
83
+
84
+ def all_energy_types
85
+ @xml_doc.search("Energy-Type").map(&:content)
86
+ end
87
+
88
+ def all_reason_types
89
+ @xml_doc.search("Reason-Type").map(&:content)
90
+ end
91
+
92
+ def or_assessment_end_date
93
+ xpath(%w[OR-Operational-Rating OR-Assessment-End-Date])
94
+ end
95
+
96
+ def calculation_tool
97
+ xpath(%w[Calculation-Details Calculation-Tool])
98
+ end
99
+
100
+ def inspection_type
101
+ xpath(%w[Calculation-Details Inspection-Type])
102
+ end
103
+
104
+ def building_level
105
+ xpath(%w[Building-Level])&.to_i
106
+ end
107
+ end
108
+ end
109
+ end