From c170738092dd0d58c57dee1ac70e80d479eaede7 Mon Sep 17 00:00:00 2001 From: isaiahsaucedo <24325949+isaiahsaucedo@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:36:02 -0600 Subject: [PATCH 1/4] seeds - mofed from previous branch --- ...legacy_appeals_for_vlj_movement_testing.rb | 111 +++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb index ab3ad8e5478..0b7d16088f9 100644 --- a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb +++ b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb @@ -4,14 +4,121 @@ module Seeds class LegacyAppealsForVljMovementTesting < Base def initialize RequestStore[:current_user] = User.system_user + initial_scenario_3_id_values end def seed! - # place seed method calls here + scenario_3_seeds end private - # place seed methods below + def initial_scenario_3_id_values + @scenario_3_file_number ||= 800_000_000 + @scenario_3_participant_id ||= 900_000_000 + while Veteran.find_by(file_number: format("%09d", n: @scenario_3_file_number + 1)) + @scenario_3_file_number += 2000 + @scenario_3_participant_id += 2000 + end + end + + def create_scenario_3_veteran(options = {}) + @scenario_3_file_number += 1 + @scenario_3_participant_id += 1 + params = { + file_number: format("%09d", n: @scenario_3_file_number), + participant_id: format("%09d", n: @scenario_3_participant_id) + } + create(:veteran, params.merge(options)) + end + + def scenario_3_seeds + draft_one = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "One") + draft_two = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Two") + draft_three = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Three") + draft_four = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Four") + draft_five = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Five") + draft_six = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Six") + not_draftable = create_scenario_3_veteran(first_name: "NotSwappable", last_name: "NotDraftable") + + # Scenario 1: Draft One (Primary, age-based, CAVC, 2 issues) + create(:legacy_appeal, :with_veteran, vacols_case: create( + :case, + :type_cavc_remand, + :aod, + :assigned, + user: User.find_by_css_id("BVACOTBJUDGE"), + 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, + :assigned, + user: User.find_by_css_id("BVACOTBJUDGE"), + assigner: User.find_by_css_id("BVACOTBJUDGE"), + 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, + :assigned, + user: User.find_by_css_id("BVACOTBJUDGE"), + 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, CAVC, 1 issue) + create(:legacy_appeal, :with_veteran, vacols_case: create( + :case, + :type_cavc_remand, + :aod, + :assigned, + user: User.find_by_css_id("BVAGSPORER"), + 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, 2 issues) + create(:legacy_appeal, :with_veteran, vacols_case: create( + :case, + :aod, + :assigned, + user: User.find_by_css_id("BVAGSPORER"), + 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, + :assigned, + user: User.find_by_css_id("BVAGSPORER"), + 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 Draftable (Non-priority, 1 issue, not distributed yet) + create(:legacy_appeal, :with_veteran, vacols_case: create( + :case, + :ready_for_distribution, + bfcorlid: "#{not_draftable.file_number}S", + case_issues: create_list(:case_issue, 1, :compensation) + )) + end end end From 97444d92fca8598918a37bb48baca5e816af9ea8 Mon Sep 17 00:00:00 2001 From: isaiahsaucedo <24325949+isaiahsaucedo@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:21:13 -0600 Subject: [PATCH 2/4] trait additions to match higher env req. --- ...legacy_appeals_for_vlj_movement_testing.rb | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb index 0b7d16088f9..27483f146bc 100644 --- a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb +++ b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb @@ -56,8 +56,10 @@ def scenario_3_seeds # Scenario 2: Draft Two (Non-priority, 1 issue) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :assigned, + :type_original, + :status_active, user: User.find_by_css_id("BVACOTBJUDGE"), assigner: User.find_by_css_id("BVACOTBJUDGE"), as_judge_assign_task: true, @@ -67,8 +69,10 @@ def scenario_3_seeds # Scenario 3: Draft Three (Non-priority, 2 issues) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :assigned, + :type_original, + :status_active, user: User.find_by_css_id("BVACOTBJUDGE"), assigner: User.find_by_css_id("BVACOTBJUDGE"), as_judge_assign_task: true, @@ -91,9 +95,11 @@ def scenario_3_seeds # Scenario 5: Draft Five (Priority, 2 issues) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :aod, :assigned, + :type_original, + :status_active, user: User.find_by_css_id("BVAGSPORER"), assigner: User.find_by_css_id("BVAGSPORER"), as_judge_assign_task: true, @@ -103,8 +109,10 @@ def scenario_3_seeds # Scenario 6: Draft Six (Non-priority, 1 issue) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :assigned, + :type_original, + :status_active, user: User.find_by_css_id("BVAGSPORER"), assigner: User.find_by_css_id("BVAGSPORER"), as_judge_assign_task: true, @@ -114,8 +122,10 @@ def scenario_3_seeds # Scenario 7: Not Draftable (Non-priority, 1 issue, not distributed yet) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :ready_for_distribution, + :type_original, + :status_active, bfcorlid: "#{not_draftable.file_number}S", case_issues: create_list(:case_issue, 1, :compensation) )) From 63c0277de3df9e6fefaa368e78b92e196c7fce6e Mon Sep 17 00:00:00 2001 From: isaiahsaucedo <24325949+isaiahsaucedo@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:12:47 -0600 Subject: [PATCH 3/4] added traits to CAVC --- db/seeds/legacy_appeals_for_vlj_movement_testing.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb index 27483f146bc..54d80e96462 100644 --- a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb +++ b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb @@ -43,10 +43,11 @@ def scenario_3_seeds # Scenario 1: Draft One (Primary, age-based, CAVC, 2 issues) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :type_cavc_remand, :aod, :assigned, + :status_active, user: User.find_by_css_id("BVACOTBJUDGE"), assigner: User.find_by_css_id("BVACOTBJUDGE"), as_judge_assign_task: true, @@ -82,10 +83,11 @@ def scenario_3_seeds # Scenario 4: Draft Four (Priority, manually added, CAVC, 1 issue) create(:legacy_appeal, :with_veteran, vacols_case: create( - :case, + :case_with_form_9, :type_cavc_remand, :aod, :assigned, + :status_active, user: User.find_by_css_id("BVAGSPORER"), assigner: User.find_by_css_id("BVAGSPORER"), as_judge_assign_task: true, From 3cd6fafbcda80ab165e6acb513c61d866f49d782 Mon Sep 17 00:00:00 2001 From: isaiahsaucedo <24325949+isaiahsaucedo@users.noreply.github.com> Date: Fri, 15 Nov 2024 12:24:05 -0600 Subject: [PATCH 4/4] name update --- db/seeds/legacy_appeals_for_vlj_movement_testing.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb index 54d80e96462..40a0de0571f 100644 --- a/db/seeds/legacy_appeals_for_vlj_movement_testing.rb +++ b/db/seeds/legacy_appeals_for_vlj_movement_testing.rb @@ -39,7 +39,7 @@ def scenario_3_seeds draft_four = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Four") draft_five = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Five") draft_six = create_scenario_3_veteran(first_name: "Aq'swap", last_name: "Six") - not_draftable = create_scenario_3_veteran(first_name: "NotSwappable", last_name: "NotDraftable") + not_draftable = create_scenario_3_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(