Skip to content

Commit

Permalink
Removing unused download_pdf functionality from health_care_applicati…
Browse files Browse the repository at this point in the history
…on controller (#16323)
  • Loading branch information
bosawt authored Apr 15, 2024
1 parent 6a70c96 commit 1e48c4c
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 453 deletions.
17 changes: 1 addition & 16 deletions app/controllers/v0/health_care_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class HealthCareApplicationsController < ApplicationController
service_tag 'healthcare-application'
FORM_ID = '1010ez'

skip_before_action(:authenticate, only: %i[create show enrollment_status healthcheck download_pdf facilities])
skip_before_action(:authenticate, only: %i[create show enrollment_status healthcheck facilities])

before_action :record_submission_attempt, only: :create
before_action :load_user, only: %i[create enrollment_status]
Expand Down Expand Up @@ -69,14 +69,6 @@ def healthcheck
render(json: HCA::Service.new.health_check)
end

def download_pdf
source_file_path = PdfFill::Filler.fill_form(health_care_application, SecureRandom.uuid, sign: false)
file_contents = File.read(source_file_path)
File.delete(source_file_path)

send_data file_contents, filename: file_name_for_pdf, type: 'application/pdf', disposition: 'attachment'
end

def facilities
render(json: lighthouse_facilities_service.get_facilities(lighthouse_facilities_params))
end
Expand Down Expand Up @@ -109,13 +101,6 @@ def lighthouse_facilities_params
)
end

def file_name_for_pdf
veteran_name = health_care_application.parsed_form.try(:[], 'veteranFullName')
first_name = veteran_name.try(:[], 'first') || 'First'
last_name = veteran_name.try(:[], 'last') || 'Last'
"10-10EZ_#{first_name}_#{last_name}.pdf"
end

def record_submission_attempt
StatsD.increment("#{HCA::Service::STATSD_KEY_PREFIX}.submission_attempt")
if health_care_application.short_form?
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
get(:enrollment_status)
get(:rating_info)
get(:facilities)
post(:download_pdf)
end
end

Expand Down
2 changes: 0 additions & 2 deletions lib/pdf_fill/filler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
require 'pdf_fill/forms/va210781'
require 'pdf_fill/forms/va218940'
require 'pdf_fill/forms/va1010cg'
require 'pdf_fill/forms/va1010ez'
require 'pdf_fill/forms/va686c674'
require 'pdf_fill/forms/va281900'
require 'pdf_fill/forms/va288832'
Expand All @@ -32,7 +31,6 @@ module Filler
'21-0781' => PdfFill::Forms::Va210781,
'21-8940' => PdfFill::Forms::Va218940,
'10-10CG' => PdfFill::Forms::Va1010cg,
'10-10EZ' => PdfFill::Forms::Va1010ez,
'686C-674' => PdfFill::Forms::Va686c674,
'28-1900' => PdfFill::Forms::Va281900,
'28-8832' => PdfFill::Forms::Va288832,
Expand Down
111 changes: 0 additions & 111 deletions lib/pdf_fill/forms/maps/input_map_1010_ez.rb

This file was deleted.

113 changes: 0 additions & 113 deletions lib/pdf_fill/forms/maps/key_map_1010_ez.rb

This file was deleted.

Binary file removed lib/pdf_fill/forms/pdfs/10-10EZ.pdf
Binary file not shown.
Loading

0 comments on commit 1e48c4c

Please sign in to comment.