Skip to content

LG-8932: Send USPS the state ID address instead of residential address#8098

Merged
NavaTim merged 3 commits intomainfrom
tbradley/lg-8932-send-state-id-details-to-usps
Mar 31, 2023
Merged

LG-8932: Send USPS the state ID address instead of residential address#8098
NavaTim merged 3 commits intomainfrom
tbradley/lg-8932-send-state-id-details-to-usps

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Mar 30, 2023

🎫 Ticket

🛠 Summary of changes

If the Double Address Verification feature is enabled for a given in-person enrollment record, then send the state ID address to USPS instead of the residential address.

📜 Testing Plan

  • Enable feature flag in_person_capture_secondary_id_enabled
  • Complete in in-person proofing process up to the state ID form
  • Complete state ID form, indicating that the residential address differs from the ID
  • Complete the following residential address form with a different address
  • Complete the remainder of the in-person proofing process
  • Verify with USPS that they received the state ID address

changelog: Upcoming Features, In-Person Proofing, Send USPS the state ID address instead of residential address based on a feature flag
@NavaTim NavaTim requested review from a team and eileen-nava March 30, 2023 02:10
Copy link
Contributor

@eileen-nava eileen-nava left a comment

Choose a reason for hiding this comment

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

Hey, I started to review this then saw the build is failing. It looks like there’s a problem with the symbolize_keys method. Here's a link to one of the failing specs. Could you please get the build to pass and then I’ll return to this review? Thanks!

@@ -45,17 +45,26 @@ def create_usps_enrollment(enrollment, pii)
# Use the enrollment's unique_id value if it exists, otherwise use the deprecated
# #usps_unique_id value in order to remain backwards-compatible. LG-7024 will remove this
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not directly related to this PR, but should we add LG-7024 to our scheduled work for upcoming sprints?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eileen-nava I think that's a good idea, would recommend bringing it up in the Slack channel w/ David & Sumi.

Copy link
Contributor

@sheldon-b sheldon-b left a comment

Choose a reason for hiding this comment

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

Couple minor comments but generally looks good! Will wait for the build to pass to approve


private

SECONDARY_ID_CAPTURE_MAP = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this seems more descriptive to me

Suggested change
SECONDARY_ID_CAPTURE_MAP = {
SECONDARY_ID_ADDRESS_MAP = {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This constant name was based on the feature flag, but I think your refactor is more intuitive. I'll push up this change in a bit.

transform_keys(&:to_s).freeze
end

context 'DAV enabled' do
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer spelling out acronyms so it's more comprehensible to people who aren't familiar with it

Suggested change
context 'DAV enabled' do
context 'double address verification is enabled' do

Copy link
Contributor Author

@NavaTim NavaTim Mar 30, 2023

Choose a reason for hiding this comment

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

The context is provided by the outer describe block here. If anything, I would remove DAV altogether and just leave enabled. Also was thinking spelling this out again could be excessively verbose for the output in the case of a test failure.


# If we're using secondary ID capture (aka double address verification),
# then send the state ID address to USPS. Otherwise send the residential address.
if enrollment.capture_secondary_id_enabled?
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, should we also check that the user actually entered two different addresses?

Suggested change
if enrollment.capture_secondary_id_enabled?
if enrollment.capture_secondary_id_enabled? && !pii.same_address_as_id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the state_id_* fields would be the only fields containing values in that case. This kind of transformation would still need to occur.

Copy link
Contributor

@sheldon-b sheldon-b Mar 30, 2023

Choose a reason for hiding this comment

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

The plan is to copy the user's state ID address into the address1, address2, etc fields if the user says that their residential address matches their state ID address, so those fields will be filled and this would be unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's my understanding that the copying is not implemented yet. When the copying is implemented, then we could potentially add that as an optimization on this code.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not implemented, but these fields aren't empty either. The user just inputs their address twice no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, and the story for doing that is literally the next story we have planned to pull in.

Copy link
Contributor

@sheldon-b sheldon-b left a comment

Choose a reason for hiding this comment

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

👍

@NavaTim NavaTim merged commit 24db89d into main Mar 31, 2023
@NavaTim NavaTim deleted the tbradley/lg-8932-send-state-id-details-to-usps branch March 31, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants