Class: DecisionReview::Form4142Submit

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/sidekiq/decision_review/form4142_submit.rb

Constant Summary collapse

STATSD_KEY_PREFIX =
'worker.decision_review.form4142_submit'

Instance Method Summary collapse

Instance Method Details

#decrypt_form(encrypted_payload) ⇒ Object



16
17
18
# File 'app/sidekiq/decision_review/form4142_submit.rb', line 16

def decrypt_form(encrypted_payload)
  JSON.parse(KmsEncrypted::Box.new.decrypt(encrypted_payload))
end

#perform(appeal_submission_id, encrypted_payload, submitted_appeal_uuid) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/sidekiq/decision_review/form4142_submit.rb', line 20

def perform(appeal_submission_id, encrypted_payload, )
  decision_review_service.process_form4142_submission(appeal_submission_id:,
                                                      rejiggered_payload: decrypt_form(encrypted_payload))
  StatsD.increment("#{STATSD_KEY_PREFIX}.success")
rescue => e
  StatsD.increment("#{STATSD_KEY_PREFIX}.error")
  ::Rails.logger.error({
                         error_message: e.message,
                         form_id: DecisionReviewV1::FORM4142_ID,
                         parent_form_id: DecisionReviewV1::SUPP_CLAIM_FORM_ID,
                         message: 'Supplemental Claim Form4142 Queued Job Errored',
                         appeal_submission_id:,
                         lighthouse_submission: {
                           id: 
                         }
                       })
  raise e
end