epb_view_models 2.2.15 → 2.2.16

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.
@@ -349,6 +349,7 @@ module ViewModel
349
349
  if fixed_lighting_outlets_count.zero?
350
350
  return 0
351
351
  end
352
+
352
353
  ((low_energy_fixed_lighting_outlets_count.to_f / fixed_lighting_outlets_count) * 100).round
353
354
  end
354
355
 
@@ -566,7 +567,7 @@ module ViewModel
566
567
  @xml_doc
567
568
  .search("SAP-Building-Part")
568
569
  .map do |node|
569
- xpath(%w[Party-Wall-Construction], node)
570
+ xpath(%w[Party-Wall-Construction], node)
570
571
  end
571
572
  end
572
573
 
@@ -574,16 +575,16 @@ module ViewModel
574
575
  @xml_doc
575
576
  .search("SAP-Building-Part")
576
577
  .map do |node|
577
- {
578
- alternative_wall_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness")&.content,
579
- alternative_wall_thickness_measured: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness-Measured")&.content,
580
- alternative_wall_construction: node.at_xpath("SAP-Alternative-Wall/Wall-Construction")&.content,
581
- alternative_wall_u_value: node.at_xpath("SAP-Alternative-Wall/Wall-U-Value")&.content,
582
- alternative_wall_insulation_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Insulation-Thickness")&.content,
583
- wall_thickness: node.at_xpath("Wall-Thickness")&.content,
584
- wall_construction: node.at_xpath("Wall-Construction")&.content,
585
- wall_thickness_measured: node.at_xpath("Wall-Thickness-Measured")&.content,
586
- }
578
+ {
579
+ alternative_wall_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness")&.content,
580
+ alternative_wall_thickness_measured: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness-Measured")&.content,
581
+ alternative_wall_construction: node.at_xpath("SAP-Alternative-Wall/Wall-Construction")&.content,
582
+ alternative_wall_u_value: node.at_xpath("SAP-Alternative-Wall/Wall-U-Value")&.content,
583
+ alternative_wall_insulation_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Insulation-Thickness")&.content,
584
+ wall_thickness: node.at_xpath("Wall-Thickness")&.content,
585
+ wall_construction: node.at_xpath("Wall-Construction")&.content,
586
+ wall_thickness_measured: node.at_xpath("Wall-Thickness-Measured")&.content,
587
+ }
587
588
  end
588
589
  end
589
590
 
@@ -591,10 +592,10 @@ module ViewModel
591
592
  @xml_doc
592
593
  .search("SAP-Building-Part")
593
594
  .map do |node|
594
- {
595
- roof_insulation_location: node.at_xpath("Roof-Insulation-Location")&.content,
596
- roof_construction: node.at_xpath("Roof-Construction")&.content,
597
- }
595
+ {
596
+ roof_insulation_location: node.at_xpath("Roof-Insulation-Location")&.content,
597
+ roof_construction: node.at_xpath("Roof-Construction")&.content,
598
+ }
598
599
  end
599
600
  end
600
601
 
@@ -606,10 +607,10 @@ module ViewModel
606
607
  @xml_doc
607
608
  .search("SAP-Building-Part")
608
609
  .map do |node|
609
- {
610
- floor_u_value: node.at_xpath("Floor-U-Value")&.content,
611
- floor_insulation_thickness: node.at_xpath("Floor-Insulation-Thickness")&.content,
612
- }
610
+ {
611
+ floor_u_value: node.at_xpath("Floor-U-Value")&.content,
612
+ floor_insulation_thickness: node.at_xpath("Floor-Insulation-Thickness")&.content,
613
+ }
613
614
  end
614
615
  end
615
616
 
@@ -617,13 +618,13 @@ module ViewModel
617
618
  @xml_doc
618
619
  .search("SAP-Building-Part")
619
620
  .map do |node|
620
- {
621
- roof_u_value: node.at_xpath("Roof-U-Value")&.content,
622
- roof_insulation_thickness: node.at_xpath("Roof-Insulation-Thickness")&.content,
623
- rafter_insulation_thickness: node.at_xpath("Rafter-Insulation-Thickness")&.content,
624
- flat_roof_insulation_thickness: node.at_xpath("Flat-Roof-Insulation-Thickness")&.content,
625
- sloping_ceiling_insulation_thickness: node.at_xpath("Sloping-Ceiling-Insulation-Thickness")&.content,
626
- }
621
+ {
622
+ roof_u_value: node.at_xpath("Roof-U-Value")&.content,
623
+ roof_insulation_thickness: node.at_xpath("Roof-Insulation-Thickness")&.content,
624
+ rafter_insulation_thickness: node.at_xpath("Rafter-Insulation-Thickness")&.content,
625
+ flat_roof_insulation_thickness: node.at_xpath("Flat-Roof-Insulation-Thickness")&.content,
626
+ sloping_ceiling_insulation_thickness: node.at_xpath("Sloping-Ceiling-Insulation-Thickness")&.content,
627
+ }
627
628
  end
628
629
  end
629
630
 
@@ -631,10 +632,10 @@ module ViewModel
631
632
  @xml_doc
632
633
  .search("SAP-Building-Part")
633
634
  .map do |node|
634
- {
635
- wall_u_value: node.at_xpath("Wall-U-Value")&.content,
636
- wall_insulation_thickness: node.at_xpath("Wall-Insulation-Thickness")&.content,
637
- }
635
+ {
636
+ wall_u_value: node.at_xpath("Wall-U-Value")&.content,
637
+ wall_insulation_thickness: node.at_xpath("Wall-Insulation-Thickness")&.content,
638
+ }
638
639
  end
639
640
  end
640
641
 
@@ -649,12 +650,12 @@ module ViewModel
649
650
  def main_heating_details
650
651
  @xml_doc
651
652
  .search("Main-Heating")
652
- .map do |node|
653
- {
654
- main_heating_index_number: xpath(%w[Main-Heating-Index-Number]),
655
- sap_main_heating_code: xpath(%w[SAP-Main-Heating-Code]),
656
- main_fuel_type: xpath(%w[Main-Fuel-Type]),
657
- }
653
+ .map do |_node|
654
+ {
655
+ main_heating_index_number: xpath(%w[Main-Heating-Index-Number]),
656
+ sap_main_heating_code: xpath(%w[SAP-Main-Heating-Code]),
657
+ main_fuel_type: xpath(%w[Main-Fuel-Type]),
658
+ }
658
659
  end
659
660
  end
660
661
 
@@ -87,6 +87,8 @@ module ViewModel
87
87
  ViewModel::RdSapSchemaS190::CommonSchema.new xml_doc
88
88
  when :"RdSAP-Schema-S-21.0"
89
89
  ViewModel::RdSapSchemaS210::CommonSchema.new xml_doc
90
+ when :"RdSAP-Schema-S-18.0"
91
+ ViewModel::RdSapSchemaS180::CommonSchema.new xml_doc
90
92
  else
91
93
  raise ArgumentError, "Unsupported schema type"
92
94
  end
@@ -51,10 +51,6 @@ module ViewModel
51
51
  xpath(%w[Registration-Date])
52
52
  end
53
53
 
54
- def date_of_completion
55
- xpath(%w[Completion-Date])
56
- end
57
-
58
54
  def address_id
59
55
  xpath(%w[UPRN])
60
56
  end
@@ -603,11 +599,11 @@ module ViewModel
603
599
  def main_heating_types
604
600
  @xml_doc
605
601
  .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
- }
602
+ .map do |_node|
603
+ {
604
+ main_heating_code: xpath(%w[Main-Heating-Code]),
605
+ main_heating_index_number: xpath(%w[Main-Heating-Index-Number]),
606
+ }
611
607
  end
612
608
  end
613
609
 
@@ -615,7 +611,7 @@ module ViewModel
615
611
  @xml_doc
616
612
  .search("SAP-Building-Part")
617
613
  .map do |node|
618
- xpath(%w[Construction-Year], node)
614
+ xpath(%w[Construction-Year], node)
619
615
  end
620
616
  end
621
617
  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.15
4
+ version: 2.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - MHCLG Energy Performance of Buildings
@@ -320,6 +320,17 @@ files:
320
320
  - api/schemas/xml/RdSAP-Schema-NI-21.0.1/RdSAP/Templates/RdSAP-Report.xsd
321
321
  - api/schemas/xml/RdSAP-Schema-NI-21.0.1/RdSAP/UDT/EPC-Domains.xsd
322
322
  - api/schemas/xml/RdSAP-Schema-NI-21.0.1/RdSAP/UDT/SAP-Domains.xsd
323
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/ExternalDefinitions.xml
324
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/ExternalDefinitions.xsd
325
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/AssessorManagement.xsd
326
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/EPC-Certificate.xsd
327
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/EPC-CollectedData.xsd
328
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/ExceptionList.xsd
329
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/Property.xsd
330
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/RdSAP-Report.xsd
331
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/Templates/ReportList.xsd
332
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/UDT/EPC-Domains.xsd
333
+ - api/schemas/xml/RdSAP-Schema-S-18.0/RdSAP/UDT/SAP-Domains.xsd
323
334
  - api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/ExternalDefinitions.xml
324
335
  - api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/ExternalDefinitions.xsd
325
336
  - api/schemas/xml/RdSAP-Schema-S-19.0/RdSAP/Templates/AssessorManagement.xsd
@@ -1716,6 +1727,7 @@ files:
1716
1727
  - lib/view_model/rd_sap_schema_ni_200/common_schema.rb
1717
1728
  - lib/view_model/rd_sap_schema_ni_210/common_schema.rb
1718
1729
  - lib/view_model/rd_sap_schema_ni_2101/common_schema.rb
1730
+ - lib/view_model/rd_sap_schema_s_180/common_schema.rb
1719
1731
  - lib/view_model/rd_sap_schema_s_190/common_schema.rb
1720
1732
  - lib/view_model/rd_sap_schema_s_210/common_schema.rb
1721
1733
  - lib/view_model/rd_sap_wrapper.rb