Skip to content

Commit

Permalink
linked request issues to appeal and addded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kristeja committed Aug 25, 2023
1 parent b046e96 commit 78e0880
Showing 1 changed file with 45 additions and 53 deletions.
98 changes: 45 additions & 53 deletions db/seeds/additional_remanded_appeals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,133 +48,137 @@ def attorney
@attorney ||= User.find_by_css_id("BVASCASPER1")
end

def create_allowed_request_issue_1
def create_allowed_request_issue_1(appeal)
nca = BusinessLine.find_by(name: "National Cemetery Administration")
description = "Service connection for pain disorder is granted with an evaluation of 25\% effective August 1 2020"
notes = "Pain disorder with 25\% evaluation per examination"

1.times do |index|
board_grant_task = create(:board_grant_effectuation_task,
status: "assigned",
assigned_to: nca)
assigned_to: nca,
appeal: appeal)

request_issues = create_list(:request_issue, 1,
:nonrating,
contested_issue_description: "#{index} #{description}",
notes: "#{index} #{notes}",
benefit_type: nca.url,
benefit_type: "nca",
decision_review: board_grant_task.appeal)

request_issues.each do |request_issue|
# create matching decision issue
create(
:decision_issue,
:nonrating,
:ama_remand_reason,
# :ama_remand_reason,
disposition: "allowed",
decision_review: board_grant_task.appeal,
request_issues: [request_issue],
rating_promulgation_date: 2.months.ago,
benefit_type: request_issue.benefit_type
benefit_type: "nca"
)
end
end
end

def create_allowed_request_issue_2
def create_allowed_request_issue_2(appeal)
education = BusinessLine.find_by(name: "Education")
description = "Service connection for pain disorder is granted with an evaluation of 50\% effective August 2 2021"
notes = "Pain disorder with 50\% evaluation per examination"

1.times do |index|
board_grant_task = create(:board_grant_effectuation_task,
status: "assigned",
assigned_to: education)
assigned_to: education,
appeal: appeal)

request_issues = create_list(:request_issue, 1,
:nonrating,
contested_issue_description: "#{index} #{description}",
notes: "#{index} #{notes}",
benefit_type: nca.url,
benefit_type: "education",
decision_review: board_grant_task.appeal)

request_issues.each do |request_issue|
# create matching decision issue
create(
:decision_issue,
:nonrating,
:ama_remand_reason,
# :ama_remand_reason,
disposition: "allowed",
decision_review: board_grant_task.appeal,
request_issues: [request_issue],
rating_promulgation_date: 1.month.ago,
benefit_type: request_issue.benefit_type
benefit_type: "education"
)
end
end
end

def create_remanded_request_issue_1
def create_remanded_request_issue_1(appeal)
compensation = BusinessLine.find_by(name: "Compensation")
description = "Service connection for pain disorder is granted with an evaluation of 75\% effective February 3 2021"
notes = "Pain disorder with 75\% evaluation per examination"

1.times do |index|
board_grant_task = create(:board_grant_effectuation_task,
status: "assigned",
assigned_to: compensation)
assigned_to: compensation,
appeal: appeal)

request_issues = create_list(:request_issue, 1,
:nonrating,
contested_issue_description: "#{index} #{description}",
notes: "#{index} #{notes}",
benefit_type: comp.url,
benefit_type: "compensation",
decision_review: board_grant_task.appeal)

request_issues.each do |request_issue|
# create matching decision issue
create(
:decision_issue,
:nonrating,
:ama_remand_reason,
# :ama_remand_reason, no trait is found, create a trait in decision_issues factory and use
disposition: "remanded",
decision_review: board_grant_task.appeal,
request_issues: [request_issue],
rating_promulgation_date: 1.month.ago,
benefit_type: request_issue.benefit_type
benefit_type: "compensation"
)
end
end
end

def create_remanded_request_issue_2
def create_remanded_request_issue_2(appeal)
compensation = BusinessLine.find_by(name: "Compensation")
description = "Service connection for pain disorder is granted with an evaluation of 100\% effective February 4 2021"
notes = "Pain disorder with 100\% evaluation per examination"

1.times do |index|
board_grant_task = create(:board_grant_effectuation_task,
status: "assigned",
assigned_to: compensation)
assigned_to: compensation,
appeal: appeal)

request_issues = create_list(:request_issue, 1,
:nonrating,
contested_issue_description: "#{index} #{description}",
notes: "#{index} #{notes}",
benefit_type: comp.url,
benefit_type: "compensation",
decision_review: board_grant_task.appeal)

request_issues.each do |request_issue|
# create matching decision issue
create(
:decision_issue,
:nonrating,
:ama_remand_reason,
# :ama_remand_reason,
disposition: "remanded",
decision_review: board_grant_task.appeal,
request_issues: [request_issue],
rating_promulgation_date: 1.month.ago,
benefit_type: request_issue.benefit_type
benefit_type: "compensation"
)
end
end
Expand Down Expand Up @@ -256,6 +260,12 @@ def create_ama_appeals_decision_ready_dr
Timecop.return
end

def link_request_issues(appeal)
create_allowed_request_issue_1(appeal)
create_allowed_request_issue_2(appeal)
create_remanded_request_issue_1(appeal)
end

#Appeals Ready for Decision with 1 Remand
#Evidence Submission
def create_ama_appeals_ready_to_dispatch_remanded_es
Expand All @@ -265,15 +275,12 @@ def create_ama_appeals_ready_to_dispatch_remanded_es
:evidence_submission_docket,
:with_decision_issue,
:at_judge_review,
request_issues: create_list(
create_allowed_request_issue_1,
create_allowed_request_issue_2,
create_remanded_request_issue_1),
code: decision_reason_remand_list.at(i-1),
# code: decision_reason_remand_list.at(i-1),
associated_judge: judge,
associated_attorney: attorney,
issue_count: 3,
veteran: create_veteran)
link_request_issues(appeal)
end
Timecop.return
end
Expand All @@ -286,15 +293,12 @@ def create_ama_appeals_ready_to_dispatch_remanded_hr
:hearing_docket,
:with_decision_issue,
:at_judge_review,
request_issues: create_list(
create_allowed_request_issue_1,
create_allowed_request_issue_2,
create_remanded_request_issue_1),
code: decision_reason_remand_list.at(i-1),
# code: decision_reason_remand_list.at(i-1),
associated_judge: judge,
associated_attorney: attorney,
issue_count: 3,
veteran: create_veteran)
link_request_issues(appeal)
end
Timecop.return
end
Expand All @@ -307,15 +311,12 @@ def create_ama_appeals_ready_to_dispatch_remanded_dr
:direct_review_docket,
:with_decision_issue,
:at_judge_review,
request_issues: create_list(
create_allowed_request_issue_1,
create_allowed_request_issue_2,
create_remanded_request_issue_1),
code: decision_reason_remand_list.at(i-1),
# code: decision_reason_remand_list.at(i-1), code is not related to appeal you need to create ama_remand_reason trait and add code to it and link it decision_issues
associated_judge: judge,
associated_attorney: attorney,
issue_count: 3,
veteran: create_veteran)
link_request_issues(appeal)
end
Timecop.return
end
Expand All @@ -330,16 +331,13 @@ def create_ama_appeals_ready_to_dispatch_remanded_multiple_es
:evidence_submission_docket,
:with_decision_issue,
:at_judge_review,
request_issues: create_list(
create_allowed_request_issue_1,
create_allowed_request_issue_2,
create_remanded_request_issue_1,
create_remanded_request_issue_2),
code: decision_reason_remand_list.at(i-1),
# code: decision_reason_remand_list.at(i-1),
associated_judge: judge,
associated_attorney: attorney,
issue_count: 4,
veteran: create_veteran)
link_request_issues(appeal)
create_remanded_request_issue_2(appeal)
end
Timecop.return
end
Expand All @@ -352,16 +350,13 @@ def create_ama_appeals_ready_to_dispatch_remanded_multiple_hr
:hearing_docket,
:with_decision_issue,
:at_judge_review,
request_issues: create_list(
create_allowed_request_issue_1,
create_allowed_request_issue_2,
create_remanded_request_issue_1,
create_remanded_request_issue_2),
code: decision_reason_remand_list.at(i-1),
# code: decision_reason_remand_list.at(i-1),
associated_judge: judge,
associated_attorney: attorney,
issue_count: 4,
veteran: create_veteran)
link_request_issues(appeal)
create_remanded_request_issue_2(appeal)
end
Timecop.return
end
Expand All @@ -374,16 +369,13 @@ def create_ama_appeals_ready_to_dispatch_remanded_multiple_dr
:direct_review_docket,
:with_decision_issue,
:at_judge_review,
request_issues: create_list(
create_allowed_request_issue_1,
create_allowed_request_issue_2,
create_remanded_request_issue_1,
create_remanded_request_issue_2),
code: decision_reason_remand_list.at(i-1),
# code: decision_reason_remand_list.at(i-1),
associated_judge: judge,
associated_attorney: attorney,
issue_count: 4,
veteran: create_veteran)
link_request_issues(appeal)
create_remanded_request_issue_2(appeal)
end
Timecop.return
end
Expand Down

0 comments on commit 78e0880

Please sign in to comment.