Use selected in-person location details from session#6645
Conversation
**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) |
There was a problem hiding this comment.
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:
identity-idp/app/forms/gpo_verify_form.rb
Lines 22 to 26 in 1c84c38
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@tomas-nava Would you want to see that here, or should we follow-up with that as part of the GPO supports implementation?
There was a problem hiding this comment.
let's follow up with that
| profile: profile, | ||
| user: user, | ||
| current_address_matches_id: pii[:same_address_as_id], | ||
| current_address_matches_id: pii['same_address_as_id'], |
There was a problem hiding this comment.
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"
tomas-nava
left a comment
There was a problem hiding this comment.
approve! I appreciate the new specs
Context: #6635 (comment)
Why: Because the user's selection should be respected.
Screenshot: