-
Notifications
You must be signed in to change notification settings - Fork 166
LG-7602 Pull VA IP Data and Store It In Session (Controller and Flow State) 3 of 3 #7022
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
Merged
gangelo
merged 6 commits into
main
from
lg-7602-pull-va-ip-data-and-store-it-in-session-controller-and-flow-state
Sep 23, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e55ea99
Include mixins needed for Inherited Proofing flow
gangelo 85ecd42
Set the initial session for our flow
gangelo 79b5371
Add mixin to obtain user pii needed
gangelo a749f49
Add a mixin to manage the user pii and flow session
gangelo 0f4ce3d
Refactor the AgreementStep to save user pii
gangelo 412b32b
Refactor specs to accomodate changes
gangelo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/services/idv/steps/inherited_proofing/user_pii_managable.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| module Idv | ||
| module Steps | ||
| module InheritedProofing | ||
| module UserPiiManagable | ||
| include UserPiiRetrievable | ||
|
|
||
| def inherited_proofing_save_user_pii_to_session! | ||
| inherited_proofing_save_session! | ||
| inherited_proofing_skip_steps! | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def inherited_proofing_save_session! | ||
| return unless inherited_proofing_form_response.success? | ||
|
|
||
| flow_session[:pii_from_user] = | ||
| flow_session[:pii_from_user].to_h.merge(inherited_proofing_user_pii) | ||
| # This is unnecessary, but added for completeness. Any subsequent FLOWS we | ||
| # might splice into will pull from idv_session['applicant'] and merge into | ||
| # flow_session[:pii_from_user] anyhow in their #initialize(r); any subsequent | ||
| # STEP FLOWS we might splice into will populate idv_session['applicant'] and | ||
| # ultimately get merged in to flow_session[:pii_from_user] as well. | ||
| idv_session['applicant'] = flow_session[:pii_from_user] | ||
| end | ||
|
|
||
| def inherited_proofing_skip_steps! | ||
| idv_session['profile_confirmation'] = true | ||
| idv_session['vendor_phone_confirmation'] = false | ||
| idv_session['user_phone_confirmation'] = false | ||
| idv_session['address_verification_mechanism'] = 'phone' | ||
| idv_session['resolution_successful'] = 'phone' | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end |
39 changes: 39 additions & 0 deletions
39
app/services/idv/steps/inherited_proofing/user_pii_retrievable.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| module Idv | ||
| module Steps | ||
| module InheritedProofing | ||
| module UserPiiRetrievable | ||
| def inherited_proofing_user_pii | ||
| inherited_proofing_info[0] | ||
| end | ||
|
|
||
| def inherited_proofing_form_response | ||
| inherited_proofing_info[1] | ||
| end | ||
|
|
||
| private | ||
|
|
||
| # This needs error handling. | ||
| def inherited_proofing_info | ||
| return @inherited_proofing_info if defined? @inherited_proofing_info | ||
|
|
||
| payload_hash = inherited_proofing_service.execute.dup | ||
| form = inherited_proofing_form(payload_hash) | ||
| form_response = form.submit | ||
|
|
||
| user_pii = {} | ||
| user_pii = form.user_pii if form_response.success? | ||
|
|
||
| @inherited_proofing_info = [user_pii, form_response] | ||
| end | ||
|
|
||
| def inherited_proofing_service | ||
| controller.inherited_proofing_service | ||
| end | ||
|
|
||
| def inherited_proofing_form(payload_hash) | ||
| controller.inherited_proofing_form payload_hash | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.