Class: SavedClaim::Pension

Inherits:
SavedClaim show all
Defined in:
app/models/saved_claim/pension.rb

Constant Summary collapse

FORM =
'21P-527EZ'

Instance Method Summary collapse

Methods inherited from SavedClaim

add_form_and_validation, #confirmation_number, #form_is_string, #form_matches_schema, #form_must_be_string, #open_struct_form, #parsed_form, #process_attachments!, #submit_to_structured_data_services!, #submitted_at, #to_pdf, #update_form

Methods inherited from ApplicationRecord

descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?

Instance Method Details

#attachment_keysObject



12
13
14
# File 'app/models/saved_claim/pension.rb', line 12

def attachment_keys
  [:files].freeze
end

#emailObject



16
17
18
# File 'app/models/saved_claim/pension.rb', line 16

def email
  parsed_form['email']
end

#regional_officeObject



8
9
10
# File 'app/models/saved_claim/pension.rb', line 8

def regional_office
  PensionBurial::ProcessingOffice.address_for(open_struct_form.veteranAddress.postalCode)
end

#send_confirmation_emailObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/models/saved_claim/pension.rb', line 20

def send_confirmation_email
  return if email.blank?

  VANotify::EmailJob.perform_async(
    email,
    Settings.vanotify.services.va_gov.template_id.form527ez_confirmation_email,
    {
      'first_name' => parsed_form.dig('veteranFullName', 'first')&.upcase.presence,
      'date_submitted' => Time.zone.today.strftime('%B %d, %Y'),
      'confirmation_number' => guid
    }
  )
end

#upload_to_lighthouseObject

Send this Pension claim to the Lighthouse Benefit Intake API developer.va.gov/explore/api/benefits-intake/docs



37
38
39
# File 'app/models/saved_claim/pension.rb', line 37

def upload_to_lighthouse
  Lighthouse::PensionBenefitIntakeJob.perform_async(id)
end