-
Notifications
You must be signed in to change notification settings - Fork 166
Add InPerson::AddressController to FlowPolicy #9794
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
Changes from all commits
e3fa6d7
5a81202
8a08c91
1d5f5af
37a127c
09204d9
3524e2f
71a35e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ class AddressController < ApplicationController | |
|
|
||
| before_action :render_404_if_in_person_residential_address_controller_enabled_not_set | ||
| before_action :confirm_in_person_state_id_step_complete | ||
| ## before_action :confirm_step_allowed # pending FSM removal of state id step | ||
| before_action :confirm_in_person_address_step_needed, only: :show | ||
|
|
||
| def show | ||
|
|
@@ -15,6 +16,8 @@ def show | |
| end | ||
|
|
||
| def update | ||
| # don't clear the ssn when updating address, clear after SsnController | ||
| clear_future_steps_from!(controller: Idv::InPerson::SsnController) | ||
| attrs = Idv::InPerson::AddressForm::ATTRIBUTES.difference([:same_address_as_id]) | ||
| pii_from_user[:same_address_as_id] = 'false' if updating_address? | ||
| form_result = form.submit(flow_params) | ||
|
|
@@ -42,6 +45,24 @@ def extra_view_variables | |
| } | ||
| end | ||
|
|
||
| # update Idv::DocumentCaptureController.step_info.next_steps to include | ||
| # :ipp_address instead of :ipp_ssn in delete PR | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we talked about this but want to check that my understanding is correct. next_step should be the first non-FSM step. So currently- that is SSN. Upon delete- it will be address. But still can't remember why not just keep it ipp_ssn b/c it is the next step in the flow
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The in person flow has DocumentCapture -> (several React steps) -> State ID -> Address (optional) -> SSN -> Verify Info. Eventually FlowPolicy will have :document_capture next_steps include :ipp_state_id when that's out of the FSM. We might need to wait to update it until then, actually, since Address is optional. It's going to take some fiddling to get all that right. |
||
| def self.step_info | ||
| Idv::StepInfo.new( | ||
| key: :ipp_address, | ||
| controller: self, | ||
| next_steps: [:ipp_ssn], | ||
| preconditions: ->(idv_session:, user:) { idv_session.ipp_state_id_complete? }, | ||
| undo_step: ->(idv_session:, user:) do | ||
| flow_session[:pii_from_user][:address1] = nil | ||
| flow_session[:pii_from_user][:address2] = nil | ||
| flow_session[:pii_from_user][:city] = nil | ||
| flow_session[:pii_from_user][:zipcode] = nil | ||
| flow_session[:pii_from_user][:state] = nil | ||
|
Comment on lines
+57
to
+61
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @svalexander, since the state_id step also sets these fields, I wonder if we shouldn't clear them here. What do you think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's ok for now, especially since we're not yet including this step as a next step anywhere, so undo_step won't be called. And then if we always clear starting after SsnController for the in person steps that edit pii_from_user and ssn, it won't be a problem. But we'll have to give this more thought and see if we can come up with a better solution. |
||
| end, | ||
| ) | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def flow_session | ||
|
|
||
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.
Thanks for leaving comment- I understand b/c we talked about this but think it will be helpful to future devs