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-63207 Add a Task Action to move appeals from one attorney to another for decision drafting #23591

Open
wants to merge 9 commits into
base: feature/APPEALS-60032
Choose a base branch
from
10 changes: 10 additions & 0 deletions app/models/legacy_tasks/attorney_legacy_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ def available_actions(current_user, role)
Constants.TASK_ACTIONS.SUBMIT_OMO_REQUEST_FOR_REVIEW.to_h,
Constants.TASK_ACTIONS.ADD_ADMIN_ACTION.to_h]

if SpecialCaseMovementTeam.singleton.user_has_access?(current_user) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should use .can_act_on_behalf_of_judges? from the User model here instead of user_has_access?. They are functionally similar, but can_act_on_behalf_of_judges? is a more semantic/clear way of writing it to explain why the user has access to that action.

legacy_atty_to_atty_special_case_movement(current_user)
actions << Constants.TASK_ACTIONS.ASSIGN_TO_ATTORNEY.to_h
end

actions
end

Expand All @@ -23,4 +28,9 @@ def timeline_title
def label
COPY::ATTORNEY_TASK_LABEL
end

def legacy_atty_to_atty_special_case_movement(user)
FeatureToggle.enabled?(:legacy_case_movement_atty_to_atty_for_decisiondraft, user: user) &&
appeal.tasks.open.where(type: AttorneyLegacyTask.name) && appeal.is_a?(LegacyAppeal)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There won't be an AttorneyLegacyTask for the legacy appeals. The LegacyTask class and its children are not persisted in the DB, they are dynamically generated when loading the appeal in a queue or on a case details page.

end
end
156 changes: 78 additions & 78 deletions db/seeds/legacy_appeals_for_vlj_movement_testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def create_scenario_4_veteran(options = {})
# place seed methods below
def scenario_4_seeds
draft_one = create_scenario_4_veteran(first_name: "Attyswap", last_name: "One")
draft_two = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Two")
draft_three = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Three")
draft_four = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Four")
draft_five = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Five")
draft_six = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Six")
not_swappable = create_scenario_4_veteran(first_name: "NotSwappable", last_name: "Control")
# draft_two = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Two")
# draft_three = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Three")
# draft_four = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Four")
# draft_five = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Five")
# draft_six = create_scenario_4_veteran(first_name: "Attyswap", last_name: "Six")
# not_swappable = create_scenario_4_veteran(first_name: "NotSwappable", last_name: "Control")

# Scenario 1: Draft One (Primary, age-based, CAVC, 2 issues)
create(:legacy_appeal, :with_veteran, vacols_case: create(
Expand All @@ -34,89 +34,89 @@ def scenario_4_seeds
:status_active,
:aod,
:assigned,
user: User.find_by_css_id("BVALSHIELDS"),
user: User.find_by_css_id("BVARDUNKLE"),
craigrva marked this conversation as resolved.
Show resolved Hide resolved
assigner: User.find_by_css_id("BVACOTBJUDGE"),
as_judge_assign_task: true,
bfcorlid: "#{draft_one.file_number}S",
case_issues: create_list(:case_issue, 2, :compensation)
))

# Scenario 2: Draft Two (Non-priority, 1 issue)
create(:legacy_appeal, :with_veteran, vacols_case: create(
:case_with_form_9,
:type_original,
:status_active,
:assigned,
user: User.find_by_css_id("BVALCASPER1"),
assigner: User.find_by_css_id("BVALCASPER1"),
as_judge_assign_task: true,
bfcorlid: "#{draft_two.file_number}S",
case_issues: create_list(:case_issue, 1, :compensation)
))
# # Scenario 2: Draft Two (Non-priority, 1 issue)
# create(:legacy_appeal, :with_veteran, vacols_case: create(
# :case_with_form_9,
# :type_original,
# :status_active,
# :assigned,
# user: User.find_by_css_id("BVALCASPER1"),
# assigner: User.find_by_css_id("BVALCASPER1"),
# as_judge_assign_task: true,
# bfcorlid: "#{draft_two.file_number}S",
# case_issues: create_list(:case_issue, 1, :compensation)
# ))

# Scenario 3: Draft Three (Non-priority, 2 issues)
create(:legacy_appeal, :with_veteran, vacols_case: create(
:case_with_form_9,
:type_original,
:status_active,
:assigned,
user: User.find_by_css_id("BVALSHIELDS"),
assigner: User.find_by_css_id("BVACOTBJUDGE"),
as_judge_assign_task: true,
bfcorlid: "#{draft_three.file_number}S",
case_issues: create_list(:case_issue, 2, :compensation)
))
# # Scenario 3: Draft Three (Non-priority, 2 issues)
# create(:legacy_appeal, :with_veteran, vacols_case: create(
# :case_with_form_9,
# :type_original,
# :status_active,
# :assigned,
# user: User.find_by_css_id("BVALSHIELDS"),
# assigner: User.find_by_css_id("BVACOTBJUDGE"),
# as_judge_assign_task: true,
# bfcorlid: "#{draft_three.file_number}S",
# case_issues: create_list(:case_issue, 2, :compensation)
# ))

# Scenario 4: Draft Four (Priority, manually added, 1 issue)
create(:legacy_appeal, :with_veteran, vacols_case: create(
:case_with_form_9,
:type_original,
:status_active,
:aod,
:assigned,
user: User.find_by_css_id("BVAOTRANTOW"),
assigner: User.find_by_css_id("BVAGSPORER"),
as_judge_assign_task: true,
bfcorlid: "#{draft_four.file_number}S",
case_issues: create_list(:case_issue, 1, :compensation)
))
# # Scenario 4: Draft Four (Priority, manually added, 1 issue)
# create(:legacy_appeal, :with_veteran, vacols_case: create(
# :case_with_form_9,
# :type_original,
# :status_active,
# :aod,
# :assigned,
# user: User.find_by_css_id("BVAOTRANTOW"),
# assigner: User.find_by_css_id("BVAGSPORER"),
# as_judge_assign_task: true,
# bfcorlid: "#{draft_four.file_number}S",
# case_issues: create_list(:case_issue, 1, :compensation)
# ))

# Scenario 5: Draft Five (Priority, CAVC, 2 issues)
create(:legacy_appeal, :with_veteran, vacols_case: create(
:case_with_form_9,
:type_cavc_remand,
:aod,
:status_active,
:assigned,
user: User.find_by_css_id("BVAGBOTSFORD"),
assigner: User.find_by_css_id("BVAGSPORER"),
as_judge_assign_task: true,
bfcorlid: "#{draft_five.file_number}S",
case_issues: create_list(:case_issue, 2, :compensation)
))
# # Scenario 5: Draft Five (Priority, CAVC, 2 issues)
# create(:legacy_appeal, :with_veteran, vacols_case: create(
# :case_with_form_9,
# :type_cavc_remand,
# :aod,
# :status_active,
# :assigned,
# user: User.find_by_css_id("BVAGBOTSFORD"),
# assigner: User.find_by_css_id("BVAGSPORER"),
# as_judge_assign_task: true,
# bfcorlid: "#{draft_five.file_number}S",
# case_issues: create_list(:case_issue, 2, :compensation)
# ))

# Scenario 6: Draft Six (Non-priority, 1 issue)
create(:legacy_appeal, :with_veteran, vacols_case: create(
:case_with_form_9,
:type_post_remand,
:status_active,
:assigned,
user: User.find_by_css_id("BVAJWEHNER1"),
assigner: User.find_by_css_id("BVAGSPORER"),
as_judge_assign_task: true,
bfcorlid: "#{draft_six.file_number}S",
case_issues: create_list(:case_issue, 1, :compensation)
))
# # Scenario 6: Draft Six (Non-priority, 1 issue)
# create(:legacy_appeal, :with_veteran, vacols_case: create(
# :case_with_form_9,
# :type_post_remand,
# :status_active,
# :assigned,
# user: User.find_by_css_id("BVAJWEHNER1"),
# assigner: User.find_by_css_id("BVAGSPORER"),
# as_judge_assign_task: true,
# bfcorlid: "#{draft_six.file_number}S",
# case_issues: create_list(:case_issue, 1, :compensation)
# ))

# Scenario 7: Not Swappable (Non-priority, 1 issue, not distributed yet)
create(:legacy_appeal, :with_veteran, vacols_case: create(
:case_with_form_9,
:type_original,
:status_active,
:ready_for_distribution,
bfcorlid: "#{not_swappable.file_number}S",
case_issues: create_list(:case_issue, 1, :compensation)
))
# # Scenario 7: Not Swappable (Non-priority, 1 issue, not distributed yet)
# create(:legacy_appeal, :with_veteran, vacols_case: create(
# :case_with_form_9,
# :type_original,
# :status_active,
# :ready_for_distribution,
# bfcorlid: "#{not_swappable.file_number}S",
# case_issues: create_list(:case_issue, 1, :compensation)
# ))
end
end
end
Loading