Skip to content

Commit

Permalink
reduce method length
Browse files Browse the repository at this point in the history
  • Loading branch information
evansmith committed Dec 4, 2024
1 parent 153d482 commit 70d9d4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/sidekiq/central_mail/submit_central_form686c_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,19 @@ def get_hash_and_pages(file_path)
}
end

def generate_metadata # rubocop:disable Metrics/MethodLength
def generate_metadata
form = claim.parsed_form['dependents_application']
veteran_information = form['veteran_information'].presence || claim.parsed_form['veteran_information']
form_pdf_metadata = get_hash_and_pages(form_path)
address = form['veteran_contact_information']['veteran_address']
receive_date = claim.created_at.in_time_zone('Central Time (US & Canada)')
is_usa = address['country_name'] == 'USA'
metadata = {
'veteranFirstName' => veteran_information['full_name']['first'],
'veteranLastName' => veteran_information['full_name']['last'],
'fileNumber' => veteran_information['file_number'] || veteran_information['ssn'],
'receiveDt' => receive_date.strftime('%Y-%m-%d %H:%M:%S'),
'uuid' => claim.guid,
'zipCode' => is_usa ? address['zip_code'] : FOREIGN_POSTALCODE,
'zipCode' => address['country_name'] == 'USA' ? address['zip_code'] : FOREIGN_POSTALCODE,
'source' => 'va.gov',
'hashV' => form_pdf_metadata[:hash],
'numberAttachments' => attachment_paths.size,
Expand Down

0 comments on commit 70d9d4a

Please sign in to comment.