Skip to content

Commit

Permalink
APPEALS-65174: Refactor ineligible judge list to not call to VACOLS o…
Browse files Browse the repository at this point in the history
…n app startup (#23537)

APPEALS-65174: Refactor ineligible judge list to not call to VACOLS on app startup
  • Loading branch information
craigrva authored Nov 18, 2024
2 parents b017ddc + eeb1945 commit 9641a6e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/queries/ineligible_judge_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class IneligibleJudgeList
}.freeze

EMPTY_KEY_VALUE = "No Key Present"
INACTIVE_VACOLS = CaseDistributionIneligibleJudges.ineligible_vacols_judges
INACTIVE_CASEFLOW = CaseDistributionIneligibleJudges.ineligible_caseflow_judges

def self.generate_rows(record)
HEADERS.keys.map { |key| record[key] }
Expand Down Expand Up @@ -47,9 +45,17 @@ def self.parse_record(record)
}
end

def self.inactive_caseflow
@inactive_caseflow ||= CaseDistributionIneligibleJudges.ineligible_caseflow_judges
end

def self.inactive_vacols
@inactive_vacols ||= CaseDistributionIneligibleJudges.ineligible_vacols_judges
end

def self.get_reason_for_ineligibility(css_id_value, sdomainid_value)
inactive_caseflow_user = INACTIVE_CASEFLOW.find { |caseflow_user| caseflow_user[:css_id] == css_id_value }
inactive_vacols_user = INACTIVE_VACOLS.find { |vacols_user| vacols_user[:sdomainid] == sdomainid_value }
inactive_caseflow_user = inactive_caseflow.find { |caseflow_user| caseflow_user[:css_id] == css_id_value }
inactive_vacols_user = inactive_vacols.find { |vacols_user| vacols_user[:sdomainid] == sdomainid_value }

@reason = if inactive_caseflow_user && inactive_vacols_user
"BOTH"
Expand Down

0 comments on commit 9641a6e

Please sign in to comment.