epb_view_models 2.2.12 → 2.2.13

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: ff10125eacd9b91fc1954def6349f5f94afd5f3066a066c0346fa14628fc2ead
4
- data.tar.gz: f0076f0b3a96328121efa7884f2d6e229b76fc477accfa505f32bde80edcdbf1
3
+ metadata.gz: cfad5c567761f739018096a595681262b5a09a126a8df371c284d2775f968181
4
+ data.tar.gz: c404a439cae5c169165abc5932e740b9bbed47c9685f867190285b784866e5cd
5
5
  SHA512:
6
- metadata.gz: 355767e1ec7327969f5e913d211602f28199919c9f4446a543091c400069c93ce0ecdfdd7d4a283df41cd2536ccba7f0ec44b05fddac9655f837e2100d49de5d
7
- data.tar.gz: 2bfbc39036bc745c0617f327927061904398dffcd566192a2bfa8f4c9bd72530a2aab91be66b04ea71626e04b3ac0fab666c7188bdfa3e8ea83367df2e07007b
6
+ metadata.gz: d8b240543825514e005533874580ba28beb101bce383880ffda39dffa21585a39a923a1bc24558748cf0290a78889603491627245b812cb83ec68d4ee6052c29
7
+ data.tar.gz: 69de0c2827d73b37b75ab93e669983d4cb3f50fec1aa1a880cc6fda73ddf22226943df643ad1452c007901874e1ce76e7ce87fa6f754ff8cdc5f7a4fe6ec28f2
@@ -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.12"
8
+ VERSION = "2.2.13"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -171,6 +171,14 @@ module ViewModel
171
171
  def insurer_pi_limit
172
172
  xpath(%w[PI-Limit])
173
173
  end
174
+
175
+ def inspection_date
176
+ xpath(%w[Inspection-Date])
177
+ end
178
+
179
+ def completion_date
180
+ xpath(%w[Completion-Date])
181
+ end
174
182
  end
175
183
  end
176
184
  end
@@ -53,6 +53,10 @@ module ViewModel
53
53
  xpath(%w[Registration-Date])
54
54
  end
55
55
 
56
+ def date_of_completion
57
+ xpath(%w[Completion-Date])
58
+ end
59
+
56
60
  def address_id
57
61
  "LPRN-#{xpath(%w[UPRN])}"
58
62
  end
@@ -528,6 +532,33 @@ module ViewModel
528
532
  def has_cylinder_thermostat
529
533
  xpath(%w[Cylinder-Thermostat])
530
534
  end
535
+
536
+ def party_wall_construction
537
+ xpath(%w[SAP-Building-Part Party-Wall-Construction])
538
+ end
539
+
540
+ def party_walls_construction
541
+ @xml_doc
542
+ .search("SAP-Building-Part")
543
+ .map do |node|
544
+ xpath(%w[Party-Wall-Construction], node)
545
+ end
546
+ end
547
+
548
+ def walls_thickness
549
+ @xml_doc
550
+ .search("SAP-Building-Part")
551
+ .map do |node|
552
+ {
553
+ alternative_wall_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness")&.content,
554
+ alternative_wall_thickness_measured: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness-Measured")&.content,
555
+ alternative_wall_construction: node.at_xpath("SAP-Alternative-Wall/Wall-Construction")&.content,
556
+ wall_thickness: node.at_xpath("Wall-Thickness")&.content,
557
+ wall_construction: node.at_xpath("Wall-Construction")&.content,
558
+ wall_thickness_measured: node.at_xpath("Wall-Thickness-Measured")&.content,
559
+ }
560
+ end
561
+ end
531
562
  end
532
563
  end
533
564
  end
@@ -595,6 +595,29 @@ module ViewModel
595
595
  def electricity_smart_meter_present
596
596
  Helper::ToBool.execute(xpath(%w[Electricity-Smart-Meter-Present]))
597
597
  end
598
+
599
+ def date_of_completion
600
+ xpath(%w[Completion-Date])
601
+ end
602
+
603
+ def main_heating_types
604
+ @xml_doc
605
+ .search("SAP-Heating/Main-Heating-Details/Main-Heating")
606
+ .map do |node|
607
+ {
608
+ main_heating_code: xpath(%w[Main-Heating-Code]),
609
+ main_heating_index_number: xpath(%w[Main-Heating-Index-Number]),
610
+ }
611
+ end
612
+ end
613
+
614
+ def construction_years
615
+ @xml_doc
616
+ .search("SAP-Building-Part")
617
+ .map do |node|
618
+ xpath(%w[Construction-Year], node)
619
+ end
620
+ end
598
621
  end
599
622
  end
600
623
  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.12
4
+ version: 2.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - MHCLG Energy Performance of Buildings