Skip to content

Commit

Permalink
Changed icn_with_aaid methods to uuid_with_aaid
Browse files Browse the repository at this point in the history
  • Loading branch information
RachalCassity committed Sep 20, 2024
1 parent c13c08a commit d1b2ce4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/va_profile/v2/contact_information/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/va_profile/v2/person/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/va_profile/v2/person/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/v0/profile/persons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:)
Expand Down

0 comments on commit d1b2ce4

Please sign in to comment.