-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: master
Are you sure you want to change the base?
Conversation
…f-veterans-affairs/vets-api into rcassity-new-v2-uri
# @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There aren't ICN
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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) |
There was a problem hiding this comment.
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' } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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
?
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? |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
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 |
There was a problem hiding this comment.
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?
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 |
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 |
There was a problem hiding this comment.
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.
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 |
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
toRESIDENCE
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
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
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?