Class: VAProfile::Person::Service

Inherits:
Service show all
Includes:
Common::Client::Concerns::Monitoring, ERB::Util
Defined in:
lib/va_profile/person/service.rb

Constant Summary

Constants inherited from Service

Service::STATSD_KEY_PREFIX

Instance Method Summary collapse

Methods included from Common::Client::Concerns::Monitoring

#with_monitoring

Methods inherited from Service

breakers_service, #initialize, #perform

Methods inherited from Common::Client::Base

configuration, #raise_backend_exception

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Constructor Details

This class inherits a constructor from VAProfile::Service

Instance Method Details

#init_vet360_id(icn = nil) ⇒ VAProfile::ContactInformation::PersonTransactionResponse

Initializes a vet360_id for a user that does not have one. Can be used when a current user is present, or through a rake task when no user is present (through passing in their ICN). This is an asynchronous process for VAProfile, so it returns VAProfile transaction information.

Parameters:

  • icn (String) (defaults to: nil)

    A users ICN. Only required when current user is absent. Intended to be used in a rake task.

Returns:



25
26
27
28
29
30
31
32
33
# File 'lib/va_profile/person/service.rb', line 25

def init_vet360_id(icn = nil)
  with_monitoring do
    raw_response = perform(:post, encode_url!(icn), empty_body)

    VAProfile::ContactInformation::PersonTransactionResponse.from(raw_response, @user)
  end
rescue => e
  handle_error(e)
end