epb_view_models 2.2.1 → 2.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25861278abdf28d7ac88619c607f0623e459f892356b021738aaa8cb7f97eb51
4
- data.tar.gz: 547e62551367e65c0d6389f07b1554feecc9f80778cd77f517b5f7be941068ec
3
+ metadata.gz: b4a5d2264f41cfcae3a898e8081930edbf6a420cd260a26e487ba9efcfb5009a
4
+ data.tar.gz: b0746277940d04d6058c19c3cfb1c80832bb3d96a8a6418776abbea033541c12
5
5
  SHA512:
6
- metadata.gz: 5acf8bc5f19ad98958e0f0a72e0979dff9820dd8a50d26d1f4647714dfecef4a43a73bf33715c7b6a1de669eb70fff3409322966f7880e49d73b046faa2e0f98
7
- data.tar.gz: 2976d431b09080249d9e3d17231c6b6a75eebdd1e37d6692e16e30429b29e8dd7ec4d279754800f0677fac8cf98d3e6796de6e36f81f695638b9d435d5e754e3
6
+ metadata.gz: 61dff3fad8d950cded6dd3ef00612f67061757ed094fb237e72fddaded10f500957ee270432970d6f0bf551f0ba732e670de931ea4f0ed87d5fc86e95b29f5a8
7
+ data.tar.gz: 61c9df812f8af2d5d7b7c6d853a797e48b78ff84e9313ac33e50c51bcccfee493867e3dba6a02783cfe45f96e274387842de46d4ca80d6595f09a8fb55e38c4d
@@ -231,5 +231,8 @@
231
231
  },
232
232
  "CEPC-S-7.1": {
233
233
  "schema_path": "api/schemas/xml/CEPC-S-7.1/Reports/CEPC-Reports.xsd"
234
+ },
235
+ "CS63-S-7.0": {
236
+ "schema_path": "api/schemas/xml/CS63-S-7.0/ActionPlan.xsd"
234
237
  }
235
238
  }
@@ -0,0 +1,818 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xs:schema xmlns="http://www.est.org.uk/s63/estcrV1/DCLG-CS63" xmlns:CS63="http://www.est.org.uk/s63/estcrV1/DCLG-CS63" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.est.org.uk/s63/estcrV1/DCLG-CS63" elementFormDefault="qualified" version="LIG-CS63-7.0">
3
+ <xs:annotation>
4
+ <xs:documentation>
5
+ The purpose of Base Data Type declarations is to provide a point of declaration of all the primitive datatypes that are in use within the domain and can be used to describe the contents of the Business Information Model.
6
+
7
+ A significant problem with the XML Schema Definition standard is that it is designed to solve a large number of software implementation problems and so provides an equally large number of datatypes with each datatype describing a variation on a theme.
8
+
9
+ For example as well as "number" we also have "short" (with a range of values corresponding to that which may be stored a 16 bit computer word), "long", "int", "integer", "decimal", "double", "byte" and quite a few other number variations. However many of these datatypes are highly-specialized computer-focused definitions that have little or no relevance to the Business stakeholders.
10
+
11
+ Most likely the business stakeholders would only recognise a limited number of datatypes - such as String, Date, Time, Integer, Decimal - and some domain-specific ones - such as Money (amount + currency attribute) - and will prefer the model to be restricted to that small set.
12
+
13
+ The advantages of defining a set of base data types and gathering them together in a single file are:
14
+ * It allows documented controls to be placed on the primitive types that are used in any schema.
15
+ * It will improve consistency of use of primitive types (e.g. consistent use of "integer" rather than "int", "long" etc.) that must be handled by applications
16
+ * It will improve code reuse.
17
+ * It allows standard attributes to be added to all elements whilst hiding the detail in a non business definition layer.
18
+
19
+ The principle is something like the way datayping is implemented in Java (as well as other programming languages) where every primitive datatype, such as "string", is wrapped by an equivalent complex class such as "String".The Java developer could declare object attributes using the "string" primitive but this isn't regarded as good practice. By using the "pfdt:string" class instead they are protected from physical changes to the implementation of "string" and also gain an extension point where additional behaviour not supported by the primitive datatype can be defined.
20
+
21
+ The declarations in this file underpin the User Defined Types, Message Infrastructure and Business Entity Template declarations.
22
+ </xs:documentation>
23
+ </xs:annotation>
24
+ <xs:simpleType name="Percentage">
25
+ <xs:restriction base="xs:decimal">
26
+ <xs:maxInclusive value="100"/>
27
+ <xs:minInclusive value="0"/>
28
+ </xs:restriction>
29
+ </xs:simpleType>
30
+ <xs:element name="Money" type="Money"/>
31
+ <xs:complexType name="Money">
32
+ <xs:annotation>
33
+ <xs:documentation>
34
+ Extension of a Decimal value for use with monetary values where a currency code needs to
35
+ be specified.
36
+
37
+ The currency code is actually metadata about the value so, in line with good XML practice, the Currency Code is declared as an XML-Attribute of the Money datatype rather than as a separate XML-Element.
38
+
39
+ The currency attribute should then include a list of valid currencies codes that are supported.
40
+ </xs:documentation>
41
+ </xs:annotation>
42
+ <xs:simpleContent>
43
+ <xs:extension base="xs:decimal">
44
+ <xs:attribute name="currency" type="xs:string" use="optional"/>
45
+ </xs:extension>
46
+ </xs:simpleContent>
47
+ </xs:complexType>
48
+ <xs:simpleType name="Count">
49
+ <xs:annotation>
50
+ <xs:documentation>A count of the number of occurrences of something - must therefore be &gt;=0. This is the functional equivalent of the XML nonNegativeInteger datatype.</xs:documentation>
51
+ </xs:annotation>
52
+ <xs:restriction base="xs:integer"/>
53
+ </xs:simpleType>
54
+ <xs:element name="Classifier" type="Classifier"/>
55
+ <xs:complexType name="Classifier">
56
+ <xs:annotation>
57
+ <xs:documentation>
58
+ A Classifier is an extended datatype used as the basis for a data-item whose allowed values are restricted to a pre-defined set of Classifiers or Enumerated Codes.
59
+
60
+ Classifier should never actually be used as the datatype for any data-item in a finished data model because a specific Enumerated Domain should be declared for defining the specific values in the domain. However it is acceptable in an incomplete model where definition of the domain has yet to be completed.
61
+ </xs:documentation>
62
+ </xs:annotation>
63
+ <xs:all/>
64
+ <xs:attribute name="pid" type="xs:string" use="required"/>
65
+ </xs:complexType>
66
+ <xs:element name="Reference" type="Reference"/>
67
+ <xs:complexType name="Reference">
68
+ <xs:annotation>
69
+ <xs:documentation>
70
+ The Reference Data Type is any association between two Business Entities (or their sub-
71
+ components). In order to be consistent across the entire dataset all references contain the ID of the thing being referenced and the value actually assigned to the element is the 'display value'. The type of reference is derived from the underlying data model
72
+
73
+ This has a shortcoming in that we can't support multi-value keys using this datatype. However
74
+ I'm reluctant to extend the datatype to include the ID as a nested element because it becomes very cumbersome to use. Instead, in all likelihood, the Primary Key to any entity in a data processing application is likely to be a single-value, system-generated key so we're imposing that restriction here as well.
75
+ </xs:documentation>
76
+ </xs:annotation>
77
+ <xs:all/>
78
+ </xs:complexType>
79
+ <xs:simpleType name="Measurement">
80
+ <xs:annotation>
81
+ <xs:documentation>A measurement of something such as a length or area. All measurements are to 2 decimal places and must be positive.</xs:documentation>
82
+ </xs:annotation>
83
+ <xs:restriction base="xs:decimal"/>
84
+ </xs:simpleType>
85
+ <xs:element name="IDString" type="IDString"/>
86
+ <xs:complexType name="IDString">
87
+ <xs:annotation>
88
+ <xs:documentation>
89
+ A string containing a unique identifier for something.
90
+
91
+ The underlying assumption is that each instance of a class or entity will have a unique identifier assigned to it which can then be assigned to any referencing entity as a reference to the entity instance.
92
+
93
+ This is a very similar concept to XML ID datatype but is locally defined because of the need to extend the datatype with domain specific attributes.
94
+ </xs:documentation>
95
+ </xs:annotation>
96
+ <xs:simpleContent>
97
+ <xs:extension base="xs:string"/>
98
+ </xs:simpleContent>
99
+ </xs:complexType>
100
+ <xs:simpleType name="NumericString">
101
+ <xs:annotation>
102
+ <xs:documentation>A Numeric String is a string based datatype for representing strings, such as telephone numbers and IP addresses, that are limited to the numeric character-set.</xs:documentation>
103
+ </xs:annotation>
104
+ <xs:restriction base="xs:string">
105
+ <xs:pattern value="[0-9\-\.\+]+"/>
106
+ </xs:restriction>
107
+ </xs:simpleType>
108
+ <xs:simpleType name="Flag">
109
+ <xs:annotation>
110
+ <xs:documentation>The Boolean datatype is a redefinition of the XML Schema defined "Boolean". The XSD version is a logical True / False datatype whereas from a data processing perspective it is more likely to be a string based Y/N value. This could be seen as an Enumerated Domain but "Boolean" is so common that it makes more sense to be a base datatype.</xs:documentation>
111
+ </xs:annotation>
112
+ <xs:restriction base="xs:string">
113
+ <xs:enumeration value="Y">
114
+ <xs:annotation>
115
+ <xs:documentation>Yes</xs:documentation>
116
+ </xs:annotation>
117
+ </xs:enumeration>
118
+ <xs:enumeration value="N">
119
+ <xs:annotation>
120
+ <xs:documentation>No</xs:documentation>
121
+ </xs:annotation>
122
+ </xs:enumeration>
123
+ </xs:restriction>
124
+ </xs:simpleType>
125
+ <xs:simpleType name="LanguageCode">
126
+ <xs:restriction base="xs:string">
127
+ <xs:enumeration value="1">
128
+ <xs:annotation>
129
+ <xs:documentation>English</xs:documentation>
130
+ </xs:annotation>
131
+ </xs:enumeration>
132
+ <xs:enumeration value="2">
133
+ <xs:annotation>
134
+ <xs:documentation>Welsh</xs:documentation>
135
+ </xs:annotation>
136
+ </xs:enumeration>
137
+ </xs:restriction>
138
+ </xs:simpleType>
139
+ <xs:element name="Sentence" type="Sentence"/>
140
+ <xs:complexType name="Sentence">
141
+ <xs:annotation>
142
+ <xs:documentation>String value with a language code for natural-language text.</xs:documentation>
143
+ </xs:annotation>
144
+ <xs:simpleContent>
145
+ <xs:extension base="xs:string">
146
+ <xs:attribute name="language" type="LanguageCode" use="optional">
147
+ <xs:annotation>
148
+ <xs:documentation>Identifies the language that the sentence is recorded in.</xs:documentation>
149
+ </xs:annotation>
150
+ </xs:attribute>
151
+ </xs:extension>
152
+ </xs:simpleContent>
153
+ </xs:complexType>
154
+ <xs:simpleType name="ExtendedBoolean">
155
+ <xs:annotation>
156
+ <xs:documentation>An extended boolean type that also allows 'unknown' as a value.</xs:documentation>
157
+ </xs:annotation>
158
+ <xs:restriction base="xs:token">
159
+ <xs:enumeration value="false"/>
160
+ <xs:enumeration value="true"/>
161
+ <xs:enumeration value="unknown"/>
162
+ </xs:restriction>
163
+ </xs:simpleType>
164
+ <xs:simpleType name="YN_Flag">
165
+ <xs:restriction base="xs:string">
166
+ <xs:enumeration value="Yes"/>
167
+ <xs:enumeration value="No"/>
168
+ </xs:restriction>
169
+ </xs:simpleType>
170
+ <xs:simpleType name="RRNType">
171
+ <xs:annotation>
172
+ <xs:documentation>
173
+ The Report Reference Number is a 20-digit unique identifier assigned to each Report.
174
+
175
+ It is formatted as five blocks of four digits i.e. 9999-9999-9999-9999-9999 and generated by an algorithm described in Appendix A "Report ID Generation" of Section 18 "Transformation Rules" of the Technical Standards.
176
+ </xs:documentation>
177
+ </xs:annotation>
178
+ <xs:restriction base="xs:string">
179
+ <xs:pattern value="[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}"/>
180
+ </xs:restriction>
181
+ </xs:simpleType>
182
+ <xs:element name="ForeignKey" type="ForeignKey"/>
183
+ <xs:complexType name="ForeignKey">
184
+ <xs:sequence/>
185
+ <xs:attribute name="EntityName" type="xs:string" use="required"/>
186
+ <xs:attribute name="KeyName" type="xs:string" use="optional"/>
187
+ <xs:attribute name="DomainName" type="xs:string" use="optional"/>
188
+ </xs:complexType>
189
+ <xs:element name="Property" type="Property"/>
190
+ <xs:complexType name="Property">
191
+ <xs:all>
192
+ <xs:element name="Address" type="AddressType"/>
193
+ <xs:element name="UPRN" type="UPRNType">
194
+ <xs:annotation>
195
+ <xs:documentation>Unique Property Reference Number</xs:documentation>
196
+ </xs:annotation>
197
+ </xs:element>
198
+ </xs:all>
199
+ </xs:complexType>
200
+ <xs:complexType name="AddressType">
201
+ <xs:annotation>
202
+ <xs:documentation>An address is composed of a number of structured elements such as Postcode, Post-Town, Street etc.</xs:documentation>
203
+ </xs:annotation>
204
+ <xs:sequence>
205
+ <xs:element name="Address-Line-1" type="xs:string" minOccurs="0"/>
206
+ <xs:element name="Address-Line-2" type="xs:string" minOccurs="0"/>
207
+ <xs:element name="Address-Line-3" type="xs:string" minOccurs="0"/>
208
+ <xs:element name="Address-Line-4" type="xs:string" minOccurs="0"/>
209
+ <xs:element name="Post-Town" type="xs:string" minOccurs="0"/>
210
+ <xs:element name="Postcode" type="PostcodeType" minOccurs="0">
211
+ <xs:annotation>
212
+ <xs:documentation>The Postcode for the Address.</xs:documentation>
213
+ </xs:annotation>
214
+ </xs:element>
215
+ </xs:sequence>
216
+ </xs:complexType>
217
+ <xs:simpleType name="UPRNType">
218
+ <xs:annotation>
219
+ <xs:documentation>Unique Property Reference Number - a 10-digit numeric string unmiquely identifuying each Property that may have a HCR registered against it.</xs:documentation>
220
+ </xs:annotation>
221
+ <xs:restriction base="xs:string">
222
+ <xs:pattern value="[0-9]{10}"/>
223
+ </xs:restriction>
224
+ </xs:simpleType>
225
+ <xs:simpleType name="PostcodeType">
226
+ <xs:restriction base="xs:string">
227
+ <xs:pattern value="[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][A-Z]{2}"/>
228
+ </xs:restriction>
229
+ </xs:simpleType>
230
+ <xs:element name="Energy-Assessor" type="Energy-Assessor"/>
231
+ <xs:complexType name="Energy-Assessor">
232
+ <xs:annotation>
233
+ <xs:documentation>An Energy-Assessor is an Approved Organisation Member qualified to carry out a Section 63 assessment.</xs:documentation>
234
+ </xs:annotation>
235
+ <xs:sequence>
236
+ <xs:element name="Membership-Number" type="xs:string" minOccurs="1" maxOccurs="1">
237
+ <xs:annotation>
238
+ <xs:documentation>The unique identifier assigned to the Energy Assessor by the Approved Organisation by which they can be identified throughout their membership of the scheme.</xs:documentation>
239
+ </xs:annotation>
240
+ </xs:element>
241
+ <xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1">
242
+ <xs:annotation>
243
+ <xs:documentation>The name by which the Energy Assessor is registered.</xs:documentation>
244
+ </xs:annotation>
245
+ </xs:element>
246
+ <xs:element name="Approved-Organisation-Name" type="xs:string" minOccurs="1" maxOccurs="1">
247
+ <xs:annotation>
248
+ <xs:documentation>The name of the Approved Organisation that certified the Energy Assessor.</xs:documentation>
249
+ </xs:annotation>
250
+ </xs:element>
251
+ <xs:element name="Approved-Organisation-Web-Address" type="xs:string" minOccurs="1" maxOccurs="1">
252
+ <xs:annotation>
253
+ <xs:documentation>The web address of the Approved Organisation that certified the Energy Assessor.</xs:documentation>
254
+ </xs:annotation>
255
+ </xs:element>
256
+ <xs:element name="Trading-Address" type="xs:string" minOccurs="0" maxOccurs="1">
257
+ <xs:annotation>
258
+ <xs:documentation>The address that any written correspondence can be sent to. This is not the same as the Registered Address because it may, of course, be a Post Office Box.</xs:documentation>
259
+ </xs:annotation>
260
+ </xs:element>
261
+ <xs:element name="Company-Name" type="xs:string" minOccurs="0" maxOccurs="1">
262
+ <xs:annotation>
263
+ <xs:documentation>The Name of the Company that the Energy Assessor is empolyed by.</xs:documentation>
264
+ </xs:annotation>
265
+ </xs:element>
266
+ <xs:element name="Status" type="EAStatusCode" minOccurs="0" maxOccurs="1">
267
+ <xs:annotation>
268
+ <xs:documentation>The Status of the Energy Assessor - at the time of producing and lodging a report this should be "Registered" but any of the values can be present on the EA Register itself.</xs:documentation>
269
+ </xs:annotation>
270
+ </xs:element>
271
+ <xs:element name="E-Mail" type="xs:string" minOccurs="0" maxOccurs="1">
272
+ <xs:annotation>
273
+ <xs:documentation>Optional e-mail address for the Energy Assessor</xs:documentation>
274
+ </xs:annotation>
275
+ </xs:element>
276
+ <xs:element name="Telephone-Number" type="xs:string" minOccurs="0" maxOccurs="1"/>
277
+ </xs:sequence>
278
+ </xs:complexType>
279
+ <xs:simpleType name="EAStatusCode">
280
+ <xs:restriction base="xs:string">
281
+ <xs:enumeration value="Inactive">
282
+ <xs:annotation>
283
+ <xs:documentation>Inactive</xs:documentation>
284
+ </xs:annotation>
285
+ </xs:enumeration>
286
+ <xs:enumeration value="Registered">
287
+ <xs:annotation>
288
+ <xs:documentation>Registered</xs:documentation>
289
+ </xs:annotation>
290
+ </xs:enumeration>
291
+ <xs:enumeration value="Struck-Off">
292
+ <xs:annotation>
293
+ <xs:documentation>Struck Off</xs:documentation>
294
+ </xs:annotation>
295
+ </xs:enumeration>
296
+ <xs:enumeration value="Suspended">
297
+ <xs:annotation>
298
+ <xs:documentation>Suspended</xs:documentation>
299
+ </xs:annotation>
300
+ </xs:enumeration>
301
+ </xs:restriction>
302
+ </xs:simpleType>
303
+ <xs:element name="AddressType" type="AddressType"/>
304
+ <xs:element name="Report-Header" type="Report-Header"/>
305
+ <xs:complexType name="Report-Header">
306
+ <xs:annotation>
307
+ <xs:documentation>Report Header contains all the identification and searchable details for the Report.</xs:documentation>
308
+ </xs:annotation>
309
+ <xs:sequence>
310
+ <xs:element name="RRN" type="RRNType">
311
+ <xs:annotation>
312
+ <xs:documentation>
313
+ Report Reference Number is the unique report Identifier that the report will be publicly known by.
314
+
315
+ The RRN is allocated to the Report at the point that it is registered and will be algorithmically derived from the natural key characteristics of the Section 63 Action Plan Report i.e. The Unique Property Reference Number (UPRN) and Inspection (Assessment) Date.
316
+ </xs:documentation>
317
+ </xs:annotation>
318
+ </xs:element>
319
+ <xs:element name="EPC-RRN" type="RRNType">
320
+ <xs:annotation>
321
+ <xs:documentation>Report Reference Number of EPC generated for the building for which the Section 63 Action Plan has been created.</xs:documentation>
322
+ </xs:annotation>
323
+ </xs:element>
324
+ <xs:element name="Sale-Lease-Date" type="xs:date" minOccurs="0" maxOccurs="1">
325
+ <xs:annotation>
326
+ <xs:documentation>The sale or lease date of which the building.</xs:documentation>
327
+ </xs:annotation>
328
+ </xs:element>
329
+ <xs:element name="Assessment-Date" type="xs:date" minOccurs="0" maxOccurs="1">
330
+ <xs:annotation>
331
+ <xs:documentation>The date on which the building was inspected and assessed for Section 63.</xs:documentation>
332
+ </xs:annotation>
333
+ </xs:element>
334
+ <xs:element name="Plan-Report-Date" type="xs:date">
335
+ <xs:annotation>
336
+ <xs:documentation>The date on which the Section 63 Action Plan Report was generated.</xs:documentation>
337
+ </xs:annotation>
338
+ </xs:element>
339
+ <xs:element name="Report-Type" type="ReportTypeCode">
340
+ <xs:annotation>
341
+ <xs:documentation>The type of Report generated.</xs:documentation>
342
+ </xs:annotation>
343
+ </xs:element>
344
+ <xs:element name="Status" type="ReportStatusCode">
345
+ <xs:annotation>
346
+ <xs:documentation>The Status of the Report.</xs:documentation>
347
+ </xs:annotation>
348
+ </xs:element>
349
+ <xs:element name="Report-Commission" type="Report-Commission">
350
+ <xs:annotation>
351
+ <xs:documentation>A Section 63 Action Plan Report can be commissioned by either the building owner or a tenant or other person provided they have been delegated by the building owner to commission the report.</xs:documentation>
352
+ </xs:annotation>
353
+ </xs:element>
354
+ <xs:element name="Property-Type" type="Building-Type">
355
+ <xs:annotation>
356
+ <xs:documentation>Describes the type of Property to which this report refers.</xs:documentation>
357
+ </xs:annotation>
358
+ </xs:element>
359
+ <xs:element name="Energy-Assessor" type="Energy-Assessor"/>
360
+ <xs:element name="Property" type="Property"/>
361
+ <xs:element name="Calculation-Details">
362
+ <xs:complexType>
363
+ <xs:sequence>
364
+ <xs:element name="Methodology" type="xs:string"/>
365
+ <xs:element name="Calculation-Tool" type="xs:string"/>
366
+ <xs:element name="Output-Engine" type="xs:string"/>
367
+ <xs:element name="Inspection-Type" type="xs:string"/>
368
+ </xs:sequence>
369
+ </xs:complexType>
370
+ </xs:element>
371
+ </xs:sequence>
372
+ </xs:complexType>
373
+ <xs:simpleType name="ReportTypeCode">
374
+ <xs:restriction base="xs:string">
375
+ <xs:enumeration value="9">
376
+ <xs:annotation>
377
+ <xs:documentation>Section 63 Action Plan</xs:documentation>
378
+ </xs:annotation>
379
+ </xs:enumeration>
380
+ </xs:restriction>
381
+ </xs:simpleType>
382
+ <xs:simpleType name="ReportStatusCode">
383
+ <xs:restriction base="xs:string">
384
+ <xs:enumeration value="cancelled">
385
+ <xs:annotation>
386
+ <xs:documentation>Cancelled</xs:documentation>
387
+ </xs:annotation>
388
+ </xs:enumeration>
389
+ <xs:enumeration value="entered">
390
+ <xs:annotation>
391
+ <xs:documentation>entered on the register</xs:documentation>
392
+ </xs:annotation>
393
+ </xs:enumeration>
394
+ <xs:enumeration value="appeal">
395
+ <xs:annotation>
396
+ <xs:documentation>under appeal</xs:documentation>
397
+ </xs:annotation>
398
+ </xs:enumeration>
399
+ <xs:enumeration value="removed">
400
+ <xs:annotation>
401
+ <xs:documentation>removed</xs:documentation>
402
+ </xs:annotation>
403
+ </xs:enumeration>
404
+ <xs:enumeration value="rejected">
405
+ <xs:annotation>
406
+ <xs:documentation>rejected</xs:documentation>
407
+ </xs:annotation>
408
+ </xs:enumeration>
409
+ <xs:enumeration value="under investigation">
410
+ <xs:annotation>
411
+ <xs:documentation>under investigation</xs:documentation>
412
+ </xs:annotation>
413
+ </xs:enumeration>
414
+ <xs:enumeration value="not for issue">
415
+ <xs:annotation>
416
+ <xs:documentation>not for issue</xs:documentation>
417
+ </xs:annotation>
418
+ </xs:enumeration>
419
+ </xs:restriction>
420
+ </xs:simpleType>
421
+ <xs:complexType name="Building-Type">
422
+ <xs:sequence>
423
+ <xs:element name="Short-Description" type="xs:string"></xs:element>
424
+ <xs:element name="Long-Description" type="xs:string"></xs:element>
425
+ </xs:sequence>
426
+ </xs:complexType>
427
+ <xs:complexType name="Report-Commission">
428
+ <xs:all>
429
+ <xs:element name="Owner-Commission-Report" type="Flag" minOccurs="1" maxOccurs="1">
430
+ <xs:annotation>
431
+ <xs:documentation>Indicates whether the Section 63 Action Plan was commissioned by the owner of the building.</xs:documentation>
432
+ </xs:annotation>
433
+ </xs:element>
434
+ <xs:element name="Owner-Name" type="xs:string" minOccurs="0" maxOccurs="1">
435
+ <xs:annotation>
436
+ <xs:documentation>The name of the building owner. This is a structured name containing prefix, first name + surname.</xs:documentation>
437
+ </xs:annotation>
438
+ </xs:element>
439
+ <xs:element name="Delegated-Person-Commission-Report" type="Flag" minOccurs="0" maxOccurs="1">
440
+ <xs:annotation>
441
+ <xs:documentation>Indicates whether the Section 63 Action Plan was commissioned by a tenant or delegated person on behalf of the owner of the building.</xs:documentation>
442
+ </xs:annotation>
443
+ </xs:element>
444
+ <xs:element name="Tenant-Delegated-Person-Name" type="xs:string" minOccurs="0" maxOccurs="1">
445
+ <xs:annotation>
446
+ <xs:documentation>The name of the tenant or delegated person. This is a structured name containing prefix, first name + surname.</xs:documentation>
447
+ </xs:annotation>
448
+ </xs:element>
449
+ <xs:element name="Delegated-Protocol-Set-Up" type="Flag" minOccurs="0" maxOccurs="1">
450
+ <xs:annotation>
451
+ <xs:documentation>Indicates whether a delegated protocol has been set up.</xs:documentation>
452
+ </xs:annotation>
453
+ </xs:element>
454
+ <xs:element name="Delegated-Protocol-Date" type="xs:date" minOccurs="0" maxOccurs="1">
455
+ <xs:annotation>
456
+ <xs:documentation>The date on which the delegated protocol was set up was generated.</xs:documentation>
457
+ </xs:annotation>
458
+ </xs:element>
459
+ </xs:all>
460
+ </xs:complexType>
461
+ <xs:complexType name="Improvement-Type">
462
+ <xs:all>
463
+ <xs:element name="Building-Improvements" type="Flag" minOccurs="1" maxOccurs="1">
464
+ <xs:annotation>
465
+ <xs:documentation>Indicates whether the improvement route selected is by implementing the building improvement measures.</xs:documentation>
466
+ </xs:annotation>
467
+ </xs:element>
468
+ <xs:element name="Operational-Rating" type="Flag" minOccurs="1" maxOccurs="1">
469
+ <xs:annotation>
470
+ <xs:documentation>Indicates whether the improvement route selected is by displaying the operational rating.</xs:documentation>
471
+ </xs:annotation>
472
+ </xs:element>
473
+ </xs:all>
474
+ </xs:complexType>
475
+ <xs:simpleType name="Measure-Type">
476
+ <xs:restriction base="xs:string">
477
+ <xs:enumeration value="Prescriptive">
478
+ <xs:annotation>
479
+ <xs:documentation>A prescriptive measure</xs:documentation>
480
+ </xs:annotation>
481
+ </xs:enumeration>
482
+ <xs:enumeration value="Alternative">
483
+ <xs:annotation>
484
+ <xs:documentation>An alternative measure input by the user</xs:documentation>
485
+ </xs:annotation>
486
+ </xs:enumeration>
487
+ </xs:restriction>
488
+ </xs:simpleType>
489
+ <xs:complexType name="Measure">
490
+ <xs:annotation>
491
+ <xs:documentation>Description of measure.</xs:documentation>
492
+ </xs:annotation>
493
+ <xs:sequence>
494
+ <xs:element name="Measure-Description-Short" type="xs:string" minOccurs="1" maxOccurs="1">
495
+ <xs:annotation>
496
+ <xs:documentation>A short description for the improvement measure.</xs:documentation>
497
+ </xs:annotation>
498
+ </xs:element>
499
+ <xs:element name="Measure-Description-Long" type="xs:string" minOccurs="0" maxOccurs="1">
500
+ <xs:annotation>
501
+ <xs:documentation>A long description for the (alternative) improvement measure as input by the user.</xs:documentation>
502
+ </xs:annotation>
503
+ </xs:element>
504
+ <xs:element name="Measure-Valid" type="Flag" minOccurs="0" maxOccurs="1">
505
+ <xs:annotation>
506
+ <xs:documentation>Whether the (prescriptive) measure is valid or applicable for the building.</xs:documentation>
507
+ </xs:annotation>
508
+ </xs:element>
509
+ <xs:element name="Measure-Type" type="Measure-Type" minOccurs="0" maxOccurs="1">
510
+ <xs:annotation>
511
+ <xs:documentation>Type of measure included in the alternative scenario: either prescriptive or alternative added by the user.</xs:documentation>
512
+ </xs:annotation>
513
+ </xs:element>
514
+ </xs:sequence>
515
+ </xs:complexType>
516
+ <xs:complexType name="Target-Savings">
517
+ <xs:annotation>
518
+ <xs:documentation>Target savings set by the prescriptive scenario of measures that are valid to the building.</xs:documentation>
519
+ </xs:annotation>
520
+ <xs:all>
521
+ <xs:element name="Target-Emission-Savings" type="xs:float" minOccurs="1" maxOccurs="1">
522
+ <xs:annotation>
523
+ <xs:documentation>Target savings of emissions in kg of CO2 per m2 per year.</xs:documentation>
524
+ </xs:annotation>
525
+ </xs:element>
526
+ <xs:element name="Target-Energy-Savings" type="xs:float" minOccurs="1" maxOccurs="1">
527
+ <xs:annotation>
528
+ <xs:documentation>Target savings of energy consumption in kWh per m2 per year.</xs:documentation>
529
+ </xs:annotation>
530
+ </xs:element>
531
+ </xs:all>
532
+ </xs:complexType>
533
+ <xs:complexType name="Prescriptive-Improvements">
534
+ <xs:sequence>
535
+ <xs:element name="Prescriptive-Scenario" type="Measure" minOccurs="7" maxOccurs="7"/>
536
+ <xs:element name="Target-Savings" type="Target-Savings" minOccurs="1" maxOccurs="1"/>
537
+ <xs:element name="Accept-Prescriptive-Improvements" type="Flag" minOccurs="1" maxOccurs="1">
538
+ <xs:annotation>
539
+ <xs:documentation>Whether the prescriptive measures have been accepted for implementation as a single package.</xs:documentation>
540
+ </xs:annotation>
541
+ </xs:element>
542
+ </xs:sequence>
543
+ </xs:complexType>
544
+ <xs:complexType name="Total-Savings">
545
+ <xs:annotation>
546
+ <xs:documentation>Total savings achieved by the alternative scenario of measures.</xs:documentation>
547
+ </xs:annotation>
548
+ <xs:all>
549
+ <xs:element name="Total-Emission-Savings" type="xs:float" minOccurs="1" maxOccurs="1">
550
+ <xs:annotation>
551
+ <xs:documentation>Total savings of emissions in kg of CO2 per m2 per year.</xs:documentation>
552
+ </xs:annotation>
553
+ </xs:element>
554
+ <xs:element name="Total-Energy-Savings" type="xs:float" minOccurs="1" maxOccurs="1">
555
+ <xs:annotation>
556
+ <xs:documentation>Total savings of energy consumption in kWh per m2 per year.</xs:documentation>
557
+ </xs:annotation>
558
+ </xs:element>
559
+ </xs:all>
560
+ </xs:complexType>
561
+ <xs:complexType name="Alternative-Improvements">
562
+ <xs:sequence>
563
+ <xs:element name="Alternative-Scenario" type="Measure" minOccurs="1" maxOccurs="unbounded"/>
564
+ <xs:element name="Total-Savings" type="Total-Savings" minOccurs="1" maxOccurs="1"/>
565
+ </xs:sequence>
566
+ </xs:complexType>
567
+ <xs:complexType name="Operational-Rating-System">
568
+ <xs:annotation>
569
+ <xs:documentation>Applicable if the improvement route selected is by displaying the operational rating.</xs:documentation>
570
+ </xs:annotation>
571
+ <xs:all>
572
+ <xs:element name="Display-Energy-Certificate" type="Flag" minOccurs="1" maxOccurs="1">
573
+ <xs:annotation>
574
+ <xs:documentation>Indicates whether a Display Energy Certificate is lodged in the Register and displayed in the building.</xs:documentation>
575
+ </xs:annotation>
576
+ </xs:element>
577
+ </xs:all>
578
+ </xs:complexType>
579
+ <xs:complexType name="Improvements-Completion">
580
+ <xs:all>
581
+ <xs:element name="Planned-Completion-Date" type="xs:date" minOccurs="0" maxOccurs="1">
582
+ <xs:annotation>
583
+ <xs:documentation>The date on which the implementation of the improvement measures is planned to have been completed.</xs:documentation>
584
+ </xs:annotation>
585
+ </xs:element>
586
+ <xs:element name="Actual-Completion-Date" type="xs:date" minOccurs="0" maxOccurs="1">
587
+ <xs:annotation>
588
+ <xs:documentation>The date on which the implementation of the improvement measures has actually been completed.</xs:documentation>
589
+ </xs:annotation>
590
+ </xs:element>
591
+ </xs:all>
592
+ </xs:complexType>
593
+ <xs:element name="Report-Data" type="Report-Data"/>
594
+ <xs:complexType name="Report-Data" abstract="true">
595
+ <xs:all/>
596
+ </xs:complexType>
597
+ <xs:element name="Action-Plan-Report" type="Action-Plan-Report"/>
598
+ <xs:complexType name="Action-Plan-Report">
599
+ <xs:annotation>
600
+ <xs:documentation>Section 63 Action Plan Report.</xs:documentation>
601
+ </xs:annotation>
602
+ <xs:sequence>
603
+ <xs:element name="TER-2002" type="xs:float" minOccurs="0" maxOccurs="1">
604
+ <xs:annotation>
605
+ <xs:documentation>Target Emission Rate defined by Section 6 of the 2002 building regulations, in kg of CO2 per m2 per year.</xs:documentation>
606
+ </xs:annotation>
607
+ </xs:element>
608
+ <xs:element name="Compliant-2002" type="Flag" minOccurs="1" maxOccurs="1">
609
+ <xs:annotation>
610
+ <xs:documentation>Indicates whether the actual building complies with the Target Emission Rate defined by Section 6 of the 2002 building regulations.</xs:documentation>
611
+ </xs:annotation>
612
+ </xs:element>
613
+ <xs:element name="Improvement-Type" type="Improvement-Type" minOccurs="1" maxOccurs="1">
614
+ <xs:annotation>
615
+ <xs:documentation>Improvement route selected for the building.</xs:documentation>
616
+ </xs:annotation>
617
+ </xs:element>
618
+ <xs:element name="Prescriptive-Improvements" type="Prescriptive-Improvements" minOccurs="1" maxOccurs="1"/>
619
+ <xs:element name="Alternative-Improvements" type="Alternative-Improvements" minOccurs="0" maxOccurs="1"/>
620
+ <xs:element name="Operational-Rating-System" type="Operational-Rating-System" minOccurs="0" maxOccurs="1"/>
621
+ <xs:element name="Improvements-Completion" type="Improvements-Completion" minOccurs="0" maxOccurs="1"/>
622
+ </xs:sequence>
623
+ </xs:complexType>
624
+ <xs:element name="Summary-Of-Performance" type="Summary-Of-Performance"/>
625
+ <xs:complexType name="Summary-Of-Performance">
626
+ <xs:sequence>
627
+ <xs:element name="Building-Data" type="Building-Data" minOccurs="1" maxOccurs="unbounded"/>
628
+ </xs:sequence>
629
+ </xs:complexType>
630
+ <xs:element name="Building-Data" type="Building-Data"/>
631
+ <xs:complexType name="Building-Data">
632
+ <xs:annotation>
633
+ <xs:documentation>
634
+ For a Section 63 Action Plan created using S63Gen, Building-Data is can be either two (for an Action Plan with the prescriptive scenario selected) or three (for an Action Plan with an altenative scenario selected), which are:- Actual Building (as-is), Building with prescriptive senario, and Building with alternative senario.
635
+ The type of Building Data is indicated by the Analysis-Type field.
636
+ </xs:documentation>
637
+ </xs:annotation>
638
+ <xs:all>
639
+ <xs:element name="Analysis-Type" type="AnalysisTypeCode"/>
640
+ <xs:element name="Area" type="xs:float"/>
641
+ <xs:element name="Area-Exterior" type="xs:float"/>
642
+ <xs:element name="Q50-Infiltration" type="xs:float"/>
643
+ <xs:element name="Weather" type="xs:string"/>
644
+ <xs:element name="Building-W-K" type="xs:float"/>
645
+ <xs:element name="Building-W-M2K" type="xs:float"/>
646
+ <xs:element name="Building-Alpha" type="xs:float"/>
647
+ <xs:element name="HVAC-Systems" type="HVAC-Systems"/>
648
+ <xs:element name="Global-Performance" type="Global-Performance"/>
649
+ <xs:element name="Activities" type="Activities"/>
650
+ <xs:element name="Primary-Energry-Indicator">
651
+ <xs:simpleType>
652
+ <xs:restriction base="xs:integer">
653
+ <xs:minInclusive value="1"/>
654
+ </xs:restriction>
655
+ </xs:simpleType>
656
+ </xs:element>
657
+ <xs:element name="Approximate-Energry-Use">
658
+ <xs:simpleType>
659
+ <xs:restriction base="xs:integer">
660
+ <xs:minInclusive value="1"/>
661
+ </xs:restriction>
662
+ </xs:simpleType>
663
+ </xs:element>
664
+ </xs:all>
665
+ </xs:complexType>
666
+ <xs:element name="Activity" type="Activity"/>
667
+ <xs:complexType name="Activity">
668
+ <xs:all>
669
+ <xs:element name="ID" type="xs:long"/>
670
+ <xs:element name="Area" type="xs:float"/>
671
+ </xs:all>
672
+ </xs:complexType>
673
+ <xs:element name="Activities" type="Activities"/>
674
+ <xs:complexType name="Activities">
675
+ <xs:sequence>
676
+ <xs:element name="Activity" type="Activity" maxOccurs="unbounded"/>
677
+ </xs:sequence>
678
+ </xs:complexType>
679
+ <xs:element name="HVAC-System-Data" type="HVAC-System-Data"/>
680
+ <xs:complexType name="HVAC-System-Data">
681
+ <xs:all>
682
+ <xs:element name="Area" type="xs:float"/>
683
+ <xs:element name="Heat-Source" type="xs:string"/>
684
+ <xs:element name="Type" type="xs:string"/>
685
+ <xs:element name="Fuel-Type" type="xs:string"/>
686
+ <xs:element name="Cooling-Gen-SEER" type="xs:float"/>
687
+ <xs:element name="Cooling-SSEER" type="xs:float"/>
688
+ <xs:element name="Heating-Gen-SEFF" type="xs:float"/>
689
+ <xs:element name="Heating-SSEFF" type="xs:float"/>
690
+ <xs:element name="KWH-M2-Auxiliary" type="xs:float"/>
691
+ <xs:element name="KWH-M2-Cooling" type="xs:float"/>
692
+ <xs:element name="KWH-M2-Heating" type="xs:float"/>
693
+ <xs:element name="MJ-M2-Heating-Dem" type="xs:float"/>
694
+ <xs:element name="MJ-M2-Cooling-Dem" type="xs:float"/>
695
+ <xs:element name="Activities" type="Activities"/>
696
+ </xs:all>
697
+ </xs:complexType>
698
+ <xs:element name="Global-Performance" type="Global-Performance"/>
699
+ <xs:complexType name="Global-Performance">
700
+ <xs:all>
701
+ <xs:element name="KWH-M2-Cooling" type="xs:float"/>
702
+ <xs:element name="KWH-M2-Heating" type="xs:float"/>
703
+ <xs:element name="KWH-M2-Auxiliary" type="xs:float"/>
704
+ <xs:element name="KWH-M2-Lighting" type="xs:float"/>
705
+ <xs:element name="KWH-M2-DHW" type="xs:float"/>
706
+ <xs:element name="KWH-M2-Equipment" type="xs:float"/>
707
+ <xs:element name="KWH-M2-Natural-Gas" type="xs:float"/>
708
+ <xs:element name="KWH-M2-Biogas" type="xs:float"/>
709
+ <xs:element name="KWH-M2-LPG" type="xs:float"/>
710
+ <xs:element name="KWH-M2-Coal" type="xs:float"/>
711
+ <xs:element name="KWH-M2-Oil" type="xs:float"/>
712
+ <xs:element name="KWH-M2-Anthracite" type="xs:float"/>
713
+ <xs:element name="KWH-M2-Smokeless" type="xs:float"/>
714
+ <xs:element name="KWH-M2-Biomass" type="xs:float"/>
715
+ <xs:element name="KWH-M2-Dual-Fuel" type="xs:float"/>
716
+ <xs:element name="KWH-M2-Supplied" type="xs:float"/>
717
+ <xs:element name="KWH-M2-Waste-Heat" type="xs:float"/>
718
+ <xs:element name="KWH-M2-Displaced" type="xs:float"/>
719
+ <xs:element name="KWH-M2-PVS" type="xs:float"/>
720
+ <xs:element name="KWH-M2-CHP" type="xs:float"/>
721
+ <xs:element name="KWH-M2-SES" type="xs:float"/>
722
+ <xs:element name="KWH-M2-Wind" type="xs:float"/>
723
+ <xs:element name="KWH-M2-District-Heating" type="xs:float"/>
724
+ </xs:all>
725
+ </xs:complexType>
726
+ <xs:element name="HVAC-Systems" type="HVAC-Systems"/>
727
+ <xs:complexType name="HVAC-Systems">
728
+ <xs:sequence>
729
+ <xs:element name="HVAC-System-Data" type="HVAC-System-Data" maxOccurs="unbounded"/>
730
+ </xs:sequence>
731
+ </xs:complexType>
732
+ <xs:simpleType name="AnalysisTypeCode">
733
+ <xs:restriction base="xs:string">
734
+ <xs:enumeration value="ACTUAL"/>
735
+ <xs:enumeration value="PRESCRIPTIVE"/>
736
+ <xs:enumeration value="ALTERNATIVE"/>
737
+ </xs:restriction>
738
+ </xs:simpleType>
739
+ <xs:element name="Input-Data" type="Input-Data"/>
740
+ <xs:complexType name="Input-Data" abstract="true">
741
+ <xs:sequence/>
742
+ </xs:complexType>
743
+ <xs:element name="Unstructured-Data" type="Unstructured-Data"/>
744
+ <xs:complexType name="Unstructured-Data">
745
+ <xs:annotation>
746
+ <xs:documentation>These are the specific data-items collected by the HI / EA needed to perform the SAP calculation.</xs:documentation>
747
+ </xs:annotation>
748
+ <xs:sequence>
749
+ <xs:element name="Data-Blob" type="Data-Blob" maxOccurs="unbounded"/>
750
+ </xs:sequence>
751
+ </xs:complexType>
752
+ <xs:element name="Data-Blob" type="Data-Blob"/>
753
+ <xs:complexType name="Data-Blob">
754
+ <xs:sequence>
755
+ <xs:element name="File-Location" type="xs:string" minOccurs="0"/>
756
+ <xs:element name="File-Name" type="xs:string" minOccurs="0"/>
757
+ <xs:element name="File-Type" type="xs:string" minOccurs="0"/>
758
+ <xs:element name="Secure-Hash" type="xs:string" minOccurs="0"/>
759
+ <xs:element name="Data" type="xs:base64Binary" minOccurs="0"/>
760
+ </xs:sequence>
761
+ </xs:complexType>
762
+ <xs:element name="LodgementReportRequest" type="LodgementReportRequest" />
763
+ <xs:complexType name="LodgementReportRequest">
764
+ <xs:sequence>
765
+ <xs:element name="Report" type="Report" minOccurs="1" maxOccurs="1" />
766
+ </xs:sequence>
767
+ </xs:complexType>
768
+ <xs:complexType name="Report">
769
+ <xs:sequence>
770
+ <xs:element name="Report-Header" type="Report-Header"/>
771
+ <xs:element name="Summary-Of-Performance" type="Summary-Of-Performance" minOccurs="0"/>
772
+ <xs:element name="Unstructured-Data" type="Unstructured-Data" minOccurs="0"/>
773
+ <xs:element name="Insurance-Details" type="Insurance-Details" minOccurs="0"/>
774
+ <xs:element name="Action-Plan-Report" type="Action-Plan-Report"/>
775
+ </xs:sequence>
776
+ </xs:complexType>
777
+ <xs:complexType name="Insurance-Details">
778
+ <xs:annotation>
779
+ <xs:documentation>
780
+ Details of the Professional Indemnity Insurance policy used to provide cover against a compensation claim against any particular Report.
781
+
782
+ A Report may be covered by an Professional Indemnity Insurance policy in one of three different ways:
783
+ * The Energy Assessor has personal Professional Indemnity Insurance and the Report is covered by this.
784
+ * The Report is covered by an umbrella Professional Indemnity Insurance policy held by the Report Supplier (the employer of the Energy Assessor) that assigned the inspection to the Energy Assessor.
785
+ * An individual insurance policy is taken out to cover the individual report such as the case where the property is unusual and falls outside the Energy Assessors normal Professional Indemnity Insurance policy.
786
+
787
+ A Energy Assessor may use any or all of these methods to providing Professional Indemnity Insurance for a Report on a case-by-case basis.
788
+ </xs:documentation>
789
+ </xs:annotation>
790
+ <xs:all>
791
+ <xs:element name="Insurer" type="xs:string">
792
+ <xs:annotation>
793
+ <xs:documentation>The name of the insurance company that underwrites / issued the insurance policy</xs:documentation>
794
+ </xs:annotation>
795
+ </xs:element>
796
+ <xs:element name="Policy-No" type="xs:string">
797
+ <xs:annotation>
798
+ <xs:documentation>The policy number of the insurance policy</xs:documentation>
799
+ </xs:annotation>
800
+ </xs:element>
801
+ <xs:element name="Effective-Date" type="xs:date">
802
+ <xs:annotation>
803
+ <xs:documentation>The date that the insurance policy becomes effective (commences cover)</xs:documentation>
804
+ </xs:annotation>
805
+ </xs:element>
806
+ <xs:element name="Expiry-Date" type="xs:date">
807
+ <xs:annotation>
808
+ <xs:documentation>The date that the insurance policy is supposed to expire.</xs:documentation>
809
+ </xs:annotation>
810
+ </xs:element>
811
+ <xs:element name="PI-Limit" type="xs:decimal">
812
+ <xs:annotation>
813
+ <xs:documentation>The upper limit of the Professional Indemnity cover provided by the insurance policy.</xs:documentation>
814
+ </xs:annotation>
815
+ </xs:element>
816
+ </xs:all>
817
+ </xs:complexType>
818
+ </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.1"
8
+ VERSION = "2.2.2"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -0,0 +1,56 @@
1
+ module Presenter
2
+ module Cs63
3
+ class CertificateSummary
4
+ TYPE_OF_ASSESSMENT = "CS63".freeze
5
+
6
+ def initialize(view_model)
7
+ @view_model = view_model
8
+ end
9
+
10
+ def to_certificate_summary
11
+ {
12
+ type_of_assessment: TYPE_OF_ASSESSMENT,
13
+ assessment_id: @view_model.assessment_id,
14
+ epc_assessment_id: @view_model.epc_assessment_id,
15
+ sale_lease_date: @view_model.sale_lease_date,
16
+ report_type: @view_model.report_type,
17
+ date_of_assessment: @view_model.assessment_date,
18
+ plan_report_date: @view_model.plan_report_date,
19
+ address: {
20
+ address_line1: @view_model.address_line1,
21
+ address_line2: @view_model.address_line2,
22
+ address_line3: @view_model.address_line3,
23
+ address_line4: @view_model.address_line4,
24
+ town: @view_model.town,
25
+ postcode: @view_model.postcode,
26
+ },
27
+ assessor: {
28
+ scheme_assessor_id: @view_model.scheme_assessor_id,
29
+ name: @view_model.assessor_name,
30
+ contact_details: {
31
+ email: @view_model.assessor_email,
32
+ telephone: @view_model.assessor_telephone,
33
+ trading_address: @view_model.trading_address,
34
+ },
35
+ company_name: @view_model.company_name,
36
+ status: @view_model.status,
37
+ },
38
+ owner_commission_report: @view_model.owner_commission_report,
39
+ delegated_person_commission_report: @view_model.delegated_person_commission_report,
40
+ property_type_short_description: @view_model.property_type_short_description,
41
+ property_type_long_description: @view_model.property_type_long_description,
42
+ building_improvements: @view_model.building_improvements,
43
+ operational_ratings: @view_model.operational_ratings,
44
+ dec: @view_model.dec,
45
+ planned_completion_date: @view_model.planned_completion_date,
46
+ actual_completion_date: @view_model.actual_completion_date,
47
+ target_emission_savings: @view_model.target_emission_savings,
48
+ target_energy_savings: @view_model.target_energy_savings,
49
+ accept_prescriptive_improvements: @view_model.accept_prescriptive_improvements,
50
+ prescriptive_improvements: @view_model.prescriptive_improvements,
51
+ alternative_improvements: @view_model.alternative_improvements,
52
+ }
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,7 @@
1
+ module Presenter
2
+ module Cs63
3
+ class ExportConfiguration < Presenter::ToWarehouse::BaseConfiguration
4
+ # configuration goes here
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,44 @@
1
+ module Presenter
2
+ module Cs63
3
+ class Summary
4
+ TYPE_OF_ASSESSMENT = "CS63".freeze
5
+
6
+ def initialize(view_model)
7
+ @view_model = view_model
8
+ end
9
+
10
+ def to_hash
11
+ {
12
+ type_of_assessment: TYPE_OF_ASSESSMENT,
13
+ assessment_id: @view_model.assessment_id,
14
+ date_of_expiry: @view_model.date_of_expiry,
15
+ report_type: @view_model.report_type,
16
+ date_of_assessment: @view_model.date_of_assessment,
17
+ date_of_registration: @view_model.date_of_registration,
18
+ address: {
19
+ address_id: @view_model.address_id,
20
+ address_line1: @view_model.address_line1,
21
+ address_line2: @view_model.address_line2,
22
+ address_line3: @view_model.address_line3,
23
+ address_line4: @view_model.address_line4,
24
+ town: @view_model.town,
25
+ postcode: @view_model.postcode,
26
+ },
27
+ related_rrn: @view_model.related_rrn,
28
+ assessor: {
29
+ scheme_assessor_id: @view_model.scheme_assessor_id,
30
+ name: @view_model.assessor_name,
31
+ contact_details: {
32
+ email: @view_model.assessor_email,
33
+ telephone: @view_model.assessor_telephone,
34
+ },
35
+ company_details: {
36
+ name: @view_model.company_name,
37
+ address: @view_model.trading_address,
38
+ },
39
+ },
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,195 @@
1
+ require "date"
2
+
3
+ module ViewModel
4
+ module Cs63
5
+ class CommonSchema < ViewModel::DomesticEpcViewModel
6
+ THRESHOLD_LOW_ENERGY_LIGHTING_EFFICACY = 65
7
+
8
+ def assessment_id
9
+ xpath(%w[Report-Header RRN])
10
+ end
11
+
12
+ def epc_assessment_id
13
+ xpath(%w[Report-Header EPC-RRN])
14
+ end
15
+
16
+ def sale_lease_date
17
+ xpath(%w[Report-Header Sale-Lease-Date])
18
+ end
19
+
20
+ def assessment_date
21
+ xpath(%w[Report-Header Assessment-Date])
22
+ end
23
+
24
+ def plan_report_date
25
+ xpath(%w[Report-Header Plan-Report-Date])
26
+ end
27
+
28
+ def report_type
29
+ xpath(%w[Report-Header Report-Type])
30
+ end
31
+
32
+ def address_line1
33
+ xpath(%w[Report-Header Property Address Address-Line-1])
34
+ end
35
+
36
+ def address_line2
37
+ xpath(%w[Report-Header Property Address Address-Line-2])
38
+ end
39
+
40
+ def address_line3
41
+ xpath(%w[Report-Header Property Address Address-Line-3])
42
+ end
43
+
44
+ def address_line4
45
+ xpath(%w[Report-Header Property Address Address-Line-4])
46
+ end
47
+
48
+ def town
49
+ xpath(%w[Report-Header Property Address Post-Town])
50
+ end
51
+
52
+ def postcode
53
+ xpath(%w[Report-Header Property Address Postcode])
54
+ end
55
+
56
+ def scheme_assessor_id
57
+ xpath(%w[Energy-Assessor Membership-Number]) or xpath(%w[Energy-Assessor Certificate-Number])
58
+ end
59
+
60
+ def assessor_name
61
+ xpath(%w[Energy-Assessor Name])
62
+ end
63
+
64
+ # def approved_organisation_name
65
+ # xpath(%w[Energy-Assessor Approved-Organisation-Name])
66
+ # end
67
+ #
68
+ # def approved_organisation_web_address
69
+ # xpath(%w[Energy-Assessor Approved-Organisation-Name])
70
+ # end
71
+
72
+ def trading_address
73
+ xpath(%w[Energy-Assessor Trading-Address])
74
+ end
75
+
76
+ def company_name
77
+ xpath(%w[Energy-Assessor Company-Name])
78
+ end
79
+
80
+ def status
81
+ xpath(%w[Energy-Assessor Status])
82
+ end
83
+
84
+ def assessor_email
85
+ xpath(%w[Energy-Assessor/E-Mail])
86
+ end
87
+
88
+ def assessor_telephone
89
+ xpath(%w[Energy-Assessor/Telephone-Number])
90
+ end
91
+
92
+ def address_id
93
+ xpath(%w[UPRN])
94
+ end
95
+
96
+ # def type_of_assessment
97
+ # "CS63"
98
+ # end
99
+
100
+ def owner_commission_report
101
+ xpath(%w[Owner-Commission-Report])
102
+ end
103
+
104
+ def delegated_person_commission_report
105
+ xpath(%w[Delegated-Person-Commission-Report])
106
+ end
107
+
108
+ def property_type_short_description
109
+ xpath(%w[Property-Type Short-Description])
110
+ end
111
+
112
+ def property_type_long_description
113
+ xpath(%w[Property-Type Long-Description])
114
+ end
115
+
116
+ def building_improvements
117
+ xpath(%w[Improvement-Type Building-Improvements])
118
+ end
119
+
120
+ def operational_ratings
121
+ xpath(%w[Improvement-Type Operational-Rating])
122
+ end
123
+
124
+ def dec
125
+ xpath(%w[Operational-Rating-System Display-Energy-Certificate])
126
+ end
127
+
128
+ def planned_completion_date
129
+ xpath(%w[Improvements-Completion Planned-Completion-Date])
130
+ end
131
+
132
+ def actual_completion_date
133
+ xpath(%w[Improvements-Completion Actual-Completion-Date])
134
+ end
135
+
136
+ def target_emission_savings
137
+ xpath(%w[Target-Savings Target-Emission-Savings])
138
+ end
139
+
140
+ def target_energy_savings
141
+ xpath(%w[Target-Savings Target-Energy-Savings])
142
+ end
143
+
144
+ def accept_prescriptive_improvements
145
+ xpath(%w[Prescriptive-Improvements Accept-Prescriptive-Improvements])
146
+ end
147
+
148
+ def prescriptive_improvements
149
+ @xml_doc
150
+ .search("Prescriptive-Improvements Prescriptive-Scenario")
151
+ .map do |node|
152
+ {
153
+ measure_description_short:
154
+ xpath(%w[Measure-Description-Short], node),
155
+ measure_description_long:
156
+ xpath(%w[Measure-Description-Long], node),
157
+ measure_valid: xpath(%w[Measure-Valid], node),
158
+ measure_type: xpath(%w[Measure-Type], node),
159
+ }
160
+ end
161
+ end
162
+
163
+ def alternative_improvements
164
+ @xml_doc
165
+ .search("Alternative-Improvements Alternative-Scenario")
166
+ .map do |node|
167
+ {
168
+ measure_description_short:
169
+ xpath(%w[Measure-Description-Short], node),
170
+ measure_description_long:
171
+ xpath(%w[Measure-Description-Long], node),
172
+ measure_valid: xpath(%w[Measure-Valid], node),
173
+ measure_type: xpath(%w[Measure-Type], node),
174
+ }
175
+ end
176
+ end
177
+
178
+ def date_of_registration
179
+ xpath(%w[Report-Header Plan-Report-Date])
180
+ end
181
+
182
+ def date_of_expiry
183
+ Date.parse(date_of_registration).next_month(42).to_s
184
+ end
185
+
186
+ def date_of_assessment
187
+ xpath(%w[Report-Header Assessment-Date])
188
+ end
189
+
190
+ def related_rrn
191
+ nil
192
+ end
193
+ end
194
+ end
195
+ end
@@ -0,0 +1,28 @@
1
+ module ViewModel
2
+ class Cs63Wrapper
3
+ attr_reader :view_model
4
+
5
+ def initialize(xml_doc, _schema_type, _additional_data = {})
6
+ @view_model = ViewModel::Cs63::CommonSchema.new xml_doc
7
+ # @view_model = build_view_model(xml_doc, schema_type)
8
+ @summary = Presenter::Cs63::Summary.new(view_model)
9
+ @certificate_summary = Presenter::Cs63::CertificateSummary.new(view_model)
10
+ end
11
+
12
+ def type
13
+ :CS63
14
+ end
15
+
16
+ def to_hash
17
+ @summary.to_hash
18
+ end
19
+
20
+ def to_certificate_summary
21
+ @certificate_summary.to_certificate_summary
22
+ end
23
+
24
+ def get_view_model
25
+ view_model
26
+ end
27
+ end
28
+ end
@@ -2,6 +2,9 @@
2
2
 
3
3
  module ViewModel
4
4
  class Factory
5
+ TYPES_OF_CS63 = %i[
6
+ CS63-S-7.0
7
+ ].freeze
5
8
  TYPES_OF_CEPC = %i[
6
9
  CEPC-8.0.0
7
10
  CEPC-NI-8.0.0
@@ -105,6 +108,8 @@ module ViewModel
105
108
  elsif TYPES_OF_SAP.include?(schema_type)
106
109
  report_type = xml_doc.at("Report-Type")&.content
107
110
  ViewModel::SapWrapper.new(xml_doc, schema_type, report_type, additional_data)
111
+ elsif TYPES_OF_CS63.include?(schema_type)
112
+ ViewModel::Cs63Wrapper.new(xml_doc, schema_type, additional_data)
108
113
  end
109
114
  end
110
115
  end
@@ -27,6 +27,8 @@ module ViewModelGateway
27
27
  rdsap_xsd_files
28
28
  when "cepc"
29
29
  cepc_xsd_files
30
+ when "cs63"
31
+ cd63_xsd_files
30
32
  end
31
33
  else
32
34
  @glob_path = "#{@dir_path}#{@xsd_dir_path}"
@@ -58,5 +60,10 @@ module ViewModelGateway
58
60
  @glob_path = "#{@dir_path + XSD_DEFAULT_PATH}Reported-Data.xsd"
59
61
  Dir.glob(@glob_path)
60
62
  end
63
+
64
+ def cs63_xsd_files
65
+ @glob_path = "#{@dir_path + XSD_DEFAULT_PATH}ActionPlan.xsd"
66
+ Dir.glob(@glob_path)
67
+ end
61
68
  end
62
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epb_view_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MHCLG Energy Performance of Buildings
@@ -170,6 +170,7 @@ files:
170
170
  - api/schemas/xml/CEPC-S-7.1/Reports/Report-Header.xsd
171
171
  - api/schemas/xml/CEPC-S-7.1/Reports/Reported-Data.xsd
172
172
  - api/schemas/xml/CEPC-S-7.1/Reports/UserManagement.xsd
173
+ - api/schemas/xml/CS63-S-7.0/ActionPlan.xsd
173
174
  - api/schemas/xml/RdSAP-Schema-17.0/RdSAP/ExternalDefinitions.xml
174
175
  - api/schemas/xml/RdSAP-Schema-17.0/RdSAP/ExternalDefinitions.xsd
175
176
  - api/schemas/xml/RdSAP-Schema-17.0/RdSAP/Templates/AssessorManagement.xsd
@@ -1577,6 +1578,9 @@ files:
1577
1578
  - lib/presenter/cepc_rr/export_configuration.rb
1578
1579
  - lib/presenter/cepc_rr/recommendation_report.rb
1579
1580
  - lib/presenter/cepc_rr/summary.rb
1581
+ - lib/presenter/cs63/certificate_summary.rb
1582
+ - lib/presenter/cs63/export_configuration.rb
1583
+ - lib/presenter/cs63/summary.rb
1580
1584
  - lib/presenter/dec/export_configuration.rb
1581
1585
  - lib/presenter/dec/report.rb
1582
1586
  - lib/presenter/dec/summary.rb
@@ -1667,6 +1671,8 @@ files:
1667
1671
  - lib/view_model/cepc_rr_wrapper.rb
1668
1672
  - lib/view_model/cepc_s_71/cepc.rb
1669
1673
  - lib/view_model/cepc_wrapper.rb
1674
+ - lib/view_model/cs63/common_schema.rb
1675
+ - lib/view_model/cs63_wrapper.rb
1670
1676
  - lib/view_model/dec_rr_wrapper.rb
1671
1677
  - lib/view_model/dec_summary_wrapper.rb
1672
1678
  - lib/view_model/dec_wrapper.rb