diff --git a/db/seeds/aoj_remand_return_legacy_appeals.rb b/db/seeds/aoj_remand_return_legacy_appeals.rb index 3f7fc62cbd4..b8de076e72a 100644 --- a/db/seeds/aoj_remand_return_legacy_appeals.rb +++ b/db/seeds/aoj_remand_return_legacy_appeals.rb @@ -72,6 +72,13 @@ def create_aoj_aod_affinity_cases create_cases_for_aoj_aod_affinty_days_lever create_cases_for_aoj_aod_affinty_days_lever_excluded_judge create_cases_for_aoj_aod_affinity_days_lever_ineligible_judge + create_cases_for_aoj_aod_with_hearing_after_decision + end + + def create_aoj_affinity_cases + create_cases_for_aoj_affinty_days_lever + create_cases_for_aoj_affinty_days_lever_excluded_judge + create_cases_for_aoj_affinity_days_lever_ineligible_judge end def affinity_judge @@ -382,158 +389,270 @@ def create_cases_for_aoj_cavc_with_hearing_after_decision def create_cases_for_aoj_aod_affinty_days_lever # aoj aod affinity cases: # no hearing held but has previous decision - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_judge, attorney: attorney, tied_to: false) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_judge, attorney: attorney, tied_to: false, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_judge, attorney: attorney, tied_to: false, appeal_affinity: false) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false, affinity_start_date: 30.days.ago, cavc: true) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false, affinity_start_date: 60.days.ago, cavc: true) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "60DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, tied_to: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "25DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "3DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "30DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 30.days.ago, cavc: true) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "60DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 60.days.ago, cavc: true) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "NoAppealAffinity").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, appeal_affinity: false) + + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "60DaysAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "25DaysAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, + tied_to: false, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "3DaysAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "NoAppealAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, + tied_to: false, appeal_affinity: false) + + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "60DaysAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, tied_to: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "25DaysAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, + tied_to: false, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "3DaysAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "NoAppealAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, + tied_to: false, appeal_affinity: false) # hearing held with previous decision where judge is not the same - ca1 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney) + ca1 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "60DaysAffinity").ssn}S", judge: other_judge, attorney: attorney) VACOLS::Case.where(bfcorlid: ca1.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) - ca2 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, affinity_start_date: 3.days.ago) + cb1 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "25DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb1.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + + ca2 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "3DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 3.days.ago) VACOLS::Case.where(bfcorlid: ca2.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) - ca3 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) + ca3 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "NoAppealAffinity").ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) VACOLS::Case.where(bfcorlid: ca3.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) - ca4 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney) - VACOLS::Case.where(bfcorlid: ca4.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + ca4 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "60DaysAffinity").ssn}S", judge: other_judge, attorney: attorney) + VACOLS::Case.where(bfcorlid: ca4.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + cb2 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "25DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb2.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + ca5 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "3DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: ca5.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + ca6 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "NoAppealAffinity").ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) + VACOLS::Case.where(bfcorlid: ca6.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) - ca5 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, affinity_start_date: 3.days.ago) - VACOLS::Case.where(bfcorlid: ca5.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + cb3 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "60DaysAffinity").ssn}S", judge: other_judge, attorney: attorney) + VACOLS::Case.where(bfcorlid: cb3.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) - ca6 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) - VACOLS::Case.where(bfcorlid: ca6.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + cb4 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "25DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb4.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + + cb5 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "3DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: cb5.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + + cb6 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "NoAppealAffinity").ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) + VACOLS::Case.where(bfcorlid: cb6.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) # hearing held with previous decision where judge is same (THIS IS TIED TO) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: tied_to_judge, attorney: attorney) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: tied_to_judge, attorney: attorney, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: tied_to_judge, attorney: attorney, appeal_affinity: false) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "60DaysAffinity").ssn}S", judge: tied_to_judge, attorney: attorney) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "25DaysAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "3DaysAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "NoAppealAffinity").ssn}S", judge: tied_to_judge, attorney: attorney, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "60DaysAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "25DaysAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "3DaysAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "NoAppealAffinity").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "60DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "25DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "3DaysAffinity").ssn}S", judge: affinity_judge, attorney: attorney, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "NoAppealAffinity").ssn}S", judge: affinity_judge, attorney: attorney, appeal_affinity: false) # hearing held but no previous deciding judge - ca7 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: tied_to_judge, attorney: attorney) + ca7 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop60Days", snamel: "AffinityStartDate").ssn}S", judge: tied_to_judge, attorney: attorney) VACOLS::Case.where(bfcorlid: ca7.bfcorlid, bfac: "1").update(bfmemid: nil) - ca8 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney) + ca8 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop60Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney) VACOLS::Case.where(bfcorlid: ca8.bfcorlid, bfac: "1").update(bfmemid: nil) # no hearing held, no previous deciding judge - ca9 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_judge, attorney: attorney, tied_to: false) + ca9 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop60Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false) VACOLS::Case.where(bfcorlid: ca9.bfcorlid, bfac: "1").update(bfmemid: nil) - ca10 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, tied_to: false) + ca10 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop60Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, + tied_to: false) VACOLS::Case.where(bfcorlid: ca10.bfcorlid, bfac: "1").update(bfmemid: nil) + + cb18 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop3Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: cb18.bfcorlid, bfac: "1").update(bfmemid: nil) + + cb19 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop3Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: cb19.bfcorlid, bfac: "1").update(bfmemid: nil) end def create_cases_for_aoj_aod_affinty_days_lever_excluded_judge # excluded judge cases: # no hearing held but has previous decision - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: excluded_judge, attorney: attorney, tied_to: false) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: excluded_judge, attorney: attorney, tied_to: false, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: excluded_judge, attorney: attorney, tied_to: false, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "60DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, tied_to: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "25DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, + tied_to: false, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "3DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "NoAppealAffinity").ssn}S", judge: excluded_judge, attorney: attorney, + tied_to: false, appeal_affinity: false) # hearing held with previous decision where judge is not the same - ca11 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney) + ca11 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "60DaysAffinity").ssn}S", judge: other_judge, attorney: attorney) VACOLS::Case.where(bfcorlid: ca11.bfcorlid, bfac: "1").update(bfmemid: excluded_judge.sattyid) - ca12 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, affinity_start_date: 3.days.ago) + cb7 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "25DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb7.bfcorlid, bfac: "1").update(bfmemid: excluded_judge.sattyid) + + ca12 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "3DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 3.days.ago) VACOLS::Case.where(bfcorlid: ca12.bfcorlid, bfac: "1").update(bfmemid: excluded_judge.sattyid) - ca13 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) + ca13 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToExcludedJudge", snamel: "NoAppealAffinity").ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) VACOLS::Case.where(bfcorlid: ca13.bfcorlid, bfac: "1").update(bfmemid: excluded_judge.sattyid) + cb8 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "25DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb8.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + + cb9 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "25DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb9.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + cb10 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "25DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb10.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + # hearing held with previous decision where judge is same (THIS IS TIED TO) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: excluded_judge, attorney: attorney) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: excluded_judge, attorney: attorney, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: excluded_judge, attorney: attorney, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "60DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "25DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "3DaysAffinity").ssn}S", judge: excluded_judge, attorney: attorney, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "NoAppealAffinity").ssn}S", judge: excluded_judge, attorney: attorney, appeal_affinity: false) end def create_cases_for_aoj_aod_affinity_days_lever_ineligible_judge # ineligible judge cases: # no hearing held but has previous decision - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney, tied_to: false) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney, tied_to: false, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney, tied_to: false, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "60DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, tied_to: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "25DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + tied_to: false, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "3DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "NoAppealAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + tied_to: false, appeal_affinity: false) # hearing held with previous decision where judge is not the same - ca14 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney) + ca14 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "60DaysAffinity").ssn}S", judge: other_judge, attorney: attorney) VACOLS::Case.where(bfcorlid: ca14.bfcorlid, bfac: "1").update(bfmemid: ineligible_judge.sattyid) - ca15 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, affinity_start_date: 3.days.ago) + cb11 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "25DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb11.bfcorlid, bfac: "1").update(bfmemid: ineligible_judge.sattyid) + + ca15 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "3DaysAffinity").ssn}S", judge: other_judge, attorney: attorney, + affinity_start_date: 3.days.ago) VACOLS::Case.where(bfcorlid: ca15.bfcorlid, bfac: "1").update(bfmemid: ineligible_judge.sattyid) - ca16 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) + ca16 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToIneligibleUser", snamel: "NoAppealAffinity").ssn}S", judge: other_judge, attorney: attorney, appeal_affinity: false) VACOLS::Case.where(bfcorlid: ca16.bfcorlid, bfac: "1").update(bfmemid: ineligible_judge.sattyid) + cb12 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "25DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb12.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + + cb13 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "25DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb13.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + cb14 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "25DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + affinity_start_date: 25.days.ago) + VACOLS::Case.where(bfcorlid: cb14.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + + cb15 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "3DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: cb15.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + + cb16 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "3DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: cb16.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + cb17 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "3DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, + affinity_start_date: 3.days.ago) + VACOLS::Case.where(bfcorlid: cb17.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + # hearing held with previous decision where judge is same (THIS IS TIED TO) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney, affinity_start_date: 3.days.ago) - create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney, appeal_affinity: false) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToIneligibleJudge", snamel: "60DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToIneligibleJudge", snamel: "25DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, affinity_start_date: 25.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToIneligibleJudge", snamel: "3DaysAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, affinity_start_date: 3.days.ago) + create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToIneligibleJudge", snamel: "NoAppealAffinity").ssn}S", judge: ineligible_judge, attorney: attorney, appeal_affinity: false) # hearing held but no previous deciding judge - ca17 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent.ssn}S", judge: ineligible_judge, attorney: attorney) - VACOLS::Case.where(bfcorlid: ca17.bfcorlid, bfac: "1").update(bfmemid: ineligible_judge.sattyid) - end - def create_aoj_affinity_cases - create_cases_for_aoj_affinty_days_lever - create_cases_for_aoj_affinty_days_lever_excluded_judge - create_cases_for_aoj_affinity_days_lever_ineligible_judge + ca17 = create(:legacy_aoj_appeal, bfcorlid: "#{create_correspondent(snamef: "Genpop60Days", snamel: "AffinityStartDate").ssn}S", judge: ineligible_judge, attorney: attorney) + VACOLS::Case.where(bfcorlid: ca17.bfcorlid, bfac: "1").update(bfmemid: nil) end - def affinity_judge - @affinity_judge ||= VACOLS::Staff.find_by_sdomainid("BVAGSPORER") - end + def create_cases_for_aoj_aod_with_hearing_after_decision + ch1 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "60DaysAffinityAfterDec").ssn}S", judge: affinity_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch1.bfcorlid, bfac: "1").update(bfmemid: nil) - def tied_to_judge - @tied_to_judge ||= VACOLS::Staff.find_by_sdomainid("BVABDANIEL") - end + ch2 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "60DaysAffinityAfterDec").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch2.bfcorlid, bfac: "1").update(bfmemid: nil) - def affinity_and_tied_to_judge - @affinity_and_tied_to_judge ||= VACOLS::Staff.find_by_sdomainid("BVAEEMARD") - end + ch3 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "60DaysAffinityAfterDec").ssn}S", judge: tied_to_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch3.bfcorlid, bfac: "1").update(bfmemid: nil) - def excluded_judge - @excluded_judge ||= find_or_create_active_excluded_judge("EXCLUDED_JUDGE", "Excluded FromAffinity Judge") - end + ch4 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "3DaysAffinityAfterDec").ssn}S", judge: affinity_judge, attorney: attorney, affinity_start_date: 3.days.ago, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch4.bfcorlid, bfac: "1").update(bfmemid: nil) - def ineligible_judge - @ineligible_judge ||= find_or_create_ineligible_judge("INELIGIBLE_JUDGE", "Ineligible Vacols Judge") - end + ch5 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "3DaysAffinityAfterDec").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, affinity_start_date: 3.days.ago, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch5.bfcorlid, bfac: "1").update(bfmemid: nil) - def attorney - @attorney ||= find_or_create_attorney("AFFINITY_ATTORNEY", "Affinity Cases Attorney") - end + ch6 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "3DaysAffinityAfterDec").ssn}S", judge: tied_to_judge, attorney: attorney, affinity_start_date: 3.days.ago, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch6.bfcorlid, bfac: "1").update(bfmemid: nil) - def other_judge - @other_judge ||= find_or_create_other_judge("OTHER_JUDGE", "Other Affinity Judge") - end + ch7 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAEEMARD", snamel: "60DaysAffinityAfterDec").ssn}S", judge: affinity_and_tied_to_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch7.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) - def find_or_create_ineligible_judge(sdomainid, full_name) - VACOLS::Staff.find_by_sdomainid(sdomainid) || ( - user = create(:user, :judge, :with_inactive_vacols_judge_record, css_id: sdomainid, full_name: full_name) - VACOLS::Staff.find_by_sdomainid(user.css_id)) - end + ch8 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVABDANIEL", snamel: "60DaysAffinityAfterDec").ssn}S", judge: tied_to_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch8.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) - def find_or_create_active_excluded_judge(sdomainid, full_name) - VACOLS::Staff.find_by_sdomainid(sdomainid) || ( - user = create(:user, :judge_with_appeals_excluded_from_affinity, - :with_vacols_judge_record, css_id: sdomainid, full_name: full_name) - VACOLS::Staff.find_by_sdomainid(user.css_id)) - end + ch9 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToBVAGSPORER", snamel: "60DaysAffinityAfterDec").ssn}S", judge: affinity_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch9.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) - def find_or_create_attorney(sdomainid, full_name) - VACOLS::Staff.find_by_sdomainid(sdomainid) || ( - user = create(:user, :with_vacols_attorney_record, css_id: sdomainid, full_name: full_name) - VACOLS::Staff.find_by_sdomainid(user.css_id)) - end + ch10 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "60DaysAffinityAfterDec").ssn}S", judge: excluded_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch10.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) - def find_or_create_other_judge(sdomainid, full_name) - VACOLS::Staff.find_by_sdomainid(sdomainid) || ( - user = create(:user, :judge, :with_vacols_judge_record, css_id: sdomainid, full_name: full_name) - VACOLS::Staff.find_by_sdomainid(user.css_id)) + ch11 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "60DaysAffinityAfterDec").ssn}S", judge: excluded_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch11.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + ch12 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "TiedToExcludedJudge", snamel: "60DaysAffinityAfterDec").ssn}S", judge: excluded_judge, attorney: attorney, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch12.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + ch13 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAGSPORER", snamel: "3DaysAffinityAfterDec").ssn}S", judge: ineligible_judge, attorney: attorney, affinity_start_date: 3.days.ago, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch13.bfcorlid, bfac: "1").update(bfmemid: affinity_judge.sattyid) + + ch14 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVAEEMARD", snamel: "3DaysAffinityAfterDec").ssn}S", judge: ineligible_judge, attorney: attorney, affinity_start_date: 3.days.ago, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch14.bfcorlid, bfac: "1").update(bfmemid: affinity_and_tied_to_judge.sattyid) + + ch15 = create(:legacy_aoj_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "AffinityToBVABDANIEL", snamel: "3DaysAffinityAfterDec").ssn}S", judge: ineligible_judge, attorney: attorney, affinity_start_date: 3.days.ago, hearing_after_decision: true) + VACOLS::Case.where(bfcorlid: ch15.bfcorlid, bfac: "1").update(bfmemid: tied_to_judge.sattyid) + + create(:legacy_cavc_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop90Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 90.days.ago) + create(:legacy_cavc_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop60Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 60.days.ago) + create(:legacy_cavc_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop25Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 25.days.ago) + create(:legacy_cavc_appeal, :aod, bfcorlid: "#{create_correspondent(snamef: "Genpop3Days", snamel: "AffinityStartDate").ssn}S", judge: affinity_judge, attorney: attorney, + tied_to: false, affinity_start_date: 3.days.ago) end def create_cases_for_aoj_affinty_days_lever