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

Add SendCavcRemandProcessedLetterTask #15548

Merged
merged 20 commits into from
Nov 10, 2020

Conversation

yoomlam
Copy link
Contributor

@yoomlam yoomlam commented Nov 2, 2020

Resolves #15076

Description

Add SendCavcRemandProcessedLetterTask when CavcTask is created.

Acceptance criteria

  • This feature should be accessible to the following user groups: CAVC Litigation Support
  • Consider better naming of SendCavcRemandProcessedLetterTask
    • couldn't think of anything better: SendCavcProcessedLetterTask, SendCavcCompleteLetterTask
  • SendCavcRemandProcessedLetterTask is created on the new appeal stream as a child of the CAVC task
  • SendCavcRemandProcessedLetterTask is assigned to the CAVC Litigation Support organization as unassigned
  • The Actions drop-down has the following available for the Admin of the organization:
    • Assign to person
  • Once assigned by the Admin of the organization, the Actions drop-down has the following available for the assigned user:

I implemented task reassignment, but only for the user-task (task assigned to a user) not the org-task (task assigned to the CAVC Lit Support org). Reassignment of the org-task will cancel the existing org-task and create a user-task without an org-task parent, which is probably not what we want.

Testing Plan

  1. Create the SendCavcRemandProcessedLetterTask task
# Find an appeal with an open DistributionTask to play with
appeal=DistributionTask.open.first.appeal
appeal.treee

distr_task=appeal.tasks.open.where(type: DistributionTask.name).first 
cavc_task=CavcTask.create(appeal: appeal, parent: distr_task)
appeal.reload.treee

send_task=SendCavcRemandProcessedLetterTask.create(appeal: appeal, parent: cavc_task)
appeal.reload.treee
  1. Sign in as # CAVC_LIT_SUPPORT_ADMIN (VACO) and switch to their CAVC Lit Support team view. The appeal should be listed in the Unassigned tab.
  2. Click on the case; assign task to a CAVC Lit Support team member; check that case is now under the "Assigned" tab.
  3. Sign in as the user you assigned it to and go to their queue; click on the case.
  4. Play around with task actions, check the case appears in correct queue tab, and check the task tree appeal.reload.treee
    • ADD_ADMIN_ACTION; cancel it (Task.where(id: [3374, 3375]).map(&:cancelled!)) or complete it as the assigned user to have the case assigned back to the assigner. Can also destroy the tasks (Task.where(id: [3374, 3375]).map(&:destroy)).
    • REASSIGN_TO_PERSON
    • MARK_COMPLETE will complete all the way up the tree up to (and including CavcTask since it has no open children tasks). Can test scenario where CavcTask does have other open children after marking the task complete.
                                                      ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
Appeal 9 (evidence_submission) ──────────────────────  ID    STATUS     ASGN_BY                 ASGN_TO                 UPDATED_AT              
└── RootTask                                           24    on_hold                            Bva                     2020-11-03 21:30:55 UTC 
    └── DistributionTask                               25    on_hold                            Bva                     2020-11-03 21:30:55 UTC 
        ├── EvidenceSubmissionWindowTask               26    assigned                           MailTeam                2020-11-03 21:30:55 UTC 
        └── CavcTask                                   3369  completed                          Bva                     2020-11-04 18:18:39 UTC 
            └── SendCavcRemandProcessedLetterTask      3372  completed                          CavcLitigationSupport   2020-11-04 18:18:39 UTC 
                └── SendCavcRemandProcessedLetterTask  3373  completed  CAVC_LIT_SUPPORT_ADMIN  CAVC_LIT_SUPPORT_USER1  2020-11-04 18:18:38 UTC 
                                                      └──────────────────────────────────────────────────────────────────────────────────────────────┘

User Facing Changes

  • Screenshots of UI changes added to PR & Original Issue
BEFORE AFTER
(None) For CAVC Lit Support Admin user for an org-task image
(None) For CAVC Lit Support Non-Admin user for a user-task image

Code Documentation Updates

  • Add or update code comments at the top of the class, module, and/or component.

@yoomlam yoomlam added Product: caseflow-queue Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Type: New Development New feature development labels Nov 2, 2020
@yoomlam yoomlam self-assigned this Nov 2, 2020
@codeclimate
Copy link

codeclimate bot commented Nov 2, 2020

Code Climate has analyzed commit ab50611 and detected 0 issues on this pull request.

View more on Code Climate.

spec/models/tasks/cavc_task_spec.rb Show resolved Hide resolved
spec/models/tasks/cavc_task_spec.rb Show resolved Hide resolved
app/controllers/tasks_controller.rb Outdated Show resolved Hide resolved
spec/factories/task.rb Show resolved Hide resolved
Comment on lines +83 to +84
elsif task.is_a?(SendCavcRemandProcessedLetterTask) && task.assigned_to_type == "Organization"
{ redirect_after: "/organizations/#{CavcLitigationSupport.singleton.url}" }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stay in the "team cases" view after assigning a case.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if a better play here would be to send the user back to the organization queue for all tasks that are assigned to an org

extras[:redirect_after] = "/organizations/#{task.assigned_to.url}" if task.assigned_to_type == Organization.name

Would cover both redirects for these special cases, but also provide redirecting that makes more sense when assigning any org task.
Thoughts? Out of scope of this pr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using your suggestion, 2 tests failed. I think a separate ticket is appropriate.

Copy link
Contributor

@hschallhorn hschallhorn left a comment

Choose a reason for hiding this comment

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

Ran testing from a make reset. Kat added some seeds and, with your additions, we've got 9 open SendCavcRemandProcessedLetterTasks to play with!

Screen Shot 2020-11-09 at 12 02 40 PM

Copy link
Contributor

@hschallhorn hschallhorn left a comment

Choose a reason for hiding this comment

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

Checked bulk task assign as well! Looks great :trulyamazingpanda:

@@ -50,6 +29,7 @@
expect(RootTask.count).to eq 1
expect(DistributionTask.count).to eq 1
expect(CavcTask.count).to eq 1
expect(cavc_task.parent).to eq parent_task
Copy link
Contributor Author

@yoomlam yoomlam Nov 9, 2020

Choose a reason for hiding this comment

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

Check for expected parent task in these 3 tests as well.

Copy link
Contributor

@hschallhorn hschallhorn left a comment

Choose a reason for hiding this comment

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

Looks great!

@yoomlam yoomlam added the Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master label Nov 10, 2020
@va-bot va-bot merged commit a33e191 into master Nov 10, 2020
@va-bot va-bot deleted the yoom/15076-create-SendCavcRemandProcessedLetterTask branch November 10, 2020 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Product: caseflow-queue Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Type: New Development New feature development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Litigation Support: Create new SendCavcRemandProcessedLetterTask type
3 participants