Class: EVSSClaimDetailSerializer

Inherits:
EVSSClaimBaseSerializer show all
Defined in:
app/serializers/evss_claim_detail_serializer.rb

Constant Summary

Constants inherited from EVSSClaimBaseSerializer

EVSSClaimBaseSerializer::PHASE_MAPPING

Instance Method Summary collapse

Methods inherited from EVSSClaimBaseSerializer

#claim_type, #current_phase_back, #ever_phase_back, #id, #open, #phase_from_keys, #requested_decision, #updated_at_nil?, #waiver_submitted

Instance Method Details

#contention_listObject



6
7
8
# File 'app/serializers/evss_claim_detail_serializer.rb', line 6

def contention_list
  object.data['contention_list']
end

#events_timelineObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/serializers/evss_claim_detail_serializer.rb', line 14

def events_timeline
  events = [
    create_event_from_string_date(:filed, 'date'),
    create_event_from_string_date(:completed, 'claim_complete_date')
  ]

  # Do the 8 phases
  (1..8).each do |n|
    events << create_event_from_string_date(
      "phase#{n}", 'claim_phase_dates', "phase#{n}_complete_date"
    )
  end

  # Add tracked items
  events += create_events_for_tracked_items

  # Add documents not associated with a tracked item
  events += create_events_for_documents

  # Make reverse chron with nil date items at the end
  events.compact.sort_by { |h| h[:date] || Date.new }.reverse
end

#phaseObject



37
38
39
# File 'app/serializers/evss_claim_detail_serializer.rb', line 37

def phase
  phase_from_keys 'claim_phase_dates', 'latest_phase_type'
end

#va_representativeObject



10
11
12
# File 'app/serializers/evss_claim_detail_serializer.rb', line 10

def va_representative
  sanitize_va_representative(object.data['poa'])
end