LG-10886 start moving ssn to idv session#9129
Conversation
|
I am 👍 on the general idea, but I have thoughts on some of the specifics. I think there is value in the term Most (all?) of the attributes currently on idv_session.pii_from_user[:ssn]or even idv_session.pii_from_user.ssnI could envision folks getting confused about the source of (Though I guess when you edit your address currently we just write that data back into |
|
|
|
|
||
| def show | ||
| @ssn_form = Idv::SsnFormatForm.new(current_user, flow_session) | ||
| @ssn_form = Idv::SsnFormatForm.new(current_user, idv_session.ssn, flow_session) |
There was a problem hiding this comment.
This form only consumes the flow_session to get the ssn (from pii_from_doc), so we can remove the flow_session argument here.
|
|
||
| def show | ||
| @ssn_form = Idv::SsnFormatForm.new(current_user, flow_session) | ||
| @ssn_form = Idv::SsnFormatForm.new(current_user, idv_session.ssn, flow_session) |
There was a problem hiding this comment.
Pass in only the ssn instead of flow_session, and either pass in idv_session.ssn or flow_session[:ssn].
| @error_message = nil | ||
|
|
||
| @ssn_form = Idv::SsnFormatForm.new(current_user, flow_session) | ||
| @ssn_form = Idv::SsnFormatForm.new(current_user, idv_session.ssn, flow_session) |
There was a problem hiding this comment.
Same as above.
app/forms/idv/ssn_format_form.rb
Outdated
| end | ||
|
|
||
| def initialize(user, flow_session = {}) | ||
| def initialize(user, incoming_ssn, flow_session = {}) |
There was a problem hiding this comment.
Take only ssn as an argument.
We want to use |
…moving-ssn-to-idv-session
And fix the initial conditions for a test on clearing idv_session.applicant
| }.merge(ab_test_args) | ||
| end | ||
|
|
||
| let(:idv_session) do |
There was a problem hiding this comment.
This let won't affect idv_session
| expect(subject.idv_session.resolution_successful).to be_blank | ||
| expect(subject.idv_session.profile_confirmation).to be_blank | ||
| expect(subject.idv_session.vendor_phone_confirmation).to be_blank | ||
| expect(subject.idv_session.user_phone_confirmation).to be_blank |
There was a problem hiding this comment.
These attributes are deleted from the spec because they have to be blank because they are set later by the phone step or review step, and ssn step can't be accessed when they are set.
…moving-ssn-to-idv-session
|
Tested both IPP Flow & Remote Verification for Initial entry, edit on verify, entering bad ssn to confirm attempts remaining, move to phone and all the way to get a barcode- working as expected. |
| return unless defined?(flow_session) && defined?(idv_session) && user_session | ||
| pii_from_doc_ssn = idv_session&.ssn || flow_session[:pii_from_doc]&.[](:ssn) | ||
| return pii_from_doc_ssn if pii_from_doc_ssn | ||
| flow_session[:pii_from_user]&.[](:ssn) |
There was a problem hiding this comment.
Initially I thought we needed to make an update to line 70 to include an or statement but whether Remote (pii_from_doc) or IPP (pii_from_user) - if idv_session.ssn was present, line 68 would return it so it would not make it past. Nothing to change - just writing my thoughts.
gina-yamada
left a comment
There was a problem hiding this comment.
I poked around the repo more after testing. It looks like you got all of the updates I would have expected when I search. Thanks for adding in those tests as well.
🎫 Ticket
LG-10886
🛠 Summary of changes
This implements the first half of moving ssn to idv_session. Part 2 will remove references to ssn as an attribute of flow_session[:pii_from_doc] and flow_session[:pii_from_user].
When a user moves through IdV, their SSN is currently stored as an attribute of :pii_from_doc or :pii_from_user. As part of moving :pii_from_doc out of flow_session, this gives ssn its own entry in idv_session.
Reasons:
📜 Testing Plan