diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 89a194b2c67..039ba73a68a 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -2,6 +2,7 @@ ActiveSupport::Inflector.inflections do |inflect| inflect.acronym 'AWS' + inflect.acronym 'CC' inflect.acronym 'DOD' inflect.acronym 'EMIS' inflect.acronym 'EVSS' diff --git a/modules/vaos/app/controllers/vaos/cc_eligibility_controller.rb b/modules/vaos/app/controllers/vaos/cc_eligibility_controller.rb new file mode 100644 index 00000000000..2b0968559f5 --- /dev/null +++ b/modules/vaos/app/controllers/vaos/cc_eligibility_controller.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module VAOS + class CCEligibilityController < VAOS::BaseController + def show + response = cce_service.get_eligibility(params[:service_type]) + render json: VAOS::CCEligibilitySerializer.new(response[:data], meta: response[:meta]) + end + + private + + def cce_service + VAOS::CCEligibilityService.for_user(current_user) + end + end +end diff --git a/modules/vaos/app/serializers/vaos/cc_eligibility_serializer.rb b/modules/vaos/app/serializers/vaos/cc_eligibility_serializer.rb new file mode 100644 index 00000000000..3957bd084ad --- /dev/null +++ b/modules/vaos/app/serializers/vaos/cc_eligibility_serializer.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'fast_jsonapi' + +module VAOS + class CCEligibilitySerializer + include FastJsonapi::ObjectSerializer + + set_id do |object| + object.patient_request[:service_type] + end + + set_type :cc_eligibility + + attributes :eligible + end +end diff --git a/modules/vaos/app/services/vaos/cc_eligibility_service.rb b/modules/vaos/app/services/vaos/cc_eligibility_service.rb new file mode 100644 index 00000000000..a3ede222d70 --- /dev/null +++ b/modules/vaos/app/services/vaos/cc_eligibility_service.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative '../vaos/concerns/headers' + +module VAOS + class CCEligibilityService < Common::Client::Base + include Common::Client::Monitoring + include SentryLogging + include VAOS::Headers + + configuration VAOS::Configuration + + STATSD_KEY_PREFIX = 'api.vaos' + + attr_accessor :user + + def self.for_user(user) + as = VAOS::CCEligibilityService.new + as.user = user + as + end + + def get_eligibility(service_type) + with_monitoring do + response = perform(:get, url(service_type), nil, headers(user)) + { + data: OpenStruct.new(response.body), + meta: {} + } + end + end + + private + + def url(service_type) + "/cce/v1/patients/#{user.icn}/eligibility/#{service_type}" + end + end +end diff --git a/modules/vaos/app/services/vaos/middleware/response/errors.rb b/modules/vaos/app/services/vaos/middleware/response/errors.rb index 9c3d9ccdd61..e03a3f474a0 100644 --- a/modules/vaos/app/services/vaos/middleware/response/errors.rb +++ b/modules/vaos/app/services/vaos/middleware/response/errors.rb @@ -30,7 +30,12 @@ def error_400(body) end def parse_error(body) - JSON.parse(body)['errors'].first['errorMessage'] + parsed = JSON.parse(body) + if parsed['errors'] + parsed['errors'].first['errorMessage'] + else + parsed['message'] + end rescue body end diff --git a/modules/vaos/config/routes.rb b/modules/vaos/config/routes.rb index 5b6f636cbcd..b8d18fa27b8 100644 --- a/modules/vaos/config/routes.rb +++ b/modules/vaos/config/routes.rb @@ -8,6 +8,7 @@ resources :appointment_requests, only: %i[index create update] do resources :messages, only: %i[index create] end + get 'community_care/eligibility/:service_type', to: 'cc_eligibility#show' resources :systems, only: :index do resources :direct_scheduling_facilities, only: :index resources :pact, only: :index diff --git a/modules/vaos/spec/request/cc_eligibility_request_spec.rb b/modules/vaos/spec/request/cc_eligibility_request_spec.rb new file mode 100644 index 00000000000..842d520e833 --- /dev/null +++ b/modules/vaos/spec/request/cc_eligibility_request_spec.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +require 'rails_helper' +RSpec.describe 'vaos community care eligibility', type: :request do + include SchemaMatchers + + before do + Flipper.enable('va_online_scheduling') + sign_in_as(current_user) + allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') + end + + describe 'GET eligibility' do + let(:service_type) { 'PrimaryCare' } + + context 'loa1 user with flipper enabled' do + let(:current_user) { build(:user, :loa1) } + + it 'does not have access' do + get "/v0/vaos/community_care/eligibility/#{service_type}" + expect(response).to have_http_status(:forbidden) + expect(JSON.parse(response.body)['errors'].first['detail']) + .to eq('You do not have access to online scheduling') + end + end + + context 'loa3 user' do + let(:current_user) { build(:user, :vaos) } + + context 'with flipper disabled' do + it 'does not have access' do + Flipper.disable('va_online_scheduling') + get "/v0/vaos/community_care/eligibility/#{service_type}" + expect(response).to have_http_status(:forbidden) + expect(JSON.parse(response.body)['errors'].first['detail']) + .to eq('You do not have access to online scheduling') + end + end + + it 'has access and returns eligibility true', :skip_mvi do + VCR.use_cassette('vaos/cc_eligibility/get_eligibility_true', match_requests_on: %i[method uri]) do + get "/v0/vaos/community_care/eligibility/#{service_type}" + + expect(response).to have_http_status(:success) + expect(response.body).to be_a(String) + expect(json_body_for(response)).to match_schema('vaos/cc_eligibility') + end + end + + context 'with access and invalid service_type' do + let(:service_type) { 'NotAType' } + + it 'returns a validation error', :skip_mvi do + VCR.use_cassette('vaos/cc_eligibility/get_eligibility_400', match_requests_on: %i[method uri]) do + get "/v0/vaos/community_care/eligibility/#{service_type}" + + expect(response).to have_http_status(:bad_request) + expect(response.body).to be_a(String) + expect(JSON.parse(response.body)['errors'].first['detail']) + .to eq('Unknown service type: NotAType') + end + end + end + end + end +end diff --git a/modules/vaos/spec/routing/vaos_routing_spec.rb b/modules/vaos/spec/routing/vaos_routing_spec.rb index 499448e5cc8..18066a636b8 100644 --- a/modules/vaos/spec/routing/vaos_routing_spec.rb +++ b/modules/vaos/spec/routing/vaos_routing_spec.rb @@ -13,4 +13,13 @@ schedule_type: 'direct' ) end + + it 'routes to the community care eligibilty endpoint' do + expect(get('/v0/vaos/community_care/eligibility/PrimaryCare')).to route_to( + format: :json, + controller: 'vaos/cc_eligibility', + action: 'show', + service_type: 'PrimaryCare' + ) + end end diff --git a/modules/vaos/spec/services/cc_eligibility_service_spec.rb b/modules/vaos/spec/services/cc_eligibility_service_spec.rb new file mode 100644 index 00000000000..a1847d7e6c8 --- /dev/null +++ b/modules/vaos/spec/services/cc_eligibility_service_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe VAOS::CCEligibilityService do + subject { described_class.for_user(user) } + + let(:user) { build(:user, :vaos) } + let(:service_type) { 'PrimaryCare' } + + before { allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') } + + describe '#get_eligibility', :skip_mvi do + it 'gets an eligibility of true' do + VCR.use_cassette('vaos/cc_eligibility/get_eligibility_true', match_requests_on: %i[method uri]) do + response = subject.get_eligibility(service_type) + expect(response[:data].eligible).to eq(true) + end + end + + it 'gets an eligibility of false' do + VCR.use_cassette('vaos/cc_eligibility/get_eligibility_false', match_requests_on: %i[method uri]) do + response = subject.get_eligibility(service_type) + expect(response[:data].eligible).to eq(false) + end + end + + context 'invalid service_type' do + let(:service_type) { 'NotAType' } + + it 'handles 400 error appropriately' do + VCR.use_cassette('vaos/cc_eligibility/get_eligibility_400', match_requests_on: %i[method uri]) do + expect { subject.get_eligibility(service_type) }.to raise_error( + Common::Exceptions::BackendServiceException + ) + end + end + end + end +end diff --git a/spec/support/schemas/vaos/cc_eligibility.json b/spec/support/schemas/vaos/cc_eligibility.json new file mode 100644 index 00000000000..93525a3ab61 --- /dev/null +++ b/spec/support/schemas/vaos/cc_eligibility.json @@ -0,0 +1,15 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "type": "object", + "required": ["id", "type", "attributes"], + "properties": { + "id": { "type": "string" }, + "type": { "type": "string", "enum": ["cc_eligibility"] }, + "attributes": { + "type": "object", + "properties": { + "eligible": { "type": "boolean" } + } + } + } +} diff --git a/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_400.yml b/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_400.yml new file mode 100644 index 00000000000..ec54ab310ef --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_400.yml @@ -0,0 +1,63 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/cce/v1/patients/1012845331V153043/eligibility/NotAType + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://api.va.gov + X-Vamf-Jwt: + - eyJhbGciOiJSUzUxMiJ9.eyJsYXN0TmFtZSI6Ik1vcnJpc29uIiwic3ViIjoiMTAxMjg0NTMzMVYxNTMwNDMiLCJhdXRoZW50aWNhdGVkIjp0cnVlLCJhdXRoZW50aWNhdGlvbkF1dGhvcml0eSI6Imdvdi52YS52YW9zIiwiaWRUeXBlIjoiSUNOIiwiZ2VuZGVyIjoiRkVNQUxFIiwiaXNzIjoiZ292LnZhLnZhbWYudXNlcnNlcnZpY2UudjEiLCJ2YW1mLmF1dGgucmVzb3VyY2VzIjpbIl4uKihcLyk_c2l0ZVtzXT9cLyhkZm4tKT85ODRcL3BhdGllbnRbc10_XC81NTIxNjEwNTBcL2FwcG9pbnRtZW50cyhcLy4qKT8kIiwiXi4qKFwvKT9zaXRlW3NdP1wvKGRmbi0pPzk4M1wvcGF0aWVudFtzXT9cLzcyMTY2OTFcL2FwcG9pbnRtZW50cyhcLy4qKT8kIiwiXi4qKFwvKT9wYXRpZW50W3NdP1wvKElDTlwvKT8xMDEyODQ1MzMxVjE1MzA0MyhcLy4qKT8kIl0sImRhdGVPZkJpcnRoIjoiMTk1My0wNC0wMSIsInZlcnNpb24iOjIuMSwiZWRpcGlkIjoiMTI1OTg5Nzk3OCIsInZpc3RhSWRzIjpbeyJwYXRpZW50SWQiOiI1NTIxNjEwNTAiLCJzaXRlSWQiOiI5ODQifSx7InBhdGllbnRJZCI6IjcyMTY2OTEiLCJzaXRlSWQiOiI5ODMifV0sInNzbiI6Ijc5NjA2MTk3NiIsImZpcnN0TmFtZSI6Ikp1ZHkiLCJzdGFmZkRpc2NsYWltZXJBY2NlcHRlZCI6dHJ1ZSwibmJmIjoxNTc2MjI4NjA1LCJzc3QiOjE1NzYyMjg3ODQsInBhdGllbnQiOnsiZmlyc3ROYW1lIjoiSnVkeSIsImxhc3ROYW1lIjoiTW9ycmlzb24iLCJnZW5kZXIiOiJGRU1BTEUiLCJpY24iOiIxMDEyODQ1MzMxVjE1MzA0MyIsImRvYiI6IjE5NTMtMDQtMDEiLCJkYXRlT2ZCaXJ0aCI6IjE5NTMtMDQtMDEiLCJzc24iOiI3OTYwNjE5NzYifSwiZG9iIjoiMTk1My0wNC0wMSIsInZhbWYuYXV0aC5yb2xlcyI6WyJ2ZXRlcmFuIl0sInJpZ2h0T2ZBY2Nlc3NBY2NlcHRlZCI6dHJ1ZSwiZXhwIjoxNTc2MjI5Njg1LCJqdGkiOiI1MjdmYmViZC04ZTc2LTRiZDgtODI4YS1jNWVlNGFkY2ZkZDMiLCJsb2EiOjJ9.cTMeNagVeuQn5fJEzdYnJWUt8yGA8juLhWy4niHo6ccmkz1xK_cDGFRmGsNys2h-d1hPY1A946AaCCEGZ5ety6Zl22YA_q5JRX9n86716cIQGFccpqVdejhUeWfwKjRczWThc0UjeJ-8NSP7pDrLAF_Apdyi9wwILdQ8FI8Te5-Ad-cF9cxaYStqLv_b6IQ2Rlzqmiyr1FL9foXrAf91KKxC1QrGp6z6RN6CWOsMvkYcszfS3_aMJQiHw4kCtBi1K_IexOAYbeelWgJ5l8pBmE-YQXsfr31zYnxAwrKSb6RFNB08RqVC0Tseo-93DMfdt9eB-2LsJT2OxLG92BbQng + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Fri, 13 Dec 2019 09:19:45 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Server: + - openresty + X-B3-Parentspanid: + - 75e4054218df130e + X-Vamf-Version: + - 1.2.0 + X-B3-Traceid: + - 590e77a0662562b2 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - fcd1945 + X-B3-Sampled: + - '0' + X-Vamf-Timestamp: + - '2019-12-12T12:59:35+0000' + Access-Control-Allow-Origin: + - "*" + X-B3-Spanid: + - 7142053b3e130efa + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + body: + encoding: UTF-8 + string: '{"timestamp":1576228785789,"type":"UnknownServiceTypeException","message":"Unknown + service type: NotAType"}' + http_version: + recorded_at: Fri, 13 Dec 2019 09:19:45 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_false.yml b/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_false.yml new file mode 100644 index 00000000000..b758adc1a96 --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_false.yml @@ -0,0 +1,64 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/cce/v1/patients/1012845331V153043/eligibility/PrimaryCare + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://api.va.gov + X-Vamf-Jwt: + - eyJhbGciOiJSUzUxMiJ9.eyJsYXN0TmFtZSI6Ik1vcnJpc29uIiwic3ViIjoiMTAxMjg0NTMzMVYxNTMwNDMiLCJhdXRoZW50aWNhdGVkIjp0cnVlLCJhdXRoZW50aWNhdGlvbkF1dGhvcml0eSI6Imdvdi52YS52YW9zIiwiaWRUeXBlIjoiSUNOIiwiZ2VuZGVyIjoiRkVNQUxFIiwiaXNzIjoiZ292LnZhLnZhbWYudXNlcnNlcnZpY2UudjEiLCJ2YW1mLmF1dGgucmVzb3VyY2VzIjpbIl4uKihcLyk_c2l0ZVtzXT9cLyhkZm4tKT85ODRcL3BhdGllbnRbc10_XC81NTIxNjEwNTBcL2FwcG9pbnRtZW50cyhcLy4qKT8kIiwiXi4qKFwvKT9zaXRlW3NdP1wvKGRmbi0pPzk4M1wvcGF0aWVudFtzXT9cLzcyMTY2OTFcL2FwcG9pbnRtZW50cyhcLy4qKT8kIiwiXi4qKFwvKT9wYXRpZW50W3NdP1wvKElDTlwvKT8xMDEy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dlRkp-2ZRCywZDOSX8zkJ-7YygTCEvoBm4YAdc9ugsjl4HV1-zlcX62EPi-c_v_iQQBB0P89tqtQ + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 13 Dec 2019 09:19:34 GMT + Content-Type: + - application/json + Content-Length: + - '259' + Server: + - openresty + X-B3-Parentspanid: + - e4c9731afbd8e9c4 + X-Vamf-Version: + - 1.2.0 + X-B3-Traceid: + - 4f93f00d476645a5 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - fcd1945 + X-B3-Sampled: + - '0' + X-Vamf-Timestamp: + - '2019-12-12T12:59:35+0000' + Access-Control-Allow-Origin: + - "*" + X-B3-Spanid: + - 5ea941fbe78631cd + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"patientRequest":{"patientIcn":"1012845331V153043","serviceType":"PrimaryCare","timestamp":"2019-12-13T09:19:34.308802Z"},"eligibilityCodes":[{"description":"Hardship","code":"H"}],"grandfathered":false,"noFullServiceVaMedicalFacility":false,"eligible":false}' + http_version: + recorded_at: Fri, 13 Dec 2019 09:19:34 GMT +recorded_with: VCR 3.0.3 diff --git a/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_true.yml b/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_true.yml new file mode 100644 index 00000000000..5d3dd23b2cb --- /dev/null +++ b/spec/support/vcr_cassettes/vaos/cc_eligibility/get_eligibility_true.yml @@ -0,0 +1,64 @@ +--- +http_interactions: +- request: + method: get + uri: https://veteran.apps.va.gov/cce/v1/patients/1012845331V153043/eligibility/PrimaryCare + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Referer: + - https://api.va.gov + X-Vamf-Jwt: + - eyJhbGci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DEiLCJkYXRlT2ZCaXJ0aCI6IjE5NTMtMDQtMDEiLCJzc24iOiI3OTYwNjE5NzYifSwiZG9iIjoiMTk1My0wNC0wMSIsInZhbWYuYXV0aC5yb2xlcyI6WyJ2ZXRlcmFuIl0sInJpZ2h0T2ZBY2Nlc3NBY2NlcHRlZCI6dHJ1ZSwiZXhwIjoxNTc2MjI5NjQ0LCJqdGkiOiI5NDUwNjAzOS1kM2ZhLTRhNGItOWFmZi05NzI2ZTUxOTZhOGYiLCJsb2EiOjJ9.wP5uqjIYQKN3ZQyVST53_g-QLZM-Sm-KR_esWSAEMx7MRtNEHvHzYw_2oIauLCjSK7nnktbohsvp8lFjs-dVQYWewT-ZWSTsXSN3T-Q7quzoKFsO7sFVL406SWxWZaAIrbof6KyQ-eiiJ5oD7WP4Y72VurRFGErnTJ5PBIuxikEWdtmx3p7ECez_CSWxwuiw-pOUM4JjCKqLmRjVD1foewRu1VWH9-wr91iiLd0jWen-q-2NKEqx_H3W3lIYxtWDMl1X1fsdSqb4hNrplMeonKea6-PlWJkSkn-u2BTM6TVPne0QXKfFcXv6Pc7EJ9aZx9_dJ7kKuzpbFaNWDChxFQ + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 13 Dec 2019 09:19:05 GMT + Content-Type: + - application/json + Content-Length: + - '259' + Server: + - openresty + X-B3-Parentspanid: + - 75c4eb9dcd95990e + X-Vamf-Version: + - 1.2.0 + X-B3-Traceid: + - a0bfcbfe994d80a9 + Access-Control-Allow-Headers: + - x-vamf-jwt + X-Vamf-Build: + - fcd1945 + X-B3-Sampled: + - '0' + X-Vamf-Timestamp: + - '2019-12-12T12:59:35+0000' + Access-Control-Allow-Origin: + - "*" + X-B3-Spanid: + - 96cfedf663a60469 + Access-Control-Allow-Methods: + - GET,OPTIONS + Access-Control-Max-Age: + - '3600' + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"patientRequest":{"patientIcn":"1012845331V153043","serviceType":"PrimaryCare","timestamp":"2019-12-13T09:19:05.253378Z"},"eligibilityCodes":[{"description":"Hardship","code":"H"}],"grandfathered":false,"noFullServiceVaMedicalFacility":false,"eligible":true}' + http_version: + recorded_at: Fri, 13 Dec 2019 09:19:05 GMT +recorded_with: VCR 3.0.3