Class: EVSS::CommonService

Inherits:
BaseService show all
Defined in:
lib/evss/common_service.rb

Constant Summary collapse

API_VERSION =
Settings.evss.versions.common
BASE_URL =
"#{Settings.evss.url}/wss-common-services-web-#{API_VERSION}/rest/".freeze

Constants inherited from BaseService

BaseService::DEFAULT_TIMEOUT, BaseService::SYSTEM_NAME

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseService

#base_url, create_breakers_service, #get, #post, #timeout

Methods included from SentryLogging

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

Constructor Details

#initialize(*args) ⇒ CommonService

Returns a new instance of CommonService.



11
12
13
14
# File 'lib/evss/common_service.rb', line 11

def initialize(*args)
  super
  @use_mock = Settings.evss.mock_common_service || false
end

Class Method Details

.breakers_serviceObject



27
28
29
# File 'lib/evss/common_service.rb', line 27

def self.breakers_service
  BaseService.create_breakers_service(name: 'EVSS/Common', url: BASE_URL)
end

Instance Method Details

#get_current_infoObject



16
17
18
# File 'lib/evss/common_service.rb', line 16

def get_current_info
  post 'vsoSearch/11.6/getCurrentInfo'
end

#get_rating_infoObject



20
21
22
23
24
25
# File 'lib/evss/common_service.rb', line 20

def get_rating_info
  msg_body = { 'participantId' => @headers['va_eauth_pid'] }
  headers = { 'Content-Type' => 'application/json' }
  raw_response = post 'ratingInfoService/11.6/findRatingInfoPID', msg_body.to_json, headers
  EVSS::DisabilityCompensationForm::RatingInfoResponse.new(raw_response.status, raw_response)
end