Class: SavedClaim::EducationCareerCounselingClaim

Inherits:
CentralMailClaim show all
Includes:
SentryLogging
Defined in:
app/models/saved_claim/education_career_counseling_claim.rb

Constant Summary collapse

FORM =
'28-8832'

Instance Method Summary collapse

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

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, #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

#process_attachments!Object



25
26
27
28
29
30
31
# File 'app/models/saved_claim/education_career_counseling_claim.rb', line 25

def process_attachments!
  refs = attachment_keys.map { |key| Array(open_struct_form.send(key)) }.flatten
  files = PersistentAttachment.where(guid: refs.map(&:confirmationCode))
  files.find_each { |f| f.update(saved_claim_id: id) }

  CentralMail::SubmitSavedClaimJob.new.perform(id)
end

#regional_officeObject



7
8
9
# File 'app/models/saved_claim/education_career_counseling_claim.rb', line 7

def regional_office
  []
end

#send_to_central_mail!Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/models/saved_claim/education_career_counseling_claim.rb', line 11

def send_to_central_mail!
  form_copy = parsed_form

  if form_copy['veteranSocialSecurityNumber'].blank?
    claimant_info = parsed_form['claimantInformation']
    form_copy['veteranSocialSecurityNumber'] = claimant_info['ssn'] || claimant_info['veteranSocialSecurityNumber']

    update(form: form_copy.to_json)
  end

  log_message_to_sentry(guid, :warn, { attachment_id: guid }, { team: 'vfs-ebenefits' })
  process_attachments!
end