Class: Presenter::DecRr::CertificateSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/presenter/dec_rr/certificate_summary.rb

Instance Method Summary collapse

Constructor Details

#initialize(view_model) ⇒ CertificateSummary

Returns a new instance of CertificateSummary.



4
5
6
# File 'lib/presenter/dec_rr/certificate_summary.rb', line 4

def initialize(view_model)
  @view_model = view_model
end

Instance Method Details

#to_certificate_summaryObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/presenter/dec_rr/certificate_summary.rb', line 8

def to_certificate_summary
  {
    type_of_assessment: @view_model&.type_of_assessment,
    assessment_id: @view_model.assessment_id,
    report_type: @view_model.report_type,
    date_of_assessment: @view_model.date_of_assessment,
    date_of_expiry: @view_model.date_of_expiry,
    date_of_registration: @view_model.date_of_registration,
    address: {
      address_line1: @view_model.address_line1,
      address_line2: @view_model.address_line2,
      address_line3: @view_model.address_line3,
      address_line4: @view_model.address_line4,
      town: @view_model.town,
      postcode: @view_model.postcode,
    },
    assessor: {
      scheme_assessor_id: @view_model.scheme_assessor_id,
      name: @view_model.assessor_name,
      contact_details: {
        email: @view_model.assessor_email,
        telephone: @view_model.assessor_telephone,
      },
      company_details: {
        name: @view_model.company_name,
        address: @view_model.company_address,
      },
    },
    short_payback_recommendations:
      @view_model.short_payback_recommendations,
    medium_payback_recommendations:
      @view_model.medium_payback_recommendations,
    long_payback_recommendations: @view_model.long_payback_recommendations,
    other_payback_recommendations: @view_model.other_recommendations,
    technical_information: {
      building_environment: @view_model.building_environment,
      floor_area: @view_model.floor_area,
      occupier: @view_model.occupier,
      property_type: @view_model.property_type,
      renewable_sources: @view_model.renewable_sources,
      discounted_energy: @view_model.discounted_energy,
      inspection_type: @view_model.inspection_type,
    },
    administrative_information: {
      issue_date: @view_model.date_of_issue,
      calculation_tool: @view_model.calculation_tool,
    },
    site_service_one: @view_model.site_service_one,
    site_service_two: @view_model.site_service_two,
    site_service_three: @view_model.site_service_three,
    related_rrn: @view_model.related_rrn,
  }
end