Skip to content

Commit

Permalink
Refactor status check job for decision review forms (#19426)
Browse files Browse the repository at this point in the history
* Extract shared code for appeal status updates
* Centralize handling of evidence and secondary forms
* Use better associations
* Update job names in cron entries
  • Loading branch information
kayline authored Nov 18, 2024
1 parent 9085870 commit 8421bb4
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 279 deletions.
41 changes: 41 additions & 0 deletions app/sidekiq/decision_review/hlr_status_updater_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

require_relative 'saved_claim_status_updater_job'

module DecisionReview
class HlrStatusUpdaterJob < SavedClaimStatusUpdaterJob
private

def records_to_update
@higher_level_reviews ||= ::SavedClaim::HigherLevelReview.where(delete_date: nil).order(created_at: :asc)
end

def statsd_prefix
'worker.decision_review.saved_claim_hlr_status_updater'
end

def log_prefix
'DecisionReview::SavedClaimHlrStatusUpdaterJob'
end

def service_tag
'service:higher-level-review'
end

def get_record_status(guid)
decision_review_service.get_higher_level_review(guid).body
end

def evidence?
false
end

def secondary_forms?
false
end

def enabled?
Flipper.enabled? :decision_review_saved_claim_hlr_status_updater_job_enabled
end
end
end
45 changes: 45 additions & 0 deletions app/sidekiq/decision_review/nod_status_updater_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: true

require_relative 'saved_claim_status_updater_job'

module DecisionReview
class NodStatusUpdaterJob < SavedClaimStatusUpdaterJob
private

def records_to_update
@notice_of_disagreements ||= ::SavedClaim::NoticeOfDisagreement.where(delete_date: nil).order(created_at: :asc)
end

def statsd_prefix
'worker.decision_review.saved_claim_nod_status_updater'
end

def log_prefix
'DecisionReview::SavedClaimNodStatusUpdaterJob'
end

def service_tag
'service:board-appeal'
end

def get_record_status(guid)
decision_review_service.get_notice_of_disagreement(guid).body
end

def get_evidence_status(guid)
decision_review_service.get_notice_of_disagreement_upload(guid:).body
end

def evidence?
true
end

def secondary_forms?
false
end

def enabled?
Flipper.enabled? :decision_review_saved_claim_nod_status_updater_job_enabled
end
end
end
85 changes: 0 additions & 85 deletions app/sidekiq/decision_review/saved_claim_hlr_status_updater_job.rb

This file was deleted.

137 changes: 0 additions & 137 deletions app/sidekiq/decision_review/saved_claim_nod_status_updater_job.rb

This file was deleted.

Loading

0 comments on commit 8421bb4

Please sign in to comment.