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

Submit action for 'No Errors Found' modal #23636

Draft
wants to merge 4 commits into
base: feature/APPEALS-49620-and-APPEALS-49626
Choose a base branch
from

Conversation

piedram
Copy link
Contributor

@piedram piedram commented Nov 27, 2024

Resolves APPEALS-64077

Description

As a Caseflow User I need the ability to upload the "final PDF" to the selected Appellants eFolder endpoint in VBMS so that files can be retrieved when needed.

As a Caseflow Developer I need to;

Create a new method on submit for 'No Errors Found'
1- DocketNumber_interenalHearingID_HearingClassName.pdf

  • Found in the transcription_files table
  • aws_link column for the pdf file

2- Upload the PDF file to the Appellants eFolder location in VBMS

Acceptance Criteria

  • Code compiles correctly

Testing Plan

Frontend

  1. Open claseflow demo application.
  2. Login like a admin Hearing
  3. Go to demo/hearings/transcription_files
  4. Switch the view and select Hearing Admin Team cases
  5. Select any hearing with a Review Transcript task open
  6. In the action Select No errors found: Upload transcript to VBMS
  7. Add a description in the text area and click Upload to VBMS

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

@@ -187,6 +187,37 @@ def request_hearing_disposition_change
end

def upload_transcription_to_vbms
file_paths = ReviewTranscriptTask.find_by(id: task.id).appeal.hearings.first.transcription_files
Copy link
Contributor

Choose a reason for hiding this comment

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

Change ReviewTranscriptTask.find_by(task.id)... to task

You already have the task - you do not need to query the db again using the id of the task you have already fetched.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mchbidwell Getting from ReviewTranscriptTask to TranscriptionFile seems prone to wackiness - tasks -> appeals -> hearings (could be multiple hearings for an appeal) -> transcription_files

In the implementation here, we're arbitrarily grabbing .first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


private

def create_document_params(appeal, file_name, current_file_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it may need to belong in another class - probably not the responsibility of TasksController

file_paths = ReviewTranscriptTask.find_by(id: task.id).appeal.hearings.first.transcription_files
.where(file_type: "pdf").map(&:fetch_file_from_s3!)

appeal = ReviewTranscriptTask.find_by(id: task.id).appeal
Copy link
Contributor

Choose a reason for hiding this comment

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

Again ReviewTranscriptTask.find_by(id: task.id) can just be task

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants