epb_view_models 1.0.3 → 1.0.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 (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 +264 -114
  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 +19 -7
  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
@@ -92,6 +92,14 @@ module ViewModel
92
92
  def thermal_store
93
93
  nil
94
94
  end
95
+
96
+ def ventilation_type
97
+ nil
98
+ end
99
+
100
+ def water_heating_fuel
101
+ xpath(%w[Water-Heating-Fuel])
102
+ end
95
103
  end
96
104
  end
97
105
  end
@@ -36,6 +36,14 @@ module ViewModel
36
36
  def thermal_store
37
37
  xpath(%w[Thermal-Store])
38
38
  end
39
+
40
+ def ventilation_type
41
+ xpath(%w[Ventilation-Type])
42
+ end
43
+
44
+ def water_heating_fuel
45
+ xpath(%w[Water-Fuel-Type])
46
+ end
39
47
  end
40
48
  end
41
49
  end
@@ -243,10 +243,6 @@ module ViewModel
243
243
  xpath(%w[Secondary-Fuel-Type])
244
244
  end
245
245
 
246
- def water_heating_fuel
247
- xpath(%w[Water-Fuel-Type])
248
- end
249
-
250
246
  def type_of_assessment
251
247
  case xpath(%w[Report-Type]).to_i
252
248
  when 1
@@ -92,6 +92,14 @@ module ViewModel
92
92
  def thermal_store
93
93
  nil
94
94
  end
95
+
96
+ def ventilation_type
97
+ nil
98
+ end
99
+
100
+ def water_heating_fuel
101
+ xpath(%w[Water-Heating-Fuel])
102
+ end
95
103
  end
96
104
  end
97
105
  end
@@ -36,6 +36,14 @@ module ViewModel
36
36
  def thermal_store
37
37
  xpath(%w[Thermal-Store])
38
38
  end
39
+
40
+ def ventilation_type
41
+ xpath(%w[Ventilation-Type])
42
+ end
43
+
44
+ def water_heating_fuel
45
+ xpath(%w[Water-Fuel-Type])
46
+ end
39
47
  end
40
48
  end
41
49
  end
@@ -243,10 +243,6 @@ module ViewModel
243
243
  xpath(%w[Secondary-Fuel-Type])
244
244
  end
245
245
 
246
- def water_heating_fuel
247
- xpath(%w[Water-Fuel-Type])
248
- end
249
-
250
246
  def type_of_assessment
251
247
  case xpath(%w[Report-Type]).to_i
252
248
  when 1
@@ -92,6 +92,14 @@ module ViewModel
92
92
  def thermal_store
93
93
  nil
94
94
  end
95
+
96
+ def ventilation_type
97
+ nil
98
+ end
99
+
100
+ def water_heating_fuel
101
+ xpath(%w[Water-Heating-Fuel])
102
+ end
95
103
  end
96
104
  end
97
105
  end
@@ -36,6 +36,14 @@ module ViewModel
36
36
  def thermal_store
37
37
  xpath(%w[Thermal-Store])
38
38
  end
39
+
40
+ def ventilation_type
41
+ xpath(%w[Ventilation-Type])
42
+ end
43
+
44
+ def water_heating_fuel
45
+ xpath(%w[Water-Fuel-Type])
46
+ end
39
47
  end
40
48
  end
41
49
  end
@@ -243,10 +243,6 @@ module ViewModel
243
243
  xpath(%w[Secondary-Fuel-Type])
244
244
  end
245
245
 
246
- def water_heating_fuel
247
- xpath(%w[Water-Fuel-Type])
248
- end
249
-
250
246
  def type_of_assessment
251
247
  case xpath(%w[Report-Type]).to_i
252
248
  when 1
@@ -92,6 +92,14 @@ module ViewModel
92
92
  def thermal_store
93
93
  nil
94
94
  end
95
+
96
+ def ventilation_type
97
+ nil
98
+ end
99
+
100
+ def water_heating_fuel
101
+ xpath(%w[Water-Heating-Fuel])
102
+ end
95
103
  end
96
104
  end
97
105
  end
@@ -36,6 +36,14 @@ module ViewModel
36
36
  def thermal_store
37
37
  xpath(%w[Thermal-Store])
38
38
  end
39
+
40
+ def ventilation_type
41
+ xpath(%w[Ventilation-Type])
42
+ end
43
+
44
+ def water_heating_fuel
45
+ xpath(%w[Water-Fuel-Type])
46
+ end
39
47
  end
40
48
  end
41
49
  end
@@ -243,10 +243,6 @@ module ViewModel
243
243
  xpath(%w[Secondary-Fuel-Type])
244
244
  end
245
245
 
246
- def water_heating_fuel
247
- xpath(%w[Water-Fuel-Type])
248
- end
249
-
250
246
  def type_of_assessment
251
247
  case xpath(%w[Report-Type]).to_i
252
248
  when 1
@@ -96,6 +96,14 @@ module ViewModel
96
96
  def thermal_store
97
97
  nil
98
98
  end
99
+
100
+ def ventilation_type
101
+ nil
102
+ end
103
+
104
+ def water_heating_fuel
105
+ xpath(%w[Water-Heating-Fuel])
106
+ end
99
107
  end
100
108
  end
101
109
  end
@@ -45,6 +45,14 @@ module ViewModel
45
45
  def thermal_store
46
46
  xpath(%w[Thermal-Store])
47
47
  end
48
+
49
+ def ventilation_type
50
+ xpath(%w[Ventilation-Type])
51
+ end
52
+
53
+ def water_heating_fuel
54
+ xpath(%w[Water-Fuel-Type])
55
+ end
48
56
  end
49
57
  end
50
58
  end
@@ -234,10 +234,6 @@ module ViewModel
234
234
  xpath(%w[Secondary-Fuel-Type])
235
235
  end
236
236
 
237
- def water_heating_fuel
238
- xpath(%w[Water-Fuel-Type])
239
- end
240
-
241
237
  def type_of_assessment
242
238
  case xpath(%w[Report-Type]).to_i
243
239
  when 1
@@ -100,6 +100,14 @@ module ViewModel
100
100
  def thermal_store
101
101
  nil
102
102
  end
103
+
104
+ def ventilation_type
105
+ nil
106
+ end
107
+
108
+ def water_heating_fuel
109
+ xpath(%w[Water-Heating-Fuel])
110
+ end
103
111
  end
104
112
  end
105
113
  end
@@ -45,6 +45,14 @@ module ViewModel
45
45
  def thermal_store
46
46
  xpath(%w[Thermal-Store])
47
47
  end
48
+
49
+ def ventilation_type
50
+ xpath(%w[Ventilation-Type])
51
+ end
52
+
53
+ def water_heating_fuel
54
+ xpath(%w[Water-Fuel-Type])
55
+ end
48
56
  end
49
57
  end
50
58
  end
@@ -230,10 +230,6 @@ module ViewModel
230
230
  xpath(%w[Secondary-Fuel-Type])
231
231
  end
232
232
 
233
- def water_heating_fuel
234
- xpath(%w[Water-Fuel-Type])
235
- end
236
-
237
233
  def type_of_assessment
238
234
  case xpath(%w[Report-Type]).to_i
239
235
  when 1
@@ -100,6 +100,14 @@ module ViewModel
100
100
  def thermal_store
101
101
  nil
102
102
  end
103
+
104
+ def ventilation_type
105
+ nil
106
+ end
107
+
108
+ def water_heating_fuel
109
+ xpath(%w[Water-Heating-Fuel])
110
+ end
103
111
  end
104
112
  end
105
113
  end
@@ -45,6 +45,14 @@ module ViewModel
45
45
  def thermal_store
46
46
  xpath(%w[Thermal-Store])
47
47
  end
48
+
49
+ def ventilation_type
50
+ xpath(%w[Ventilation-Type])
51
+ end
52
+
53
+ def water_heating_fuel
54
+ xpath(%w[Water-Fuel-Type])
55
+ end
48
56
  end
49
57
  end
50
58
  end
@@ -230,10 +230,6 @@ module ViewModel
230
230
  xpath(%w[Secondary-Fuel-Type])
231
231
  end
232
232
 
233
- def water_heating_fuel
234
- xpath(%w[Water-Fuel-Type])
235
- end
236
-
237
233
  def type_of_assessment
238
234
  case xpath(%w[Report-Type]).to_i
239
235
  when 1
@@ -96,6 +96,14 @@ module ViewModel
96
96
  def thermal_store
97
97
  nil
98
98
  end
99
+
100
+ def ventilation_type
101
+ nil
102
+ end
103
+
104
+ def water_heating_fuel
105
+ xpath(%w[Water-Heating-Fuel])
106
+ end
99
107
  end
100
108
  end
101
109
  end
@@ -45,6 +45,14 @@ module ViewModel
45
45
  def thermal_store
46
46
  xpath(%w[Thermal-Store])
47
47
  end
48
+
49
+ def ventilation_type
50
+ xpath(%w[Ventilation-Type])
51
+ end
52
+
53
+ def water_heating_fuel
54
+ xpath(%w[Water-Fuel-Type])
55
+ end
48
56
  end
49
57
  end
50
58
  end
@@ -522,6 +522,10 @@ module ViewModel
522
522
  def thermal_store
523
523
  xpath(%w[Thermal-Store])
524
524
  end
525
+
526
+ def ventilation_type
527
+ xpath(%w[Ventilation-Type])
528
+ end
525
529
  end
526
530
  end
527
531
  end
@@ -522,6 +522,10 @@ module ViewModel
522
522
  def thermal_store
523
523
  xpath(%w[Thermal-Store])
524
524
  end
525
+
526
+ def ventilation_type
527
+ xpath(%w[Ventilation-Type])
528
+ end
525
529
  end
526
530
  end
527
531
  end
@@ -297,10 +297,6 @@ module ViewModel
297
297
  xpath(%w[Floor-Heat-Loss])
298
298
  end
299
299
 
300
- def water_heating_code
301
- xpath(%w[Water-Heating-Code])
302
- end
303
-
304
300
  def immersion_heating_type
305
301
  xpath(%w[Immersion-Heating-Type])
306
302
  end
@@ -582,6 +578,10 @@ module ViewModel
582
578
  def thermal_store
583
579
  xpath(%w[Thermal-Store])
584
580
  end
581
+
582
+ def ventilation_type
583
+ xpath(%w[Ventilation-Type])
584
+ end
585
585
  end
586
586
  end
587
587
  end
@@ -190,7 +190,7 @@ module ViewModel
190
190
  end
191
191
 
192
192
  def tenure
193
- xpath(%w[Tenure])
193
+ nil
194
194
  end
195
195
 
196
196
  def transaction_type
@@ -235,10 +235,6 @@ module ViewModel
235
235
  xpath(%w[Secondary-Fuel-Type])
236
236
  end
237
237
 
238
- def water_heating_fuel
239
- xpath(%w[Water-Fuel-Type])
240
- end
241
-
242
238
  def type_of_assessment
243
239
  case xpath(%w[Report-Type]).to_i
244
240
  when 1
@@ -97,9 +97,22 @@ module ViewModel
97
97
  nil
98
98
  end
99
99
 
100
+ # DO NOT CORRECT - this typo is present in the schema XML pre 12.0
101
+ def mechanical_ventilation
102
+ xpath(%w[Mechanical-Ventliation])
103
+ end
104
+
100
105
  def thermal_store
101
106
  nil
102
107
  end
108
+
109
+ def ventilation_type
110
+ nil
111
+ end
112
+
113
+ def water_heating_fuel
114
+ xpath(%w[Water-Heating-Fuel])
115
+ end
103
116
  end
104
117
  end
105
118
  end
@@ -28,6 +28,14 @@ module ViewModel
28
28
  def thermal_store
29
29
  xpath(%w[Thermal-Store])
30
30
  end
31
+
32
+ def ventilation_type
33
+ xpath(%w[Ventilation-Type])
34
+ end
35
+
36
+ def water_heating_fuel
37
+ xpath(%w[Water-Fuel-Type])
38
+ end
31
39
  end
32
40
  end
33
41
  end