Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
khenson-oddball committed Nov 14, 2024
1 parent a922f41 commit c92b1b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
16 changes: 9 additions & 7 deletions lib/lighthouse/veteran_verification/constants.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# frozen_string_literal: true

module VeteranVerification
module Constants
NOT_FOUND_MESSAGE = [
'We’re sorry. There’s a problem with your discharge status records. We can’t provide a Veteran status ' \
'card for you right now.',
'card for you right now.',
'To fix the problem with your records, call the Defense Manpower Data Center at 800-538-9552 (TTY: 711).' \
' They’re open Monday through Friday, 8:00 a.m. to 8:00 p.m. ET.'
]
' They’re open Monday through Friday, 8:00 a.m. to 8:00 p.m. ET.'
].freeze
NOT_ELIGIBLE_MESSAGE = [
'Our records show that you’re not eligible for a Veteran status card. To get a Veteran status card, you ' \
'must have received an honorable discharge for at least one period of service.',
'must have received an honorable discharge for at least one period of service.',
'If you think your discharge status is incorrect, call the Defense Manpower Data Center at 800-538-9552 ' \
'(TTY: 711). They’re open Monday through Friday, 8:00 a.m. to 8:00 p.m. ET.'
]
'(TTY: 711). They’re open Monday through Friday, 8:00 a.m. to 8:00 p.m. ET.'
].freeze
end
end
end
14 changes: 7 additions & 7 deletions lib/lighthouse/veteran_verification/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def handle_error(error, lighthouse_client_id, endpoint)

def transform_response(response)
attributes = response['data']['attributes']
return response if attributes['veteran_status'] != 'not confirmed' || !attributes.include?('not_confirmed_reason')

if attributes['not_confirmed_reason'] == 'NOT_TITLE_38'
response['data']['message'] = VeteranVerification::Constants::NOT_ELIGIBLE_MESSAGE
else
response['data']['message'] = VeteranVerification::Constants::NOT_FOUND_MESSAGE
end
return response if attributes['veteran_status'] != 'not confirmed' || attributes.exclude?('not_confirmed_reason')

response['data']['message'] =
if attributes['not_confirmed_reason'] == 'NOT_TITLE_38'
VeteranVerification::Constants::NOT_ELIGIBLE_MESSAGE
else
VeteranVerification::Constants::NOT_FOUND_MESSAGE
end
response
end
end
Expand Down

0 comments on commit c92b1b2

Please sign in to comment.