diff --git a/app/services/idv/actions/ipp/redo_address_action.rb b/app/services/idv/actions/ipp/redo_address_action.rb new file mode 100644 index 00000000000..368a449dadd --- /dev/null +++ b/app/services/idv/actions/ipp/redo_address_action.rb @@ -0,0 +1,11 @@ +module Idv + module Actions + module Ipp + class RedoAddressAction < Idv::Steps::DocAuthBaseStep + def call + mark_step_incomplete(:address) + end + end + end + end +end diff --git a/app/services/idv/actions/ipp/redo_state_id_action.rb b/app/services/idv/actions/ipp/redo_state_id_action.rb new file mode 100644 index 00000000000..99a1c9f514e --- /dev/null +++ b/app/services/idv/actions/ipp/redo_state_id_action.rb @@ -0,0 +1,11 @@ +module Idv + module Actions + module Ipp + class RedoStateIdAction < Idv::Steps::DocAuthBaseStep + def call + mark_step_incomplete(:state_id) + end + end + end + end +end diff --git a/app/services/idv/actions/redo_address_action.rb b/app/services/idv/actions/redo_address_action.rb new file mode 100644 index 00000000000..a67f6c29ecd --- /dev/null +++ b/app/services/idv/actions/redo_address_action.rb @@ -0,0 +1,9 @@ +module Idv + module Actions + class RedoAddressAction < Idv::Steps::DocAuthBaseStep + def call + redirect_to idv_address_url + end + end + end +end diff --git a/app/services/idv/flows/doc_auth_flow.rb b/app/services/idv/flows/doc_auth_flow.rb index 871703c2ad2..05f56f264e1 100644 --- a/app/services/idv/flows/doc_auth_flow.rb +++ b/app/services/idv/flows/doc_auth_flow.rb @@ -30,6 +30,7 @@ class DocAuthFlow < Flow::BaseFlow cancel_send_link: Idv::Actions::CancelSendLinkAction, cancel_link_sent: Idv::Actions::CancelLinkSentAction, cancel_update_ssn: Idv::Actions::CancelUpdateSsnAction, + redo_address: Idv::Actions::RedoAddressAction, redo_ssn: Idv::Actions::RedoSsnAction, redo_document_capture: Idv::Actions::RedoDocumentCaptureAction, verify_document: Idv::Actions::VerifyDocumentAction, diff --git a/app/services/idv/flows/in_person_flow.rb b/app/services/idv/flows/in_person_flow.rb index a1f7ef2965c..ca221951e06 100644 --- a/app/services/idv/flows/in_person_flow.rb +++ b/app/services/idv/flows/in_person_flow.rb @@ -1,6 +1,8 @@ module Idv module Flows class InPersonFlow < Flow::BaseFlow + attr_reader :idv_session # this is used by DocAuthBaseStep + STEPS = { location: Idv::Steps::Ipp::LocationStep, welcome: Idv::Steps::Ipp::WelcomeStep, # instructions @@ -11,6 +13,9 @@ class InPersonFlow < Flow::BaseFlow }.freeze ACTIONS = { + redo_state_id: Idv::Actions::Ipp::RedoStateIdAction, + redo_address: Idv::Actions::Ipp::RedoAddressAction, + redo_ssn: Idv::Actions::RedoSsnAction, }.freeze # WILLFIX: (LG-6308) move this to the barcode page when we finish setting up IPP step @@ -33,17 +38,7 @@ def initialize(controller, session, name) end def self.session_idv(session) - session[:idv] ||= { params: {}, step_attempts: { phone: 0 } } - - # WILLFIX: remove the line below when we're collecting all user data - session[:idv][:applicant] ||= Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN.dup - - # WILLFIX: (LG-6349) remove this block when we implement the verify page - session[:idv]['profile_confirmation'] = true - session[:idv]['vendor_phone_confirmation'] = false - session[:idv]['user_phone_confirmation'] = false - session[:idv]['address_verification_mechanism'] = 'phone' - session[:idv]['resolution_successful'] = 'phone' + session[:idv] ||= {} end end end diff --git a/app/services/idv/steps/ipp/address_step.rb b/app/services/idv/steps/ipp/address_step.rb index c519974f1ea..024bc05dbc6 100644 --- a/app/services/idv/steps/ipp/address_step.rb +++ b/app/services/idv/steps/ipp/address_step.rb @@ -10,6 +10,13 @@ def call end end + def extra_view_variables + { + pii: flow_session[:pii_from_user], + updating_address: flow_session[:pii_from_user].has_key?(:address1), + } + end + private def form_submit diff --git a/app/services/idv/steps/ipp/ssn_step.rb b/app/services/idv/steps/ipp/ssn_step.rb index 8ba16613953..1b4b95a4b58 100644 --- a/app/services/idv/steps/ipp/ssn_step.rb +++ b/app/services/idv/steps/ipp/ssn_step.rb @@ -10,7 +10,7 @@ def call def extra_view_variables { - applicant_ssn: flow_session[:pii_from_user][:ssn], + updating_ssn: flow_session[:pii_from_user][:ssn].present?, } end diff --git a/app/services/idv/steps/ipp/state_id_step.rb b/app/services/idv/steps/ipp/state_id_step.rb index a3719149e90..8db2067a54a 100644 --- a/app/services/idv/steps/ipp/state_id_step.rb +++ b/app/services/idv/steps/ipp/state_id_step.rb @@ -10,6 +10,13 @@ def call end end + def extra_view_variables + { + pii: flow_session[:pii_from_user], + updating_state_id: flow_session[:pii_from_user].has_key?(:first_name), + } + end + private def form_submit diff --git a/app/services/idv/steps/ipp/verify_step.rb b/app/services/idv/steps/ipp/verify_step.rb index 025308b2b51..64660003d69 100644 --- a/app/services/idv/steps/ipp/verify_step.rb +++ b/app/services/idv/steps/ipp/verify_step.rb @@ -1,13 +1,24 @@ module Idv module Steps module Ipp - class VerifyStep < DocAuthBaseStep + class VerifyStep < VerifyBaseStep STEP_INDICATOR_STEP = :verify_info def call + # WILLFIX: (LG-6498) make a call to Instant Verify before allowing the user to continue + save_legacy_state + delete_pii + # send the user to the phone page where they'll continue the remainder of # the idv flow redirect_to idv_phone_url end + + def extra_view_variables + { + pii: pii, + step_url: method(:idv_in_person_step_url), + } + end end end end diff --git a/app/services/idv/steps/ssn_step.rb b/app/services/idv/steps/ssn_step.rb index 8723b85c844..c80825850d1 100644 --- a/app/services/idv/steps/ssn_step.rb +++ b/app/services/idv/steps/ssn_step.rb @@ -11,7 +11,7 @@ def call def extra_view_variables { - applicant_ssn: flow_session[:pii_from_doc][:ssn], + updating_ssn: flow_session[:pii_from_doc][:ssn].present?, } end diff --git a/app/services/idv/steps/verify_step.rb b/app/services/idv/steps/verify_step.rb index 7d62d34c623..63b8f29a204 100644 --- a/app/services/idv/steps/verify_step.rb +++ b/app/services/idv/steps/verify_step.rb @@ -7,6 +7,13 @@ def call enqueue_job end + def extra_view_variables + { + pii: pii, + step_url: method(:idv_doc_auth_step_url), + } + end + private def enqueue_job diff --git a/app/views/idv/doc_auth/ssn.html.erb b/app/views/idv/doc_auth/ssn.html.erb index ad29b047658..22e2f37ac4e 100644 --- a/app/views/idv/doc_auth/ssn.html.erb +++ b/app/views/idv/doc_auth/ssn.html.erb @@ -1 +1 @@ -<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: applicant_ssn.blank?, updating_ssn: applicant_ssn %> +<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: !updating_ssn, updating_ssn: updating_ssn %> diff --git a/app/views/idv/doc_auth/verify.html.erb b/app/views/idv/doc_auth/verify.html.erb index 97079b7666d..f5e617c9512 100644 --- a/app/views/idv/doc_auth/verify.html.erb +++ b/app/views/idv/doc_auth/verify.html.erb @@ -18,84 +18,4 @@ <% end %> <% end %> -<% title t('titles.doc_auth.verify_info') %> - -<%= render PageHeadingComponent.new.with_content(t('doc_auth.headings.verify')) %> -
-
- <%= "#{t('doc_auth.forms.first_name')}: #{flow_session[:pii_from_doc][:first_name]}" %> -
-
- <%= "#{t('doc_auth.forms.last_name')}: #{flow_session[:pii_from_doc][:last_name]}" %> -
-
- <%= "#{t('doc_auth.forms.dob')}: #{flow_session[:pii_from_doc][:dob]}" %> -
-
-
-
- <%= "#{t('doc_auth.forms.address1')}: #{flow_session[:pii_from_doc][:address1]}" %> -
-
- <%= "#{t('doc_auth.forms.city')}: #{flow_session[:pii_from_doc][:city]}" %> -
-
- <%= "#{t('doc_auth.forms.state')}: #{flow_session[:pii_from_doc][:state]}" %> -
-
- <%= "#{t('doc_auth.forms.zip_code')}: #{flow_session[:pii_from_doc][:zipcode]}" %> -
-
-
- <%= link_to(t('doc_auth.buttons.change_address'), idv_address_url, 'aria-label': t('doc_auth.buttons.change_address_label')) %> -
-
-
-
- <%= t('doc_auth.forms.ssn') %>: - <%= render( - 'shared/masked_text', - text: SsnFormatter.format(flow_session[:pii_from_doc][:ssn]), - masked_text: SsnFormatter.format_masked(flow_session[:pii_from_doc][:ssn]), - accessible_masked_text: t( - 'idv.accessible_labels.masked_ssn', - first_number: flow_session[:pii_from_doc][:ssn][0], - last_number: flow_session[:pii_from_doc][:ssn][-1], - ), - toggle_label: t('forms.ssn.show'), - ) %> -
-
- <%= button_to( - idv_doc_auth_step_path(step: :redo_ssn), - method: :put, - class: 'usa-button usa-button--unstyled', - 'aria-label': t('doc_auth.buttons.change_ssn_label'), - ) { t('doc_auth.buttons.change_ssn') } %> -
-
-
- <%= render SpinnerButtonComponent.new( - action: ->(**tag_options, &block) do - button_to(url_for, **tag_options, &block) - end, - big: true, - wide: true, - action_message: t('doc_auth.info.verifying'), - method: :put, - form: { - class: 'button_to', - data: { - form_steps_wait: '', - error_message: t('idv.failure.exceptions.internal_error'), - alert_target: '#form-steps-wait-alert', - wait_step_path: idv_doc_auth_step_path(step: :verify_wait), - poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000, - }, - }, - ).with_content(t('forms.buttons.continue')) %> -
-
- -<% javascript_packs_tag_once 'form-steps-wait' %> -<%= render 'idv/doc_auth/start_over_or_cancel', step: 'verify' %> +<%= render 'idv/shared/verify', pii: pii, step_url: step_url, remote_identity_proofing: true %> diff --git a/app/views/idv/in_person/address.html.erb b/app/views/idv/in_person/address.html.erb index 44a2c5bf557..f24f0d54503 100644 --- a/app/views/idv/in_person/address.html.erb +++ b/app/views/idv/in_person/address.html.erb @@ -1,6 +1,10 @@ <% title t('titles.doc_auth.verify') %> -<%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.address')) %> +<% if updating_address %> + <%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.update_address')) %> +<% else %> + <%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.address')) %> +<% end %>

<%= t('in_person_proofing.body.address.info') %> @@ -12,64 +16,70 @@ html: { autocomplete: 'off' } ) do |f| %> <%= render ValidatedFieldComponent.new( - name: :address1, form: f, + input_html: { value: pii[:address1] }, label: t('in_person_proofing.form.address.address1'), - required: true, - maxlength: 255, label_html: { class: 'usa-label' }, + maxlength: 255, + name: :address1, + required: true, ) %> <%= render ValidatedFieldComponent.new( - name: :address2, form: f, + input_html: { value: pii[:address2] }, label: t('in_person_proofing.form.address.address2'), - required: false, - maxlength: 255, label_html: { class: 'usa-label' }, + maxlength: 255, + name: :address2, + required: false, ) %> <%= render ValidatedFieldComponent.new( - name: :city, form: f, + input_html: { value: pii[:city] }, label: t('in_person_proofing.form.address.city'), - required: true, - maxlength: 255, label_html: { class: 'usa-label' }, + maxlength: 255, + name: :city, + required: true, ) %> <%= render ValidatedFieldComponent.new( - name: :state, - form: f, collection: us_states_territories, + form: f, label: t('in_person_proofing.form.address.state'), + label_html: { class: 'usa-label' }, + name: :state, prompt: t('in_person_proofing.form.address.state_prompt'), required: true, - label_html: { class: 'usa-label' }, + selected: pii[:state], ) %>

<%# using :tel for mobile numeric keypad %> <%= render ValidatedFieldComponent.new( - name: :zipcode, - form: f, as: :tel, + error_messages: { patternMismatch: t('idv.errors.pattern_mismatch.zipcode') }, + form: f, + input_html: { value: pii[:zipcode] }, label: t('in_person_proofing.form.address.zipcode'), - required: true, - pattern: '\d{5}([\-]\d{4})?', label_html: { class: 'usa-label' }, - error_messages: { patternMismatch: t('idv.errors.pattern_mismatch.zipcode') }, + name: :zipcode, + pattern: '\d{5}([\-]\d{4})?', + required: true, ) %>
<%= render ValidatedFieldComponent.new( - name: :same_address_as_id, - form: f, as: :radio_buttons, - wrapper: :uswds_radio_buttons, - label: t('in_person_proofing.form.address.same_address'), - required: true, + checked: pii[:same_address_as_id], collection: [ [t('in_person_proofing.form.address.same_address_choice_yes'), true], [t('in_person_proofing.form.address.same_address_choice_no'), false], ], + form: f, + label: t('in_person_proofing.form.address.same_address'), + name: :same_address_as_id, + required: true, + wrapper: :uswds_radio_buttons, ) %> <%= render ButtonComponent.new(big: true, wide: true, class: 'margin-top-1') do %> diff --git a/app/views/idv/in_person/ssn.html.erb b/app/views/idv/in_person/ssn.html.erb index e8e33007676..5bb75490e02 100644 --- a/app/views/idv/in_person/ssn.html.erb +++ b/app/views/idv/in_person/ssn.html.erb @@ -1 +1 @@ -<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: false, updating_ssn: applicant_ssn %> +<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: false, updating_ssn: updating_ssn %> diff --git a/app/views/idv/in_person/state_id.html.erb b/app/views/idv/in_person/state_id.html.erb index 2f2eedad725..8ea997c1454 100644 --- a/app/views/idv/in_person/state_id.html.erb +++ b/app/views/idv/in_person/state_id.html.erb @@ -1,7 +1,10 @@ <% title t('titles.doc_auth.verify') %> - -<%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.state_id')) %> +<% if updating_state_id %> + <%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.update_state_id')) %> +<% else %> + <%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.state_id')) %> +<% end %>

<%= t('in_person_proofing.body.state_id.info_html') %> @@ -16,6 +19,7 @@ <%= render ValidatedFieldComponent.new( name: :first_name, form: f, + input_html: { value: pii[:first_name] }, label: t('in_person_proofing.form.state_id.first_name'), label_html: { class: 'usa-label' }, maxlength: 255, @@ -27,6 +31,7 @@ <%= render ValidatedFieldComponent.new( name: :last_name, form: f, + input_html: { value: pii[:last_name] }, label: t('in_person_proofing.form.state_id.last_name'), label_html: { class: 'usa-label' }, maxlength: 255, @@ -41,6 +46,7 @@ form: f, hint: t('in_person_proofing.form.state_id.dob_hint'), html5: true, + input_html: { value: pii[:dob] }, label: t('in_person_proofing.form.state_id.dob'), label_html: { class: 'usa-label' }, maxlength: 255, @@ -58,6 +64,7 @@ label_html: { class: 'usa-label' }, prompt: t('in_person_proofing.form.state_id.state_id_jurisdiction_prompt'), required: true, + selected: pii[:state_id_jurisdiction], ) %> @@ -66,6 +73,7 @@ name: :state_id_number, form: f, hint: t('in_person_proofing.form.state_id.state_id_number_hint'), + input_html: { value: pii[:state_id_number] }, label: t('in_person_proofing.form.state_id.state_id_number'), label_html: { class: 'usa-label' }, maxlength: 255, diff --git a/app/views/idv/in_person/verify.html.erb b/app/views/idv/in_person/verify.html.erb index 13140ff8bd5..28f3686a616 100644 --- a/app/views/idv/in_person/verify.html.erb +++ b/app/views/idv/in_person/verify.html.erb @@ -1,15 +1 @@ -<% title t('titles.doc_auth.verify') %> - -

- <%= t('in_person_proofing.headings.verify') %> -

- -<%= validated_form_for :doc_auth, - url: url_for, - method: 'put', - html: { autocomplete: 'off', class: 'margin-y-5' } do |f| %> - <%= f.button :button, - t('doc_auth.buttons.continue'), - type: :submit, - class: 'usa-button--big usa-button--wide' %> -<% end %> +<%= render 'idv/shared/verify', pii: pii, step_url: step_url, remote_identity_proofing: false %> diff --git a/app/views/idv/shared/_verify.html.erb b/app/views/idv/shared/_verify.html.erb new file mode 100644 index 00000000000..db882ffc062 --- /dev/null +++ b/app/views/idv/shared/_verify.html.erb @@ -0,0 +1,111 @@ +<%# +locals: + pii - user's information + remote_identity_proofing - true if we're doing RIDP, false if we're doing IPP + step_url - generator for step URLs +%> +<% title t('titles.doc_auth.verify_info') %> + +<%= render PageHeadingComponent.new.with_content(t('doc_auth.headings.verify')) %> +
+
+
+
+ <%= "#{t('doc_auth.forms.first_name')}: #{pii[:first_name]}" %> +
+
+ <%= "#{t('doc_auth.forms.last_name')}: #{pii[:last_name]}" %> +
+
+ <%= "#{t('doc_auth.forms.dob')}: #{pii[:dob]}" %> +
+ <% if !remote_identity_proofing %> +
+ <%= "#{t('doc_auth.forms.id_number')}: #{pii[:state_id_number]}" %> +
+ <% end %> +
+ <% if !remote_identity_proofing %> +
+ <%= button_to( + step_url.call(step: :redo_state_id), + method: :put, + class: 'usa-button usa-button--unstyled', + 'aria-label': t('doc_auth.buttons.change_state_id_label'), + ) { t('doc_auth.buttons.change_label') } %> +
+ <% end %> +
+
+
+
+ <%= "#{t('doc_auth.forms.address1')}: #{pii[:address1]}" %> +
+
+ <%= "#{t('doc_auth.forms.city')}: #{pii[:city]}" %> +
+
+ <%= "#{t('doc_auth.forms.state')}: #{pii[:state]}" %> +
+
+ <%= "#{t('doc_auth.forms.zip_code')}: #{pii[:zipcode]}" %> +
+
+
+ <%= button_to( + step_url.call(step: :redo_address), + method: :put, + class: 'usa-button usa-button--unstyled', + 'aria-label': t('doc_auth.buttons.change_address_label'), + ) { t('doc_auth.buttons.change_label') } %> +
+
+
+
+ <%= t('doc_auth.forms.ssn') %>: + <%= render( + 'shared/masked_text', + text: SsnFormatter.format(pii[:ssn]), + masked_text: SsnFormatter.format_masked(pii[:ssn]), + accessible_masked_text: t( + 'idv.accessible_labels.masked_ssn', + first_number: pii[:ssn][0], + last_number: pii[:ssn][-1], + ), + toggle_label: t('forms.ssn.show'), + ) %> +
+
+ <%= button_to( + step_url.call(step: :redo_ssn), + method: :put, + class: 'usa-button usa-button--unstyled', + 'aria-label': t('doc_auth.buttons.change_ssn_label'), + ) { t('doc_auth.buttons.change_label') } %> +
+
+
+ <%= render SpinnerButtonComponent.new( + action: ->(**tag_options, &block) do + button_to(url_for, **tag_options, &block) + end, + big: true, + wide: true, + action_message: t('doc_auth.info.verifying'), + method: :put, + form: { + class: 'button_to', + data: { + form_steps_wait: '', + error_message: t('idv.failure.exceptions.internal_error'), + alert_target: '#form-steps-wait-alert', + wait_step_path: idv_doc_auth_step_path(step: :verify_wait), + poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000, + }, + }, + ).with_content(t('forms.buttons.continue')) %> +
+
+ +<% javascript_packs_tag_once 'form-steps-wait' %> +<%= render 'idv/doc_auth/start_over_or_cancel', step: 'verify' %> diff --git a/config/locales/doc_auth/en.yml b/config/locales/doc_auth/en.yml index fc6844c7ef1..d691803f509 100644 --- a/config/locales/doc_auth/en.yml +++ b/config/locales/doc_auth/en.yml @@ -8,10 +8,10 @@ en: selfie_alt_text: An uploaded image buttons: add_new_photos: Add new photos - change_address: Change change_address_label: Change address - change_ssn: Change + change_label: Change change_ssn_label: Change Social Security Number + change_state_id_label: Change state ID continue: Continue start_over: Start over take_or_upload_picture: 'Take photo or @@ -118,6 +118,7 @@ en: dob: Date of Birth doc_success: We have verified your personal information first_name: First Name + id_number: ID Number last_name: Last Name selected_file: Selected file ssn: Social Security Number diff --git a/config/locales/doc_auth/es.yml b/config/locales/doc_auth/es.yml index 9bedb45a3df..fbc762b537b 100644 --- a/config/locales/doc_auth/es.yml +++ b/config/locales/doc_auth/es.yml @@ -8,10 +8,10 @@ es: selfie_alt_text: Una foto subida buttons: add_new_photos: Añadir nuevas fotos - change_address: Cambio change_address_label: Cambiar dirección - change_ssn: Cambio + change_label: Cambio change_ssn_label: Cambiar número de Seguridad Social + change_state_id_label: Cambiar ID de estado continue: Continuar start_over: Comenzar de nuevo take_or_upload_picture: 'Toma una foto o @@ -145,6 +145,7 @@ es: dob: Fecha de nacimiento doc_success: Hemos verificado su información personal first_name: Nombre de pila + id_number: Número de identificación last_name: Apellido selected_file: Archivo seleccionado ssn: Número de seguridad social diff --git a/config/locales/doc_auth/fr.yml b/config/locales/doc_auth/fr.yml index 43c2d59206d..49ae1e62234 100644 --- a/config/locales/doc_auth/fr.yml +++ b/config/locales/doc_auth/fr.yml @@ -8,10 +8,10 @@ fr: selfie_alt_text: Une photo téléversée buttons: add_new_photos: Ajoutez de nouvelles photos - change_address: Changement change_address_label: Changement d’adresse - change_ssn: Changement + change_label: Changement change_ssn_label: Changement de numéro de sécurité sociale + change_state_id_label: Modifier l’ID d’état continue: Continuer start_over: Recommencer take_or_upload_picture: 'Prendre une photo ou @@ -151,6 +151,7 @@ fr: dob: Date de naissance doc_success: Nous avons vérifié vos informations personnelles first_name: Prénom + id_number: Numéro d’identification last_name: Nom de famille selected_file: Fichier sélectionné ssn: Numéro de sécurité sociale diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml index b464e5fa908..3d971f11a5a 100644 --- a/config/locales/in_person_proofing/en.yml +++ b/config/locales/in_person_proofing/en.yml @@ -37,5 +37,6 @@ en: barcode: You’re ready to verify your identity in person location: Select a location to verify your ID state_id: Enter the information on your ID - verify: Please verify your information + update_address: Update your current address + update_state_id: Update the information on your ID welcome: Verify your identity in person diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml index ecf1b79693a..b643c2c8bfa 100644 --- a/config/locales/in_person_proofing/es.yml +++ b/config/locales/in_person_proofing/es.yml @@ -38,5 +38,6 @@ es: barcode: Estás listo para verificar tu identidad en persona location: Seleccione una ubicación para verificar su identificación state_id: Introduce los datos de su documento de identidad - verify: Por favor verifique su información + update_address: Actualiza tu dirección actual + update_state_id: Actualiza la información de tu DNI welcome: Verifica tu identidad en persona diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml index e3698a20c6c..56598cf16e3 100644 --- a/config/locales/in_person_proofing/fr.yml +++ b/config/locales/in_person_proofing/fr.yml @@ -39,5 +39,6 @@ fr: barcode: Vous êtes prêt à vérifier votre identité en personne location: Sélectionnez un emplacement pour vérifier votre identité state_id: Entrez les informations sur votre pièce d’identité - verify: Veuillez vérifier vos informations + update_address: Mettre à jour votre adresse actuelle + update_state_id: Mettre à jour les informations sur votre id welcome: Vérifiez votre identité en personne diff --git a/lib/idp/constants.rb b/lib/idp/constants.rb index 87f7193e854..7ea36719bee 100644 --- a/lib/idp/constants.rb +++ b/lib/idp/constants.rb @@ -33,5 +33,6 @@ module Constants MOCK_IDV_APPLICANT_WITH_PHONE = MOCK_IDV_APPLICANT_WITH_SSN.merge(phone: '12025551212').freeze MOCK_IDV_APPLICANT_FULL_STATE_ID_JURISDICTION = 'North Dakota' + MOCK_IDV_APPLICANT_FULL_STATE = 'Montana' end end diff --git a/spec/features/idv/doc_auth/verify_step_spec.rb b/spec/features/idv/doc_auth/verify_step_spec.rb index 3b283b0762c..4fa9ffaa781 100644 --- a/spec/features/idv/doc_auth/verify_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_step_spec.rb @@ -52,7 +52,7 @@ end it 'proceeds to address page prepopulated with defaults if the user clicks change address' do - click_link t('doc_auth.buttons.change_address') + click_button t('doc_auth.buttons.change_address_label') expect(page).to have_current_path(idv_address_path) expect(page).to have_selector("input[value='1 FAKE RD']") @@ -63,7 +63,7 @@ it 'tracks when the user edits their address' do allow_any_instance_of(ApplicationController).to receive(:analytics).and_return(fake_analytics) - click_link t('doc_auth.buttons.change_address') + click_button t('doc_auth.buttons.change_address_label') fill_out_address_form_ok click_idv_continue # address form @@ -76,7 +76,7 @@ end it 'proceeds to the ssn page if the user clicks change ssn and allows user to go back' do - click_button t('doc_auth.buttons.change_ssn') + click_button t('doc_auth.buttons.change_ssn_label') expect(page).to have_current_path(idv_doc_auth_ssn_step) expect(page).to have_content(t('doc_auth.headings.ssn_update')) diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index a146c468207..e691e773a24 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -52,7 +52,36 @@ click_idv_continue # verify page - expect(page).to have_content(t('in_person_proofing.headings.verify')) + expect(page).to have_content(t('doc_auth.headings.verify')) + expect(page).to have_text(InPersonHelper::GOOD_FIRST_NAME) + expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME) + expect(page).to have_text(InPersonHelper::GOOD_DOB) + expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER) + expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) + expect(page).to have_text(InPersonHelper::GOOD_ADDRESS2) + expect(page).to have_text(InPersonHelper::GOOD_CITY) + expect(page).to have_text(InPersonHelper::GOOD_ZIPCODE) + expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state]) + expect(page).to have_text('9**-**-***4') + + # click update state ID button + click_button t('doc_auth.buttons.change_state_id_label') + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + click_idv_continue + expect(page).to have_content(t('doc_auth.headings.verify')) + + # click update address button + click_button t('doc_auth.buttons.change_address_label') + expect(page).to have_content(t('in_person_proofing.headings.update_address')) + click_idv_continue + expect(page).to have_content(t('doc_auth.headings.verify')) + + # click update ssn button + click_button t('doc_auth.buttons.change_ssn_label') + expect(page).to have_content(t('doc_auth.headings.ssn_update')) + fill_out_ssn_form_ok + click_idv_continue + expect(page).to have_content(t('doc_auth.headings.verify')) click_idv_continue # phone page diff --git a/spec/services/idv/steps/ipp/verify_step_spec.rb b/spec/services/idv/steps/ipp/verify_step_spec.rb index bfc949757b5..fabb6abf606 100644 --- a/spec/services/idv/steps/ipp/verify_step_spec.rb +++ b/spec/services/idv/steps/ipp/verify_step_spec.rb @@ -12,8 +12,14 @@ ) end + let(:pii) do + Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN.dup + end + let(:flow) do - Idv::Flows::InPersonFlow.new(controller, {}, 'idv/in_person') + Idv::Flows::InPersonFlow.new(controller, {}, 'idv/in_person').tap do |flow| + flow.flow_session = { pii_from_user: pii } + end end subject(:step) do @@ -21,8 +27,14 @@ end describe '#call' do - it 'works' do + it 'moves PII into IDV session' do + expect(flow.idv_session).to_not have_key 'applicant' + expect(flow.flow_session).to have_key :pii_from_user step.call + + expect(flow.flow_session).to_not have_key :pii_from_user + expect(flow.idv_session).to have_key 'applicant' + expect(flow.idv_session['applicant']).to include(pii) end end end diff --git a/spec/support/features/doc_auth_helper.rb b/spec/support/features/doc_auth_helper.rb index 01a09537c20..1055f480fb5 100644 --- a/spec/support/features/doc_auth_helper.rb +++ b/spec/support/features/doc_auth_helper.rb @@ -154,7 +154,7 @@ def complete_verify_step def complete_doc_auth_steps_before_address_step(expect_accessible: false) complete_doc_auth_steps_before_verify_step expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible - click_link t('doc_auth.buttons.change_address') + click_button t('doc_auth.buttons.change_address_label') end def complete_doc_auth_steps_before_send_link_step diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index 928f7211e7e..42227b5e0f6 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -9,7 +9,7 @@ module InPersonHelper GOOD_ADDRESS2 = Idp::Constants::MOCK_IDV_APPLICANT[:address2] GOOD_CITY = Idp::Constants::MOCK_IDV_APPLICANT[:city] GOOD_ZIPCODE = Idp::Constants::MOCK_IDV_APPLICANT[:zipcode] - GOOD_STATE = Idp::Constants::MOCK_IDV_APPLICANT_FULL_STATE_ID_JURISDICTION + GOOD_STATE = Idp::Constants::MOCK_IDV_APPLICANT_FULL_STATE def fill_out_state_id_form_ok fill_in t('in_person_proofing.form.state_id.first_name'), with: GOOD_FIRST_NAME