Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APPEALS-61670: Update job to call 'distribute non genpop priority appeals' every time #23525

Open
wants to merge 9 commits into
base: feature/APPEALS-61385
Choose a base branch
from
2 changes: 1 addition & 1 deletion app/jobs/push_priority_appeals_to_judges_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PushPriorityAppealsToJudgesJob < CaseflowJob
application_attr :queue

def perform
unless use_by_docket_date?
if FeatureToggle.enabled?(:acd_ppj_distribute_not_genpop)
@tied_distributions = distribute_non_genpop_priority_appeals
end

Expand Down
4 changes: 3 additions & 1 deletion app/models/vacols/case_docket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,9 @@ def self.common_affinity_filter_logic(

genpop == "not_genpop" || reject_due_to_affinity?(appeal_affinities[appeal["bfkey"]], lever_value)
elsif lever_value == Constants.ACD_LEVERS.infinite
return if deciding_judge_ineligible_with_no_hearings_after_decision(appeal) || appeal["prev_deciding_judge"].nil?
return if
(deciding_judge_ineligible_with_no_hearings_after_decision(appeal) || appeal["prev_deciding_judge"].nil?) &&
genpop != "not_genpop"

appeal["prev_deciding_judge"] != judge_sattyid
elsif lever_value == Constants.ACD_LEVERS.omit
Expand Down
2 changes: 1 addition & 1 deletion app/services/slack_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def send_notification(msg, title = "", channel = DEFAULT_CHANNEL)
if url && (Rails.deploy_env?(:uat) || Rails.deploy_env?(:prodtest) || Rails.deploy_env?(:prod))
params = { body: slack_msg.to_json, headers: { "Content-Type" => "application/json" } }
http_service.post(url, params)
else
elsif Rails.deploy_env != :test
# rubocop:disable Rails/Output
Rails.logger.info(pp(slack_msg))
# rubocop:enable Rails/Output
Expand Down
21 changes: 14 additions & 7 deletions db/seeds/appeals_for_push_priority_job_distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def instantiate_judges
judge_one_large_previous_distribution
excluded_judge
ineligible_judge

# This user is not a judge in VACOLS in the seed data, so don't allow them to get cases in the PPJ
JudgeTeam.find_by(name: "BVAAWAKEFIELD")&.update!(accepts_priority_pushed_cases: false)
end

def tied_or_affinity_judges
Expand Down Expand Up @@ -181,13 +184,17 @@ def create_aoj_legacy_cases
def create_previous_distribtions
statistics = { batch_size: 10, info: "See related row in distribution_stats for additional stats" }
4.times do |n|
create(:distribution, :completed, :priority,
judge: judge_many_previous_distributions, completed_at: n.weeks.ago, statistics: statistics)
d = create(:distribution, :completed, :priority,
judge: judge_many_previous_distributions, completed_at: n.weeks.ago)

d.update!(statistics: statistics)
end

statistics = { batch_size: 100, info: "See related row in distribution_stats for additional stats" }
create(:distribution, :completed, :priority, :this_month,
judge: judge_one_large_previous_distribution, statistics: statistics)
d = create(:distribution, :completed, :priority, :this_month,
judge: judge_one_large_previous_distribution, statistics: statistics)

d.update!(statistics: statistics)
end

def create_direct_review_priority_not_genpop_cases
Expand Down Expand Up @@ -407,7 +414,7 @@ def create_legacy_priority_not_genpop_cases

def create_legacy_priority_genpop_cases
# no hearing type original AOD
create(:case, :type_original, :ready_for_distribution)
create(:case, :type_original, :aod, :ready_for_distribution)

tied_or_affinity_judges.each do |judge|
judge_staff = judge.vacols_staff
Expand Down Expand Up @@ -467,9 +474,9 @@ def create_aoj_legacy_priority_not_genpop_cases
# hearing before decision different deciding judge AOJ CAVC AOD affinity in window
create(:legacy_aoj_appeal, :aod, judge: other_judge_staff_record, attorney: attorney_staff_record, affinity_start_date: 3.days.ago, cavc: true, original_dec_judge_sattyid: judge_staff.sattyid)

# no hearings AOJ CAVC affinity in window
create(:legacy_aoj_appeal, :aod, judge: judge_staff, attorney: attorney_staff_record, tied_to: false, affinity_start_date: 3.days.ago)
# no hearings AOJ AOD affinity in window
create(:legacy_aoj_appeal, :aod, judge: judge_staff, attorney: attorney_staff_record, tied_to: false, affinity_start_date: 3.days.ago)
# no hearings AOJ CAVC affinity in window
create(:legacy_aoj_appeal, judge: judge_staff, attorney: attorney_staff_record, tied_to: false, affinity_start_date: 3.days.ago, cavc: true)
# no hearings AOJ CAVC AOD affinity in window
create(:legacy_aoj_appeal, :aod, judge: judge_staff, attorney: attorney_staff_record, tied_to: false, affinity_start_date: 3.days.ago, cavc: true)
Expand Down
Loading
Loading