-
Notifications
You must be signed in to change notification settings - Fork 19
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
Check if the user is the judge or attorney on a case review to determine what actions they see in LegacyTasks #15591
Conversation
…decision document
Code Climate has analyzed commit 7324458 and detected 0 issues on this pull request. View more on Code Climate. |
spec/models/legacy_appeal_spec.rb
Outdated
subject { appeal.assigned_to_acting_judge_as_judge?(acting_judge) } | ||
|
||
context "when the attorney review process has happened outside of caseflow" do | ||
context "a decision has not been written for the case" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: I think this belongs at the sibling level to when the attorney review process has happened outside of caseflow
, rather than under it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set up these examples as "when there is an attorney_case_review" and "when there is not an attorney_case_review", but gave them more "real world" descriptions. So I agree that if the attorney has not reviewed the case, the attorney review process hasn't actually happened, inside or outside of caseflow. But thought this grouped a bit nicer
spec/models/legacy_appeal_spec.rb
Outdated
it_behaves_like "assumes the case assigned to the user to draft the decision" | ||
|
||
it "falls back to check the presence of a decision document" do | ||
expect_any_instance_of(VACOLS::CaseAssignment).to receive(:valid_document_id?).once | ||
subject | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion/Question: aren't these redundant? I don't think we need the shared example here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed! Removing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
juuuust kidding
the first set of tests checks when no attorney case review is present
this test checks when an attorney case review is present but not associated with the user.
Gotta hit all those conditional branches!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just in time for my 🦇 shift too 😹
Resolves issue is some cases where a legacy appeal is sent back to the decision drafting attorney but they only see judge actions as they are an avlj.
Description
Another hacky fix in the ever evolving saga of "how the heck do we determine if a legacy case is assigned to an acting judge to write a decision to to sign a decision". Some context is provided in #14886.
Initially, we tried to use the logic that if a decision had already been drafted for an appeal, this appeal is probably assigned to the user to sign the decision as a judge.
To implement this, we initially checked if an attorney case review existed for the case in caseflow. While this was an alright start, sometimes cases are sent from an attorney to a judge outside of caseflow and no attorney case review will exist.
To resolve this, we moved to checking to see if there was a decision document listed on the vacols case assignment. The thought process here is that this will always be populated whether sent to the judge in caseflow or vacols.
The problem with this is outlined in #14886. If the case returns to the acting judge, say for rewriting the decision, our code assumes they are being assigned the case to sign the decision they wrote.
For some of these cases that were worked in caseflow, we can reach a happier middleground. We should check to see if they are the attorney that created the case review. If they are, the task will be an attorney task. It they were the judge on the case review, the task will be a judge task. If neither, we can fall back to old logic of checking to see if there is a decision already written.
While this will not resolve all cases, it will cut down on the number of batteam requests we get about this.
For instance, this batteam request could have been avoided if we had implemented this check.
Acceptance Criteria
Testing plan
UI changes