epb_view_models 2.2.2 → 2.2.4

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 (37) 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/cepc/certificate_summary.rb +5 -3
  14. data/lib/presenter/dec/certificate_summary.rb +91 -0
  15. data/lib/presenter/dec_rr/certificate_summary.rb +62 -0
  16. data/lib/presenter/dec_rr/summary.rb +1 -3
  17. data/lib/presenter/rd_sap/certificate_summary.rb +3 -0
  18. data/lib/presenter/sap/certificate_summary.rb +3 -0
  19. data/lib/view_model/cepc31/dec_rr.rb +4 -0
  20. data/lib/view_model/cepc40/dec_rr.rb +4 -0
  21. data/lib/view_model/cepc50/dec_rr.rb +4 -0
  22. data/lib/view_model/cepc51/dec_rr.rb +4 -0
  23. data/lib/view_model/cepc60/dec_rr.rb +4 -0
  24. data/lib/view_model/cepc70/dec_rr.rb +4 -0
  25. data/lib/view_model/cepc71/dec_rr.rb +4 -0
  26. data/lib/view_model/cepc800/dec_rr.rb +4 -0
  27. data/lib/view_model/cepc_ni800/dec_rr.rb +4 -0
  28. data/lib/view_model/cepc_s_71/cepc.rb +14 -18
  29. data/lib/view_model/dec_rr_wrapper.rb +7 -0
  30. data/lib/view_model/dec_summary_wrapper.rb +2 -0
  31. data/lib/view_model/dec_wrapper.rb +7 -0
  32. data/lib/view_model/decar_s_70/common_schema.rb +109 -0
  33. data/lib/view_model/decar_s_70/dec.rb +235 -0
  34. data/lib/view_model/decar_s_70/dec_rr.rb +102 -0
  35. data/lib/view_model/domestic_epc_view_model.rb +14 -0
  36. data/lib/view_model/factory.rb +4 -1
  37. metadata +15 -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.4"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -93,13 +93,15 @@ module Presenter
93
93
  potential_energy_rating: @view_model.potential_energy_rating,
94
94
  current_energy_efficiency_band: @view_model.current_energy_efficiency_band,
95
95
  potential_energy_band: @view_model.potential_energy_band,
96
- new_build_benchmark_rating: @view_model.new_build_benchmark_rating,
96
+ new_build_benchmark_rating: @view_model.new_build_rating,
97
97
  new_build_benchmark_band: @view_model.new_build_benchmark_band,
98
98
  comparative_asset_rating: @view_model.comparative_asset_rating,
99
99
  epc_rating_ber: @view_model.epc_rating_ber,
100
100
  approximate_energy_use: @view_model.approximate_energy_use,
101
- property_type: @view_model.property_type,
102
- property_short_description: @view_model.property_short_description,
101
+ property_type: {
102
+ property_type_long_description: @view_model.property_long_description,
103
+ property_type_short_description: @view_model.property_short_description,
104
+ },
103
105
  compliant_2002: @view_model.compliant_2002,
104
106
  renewable_energy_sources: @view_model.renewable_energy_sources,
105
107
  electricity_sources: @view_model.electricity_sources,
@@ -0,0 +1,91 @@
1
+ module Presenter
2
+ module Dec
3
+ class CertificateSummary
4
+ TYPE_OF_ASSESSMENT = "DEC".freeze
5
+
6
+ def initialize(view_model, schema_type)
7
+ @view_model = view_model
8
+ @schema_type = schema_type.to_s
9
+ end
10
+
11
+ def to_hash
12
+ {
13
+ assessment_id: @view_model.assessment_id,
14
+ date_of_assessment: @view_model.date_of_assessment,
15
+ date_of_expiry: @view_model.date_of_expiry,
16
+ date_of_registration: @view_model.date_of_registration,
17
+ address: {
18
+ address_id: @view_model.address_id,
19
+ address_line1: @view_model.address_line1,
20
+ address_line2: @view_model.address_line2,
21
+ address_line3: @view_model.address_line3,
22
+ address_line4: @view_model.address_line4,
23
+ town: @view_model.town,
24
+ postcode: @view_model.postcode,
25
+ },
26
+ type_of_assessment: TYPE_OF_ASSESSMENT,
27
+ schema_version: @schema_type.gsub(/[a-zA-Z-]/, "").to_f,
28
+ report_type: @view_model.report_type,
29
+ current_assessment: {
30
+ date: @view_model.current_assessment_date,
31
+ energy_efficiency_rating: @view_model.energy_efficiency_rating,
32
+ energy_efficiency_band: Helper::EnergyBandCalculator.commercial(@view_model.energy_efficiency_rating),
33
+ heating_co2: @view_model.current_heating_co2,
34
+ electricity_co2: @view_model.current_electricity_co2,
35
+ renewables_co2: @view_model.current_renewables_co2,
36
+ },
37
+ year1_assessment: {
38
+ date: @view_model.year1_assessment_date,
39
+ energy_efficiency_rating: @view_model.year1_energy_efficiency_rating,
40
+ energy_efficiency_band: Helper::EnergyBandCalculator.commercial(@view_model.year1_energy_efficiency_rating),
41
+ heating_co2: @view_model.year1_heating_co2,
42
+ electricity_co2: @view_model.year1_electricity_co2,
43
+ renewables_co2: @view_model.year1_renewables_co2,
44
+ },
45
+ year2_assessment: {
46
+ date: @view_model.year2_assessment_date,
47
+ energy_efficiency_rating: @view_model.year2_energy_efficiency_rating,
48
+ energy_efficiency_band:
49
+ Helper::EnergyBandCalculator.commercial(@view_model.year2_energy_efficiency_rating),
50
+ heating_co2: @view_model.year2_heating_co2,
51
+ electricity_co2: @view_model.year2_electricity_co2,
52
+ renewables_co2: @view_model.year2_renewables_co2,
53
+ },
54
+ technical_information: {
55
+ main_heating_fuel: @view_model.main_heating_fuel,
56
+ building_environment: @view_model.building_environment,
57
+ floor_area: @view_model.floor_area,
58
+ occupier: @view_model.occupier,
59
+ asset_rating: @view_model.asset_rating,
60
+ annual_energy_use_fuel_thermal:
61
+ @view_model.annual_energy_use_fuel_thermal,
62
+ annual_energy_use_electrical:
63
+ @view_model.annual_energy_use_electrical,
64
+ typical_thermal_use: @view_model.typical_thermal_use,
65
+ typical_electrical_use: @view_model.typical_electrical_use,
66
+ renewables_fuel_thermal: @view_model.renewables_fuel_thermal,
67
+ renewables_electrical: @view_model.renewables_electrical,
68
+ },
69
+ assessor: {
70
+ scheme_assessor_id: @view_model.scheme_assessor_id,
71
+ name: @view_model.assessor_name,
72
+ company_details: {
73
+ name: @view_model.company_name,
74
+ address: @view_model.company_address,
75
+ },
76
+ contact_details: {
77
+ email: @view_model.assessor_email,
78
+ telephone: @view_model.assessor_telephone,
79
+ },
80
+ },
81
+ administrative_information: {
82
+ issue_date: @view_model.date_of_issue,
83
+ calculation_tool: @view_model.calculation_tool,
84
+ related_party_disclosure: @view_model.dec_related_party_disclosure,
85
+ related_rrn: @view_model.related_rrn,
86
+ },
87
+ }
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,62 @@
1
+ module Presenter
2
+ module DecRr
3
+ class CertificateSummary
4
+ def initialize(view_model)
5
+ @view_model = view_model
6
+ end
7
+
8
+ def to_hash
9
+ {
10
+ type_of_assessment: @view_model&.type_of_assessment,
11
+ assessment_id: @view_model.assessment_id,
12
+ report_type: @view_model.report_type,
13
+ date_of_assessment: @view_model.date_of_assessment,
14
+ date_of_registration: @view_model.date_of_registration,
15
+ date_of_expiry: @view_model.date_of_expiry,
16
+ address: {
17
+ address_id: @view_model.address_id,
18
+ address_line1: @view_model.address_line1,
19
+ address_line2: @view_model.address_line2,
20
+ address_line3: @view_model.address_line3,
21
+ address_line4: @view_model.address_line4,
22
+ town: @view_model.town,
23
+ postcode: @view_model.postcode,
24
+ },
25
+ assessor: {
26
+ scheme_assessor_id: @view_model.scheme_assessor_id,
27
+ name: @view_model.assessor_name,
28
+ company_details: {
29
+ name: @view_model.company_name,
30
+ address: @view_model.company_address,
31
+ },
32
+ contact_details: {
33
+ email: @view_model.assessor_email,
34
+ telephone: @view_model.assessor_telephone,
35
+ },
36
+ },
37
+ short_payback_recommendations:
38
+ @view_model.short_payback_recommendations,
39
+ medium_payback_recommendations:
40
+ @view_model.medium_payback_recommendations,
41
+ long_payback_recommendations: @view_model.long_payback_recommendations,
42
+ other_recommendations: @view_model.other_recommendations,
43
+ technical_information: {
44
+ building_environment: @view_model.building_environment,
45
+ floor_area: @view_model.floor_area,
46
+ occupier: @view_model.occupier,
47
+ property_type: @view_model.property_type,
48
+ renewable_sources: @view_model.renewable_sources,
49
+ discounted_energy: @view_model.discounted_energy,
50
+ date_of_issue: @view_model.date_of_issue,
51
+ calculation_tool: @view_model.calculation_tool,
52
+ inspection_type: @view_model.inspection_type,
53
+ },
54
+ site_service_one: @view_model.site_service_one,
55
+ site_service_two: @view_model.site_service_two,
56
+ site_service_three: @view_model.site_service_three,
57
+ related_rrn: @view_model.related_rrn,
58
+ }
59
+ end
60
+ end
61
+ end
62
+ end
@@ -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,
@@ -32,6 +32,8 @@ module Presenter
32
32
  assessor: {
33
33
  scheme_assessor_id: @view_model.scheme_assessor_id,
34
34
  name: @view_model.assessor_name,
35
+ assessor_contact_address: @view_model.assessor_contact_address,
36
+ company_name: @view_model.company_name,
35
37
  contact_details: {
36
38
  email: @view_model.assessor_email,
37
39
  telephone: @view_model.assessor_telephone,
@@ -39,6 +41,7 @@ module Presenter
39
41
  },
40
42
  current_carbon_emission:
41
43
  convert_to_big_decimal(@view_model.current_carbon_emission),
44
+ carbon_emissions_current_per_floor_area: @view_model.co2_emissions_current_per_floor_area,
42
45
  current_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.current_energy_rating),
43
46
  current_energy_efficiency_rating: @view_model.current_energy_rating,
44
47
  dwelling_type: @view_model.dwelling_type,
@@ -29,6 +29,8 @@ module Presenter
29
29
  assessor: {
30
30
  scheme_assessor_id: @view_model.scheme_assessor_id,
31
31
  name: @view_model.assessor_name,
32
+ assessor_contact_address: @view_model.assessor_contact_address,
33
+ company_name: @view_model.company_name,
32
34
  contact_details: {
33
35
  email: @view_model.assessor_email,
34
36
  telephone: @view_model.assessor_telephone,
@@ -36,6 +38,7 @@ module Presenter
36
38
  },
37
39
  current_carbon_emission:
38
40
  convert_to_big_decimal(@view_model.current_carbon_emission),
41
+ carbon_emissions_current_per_floor_area: @view_model.co2_emissions_current_per_floor_area,
39
42
  current_energy_efficiency_band: Helper::EnergyBandCalculator.domestic(@view_model.current_energy_rating),
40
43
  current_energy_efficiency_rating: @view_model.current_energy_rating,
41
44
  dwelling_type: @view_model.dwelling_type,
@@ -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