Class: VeteranVerification::Service
Constant Summary
collapse
- STATSD_KEY_PREFIX =
'api.veteran_verification'
Instance Method Summary
collapse
#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Instance Method Details
#get_rated_disabilities(icn, lighthouse_client_id = nil, lighthouse_rsa_key_path = nil, options = {}) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/lighthouse/veteran_verification/service.rb', line 22
def get_rated_disabilities(icn, lighthouse_client_id = nil, lighthouse_rsa_key_path = nil, options = {})
endpoint = 'disability_rating'
config
.get(
"#{endpoint}/#{icn}",
lighthouse_client_id,
lighthouse_rsa_key_path,
options
)
.body
rescue => e
handle_error(e, lighthouse_client_id, endpoint, options)
end
|
#get_vet_verification_status(icn, lighthouse_client_id = nil, lighthouse_rsa_key_path = nil, options = {}) ⇒ Object
Request a veteran’s Title 38 status
see https://developer.va.gov/explore/api/veteran-service-history-and-eligibility/docs
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/lighthouse/veteran_verification/service.rb', line 39
def get_vet_verification_status(icn, lighthouse_client_id = nil, lighthouse_rsa_key_path = nil, options = {})
endpoint = 'status'
response = config.get(
"#{endpoint}/#{icn}",
lighthouse_client_id,
lighthouse_rsa_key_path,
options
).body
transform_response(response)
rescue => e
StatsD.increment(VeteranVerification::Constants::STATSD_VET_VERIFICATION_FAIL_KEY)
handle_error(e, lighthouse_client_id, endpoint)
ensure
StatsD.increment(VeteranVerification::Constants::STATSD_VET_VERIFICATION_TOTAL_KEY)
end
|
#handle_error(error, lighthouse_client_id, endpoint, options = {}) ⇒ Object
56
57
58
59
60
61
62
63
64
|
# File 'lib/lighthouse/veteran_verification/service.rb', line 56
def handle_error(error, lighthouse_client_id, endpoint, options = {})
Lighthouse::ServiceException.send_error(
error,
self.class.to_s.underscore,
lighthouse_client_id,
"#{config.base_api_path}/#{endpoint}",
options
)
end
|
#log_reason(reason) ⇒ Object
84
85
86
|
# File 'lib/lighthouse/veteran_verification/service.rb', line 84
def log_reason(reason)
::Rails.logger.info('Vet Verification Status Success', { not_confirmed_reason: reason })
end
|