epb_view_models 1.0.3 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/api/schemas/xml/RdSAP-Schema-NI-19.0/RdSAP/Templates/EPC-CollectedData.xsd +13 -12
  4. data/lib/epb_view_models.rb +1 -1
  5. data/lib/helper/energy_band_calculator.rb +1 -1
  6. data/lib/helper/xml_enums_to_output.rb +339 -129
  7. data/lib/presenter/export/domestic.rb +1 -1
  8. data/lib/presenter/rd_sap/report.rb +21 -11
  9. data/lib/presenter/sap/report.rb +18 -6
  10. data/lib/presenter/sap/summary.rb +1 -1
  11. data/lib/view_model/domestic_epc_view_model.rb +4 -0
  12. data/lib/view_model/rd_sap_schema_200/common_schema.rb +0 -4
  13. data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +0 -4
  14. data/lib/view_model/sap_schema_102/common_schema.rb +5 -6
  15. data/lib/view_model/sap_schema_102/rdsap.rb +4 -0
  16. data/lib/view_model/sap_schema_110/common_schema.rb +0 -4
  17. data/lib/view_model/sap_schema_110/rdsap.rb +8 -0
  18. data/lib/view_model/sap_schema_110/sap.rb +8 -0
  19. data/lib/view_model/sap_schema_112/common_schema.rb +0 -4
  20. data/lib/view_model/sap_schema_112/rdsap.rb +8 -0
  21. data/lib/view_model/sap_schema_112/sap.rb +8 -0
  22. data/lib/view_model/sap_schema_120/common_schema.rb +0 -4
  23. data/lib/view_model/sap_schema_120/rdsap.rb +8 -0
  24. data/lib/view_model/sap_schema_120/sap.rb +8 -0
  25. data/lib/view_model/sap_schema_130/common_schema.rb +0 -4
  26. data/lib/view_model/sap_schema_130/rdsap.rb +8 -0
  27. data/lib/view_model/sap_schema_130/sap.rb +8 -0
  28. data/lib/view_model/sap_schema_140/common_schema.rb +0 -4
  29. data/lib/view_model/sap_schema_140/rdsap.rb +8 -0
  30. data/lib/view_model/sap_schema_140/sap.rb +8 -0
  31. data/lib/view_model/sap_schema_141/common_schema.rb +0 -4
  32. data/lib/view_model/sap_schema_141/rdsap.rb +8 -0
  33. data/lib/view_model/sap_schema_141/sap.rb +8 -0
  34. data/lib/view_model/sap_schema_142/common_schema.rb +0 -4
  35. data/lib/view_model/sap_schema_142/rdsap.rb +8 -0
  36. data/lib/view_model/sap_schema_142/sap.rb +8 -0
  37. data/lib/view_model/sap_schema_150/common_schema.rb +0 -4
  38. data/lib/view_model/sap_schema_150/rdsap.rb +8 -0
  39. data/lib/view_model/sap_schema_150/sap.rb +8 -0
  40. data/lib/view_model/sap_schema_160/common_schema.rb +0 -4
  41. data/lib/view_model/sap_schema_160/rdsap.rb +8 -0
  42. data/lib/view_model/sap_schema_160/sap.rb +8 -0
  43. data/lib/view_model/sap_schema_161/common_schema.rb +0 -4
  44. data/lib/view_model/sap_schema_161/rdsap.rb +8 -0
  45. data/lib/view_model/sap_schema_161/sap.rb +8 -0
  46. data/lib/view_model/sap_schema_162/common_schema.rb +0 -4
  47. data/lib/view_model/sap_schema_162/rdsap.rb +8 -0
  48. data/lib/view_model/sap_schema_162/sap.rb +8 -0
  49. data/lib/view_model/sap_schema_163/common_schema.rb +0 -4
  50. data/lib/view_model/sap_schema_163/rdsap.rb +8 -0
  51. data/lib/view_model/sap_schema_163/sap.rb +8 -0
  52. data/lib/view_model/sap_schema_170/common_schema.rb +4 -0
  53. data/lib/view_model/sap_schema_171/common_schema.rb +4 -0
  54. data/lib/view_model/sap_schema_1800/common_schema.rb +4 -4
  55. data/lib/view_model/sap_schema_ni_112/common_schema.rb +1 -5
  56. data/lib/view_model/sap_schema_ni_112/rdsap.rb +13 -0
  57. data/lib/view_model/sap_schema_ni_112/sap.rb +8 -0
  58. data/lib/view_model/sap_schema_ni_120/common_schema.rb +1 -5
  59. data/lib/view_model/sap_schema_ni_120/rdsap.rb +8 -0
  60. data/lib/view_model/sap_schema_ni_120/sap.rb +8 -0
  61. data/lib/view_model/sap_schema_ni_130/common_schema.rb +1 -5
  62. data/lib/view_model/sap_schema_ni_130/rdsap.rb +8 -0
  63. data/lib/view_model/sap_schema_ni_130/sap.rb +8 -0
  64. data/lib/view_model/sap_schema_ni_140/common_schema.rb +1 -5
  65. data/lib/view_model/sap_schema_ni_140/rdsap.rb +8 -0
  66. data/lib/view_model/sap_schema_ni_140/sap.rb +8 -0
  67. data/lib/view_model/sap_schema_ni_141/common_schema.rb +1 -5
  68. data/lib/view_model/sap_schema_ni_141/rdsap.rb +8 -0
  69. data/lib/view_model/sap_schema_ni_141/sap.rb +8 -0
  70. data/lib/view_model/sap_schema_ni_142/common_schema.rb +1 -5
  71. data/lib/view_model/sap_schema_ni_142/rdsap.rb +8 -0
  72. data/lib/view_model/sap_schema_ni_142/sap.rb +8 -0
  73. data/lib/view_model/sap_schema_ni_150/common_schema.rb +1 -5
  74. data/lib/view_model/sap_schema_ni_150/rdsap.rb +8 -0
  75. data/lib/view_model/sap_schema_ni_150/sap.rb +8 -0
  76. data/lib/view_model/sap_schema_ni_160/common_schema.rb +0 -4
  77. data/lib/view_model/sap_schema_ni_160/rdsap.rb +8 -0
  78. data/lib/view_model/sap_schema_ni_160/sap.rb +8 -0
  79. data/lib/view_model/sap_schema_ni_161/common_schema.rb +0 -4
  80. data/lib/view_model/sap_schema_ni_161/rdsap.rb +8 -0
  81. data/lib/view_model/sap_schema_ni_161/sap.rb +8 -0
  82. data/lib/view_model/sap_schema_ni_170/common_schema.rb +0 -4
  83. data/lib/view_model/sap_schema_ni_170/rdsap.rb +8 -0
  84. data/lib/view_model/sap_schema_ni_170/sap.rb +8 -0
  85. data/lib/view_model/sap_schema_ni_171/common_schema.rb +0 -4
  86. data/lib/view_model/sap_schema_ni_171/rdsap.rb +8 -0
  87. data/lib/view_model/sap_schema_ni_171/sap.rb +8 -0
  88. data/lib/view_model/sap_schema_ni_172/common_schema.rb +0 -4
  89. data/lib/view_model/sap_schema_ni_172/rdsap.rb +8 -0
  90. data/lib/view_model/sap_schema_ni_172/sap.rb +8 -0
  91. data/lib/view_model/sap_schema_ni_173/common_schema.rb +4 -0
  92. data/lib/view_model/sap_schema_ni_174/common_schema.rb +4 -0
  93. data/lib/view_model/sap_schema_ni_1800/common_schema.rb +4 -4
  94. metadata +2 -3
  95. data/.DS_Store +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80efe4147a186423dd6099c2c495e7f694580511670d9ee054257ddce5e887b8
4
- data.tar.gz: 51c6e4233b76f4a3959e73b9e8a2b01dd8d2ede3a363c1e292df66b2ee8c18eb
3
+ metadata.gz: e84293861022176f883ddae06d91d887da347b27ca44d9ed52ad2bb7135d0a53
4
+ data.tar.gz: 0cb5910f39ba8e6272c2427b3255346005e5c5636777334158a457f258807f71
5
5
  SHA512:
6
- metadata.gz: 88e7eb835ea70699291c21118ef0cab44da3e4423dff5032f1d9804b1d55f1014b90afc01ace5ba5bb4681bee1fd0e94e49c3b7095edef5eed2bc2940029a5e2
7
- data.tar.gz: a1accb23c50fab70d6404edf6f01e2ee8fb544b276b825f949df758471dd270b8887f90ff4e10fd9593373a2d0e14e0da4e719bb832e4be4550c877520db610c
6
+ metadata.gz: 243a54697bca19151c977439193fa2b2651235f4289a9c853916ba91d9237fed64e67ca4df8cd6351a77bae268ecdcc6b29e8ea55cb0b95887fd202703f33a39
7
+ data.tar.gz: 5e0182f480eef682e2b46c4335161ec1e68e3c3463f95ec5609ee7b6103cd8ba87f682da26c362d120ff3b884a21090fd6c3aa88761aa9c478277e3a96ed2f76
data/.gitignore CHANGED
@@ -6,7 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- .DS_Store
9
+ **/.DS_Store
10
10
  dump.rdb
11
11
 
12
12
  # rspec failure tracking
@@ -1,5 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <xs:schema xmlns="http://www.epbniregister.com/xsd/rdsap" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.epbniregister.com/xsd/rdsap" elementFormDefault="qualified" attributeFormDefault="unqualified" version="LIG-NI-19.0">
2
+ <xs:schema xmlns="http://www.epbniregister.com/xsd/rdsap" xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
+ targetNamespace="http://www.epbniregister.com/xsd/rdsap" elementFormDefault="qualified" attributeFormDefault="unqualified" version="LIG-NI-19.0">
3
4
  <xs:include schemaLocation="../UDT/SAP-Domains.xsd"/>
4
5
  <xs:element name="SAP-Data" type="SAP-Data"/>
5
6
  <xs:complexType name="SAP-Data">
@@ -17,7 +18,7 @@
17
18
  <xs:annotation>
18
19
  <xs:documentation>The building type of the Property e.g. Detached, Semi-Detached, Terrace etc.
19
20
 
20
- Together with the Property Type, the Build Form produces a structured description of the property.</xs:documentation>
21
+ Together with the Property Type, the Build Form produces a structured description of the property.</xs:documentation>
21
22
  </xs:annotation>
22
23
  </xs:element>
23
24
  <xs:element name="Multiple-Glazed-Proportion" type="Percentage" minOccurs="0">
@@ -48,9 +49,9 @@ Together with the Property Type, the Build Form produces a structured descriptio
48
49
  </xs:element>
49
50
  <xs:element name="Habitable-Room-Count" type="Count">
50
51
  <xs:annotation>
51
- <xs:documentation>Count of the number of habitable rooms within the property.
52
+ <xs:documentation>Count of the number of habitable rooms within the property.
52
53
 
53
- This is the number of Reception Rooms (including Living Rooms, Sitting Rooms, Dining Rooms), Bedrooms, Study and similar rooms but excludes hall, stairs, kitchen, utility rooms, bathrooms, cloakrooms, en-suites and similar rooms.</xs:documentation>
54
+ This is the number of Reception Rooms (including Living Rooms, Sitting Rooms, Dining Rooms), Bedrooms, Study and similar rooms but excludes hall, stairs, kitchen, utility rooms, bathrooms, cloakrooms, en-suites and similar rooms.</xs:documentation>
54
55
  </xs:annotation>
55
56
  </xs:element>
56
57
  <xs:element name="Heated-Room-Count" type="Count">
@@ -82,14 +83,14 @@ This is the number of Reception Rooms (including Living Rooms, Sitting Rooms, Di
82
83
  <xs:annotation>
83
84
  <xs:documentation>The number of Open Fireplaces in the Property.
84
85
 
85
- An Open Fireplace is a fireplace that still allows air to pass between the inside of the Property and the outside.</xs:documentation>
86
+ An Open Fireplace is a fireplace that still allows air to pass between the inside of the Property and the outside.</xs:documentation>
86
87
  </xs:annotation>
87
88
  </xs:element>
88
89
  <xs:element name="Property-Type" type="PropertyTypeCode">
89
90
  <xs:annotation>
90
91
  <xs:documentation>Describes the type of property such as House, Flat, Mansion, Maisonette etc.
91
92
 
92
- This is actually the type differentiator for Property but only a limited number of property types, notably Apartment and Apartment Block, have any specific characteristics and warrant their own definition.</xs:documentation>
93
+ This is actually the type differentiator for Property but only a limited number of property types, notably Apartment and Apartment Block, have any specific characteristics and warrant their own definition.</xs:documentation>
93
94
  </xs:annotation>
94
95
  </xs:element>
95
96
  <xs:element name="Solar-Water-Heating" type="Flag">
@@ -191,8 +192,8 @@ This is actually the type differentiator for Property but only a limited number
191
192
  <xs:annotation>
192
193
  <xs:documentation>Details of the significant building parts that comprise the main habitable building in the property. The main habitable area generally consists of a single main building but can over time be extended to include extensions such as new wings and additional storeys.
193
194
 
194
- For the purpose of calculating the overall Energy Assessment for the property details of each distinct Building Part, such as its construction, have to be gathered because different materials have different insulation ratings (obviously) which affects the overall rating.
195
- </xs:documentation>
195
+ For the purpose of calculating the overall Energy Assessment for the property details of each distinct Building Part, such as its construction, have to be gathered because different materials have different insulation ratings (obviously) which affects the overall rating.
196
+ </xs:documentation>
196
197
  </xs:annotation>
197
198
  <xs:sequence>
198
199
  <xs:element name="SAP-Integral-Conservatory" type="SAP-Integral-Conservatory" minOccurs="0"/>
@@ -564,7 +565,7 @@ For the purpose of calculating the overall Energy Assessment for the property de
564
565
  <xs:complexType name="SAP-Deselected-Improvements">
565
566
  <xs:annotation>
566
567
  <xs:documentation>There are 22 possible improvement measures, designated from A to V. This must record measures deselected by DEA
567
- (A to V is the full set, only E, N, U and V are considered at the moment for new build).</xs:documentation>
568
+ (A to V is the full set, only E, N, U and V are considered at the moment for new build).</xs:documentation>
568
569
  </xs:annotation>
569
570
  <xs:sequence>
570
571
  <xs:element name="Deselected-Improvement-Measure" type="SAP-ImprovementMeasureCode" maxOccurs="unbounded"/>
@@ -674,7 +675,7 @@ For the purpose of calculating the overall Energy Assessment for the property de
674
675
  <xs:element name="Emitter-Temperature" type="EmitterTemperatureCode" minOccurs="0">
675
676
  <xs:annotation>
676
677
  <xs:documentation>0, 1, 3 or 4 applicable to condensing boilers and heat pumps.
677
- Other systems NA.</xs:documentation>
678
+ Other systems NA.</xs:documentation>
678
679
  </xs:annotation>
679
680
  </xs:element>
680
681
  <xs:element name="MCS-Installed-Heat-Pump" type="xs:boolean" minOccurs="0">
@@ -716,7 +717,7 @@ Other systems NA.</xs:documentation>
716
717
  <xs:element name="Peak-Power" type="Measurement">
717
718
  <xs:annotation>
718
719
  <xs:documentation>Peak kW of photovoltaics (PVs) (kWp).
719
- If the total peak power has been apportioned between different dwellings within the same building, this is the kWp ascribed to the dwelling being assessed.</xs:documentation>
720
+ If the total peak power has been apportioned between different dwellings within the same building, this is the kWp ascribed to the dwelling being assessed.</xs:documentation>
720
721
  </xs:annotation>
721
722
  </xs:element>
722
723
  <xs:element name="Orientation" type="SAP-CompassDirectionCode">
@@ -1032,4 +1033,4 @@ If the total peak power has been apportioned between different dwellings within
1032
1033
  </xs:element>
1033
1034
  </xs:sequence>
1034
1035
  </xs:complexType>
1035
- </xs:schema>
1036
+ </xs:schema>
@@ -5,7 +5,7 @@ loader = Zeitwerk::Loader.for_gem
5
5
  loader.setup
6
6
 
7
7
  module EpbViewModels
8
- VERSION = "1.0.3"
8
+ VERSION = "1.0.7"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -21,7 +21,7 @@ module Helper
21
21
 
22
22
  def self.commercial(number)
23
23
  case number
24
- when proc { |n| n <= 0 }
24
+ when proc { |n| n <= -1 }
25
25
  "a+"
26
26
  when 0..25
27
27
  "a"