diff --git a/lib/va_profile/v2/contact_information/service.rb b/lib/va_profile/v2/contact_information/service.rb index 6765e646e8..907c2b22a4 100644 --- a/lib/va_profile/v2/contact_information/service.rb +++ b/lib/va_profile/v2/contact_information/service.rb @@ -35,7 +35,7 @@ class Service < VAProfile::Service def get_person with_monitoring do vet360_id_present! - raw_response = perform(:get, "#{MPI::Constants::VA_ROOT_OID}/#{ERB::Util.url_encode(icn_with_aaid)}") + raw_response = perform(:get, "#{MPI::Constants::VA_ROOT_OID}/#{ERB::Util.url_encode(uuid_with_aaid)}") PersonResponse.from(raw_response) end rescue Common::Client::Errors::ClientError => e @@ -213,7 +213,7 @@ def get_person_transaction_status(transaction_id) private - def icn_with_aaid + def uuid_with_aaid return "#{@user.idme_uuid}^PN^200VIDM^USDVA" if @user.idme_uuid return "#{@user.logingov_uuid}^PN^200VLGN^USDVA" if @user.logingov_uuid return "#{vet360_id}^PI^200VETS^USDVA" if @user.idme_uuid.blank? && @user.logingov_uuid.blank? @@ -290,7 +290,7 @@ def vet360_id_present! def post_or_put_data(method, model, path, response_class) with_monitoring do vet360_id_present! - request_path = "#{MPI::Constants::VA_ROOT_OID}/#{ERB::Util.url_encode(icn_with_aaid)}" + "/#{path}" + request_path = "#{MPI::Constants::VA_ROOT_OID}/#{ERB::Util.url_encode(uuid_with_aaid)}" + "/#{path}" raw_response = perform(method, request_path, model.in_json) response_class.from(raw_response) end diff --git a/lib/va_profile/v2/person/service.rb b/lib/va_profile/v2/person/service.rb index fc96a43246..37f2265ce3 100644 --- a/lib/va_profile/v2/person/service.rb +++ b/lib/va_profile/v2/person/service.rb @@ -27,7 +27,7 @@ class Service < VAProfile::Service # def init_vet360_id with_monitoring do - raw_response = perform(:post, "#{MPI::Constants::VA_ROOT_OID}/#{ERB::Util.url_encode(icn_with_aaid)}", + raw_response = perform(:post, "#{MPI::Constants::VA_ROOT_OID}/#{ERB::Util.url_encode(uuid_with_aaid)}", empty_body) VAProfile::V2::ContactInformation::PersonTransactionResponse.from(raw_response, @user) end @@ -39,7 +39,7 @@ def init_vet360_id # @see https://ruby-doc.org/stdlib-2.3.0/libdoc/erb/rdoc/ERB/Util.html # - def icn_with_aaid + def uuid_with_aaid return "#{@user.idme_uuid}^PN^200VIDM^USDVA" if @user.idme_uuid return "#{@user.logingov_uuid}^PN^200VLGN^USDVA" if @user.logingov_uuid return "#{@user.vet360_id}^PI^200VETS^USDVA" if @user.idme_uuid.blank? && @user.logingov_uuid.blank? diff --git a/spec/lib/va_profile/v2/person/service_spec.rb b/spec/lib/va_profile/v2/person/service_spec.rb index 9e4bd974e1..f775059047 100644 --- a/spec/lib/va_profile/v2/person/service_spec.rb +++ b/spec/lib/va_profile/v2/person/service_spec.rb @@ -17,7 +17,7 @@ Flipper.enable(:va_v3_contact_information_service) end - context 'with a user present, that has a icn_with_aaid, and no passed in ICN' do + context 'with a user present, that has a uuid_with_aaid, and no passed in ICN' do it 'returns a status of 200', :aggregate_failures do VCR.use_cassette('va_profile/v2/person/init_vet360_id_success', VCR::MATCH_EVERYTHING) do response = subject.init_vet360_id diff --git a/spec/requests/v0/profile/persons_spec.rb b/spec/requests/v0/profile/persons_spec.rb index 6fa2bc4035..c6e8f1f204 100644 --- a/spec/requests/v0/profile/persons_spec.rb +++ b/spec/requests/v0/profile/persons_spec.rb @@ -164,7 +164,7 @@ }.to_json end - context 'with a user that has an icn_with_aaid' do + context 'with a user that has an uuid_with_aaid' do it 'matches the transaction response schema', :aggregate_failures do VCR.use_cassette('va_profile/v2/person/init_vet360_id_success', VCR::MATCH_EVERYTHING) do post('/v0/profile/initialize_vet360_id', params: empty_body, headers:)