Class: VBMS::SubmitDependentsPdfJob

Inherits:
Object
  • Object
show all
Includes:
SentryLogging, Sidekiq::Job
Defined in:
app/sidekiq/vbms/submit_dependents_pdf_job.rb

Defined Under Namespace

Classes: Invalid686cClaim

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SentryLogging

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

Instance Attribute Details

#claimObject (readonly)

Returns the value of attribute claim.



10
11
12
# File 'app/sidekiq/vbms/submit_dependents_pdf_job.rb', line 10

def claim
  @claim
end

Instance Method Details

#perform(saved_claim_id, va_file_number_with_payload, submittable_686_form, submittable_674_form) ⇒ Object

Generates PDF for 686c form and uploads to VBMS



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/sidekiq/vbms/submit_dependents_pdf_job.rb', line 18

def perform(saved_claim_id, va_file_number_with_payload, submittable_686_form, submittable_674_form)
  Rails.logger.info('VBMS::SubmitDependentsPdfJob running!', { saved_claim_id: })
  @claim = SavedClaim::DependencyClaim.find(saved_claim_id)
  claim.add_veteran_info(va_file_number_with_payload)

  raise Invalid686cClaim unless claim.valid?(:run_686_form_jobs)

  upload_attachments

  generate_pdf(submittable_686_form, submittable_674_form)
  Rails.logger.info('VBMS::SubmitDependentsPdfJob succeeded!', { saved_claim_id: })
rescue => e
  Rails.logger.warn('VBMS::SubmitDependentsPdfJob failed, retrying...', { saved_claim_id:, error: e.message })
  send_error_to_sentry(e, saved_claim_id)
  @saved_claim_id = saved_claim_id
  raise
end