Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created PersonV2 Service and enabled ContactInformationV2 for StatementIdentifierService and McpNotificationEmailJob #18514

Open
wants to merge 50 commits into
base: master
Choose a base branch
from

Conversation

RachalCassity
Copy link
Member

@RachalCassity RachalCassity commented Sep 19, 2024

Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.

Summary

The new ContactInformationV2 service modified the addressPou value from RESIDENCE/CHOICE to RESIDENCE and VAProfile::Models::V2::Address was created to build the address records with the correct addressPou. Created PersonV2 Service and VAProfile::Models::V2::Person to utilize the new VAProfile::Models::V2::Address.

With the new PersonV2 Service, the ContactInformationV2 Service can now be enabled for McpNotificationEmailJob and StatementIdentifierService.

Related issue(s)

Testing done

  • New code is covered by unit tests
  • New ContactInformationV2 Service can be tested throughout the vets-api, besides mobile endpoints. The latency and requests will be monitored for the new service in Datadog.

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

# @see https://ruby-doc.org/stdlib-2.3.0/libdoc/erb/rdoc/ERB/Util.html
#
def icn_with_aaid
return "#{@user.idme_uuid}^PN^200VIDM^USDVA" if @user.idme_uuid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There aren't ICN

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know. I kept the icn_with_aaid method for the moment. We will be refactoring a lot of code after we make sure the upgrade is successful. I can update the method name now though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contact Service is not using the ICN to make requests, I changed the method from icn_with_aaid with uuid_with_aaid to avoid confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, that makes more sense

Copy link
Contributor

@bosawt bosawt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to look at the solution more closely, it looks like things have already been merged that are trying to send ICN to another service but what it's sending is not ICN, so just 'requesting changes' until I can confirm this is intentional or not and whether the changes that have already been merged need to be reconsidered

@@ -243,7 +243,7 @@ GEM
attr_extras (7.1.0)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.976.0)
aws-partitions (1.977.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes in this file intentional?

@@ -165,8 +165,8 @@
loa do
{ current: LOA::THREE, highest: LOA::THREE }
end

idme_uuid { '6767671' }
vet360_id { '6767671' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of having this trait :error in the user factory, it probably just makes sense to define the attribute combination to cause the error for your specific service in the spec file itself. This isn't generally a user error in any other situation so it's difficult for any other spec to leverage this, which is what would be the reason to put a trait in the factory

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idme uuid also has to be null. The :user, :error factory was used to validate invalid user requests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the user model is generally fine without an idme_uuid or a vet360_id, so this doesn't actually describe an error state for the User model, it only describes an error when interacting with this specific service

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?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use VA_PROFILE_ID_POSTFIX from line 16 instead of ^PI^200VETS^USDVA?

Comment on lines +44 to +45
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?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, where do these ^PN^... values come from?

@@ -7,6 +7,194 @@
type: :service do
describe '#get_mpi_data' do
Flipper.disable(:va_v3_contact_information_service)

context 'given edipi statement' do
edipi = '492031291'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where'd you get this edipi from? The edipi I'm familiar with (from here) all start with a 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, never mind... I see it used in fixtures. I just didn't want to to be some actual Veteran edipi 😅

end
end

Flipper.disable(:va_v3_contact_information_service)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be wrapped in a before do block so it doesn't interfere with other tests?

Comment on lines +134 to +136
residence = address_for VAProfile::Models::V2::Address::CORRESPONDENCE
VCR.use_cassette('va_profile/v2/contact_information/person', VCR::MATCH_EVERYTHING) do
expect(contact_info.mailing_address).to eq residence
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call this correspondence instead?

Suggested change
residence = address_for VAProfile::Models::V2::Address::CORRESPONDENCE
VCR.use_cassette('va_profile/v2/contact_information/person', VCR::MATCH_EVERYTHING) do
expect(contact_info.mailing_address).to eq residence
correspondence = address_for VAProfile::Models::V2::Address::CORRESPONDENCE
VCR.use_cassette('va_profile/v2/contact_information/person', VCR::MATCH_EVERYTHING) do
expect(contact_info.mailing_address).to eq correspondence

Comment on lines +184 to +186
phone = phone_for VAProfile::Models::Telephone::FAX
VCR.use_cassette('va_profile/v2/contact_information/person', VCR::MATCH_EVERYTHING) do
expect(contact_info.fax_number).to eq phone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be called fax to distinguish it from the other phone numbers.

Suggested change
phone = phone_for VAProfile::Models::Telephone::FAX
VCR.use_cassette('va_profile/v2/contact_information/person', VCR::MATCH_EVERYTHING) do
expect(contact_info.fax_number).to eq phone
fax = phone_for VAProfile::Models::Telephone::FAX
VCR.use_cassette('va_profile/v2/contact_information/person', VCR::MATCH_EVERYTHING) do
expect(contact_info.fax_number).to eq fax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants