Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/controllers/idv/in_person/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class VerifyInfoController < ApplicationController
before_action :confirm_step_allowed

def show
@step_indicator_steps = step_indicator_steps
@ssn = idv_session.ssn
@pii = pii
@ssn = pii[:ssn]
@presenter = Idv::InPerson::VerifyInfoPresenter.new(enrollment: enrollment)

Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer])
.call('verify', :view, true) # specify in_person?
Expand Down Expand Up @@ -76,6 +76,10 @@ def pii
)
end

def enrollment
current_user.establishing_in_person_enrollment
end

# override IdvSessionConcern
def flow_session
user_session.fetch('idv/in_person', {})
Expand Down
5 changes: 5 additions & 0 deletions app/models/in_person_enrollment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def cancel
profile&.deactivate_due_to_in_person_verification_cancelled
end

# @return [Boolean] Whether the enrollment is type passport book.
def passport_book?
document_type == DOCUMENT_TYPE_PASSPORT_BOOK
end

private

def days_to_expire
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/idv/in_person/ready_to_verify_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def initialize(enrollment:, barcode_image_url: nil, sp_name: nil)
end

def enrolled_with_passport_book?
enrollment.document_type == InPersonEnrollment::DOCUMENT_TYPE_PASSPORT_BOOK
enrollment.passport_book?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻 This is helpful for clarity.

end

# Reminder is exclusive of the day the email is sent (1 less than days_to_due_date)
Expand Down
19 changes: 19 additions & 0 deletions app/presenters/idv/in_person/verify_info_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

class Idv::InPerson::VerifyInfoPresenter
def initialize(enrollment:)
@enrollment = enrollment
end

def step_indicator_steps
Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS_IPP
end

def identity_info_partial
passport_flow? ? 'passport_section' : 'state_id_section'
end

def passport_flow?
@enrollment.passport_book?
end
end
14 changes: 7 additions & 7 deletions app/views/idv/in_person/verify_info/_address_section.html.erb
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 padding-top-1 border-bottom border-primary-light">
<div class="grid-row grid-gap grid-gap-2 padding-bottom-2 padding-top-2 border-bottom border-primary-light">
<dl class='grid-col-fill margin-y-0'>
<div class="padding-y-1">
<div class="padding-bottom-1">
<h2 class="h4 margin-y-0"><%= t('headings.residential_address') %></h2>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address1] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address2].presence %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:address2].presence %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:city] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:zipcode] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
Expand Down
21 changes: 21 additions & 0 deletions app/views/idv/in_person/verify_info/_passport_section.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="grid-row grid-gap grid-gap-2 padding-bottom-2 border-bottom border-primary-light">
<dl class="grid-col-fill margin-y-0">
<div class="padding-bottom-1">
<h2 class="h4 margin-y-0"><%= t('in_person_proofing.form.verify_info.passport') %></h2>
</div>
<div>
<dt class="display-inline"><%= t('in_person_proofing.form.passport.surname') %>: </dt>
<dd class="display-inline margin-left-0"> <%= pii[:passport_surname] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('in_person_proofing.form.passport.first_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= pii[:passport_first_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('in_person_proofing.form.passport.dob') %>: </dt>
<dd class="display-inline margin-left-0">
<%= I18n.l(Date.parse(pii[:passport_dob]), format: I18n.t('time.formats.event_date')) %>
</dd>
</div>
</dl>
</div>
13 changes: 6 additions & 7 deletions app/views/idv/in_person/verify_info/_ssn_section.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<div class="grid-row grid-gap grid-gap-2 padding-top-1">
<div class="grid-row grid-gap grid-gap-2 padding-top-2">
<div class='grid-col-fill'>
<div class="padding-y-1">
<div class="padding-bottom-1">
<h2 class="h4 margin-y-0"><%= t('headings.ssn') %></h2>
</div>
<%= t('idv.form.ssn') %>:
<%= render(
'shared/masked_text',
text: SsnFormatter.format(@ssn),
masked_text: SsnFormatter.format_masked(@ssn),
text: SsnFormatter.format(ssn),
masked_text: SsnFormatter.format_masked(ssn),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
first_number: @ssn[0],
last_number: @ssn[-1],
first_number: ssn[0],
last_number: ssn[-1],
),
toggle_label: t('forms.ssn.show'),
) %>
Expand Down
26 changes: 13 additions & 13 deletions app/views/idv/in_person/verify_info/_state_id_section.html.erb
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 border-bottom border-primary-light">
<div class="grid-row grid-gap grid-gap-2 padding-bottom-2 border-bottom border-primary-light">
<dl class="grid-col-fill margin-y-0">
<div class="padding-y-1">
<div class="padding-bottom-1">
<h2 class="h4 margin-y-0"><%= t('headings.state_id') %></h2>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.first_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:first_name] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:first_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.last_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:last_name] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:last_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.dob') %>: </dt>
<dd class="display-inline margin-left-0">
<%= I18n.l(Date.parse(@pii[:dob]), format: I18n.t('time.formats.event_date')) %>
<%= I18n.l(Date.parse(pii[:dob]), format: I18n.t('time.formats.event_date')) %>
</dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.issuing_state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_jurisdiction] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:state_id_jurisdiction] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.id_number') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_number] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:state_id_number] %> </dd>
</div>
<div class="margin-top-105">
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address1] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:identity_doc_address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address2].presence %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:identity_doc_address2].presence %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_city] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:identity_doc_city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address_state] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:identity_doc_address_state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_zipcode] %> </dd>
<dd class="display-inline margin-left-0"> <%= pii[:identity_doc_zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= link_to(
idv_in_person_state_id_url,
class: 'usa-button usa-button--unstyled padding-y-1',
class: 'usa-button usa-button--unstyled',
'aria-label': t('idv.buttons.change_state_id_label'),
) { t('idv.buttons.change_label') } %>
</div>
Expand Down
14 changes: 8 additions & 6 deletions app/views/idv/in_person/verify_info/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<%#
locals:
@step_indicator_steps - the correct Idv::Flows variable for this flow
@pii - user's information
@ssn - user's ssn
@had_barcode_read_failure - show warning if there's a barcode read error
@presenter - An instance of Idv::InPerson::VerifyInfoPresenter
%>

<% content_for(:pre_flash_content) do %>
<%= render StepIndicatorComponent.new(
steps: @step_indicator_steps,
steps: @presenter.step_indicator_steps,
current_step: :verify_info,
locale_scope: 'idv',
class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
Expand All @@ -22,10 +21,13 @@ locals:
<% self.title = t('titles.idv.verify_info') %>

<%= render PageHeadingComponent.new.with_content(t('headings.verify')) %>
<% if @presenter.passport_flow? %>
<p>
<%= t('in_person_proofing.form.verify_info.passport_intro_text') %>
</p>
<% end %>
<div class='margin-top-4 margin-bottom-2'>
<% if !@pii[:state_id_number].nil? %>
<%= render 'state_id_section', pii: @pii %>
<% end %>
<%= render @presenter.identity_info_partial, pii: @pii %>
<%= render 'address_section', pii: @pii %>
<%= render 'ssn_section', ssn: @ssn %>
<div class="margin-top-5">
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ in_person_proofing.form.state_id.state_id_number_hint_forward_slashes: forward s
in_person_proofing.form.state_id.state_id_number_hint_spaces: spaces
in_person_proofing.form.state_id.state_id_number_texas_hint: This is the 8-digit number on your ID. Enter only numbers in this field.
in_person_proofing.form.state_id.zipcode: ZIP Code
in_person_proofing.form.verify_info.passport: U.S. passport book
in_person_proofing.form.verify_info.passport_intro_text: We will check records to verify that your address and Social Security number match the information on your ID.
in_person_proofing.headings.address: Enter your current residential address
in_person_proofing.headings.barcode: Show this barcode and your state ID at a Post Office to finish verifying your identity
in_person_proofing.headings.barcode_eipp: Bring this barcode and supporting documents to a Post Office to finish verifying your identity
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,8 @@ in_person_proofing.form.state_id.state_id_number_hint_forward_slashes: barras di
in_person_proofing.form.state_id.state_id_number_hint_spaces: espacios
in_person_proofing.form.state_id.state_id_number_texas_hint: Este es el número de 8 dígitos de su identificación. Ingrese únicamente números en este campo.
in_person_proofing.form.state_id.zipcode: Código postal
in_person_proofing.form.verify_info.passport: U.S. passport book
in_person_proofing.form.verify_info.passport_intro_text: We will check records to verify that your address and Social Security number match the information on your ID.
in_person_proofing.headings.address: Ingrese su domicilio actual
in_person_proofing.headings.barcode: Muestre este código de barras y su identificación el estado en una oficina de correos para terminar de verificar su identidad.
in_person_proofing.headings.barcode_eipp: Lleve este código de barras y los documentos comprobatorios a una oficina de correos para terminar de verificar su identidad
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ in_person_proofing.form.state_id.state_id_number_hint_forward_slashes: des barre
in_person_proofing.form.state_id.state_id_number_hint_spaces: des espaces
in_person_proofing.form.state_id.state_id_number_texas_hint: Il s’agit du numéro à huit chiffres figurant sur votre pièce d’identité. Dans ce champ, ne saisissez que des chiffres.
in_person_proofing.form.state_id.zipcode: Code postal
in_person_proofing.form.verify_info.passport: U.S. passport book
in_person_proofing.form.verify_info.passport_intro_text: We will check records to verify that your address and Social Security number match the information on your ID.
in_person_proofing.headings.address: Saisissez votre adresse résidentielle actuelle
in_person_proofing.headings.barcode: Présentez ce code-barres et votre pièce d’identité l’État à un bureau de poste pour terminer la vérification de votre identité
in_person_proofing.headings.barcode_eipp: Présenter ce code-barres et les documents complémentaires à un bureau de poste pour terminer la vérification de votre identité
Expand Down
2 changes: 2 additions & 0 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,8 @@ in_person_proofing.form.state_id.state_id_number_hint_forward_slashes: 前斜杠
in_person_proofing.form.state_id.state_id_number_hint_spaces: 空格
in_person_proofing.form.state_id.state_id_number_texas_hint: 这是你身份证件上的8位数在这一字段中只输入数字
in_person_proofing.form.state_id.zipcode: 邮编
in_person_proofing.form.verify_info.passport: U.S. passport book
in_person_proofing.form.verify_info.passport_intro_text: We will check records to verify that your address and Social Security number match the information on your ID.
in_person_proofing.headings.address: 输入你当前住宅地址
in_person_proofing.headings.barcode: 到邮局出示这一条形码和你政府颁发的身份证件来完成验证身份。
in_person_proofing.headings.barcode_eipp: 携带该条形码和支持性文件到邮局去完成验证身份。
Expand Down
42 changes: 42 additions & 0 deletions spec/features/idv/in_person/passport_scenario_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@
click_on t('forms.buttons.continue')

expect(page).to have_current_path(idv_in_person_verify_info_path)

check_passport_verify_info_page_content
end
end

Expand Down Expand Up @@ -361,4 +363,44 @@ def fill_in_passport_form
InPersonHelper::GOOD_PASSPORT_EXPIRATION_DATE,
)
end

def check_passport_verify_info_page_content
expect(page).to have_content t('in_person_proofing.form.verify_info.passport')

# Surname
expect(page).to have_content t('in_person_proofing.form.passport.surname')
expect(page).to have_content InPersonHelper::GOOD_LAST_NAME
# First name
expect(page).to have_content t('in_person_proofing.form.passport.first_name')
expect(page).to have_content InPersonHelper::GOOD_FIRST_NAME
# Date of Birth
expect(page).to have_content t('in_person_proofing.form.passport.dob')
expect(page).to have_content(
I18n.l(Date.parse(InPersonHelper::GOOD_DOB), format: t('time.formats.event_date')),
)

expect(page).to have_content(t('headings.residential_address'))
# address 1
expect(page).to have_content(t('idv.form.address1'))
expect(page).to have_content InPersonHelper::GOOD_ADDRESS1
# address 2
expect(page).to have_content(t('idv.form.address2'))
expect(page).to have_content InPersonHelper::GOOD_ADDRESS2
# address city
expect(page).to have_content(t('idv.form.city'))
expect(page).to have_content InPersonHelper::GOOD_CITY
# address state
expect(page).to have_content(t('idv.form.state'))
expect(page).to have_content InPersonHelper::GOOD_STATE_ABBR
# address zipcode
expect(page).to have_content(t('idv.form.zipcode'))
expect(page).to have_content InPersonHelper::GOOD_ZIPCODE

expect(page).to have_content(t('headings.ssn'))
expect(page).to have_content(t('idv.form.ssn'))
expect(page).to have_content SsnFormatter.format_masked(InPersonHelper::GOOD_SSN)

expect(page).to_not have_content(t('headings.state_id'))
expect(page).to_not have_content(t('idv.form.id_number'))
end
end
2 changes: 2 additions & 0 deletions spec/i18n_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class BaseTask
{ key: 'in_person_proofing.form.passport.passport_number' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.form.passport.passport_number_hint' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.form.passport.surname' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.form.verify_info.passport' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.form.verify_info.passport_intro_text' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.headings.barcode_passport' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.headings.passport' }, # Translations will be updated for In-Person Proofing Passport Epic, see LG-15972
{ key: 'in_person_proofing.process.eipp_bring_id.image_alt_text', locales: %i[fr es zh] }, # Real ID is considered a proper noun in this context, ID translated to ID Card in Chinese
Expand Down
18 changes: 18 additions & 0 deletions spec/models/in_person_enrollment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -610,4 +610,22 @@
end
end
end

describe '#passport_book?' do
context 'when the enrollment is a passport book enrollment' do
let(:enrollment) { create(:in_person_enrollment, :passport_book) }

it 'returns true' do
expect(enrollment.passport_book?).to be(true)
end
end

context 'when the enrollment is not a passport book enrollment' do
let(:enrollment) { create(:in_person_enrollment) }

it 'returns false' do
expect(enrollment.passport_book?).to be(false)
end
end
end
end
Loading