Skip to content

Use selected in-person location details from session#6645

Merged
aduth merged 3 commits intomainfrom
aduth-ipp-selected-location
Jul 28, 2022
Merged

Use selected in-person location details from session#6645
aduth merged 3 commits intomainfrom
aduth-ipp-selected-location

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jul 28, 2022

Context: #6635 (comment)

Why: Because the user's selection should be respected.

Screenshot:

Screen Shot 2022-07-28 at 9 42 18 AM

**Why**: Because the user's selection should be respected.

changelog: Upcoming Features, In-person proofing, Use user's selected location for USPS enrollment
module UspsInPersonProofing
class EnrollmentHelper
def save_in_person_enrollment(user, profile, pii)
def save_in_person_enrollment(user, profile, pii, selected_location_details = nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe a later pull request if we're not yet targeting GPO support, but we need to figure out how to pass this from GpoVerifyForm:

UspsInPersonProofing::EnrollmentHelper.new.save_in_person_enrollment(
user,
pending_profile,
pii,
)

This is difficult because (a) we can't rely on the session and (b) the enrollment record hasn't been created yet.

My initial instinct is that we should do something like what I described as the second option of #6629 (comment) : always create the enrollment in the initial flow, but keep it establishing and wait to send it to USPS. That way, we have the selected location details saved in the record. The challenge is that we need to update how we're thinking about deadline dates, since we cannot use creation date of the record (it may be different from the USPS enrollment creation).

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 creating an :establishing enrollment and adding a started_pending_at (or something) column to the enrollments table that we could us to calculate the expiration date would work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tomas-nava Would you want to see that here, or should we follow-up with that as part of the GPO supports implementation?

Copy link
Contributor

Choose a reason for hiding this comment

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

let's follow up with that

@aduth aduth marked this pull request as ready for review July 28, 2022 14:25
@aduth aduth requested review from a team, sheldon-b and tomas-nava July 28, 2022 14:25
profile: profile,
user: user,
current_address_matches_id: pii[:same_address_as_id],
current_address_matches_id: 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.

This might have been working incorrectly before as well. Note below in create_usps_enrollment we pick out pii attributes from the hash as string keys, not symbols. I confirmed in the FSMv1 flow that all these keys are strings. I haven't yet tested FSMv2. I believe GPO passes as an instance of Pii::Attributes which supports indifferent access.

[2] pry(main)> Pii::Attributes.new_from_hash(Idp::Constants::MOCK_IDV_APPLICANT_WITH_PHONE)['first_name']
=> "FAKEY"

Copy link
Contributor

@tomas-nava tomas-nava left a comment

Choose a reason for hiding this comment

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

approve! I appreciate the new specs

@aduth aduth merged commit 095b0c4 into main Jul 28, 2022
@aduth aduth deleted the aduth-ipp-selected-location branch July 28, 2022 14:50
@aduth aduth changed the title Use selected location details from session Use selected in-person location details from session Jul 28, 2022
@solipet solipet mentioned this pull request Aug 9, 2022
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.

2 participants