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

TYLERB/APPEALS-56609: Modification to Download Completed Tasks report results #23321

Open
wants to merge 6 commits into
base: feature/APPEALS-53424
Choose a base branch
from

Conversation

TylerBroyles
Copy link
Contributor

@TylerBroyles TylerBroyles commented Oct 22, 2024

Resolves APPEALS-56609

Description

Modified the Download completed tasks button in the decision review queue to allow filtering from the decision review queue page to apply to the csv generated by the BusinessLineReporter. Limited this to the VhaBusinessLine for now.

Acceptance Criteria

  • When user opts to download the completed tasks by selecting the “Download completed tasks” button, a file will be downloaded with tasks based on the current selected filter(s)
  • Only VHA Decision Review queue are impacted by the changes

Testing Plan

  1. Data setup
# This should generate some random times between 1-40 days ago. You will have to manually set a few to 366+ days for the 365 days filter
hlr_tasks = FactoryBot.create_list(:higher_level_review_vha_task_with_decision, 
          10, 
          appeal: FactoryBot.create(
		    :higher_level_review,
            :with_request_issue,
            :with_intake,
            :with_decision,
            benefit_type: "vha",
            claimant_type: :veteran_claimant)
		)
sc_tasks = FactoryBot.create_list(:supplemental_claim_vha_task_with_decision, 
          10, 
          appeal: FactoryBot.create(
		    :supplemental_claim,
            :with_request_issue,
            :with_intake,
            :with_decision,
            benefit_type: "vha",
            claimant_type: :veteran_claimant)
		)
PaperTrail.request(enabled: false) do
  hlr_tasks.each do |task|
    task.update!(closed_at: rand(40.days.ago..Time.now)) 
  end
    sc_tasks.each do |task|
    task.update!(closed_at: rand(40.days.ago..Time.now)) 
  end
end
  1. Login as a VHA user and navigate to the VHA decision review queue
  2. Click on the Download completed tasks button and verify that it still includes all completed tasks (assuming the last 7 days pre filter is not present)
  3. Filter by the completed date and set it to last 7 days
  4. Click on the Download completed tasks button again and verify that only tasks completed in the last 7 days are present in the csv
  5. Filter by an issue type and verify that only that issue type is present in the report. This will be a bit difficult since there's no indication of issue types in the report so you will have to note ahead of time the task ids or veterans to manually verify this.
  6. Lastly filter by an decision review type e.g. HLR or SC and verify that only that type appears in the CSV download.
  7. Login as another business line user like education and navigate to their decision review queue
  8. Verify that the download completed tasks still shows all tasks regardless of what filters you apply
  • For feature branches merging into main: Was this deployed to UAT?

Frontend

User Facing Changes

  • Screenshots of UI changes added to PR & Original Issue
BEFORE AFTER

Storybook Story

For Frontend (Presentation) Components

  • Add a Storybook file alongside the component file (e.g. create MyComponent.stories.js alongside MyComponent.jsx)
  • Give it a title that reflects the component's location within the overall Caseflow hierarchy
  • Write a separate story (within the same file) for each discrete variation of the component

Backend

Database Changes

Only for Schema Changes

  • Add typical timestamps (created_at, updated_at) for new tables
  • Update column comments; include a "PII" prefix to indicate definite or potential PII data content
  • Have your migration classes inherit from Caseflow::Migration, especially when adding indexes (use add_safe_index) (see Writing DB migrations)
  • Verify that migrate:rollback works as desired (change supported functions)
  • Perform query profiling (eyeball Rails log, check bullet and fasterer output)
  • For queries using raw sql was an explain plan run by System Team
  • Add appropriate indexes (especially for foreign keys, polymorphic columns, unique constraints, and Rails scopes)
  • Run make check-fks; add any missing foreign keys or add to config/initializers/immigrant.rb (see Record associations and Foreign Keys)
  • Add belongs_to for associations to enable the schema diagrams to be automatically updated
  • Document any non-obvious semantics or logic useful for interpreting database data at Caseflow Data Model and Dictionary

Integrations: Adding endpoints for external APIs

  • Check that Caseflow's external API code for the endpoint matches the code in the relevant integration repo
    • Request: Service name, method name, input field names
    • Response: Check expected data structure
    • Check that calls are wrapped in MetricService record block
  • Check that all configuration is coming from ENV variables
    • Listed all new ENV variables in description
    • Worked with or notified System Team that new ENV variables need to be set
  • Update Fakes
  • For feature branches: Was this tested in Caseflow UAT

Best practices

Code Documentation Updates

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

Tests

Test Coverage

Did you include any test coverage for your code? Check below:

  • RSpec
  • Jest
  • Other

Code Climate

Your code does not add any new code climate offenses? If so why?

  • No new code climate issues added

Monitoring, Logging, Auditing, Error, and Exception Handling Checklist

Monitoring

  • Are performance metrics (e.g., response time, throughput) being tracked?
  • Are key application components monitored (e.g., database, cache, queues)?
  • Is there a system in place for setting up alerts based on performance thresholds?

Logging

  • Are logs being produced at appropriate log levels (debug, info, warn, error, fatal)?
  • Are logs structured (e.g., using log tags) for easier querying and analysis?
  • Are sensitive data (e.g., passwords, tokens) redacted or omitted from logs?
  • Is log retention and rotation configured correctly?
  • Are logs being forwarded to a centralized logging system if needed?

Auditing

  • Are user actions being logged for audit purposes?
  • Are changes to critical data being tracked ?
  • Are logs being securely stored and protected from tampering or exposing protected data?

Error Handling

  • Are errors being caught and handled gracefully?
  • Are appropriate error messages being displayed to users?
  • Are critical errors being reported to an error tracking system (e.g., Sentry, ELK)?
  • Are unhandled exceptions being caught at the application level ?

Exception Handling

  • Are custom exceptions defined and used where appropriate?
  • Is exception handling consistent throughout the codebase?
  • Are exceptions logged with relevant context and stack trace information?
  • Are exceptions being grouped and categorized for easier analysis and resolution?

…ss line reporter by the filters that are present on the vha decision review queue.
…ehavior for other business lines but keep the new filtering behavior for VHA. Added tests for the filtered business line reporter.
Copy link

codeclimate bot commented Oct 22, 2024

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

View more on Code Climate.

@TylerBroyles TylerBroyles added Stakeholder: VHA Functionality associated with Veterans Health Administration workflows/feature requests ruby Pull requests that update Ruby code Team: Saturn 🪐 A development team for the VHA business line ART: VHA Feature: VHA Decision Review Requirement javascript Pull requests that update Javascript code labels Oct 22, 2024
@roberttravispierce
Copy link
Contributor

Code climate is complaining of duplicate code in the tests: https://codeclimate.com/github/department-of-veterans-affairs/caseflow/pull/23321

    const openFilter = async (container) => {
      const svg = container.querySelectorAll('svg');
 
      const filter = svg[svg.length - 1];

Take a look. Once resolved I'll point this PR at the feature branch. Thanks.

@TylerBroyles TylerBroyles marked this pull request as ready for review October 25, 2024 18:46
@brandondorner brandondorner changed the base branch from main to feature/APPEALS-53424 October 25, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ART: VHA Feature: VHA Decision Review Requirement javascript Pull requests that update Javascript code ruby Pull requests that update Ruby code Stakeholder: VHA Functionality associated with Veterans Health Administration workflows/feature requests Team: Saturn 🪐 A development team for the VHA business line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants