Skip to content

Commit

Permalink
LG-3839 Change SSN and mailing address (#5144)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegsa committed Jun 22, 2021
1 parent 99d5b1a commit d341be4
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 49 deletions.
9 changes: 9 additions & 0 deletions app/services/idv/actions/cancel_update_ssn_action.rb
@@ -0,0 +1,9 @@
module Idv
module Actions
class CancelUpdateSsnAction < Idv::Steps::DocAuthBaseStep
def call
mark_step_complete(:ssn) if flow_session[:pii_from_doc][:ssn]
end
end
end
end
1 change: 1 addition & 0 deletions app/services/idv/flows/doc_auth_flow.rb
Expand Up @@ -29,6 +29,7 @@ class DocAuthFlow < Flow::BaseFlow
ACTIONS = {
cancel_send_link: Idv::Actions::CancelSendLinkAction,
cancel_link_sent: Idv::Actions::CancelLinkSentAction,
cancel_update_ssn: Idv::Actions::CancelUpdateSsnAction,
reset: Idv::Actions::ResetAction,
redo_ssn: Idv::Actions::RedoSsnAction,
verify_document: Idv::Actions::VerifyDocumentAction,
Expand Down
48 changes: 48 additions & 0 deletions app/views/idv/doc_auth/_ssn_init.html.erb
@@ -0,0 +1,48 @@
<% title t('titles.doc_auth.verify') %>
<%= render 'shared/alert', {
type: 'success',
class: 'margin-bottom-4'
} do %>
<%= t('doc_auth.headings.capture_complete') %>
<% end %>

<h1>
<%= t('doc_auth.headings.ssn') %>
</h1>

<p>
<%= t('doc_auth.info.ssn') %>
<%= new_window_link_to(t('doc_auth.instructions.learn_more'), MarketingSite.security_and_privacy_practices_url) %>
</p>

<%= validated_form_for(
:doc_auth,
url: url_for,
method: :put,
html: { autocomplete: 'off', class: 'margin-top-2' }
) do |f| %>
<div class='clearfix margin-x-neg-1'>
<div class='sm-col sm-col-8 padding-x-1 margin-top-2'>
<!-- maxlength set and includes '-' delimiters to work around cleave bug -->
<%= f.input(
:ssn,
as: :password,
label: t('idv.form.ssn_label_html'),
required: true,
pattern: '^\d{3}-?\d{2}-?\d{4}$',
maxlength: 11,
input_html: { aria: { invalid: false }, class: 'ssn ssn-toggle', value: '' }
) %>
</div>
</div>

<p><%= flow_session[:error_message] %></p>

<div class='margin-top-0'>
<button type='submit' class='usa-button usa-button--big usa-button--wide'>
<%= t('forms.buttons.continue') %>
</button>
</div>
<% end %>
<%= render 'idv/doc_auth/start_over_or_cancel', step: 'ssn' %>
42 changes: 42 additions & 0 deletions app/views/idv/doc_auth/_ssn_update.html.erb
@@ -0,0 +1,42 @@
<% title t('titles.doc_auth.verify') %>

<h1>
<%= t('doc_auth.headings.ssn_update') %>
</h1>

<p>
<%= t('doc_auth.info.ssn') %>
<%= new_window_link_to(t('doc_auth.instructions.learn_more'), MarketingSite.security_and_privacy_practices_url) %>
</p>

<%= validated_form_for(
:doc_auth,
url: url_for,
method: :put,
html: { autocomplete: 'off', class: 'margin-top-2' }
) do |f| %>
<div class='clearfix margin-x-neg-1'>
<div class='sm-col sm-col-8 padding-x-1 margin-top-2'>
<!-- maxlength set and includes '-' delimiters to work around cleave bug -->
<%= f.input(
:ssn,
as: :password,
label: t('idv.form.ssn_label_html'),
required: true,
pattern: '^\d{3}-?\d{2}-?\d{4}$',
maxlength: 11,
input_html: { aria: { invalid: false }, class: 'ssn ssn-toggle', value: '' }
) %>
</div>
</div>

<p><%= flow_session[:error_message] %></p>

<div class='margin-top-0'>
<button type='submit' class='usa-button usa-button--big usa-button--wide'>
<%= t('forms.buttons.submit.update') %>
</button>
</div>
<% end %>
<%= render 'idv/doc_auth/back', action: 'cancel_update_ssn' %>

46 changes: 4 additions & 42 deletions app/views/idv/doc_auth/ssn.html.erb
@@ -1,43 +1,5 @@
<% title t('titles.doc_auth.verify') %>
<%= render 'shared/alert', {
type: 'success',
class: 'margin-bottom-4'
} do %>
<%= t('doc_auth.headings.capture_complete') %>
<% if flow_session['pii_from_doc']['ssn'] %>
<%= render 'idv/doc_auth/ssn_update', flow_session: flow_session %>
<% else %>
<%= render 'idv/doc_auth/ssn_init', flow_session: flow_session %>
<% end %>

<h1 class='margin-y-0'>
<%= t('doc_auth.headings.ssn') %>
</h1>

<%= validated_form_for(
:doc_auth,
url: url_for,
method: :put,
html: { autocomplete: 'off', class: 'margin-top-2' }
) do |f| %>
<div class='clearfix margin-x-neg-1'>
<div class='sm-col sm-col-8 padding-x-1 margin-top-2'>
<!-- maxlength set and includes '-' delimiters to work around cleave bug -->
<%= f.input(
:ssn,
as: :password,
label: t('idv.form.ssn_label_html'),
required: true,
pattern: '^\d{3}-?\d{2}-?\d{4}$',
maxlength: 11,
input_html: { aria: { invalid: false }, class: 'ssn ssn-toggle', value: '' }
) %>
</div>
</div>

<p><%= flow_session[:error_message] %></p>

<div class='margin-top-0'>
<button type='submit' class='usa-button usa-button--big usa-button--wide'>
<%= t('forms.buttons.continue') %>
</button>
</div>
<% end %>
<%= render 'idv/doc_auth/start_over_or_cancel', step: 'ssn' %>
9 changes: 7 additions & 2 deletions config/locales/doc_auth/en.yml
Expand Up @@ -115,7 +115,7 @@ en:
state: State
zip_code: Zip Code
headings:
address: Mailing Address
address: Update your mailing address
back: Back
capture_complete: We have verified your state-issued ID
document_capture: Add your state-issued ID
Expand All @@ -131,7 +131,8 @@ en:
review_issues: Check your images and try again
secure_account: Secure your account
selfie: Take a photo of yourself
ssn: Please enter your social security number.
ssn: Please enter your Social Security number.
ssn_update: Update your Social Security number
take_picture: Take a photo with a phone
text_message: We sent a message to your phone
upload: How would you like to upload your state-issued ID?
Expand Down Expand Up @@ -170,6 +171,10 @@ en:
secure_account: After you verify, we’ll ask you to encrypt your account.
Encryption means your data is protected and only you, the account
holder, will be able to access or change your information.
ssn: We need your Social Security number to validate your name, date of birth
and address. Your Social Security number is encrypted. With your
consent, we share this information with the government agency you are
trying to access to verify your identity.
tag: Recommended
take_picture: Use the camera on your mobile phone and upload images of your
ID. We only use the images to verify your identity.
Expand Down
10 changes: 8 additions & 2 deletions config/locales/doc_auth/es.yml
Expand Up @@ -141,7 +141,7 @@ es:
state: Estado
zip_code: Código postal
headings:
address: Dirección de envio
address: Actualice su dirección postal
back: Parte Trasera
capture_complete: Hemos verificado su identificación expedida por el estado
document_capture: Añada su documento de identidad expedido por el estado
Expand All @@ -157,7 +157,8 @@ es:
review_issues: Revise sus imágenes e inténtelo de nuevo
secure_account: Asegure su cuenta
selfie: Tómese una foto
ssn: Por favor ingrese su número de seguro social.
ssn: Por favor ingrese su número de Seguro Social.
ssn_update: Actualice su número de Seguro Social
take_picture: Toma una foto con un teléfono
text_message: Enviamos un mensaje a su teléfono
upload: '¿Cómo le gustaría subir su documento de identidad expedido por el
Expand Down Expand Up @@ -201,6 +202,11 @@ es:
su cuenta. Con el cifrado, sus datos quedan protegidos, por lo que solo
usted, el titular de la cuenta, puede acceder a su información o
modificarla.
ssn: Necesitamos su número de Seguro Social para validar su nombre, fecha de
nacimiento y habla a. Su número de Seguro Social está encriptado. Con su
consentimiento, compartimos este información con la agencia
gubernamental a la que está intentando acceder para verificar su
identidad.
tag: Recomendado
take_picture: Use la cámara en su teléfono móvil y cargue imágenes de su
identificación. Solo usamos las imágenes para verificar su identidad.
Expand Down
10 changes: 8 additions & 2 deletions config/locales/doc_auth/fr.yml
Expand Up @@ -146,7 +146,7 @@ fr:
state: Etat
zip_code: Code postal
headings:
address: Adresse mail
address: Mettre à jour votre adresse postale
back: Verso
capture_complete: Nous avons vérifié votre carte d’identité délivrée par l’État
document_capture: Ajoutez votre carte d’identité délivrée par l’État
Expand All @@ -162,7 +162,8 @@ fr:
review_issues: Vérifiez vos images et essayez à nouveau
secure_account: Sécuriser votre compte
selfie: Prenez une photo de vous-même
ssn: S’il vous plaît entrez votre numéro de sécurité sociale.
ssn: S’il vous plaît entrez votre numéro de Sécurité Sociale.
ssn_update: Mettre à jour votre numéro de Sécurité Sociale
take_picture: Prendre une photo avec un téléphone
text_message: Nous avons envoyé un message à votre téléphone
upload: Comment souhaitez-vous télécharger votre carte d’identité délivrée par
Expand Down Expand Up @@ -210,6 +211,11 @@ fr:
crypter votre compte. Le cryptage garantit la protection de vos données
et seul vous, le titulaire du compte, pourrez accéder à vos informations
ou les modifier.
ssn: Nous avons besoin de votre numéro de sécurité sociale pour valider votre
nom, date de naissance et adresse. Votre numéro de sécurité sociale est
crypté. Avec votre accord, nous partageons ce informations auprès de
l'agence gouvernementale à laquelle vous essayez d'accéder pour vérifier
votre identité.
tag: Recommandation
take_picture: Utilisez l’appareil photo sur votre téléphone portable et
téléchargez des images de votre identifiant. Nous utilisons uniquement
Expand Down
6 changes: 5 additions & 1 deletion spec/features/idv/doc_auth/verify_step_spec.rb
Expand Up @@ -51,10 +51,14 @@
expect(page).to have_selector("input[value='59010']")
end

it 'proceeds to the ssn page if the user clicks change ssn' do
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')

expect(page).to have_current_path(idv_doc_auth_ssn_step)
expect(page).to have_content(t('doc_auth.headings.ssn_update'))

click_button t('forms.buttons.back')
expect(page).to have_current_path(idv_doc_auth_verify_step)
end

it 'does not proceed to the next page if resolution fails' do
Expand Down

0 comments on commit d341be4

Please sign in to comment.