Class: EVSS::DisabilityCompensationForm::SubmitForm0781
- Extended by:
- Logging::ThirdPartyTransaction::MethodWrapper
- Defined in:
- app/sidekiq/evss/disability_compensation_form/submit_form0781.rb
Constant Summary collapse
- FORM_ID_0781 =
form id for PTSD
'21-0781'
- FORM_ID_0781A =
form id for PTSD Secondary to Personal Assault
'21-0781a'
- FORMS_METADATA =
{ FORM_ID_0781 => { docType: 'L228' }, FORM_ID_0781A => { docType: 'L229' } }.freeze
- STATSD_KEY_PREFIX =
'worker.evss.submit_form0781'
- RETRY =
Sidekiq has built in exponential back-off functionality for retries A max retry attempt of 10 will result in a run time of ~8 hours This job is invoked from 526 background job
10
Instance Attribute Summary collapse
-
#evss_claim_id ⇒ Object
readonly
Returns the value of attribute evss_claim_id.
-
#submission_id ⇒ Object
readonly
Returns the value of attribute submission_id.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#get_docs(submission_id, uuid) ⇒ Hash
This method generates the PDF documents but does NOT send them anywhere.
- #parsed_forms ⇒ Object
-
#perform(submission_id) ⇒ Object
Performs an asynchronous job for generating and submitting 0781 + 0781A PDF documents to VBMS.
Methods included from Logging::ThirdPartyTransaction::MethodWrapper
Methods included from Sidekiq::Form526JobStatusTracker::JobTracker
#job_success, #job_try, #non_retryable_error_handler, #retryable_error_handler, #with_tracking
Methods included from Sidekiq::Form526JobStatusTracker::BackupSubmission
#send_backup_submission_if_enabled
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Instance Attribute Details
#evss_claim_id ⇒ Object (readonly)
Returns the value of attribute evss_claim_id.
12 13 14 |
# File 'app/sidekiq/evss/disability_compensation_form/submit_form0781.rb', line 12 def evss_claim_id @evss_claim_id end |
#submission_id ⇒ Object (readonly)
Returns the value of attribute submission_id.
12 13 14 |
# File 'app/sidekiq/evss/disability_compensation_form/submit_form0781.rb', line 12 def submission_id @submission_id end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
12 13 14 |
# File 'app/sidekiq/evss/disability_compensation_form/submit_form0781.rb', line 12 def uuid @uuid end |
Instance Method Details
#get_docs(submission_id, uuid) ⇒ Hash
This method generates the PDF documents but does NOT send them anywhere. It just generates them to the filesystem and returns the path to them to be used by other methods.
but is passed along as the existing process_0781 function requires something here ‘type` (to discern between if it is a 0781 or 0781a form) and `file`, which is the generated file location
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'app/sidekiq/evss/disability_compensation_form/submit_form0781.rb', line 98 def get_docs(submission_id, uuid) @submission_id = submission_id @uuid = uuid file_type_and_file_objs = [] { 'form0781' => FORM_ID_0781, 'form0781a' => FORM_ID_0781A }.each do |form_type_key, actual_form_types| if parsed_forms[form_type_key].present? file_type_and_file_objs << { type: actual_form_types, file: process_0781(uuid, FORM_ID_0781, parsed_forms[form_type_key], upload: false) } end end file_type_and_file_objs end |
#parsed_forms ⇒ Object
115 116 117 |
# File 'app/sidekiq/evss/disability_compensation_form/submit_form0781.rb', line 115 def parsed_forms @parsed_forms ||= JSON.parse(submission.form_to_json(Form526Submission::FORM_0781)) end |
#perform(submission_id) ⇒ Object
Performs an asynchronous job for generating and submitting 0781 + 0781A PDF documents to VBMS
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'app/sidekiq/evss/disability_compensation_form/submit_form0781.rb', line 123 def perform(submission_id) @submission_id = submission_id Raven.(source: '526EZ-all-claims') super(submission_id) with_tracking('Form0781 Submission', submission.saved_claim_id, submission.id) do # process 0781 and 0781a if parsed_forms['form0781'].present? process_0781(submission.submitted_claim_id, FORM_ID_0781, parsed_forms['form0781']) end if parsed_forms['form0781a'].present? process_0781(submission.submitted_claim_id, FORM_ID_0781A, parsed_forms['form0781a']) end end rescue => e # Cannot move job straight to dead queue dynamically within an executing job # raising error for all the exceptions as sidekiq will then move into dead queue # after all retries are exhausted retryable_error_handler(e) raise e end |