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
7 changes: 4 additions & 3 deletions app/controllers/idv/choose_id_type_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ class ChooseIdTypeController < ApplicationController
def show
analytics.idv_doc_auth_choose_id_type_visited(**analytics_arguments)
render 'idv/shared/choose_id_type',
locals: { form_url: idv_choose_id_type_path,
is_hybrid: false,
auto_check_value: auto_check_value },
locals: {
presenter: Idv::ChooseIdTypePresenter.new,
auto_check_value: auto_check_value,
},
layout: true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class ChooseIdTypeController < ApplicationController
def show
analytics.idv_doc_auth_choose_id_type_visited(**analytics_arguments)
render 'idv/shared/choose_id_type',
locals: { form_url: idv_hybrid_mobile_choose_id_type_path,
is_hybrid: true,
locals: { presenter: Idv::HybridMobile::ChooseIdTypePresenter.new,
auto_check_value: auto_check_value }
end

Expand Down
44 changes: 44 additions & 0 deletions app/controllers/idv/in_person/choose_id_type_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# frozen_string_literal: true

class Idv::InPerson::ChooseIdTypeController < ApplicationController
include Idv::AvailabilityConcern
include IdvStepConcern

before_action :confirm_step_allowed

Comment thread
gina-yamada marked this conversation as resolved.
Outdated
def show
analytics.idv_in_person_proofing_choose_id_type_visited(**analytics_arguments)
render 'idv/shared/choose_id_type',
locals: {
presenter: Idv::InPerson::ChooseIdTypePresenter.new,
auto_check_value: '',
},
layout: true
end

def update
end

def self.step_info
Idv::StepInfo.new(
key: :ipp_choose_id_type,
controller: self,
next_steps: [],
preconditions: ->(idv_session:, user:) {
idv_session.in_person_passports_allowed? && user.has_establishing_in_person_enrollment?
Comment thread
shanechesnutt-ft marked this conversation as resolved.
Outdated
},
undo_step: -> {},
)
end

private

def analytics_arguments
{
flow_path: idv_session.flow_path,
step: 'choose_id_type',
Comment thread
shanechesnutt-ft marked this conversation as resolved.
Outdated
analytics_id: 'In Person Proofing',
}.merge(ab_test_analytics_buckets)
.merge(extra_analytics_properties)
end
end
13 changes: 11 additions & 2 deletions app/controllers/idv/in_person_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Idv
class InPersonController < ApplicationController
include Idv::AvailabilityConcern
include RenderConditionConcern
include IdvStepConcern

check_or_render_not_found -> { InPersonConfig.enabled_for_issuer?(current_sp&.issuer) }

Expand All @@ -13,11 +14,19 @@ class InPersonController < ApplicationController
before_action :set_usps_form_presenter

def index
redirect_to idv_in_person_state_id_url
if idv_session.in_person_passports_allowed?
redirect_to idv_in_person_choose_id_type_url
else
redirect_to idv_in_person_state_id_url
end
end

def update
redirect_to idv_in_person_state_id_url
if idv_session.in_person_passports_allowed?
redirect_to idv_in_person_choose_id_type_url
else
redirect_to idv_in_person_state_id_url
end
end

private
Expand Down
1 change: 1 addition & 0 deletions app/policies/idv/flow_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class FlowPolicy
document_capture: Idv::DocumentCaptureController.step_info,
socure_document_capture: Idv::Socure::DocumentCaptureController.step_info,
socure_errors: Idv::Socure::ErrorsController.step_info,
ipp_choose_id_type: Idv::InPerson::ChooseIdTypeController.step_info,
ipp_state_id: Idv::InPerson::StateIdController.step_info,
ipp_address: Idv::InPerson::AddressController.step_info,
ssn: Idv::SsnController.step_info,
Expand Down
21 changes: 21 additions & 0 deletions app/presenters/idv/choose_id_type_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

class Idv::ChooseIdTypePresenter
include ActionView::Helpers::TranslationHelper

def choose_id_type_info_text
t('doc_auth.info.choose_id_type')
end

def current_step
:verify_id
end

def hybrid_flow?
false
end

def step_indicator_steps
Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS
end
Comment thread
gina-yamada marked this conversation as resolved.
end
7 changes: 7 additions & 0 deletions app/presenters/idv/hybrid_mobile/choose_id_type_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class Idv::HybridMobile::ChooseIdTypePresenter < Idv::ChooseIdTypePresenter
def hybrid_flow?
true
end
Comment thread
gina-yamada marked this conversation as resolved.
end
15 changes: 15 additions & 0 deletions app/presenters/idv/in_person/choose_id_type_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

class Idv::InPerson::ChooseIdTypePresenter < Idv::ChooseIdTypePresenter
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.

Nice use of inheritance. 👍🏻

def choose_id_type_info_text
t('in_person_proofing.info.choose_id_type')
end

def current_step
:verify_info
end

def step_indicator_steps
Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS_IPP
end
end
24 changes: 24 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,30 @@ def idv_in_person_proofing_address_visited(
)
end

# @param ["hybrid","standard"] flow_path Document capture user flow
# @param [String] step Current IdV step
# @param [String] analytics_id
# @param [Boolean] opted_in_to_in_person_proofing Whether user opted into in person proofing
# @param [Boolean] skip_hybrid_handoff Whether skipped hybrid handoff A/B test is active
def idv_in_person_proofing_choose_id_type_visited(
flow_path:,
step:,
analytics_id:,
opted_in_to_in_person_proofing: nil,
skip_hybrid_handoff: nil,
**extra
Comment thread
gina-yamada marked this conversation as resolved.
Outdated
)
track_event(
:idv_in_person_proofing_choose_id_type_visited,
flow_path:,
step:,
analytics_id:,
opted_in_to_in_person_proofing:,
skip_hybrid_handoff:,
**extra,
)
end
Comment thread
gina-yamada marked this conversation as resolved.
Outdated

# A job to check USPS notifications about in-person enrollment status updates has completed
# @param [Integer] fetched_items items fetched
# @param [Integer] processed_items items fetched and processed
Expand Down
4 changes: 4 additions & 0 deletions app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ def idv_consent_given?
!!session[:idv_consent_given_at]
end

def in_person_passports_allowed?
passport_allowed && IdentityConfig.store.in_person_passports_enabled
end

private

attr_reader :user_session
Expand Down
14 changes: 7 additions & 7 deletions app/views/idv/shared/choose_id_type.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<% content_for(:pre_flash_content) do %>
<%= render StepIndicatorComponent.new(
steps: Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS,
current_step: :verify_id,
steps: presenter.step_indicator_steps,
current_step: presenter.current_step,
locale_scope: 'idv',
class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
) %>
<% end %>

<% if is_hybrid %>
<% if presenter.hybrid_flow? %>
<%= render AlertComponent.new(type: :warning, class: 'margin-bottom-4') do %>
<%= t('doc_auth.info.login_access_sp', app_name: APP_NAME, sp_name: decorated_sp_session.sp_name) %>
<%= t('doc_auth.info.add_id_consent_with_phone', app_name: APP_NAME) %>
Expand All @@ -21,7 +21,7 @@
<% end %>

<p>
<%= t('doc_auth.info.choose_id_type') %>
<%= presenter.choose_id_type_info_text %>
</p>

<%= new_tab_link_to(
Expand All @@ -30,12 +30,12 @@
category: 'verify-your-identity',
article: 'accepted-identification-documents',
),
)
)
%>

<%= simple_form_for(
:doc_auth,
url: form_url,
url: url_for,
method: :put,
) do |f| %>
<%= render ValidatedFieldComponent.new(
Expand All @@ -53,7 +53,7 @@
checked: auto_check_value,
error_messages: { valueMissing: t('doc_auth.errors.choose_id_type_check') },
) %>
<%= f.submit t('forms.buttons.continue'), class: 'margin-y-2' %>
<%= f.submit t('forms.buttons.continue'), class: 'margin-bottom-2' %>
<% end %>

<%= render 'idv/doc_auth/cancel', step: 'choose_id_type' %>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,7 @@ in_person_proofing.headings.state_id_milestone_2: Enter the information on your
in_person_proofing.headings.switch_back: Switch back to your computer to prepare to verify your identity in person
in_person_proofing.headings.update_address: Update your current residential address
in_person_proofing.headings.update_state_id: Update the information on your ID
in_person_proofing.info.choose_id_type: Select the type of document that you want to use. You’ll need to bring this document to the Post Office.
in_person_proofing.process.barcode.caption_label: Enrollment code
in_person_proofing.process.barcode.heading: Show your %{app_name} barcode
in_person_proofing.process.barcode.info: The retail associate needs to scan your barcode at the top of this page. You can print this page or show it on your mobile device.
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ in_person_proofing.headings.state_id_milestone_2: Ingrese la información de su
in_person_proofing.headings.switch_back: Vuelva a su computadora para preparar la verificación de su identidad en persona
in_person_proofing.headings.update_address: Actualice su domicilio actual
in_person_proofing.headings.update_state_id: Actualice la información de su identificación
in_person_proofing.info.choose_id_type: Select the type of document that you want to use. You’ll need to bring this document to the Post Office.
in_person_proofing.process.barcode.caption_label: Código de registro
in_person_proofing.process.barcode.heading: Muestre su código de barras de %{app_name}
in_person_proofing.process.barcode.info: El empleado debe escanear el código de barras que aparece en la parte superior de esta página. Puede imprimir esta página o mostrarla en su dispositivo móvil.
Expand Down
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,7 @@ in_person_proofing.headings.state_id_milestone_2: Saisissez les informations fig
in_person_proofing.headings.switch_back: Revenez à votre ordinateur pour vous préparer à confirmer votre identité en personne
in_person_proofing.headings.update_address: Mettre à jour votre adresse personnelle
in_person_proofing.headings.update_state_id: Mettez à jour les informations figurant sur votre document d’identité
in_person_proofing.info.choose_id_type: Select the type of document that you want to use. You’ll need to bring this document to the Post Office.
in_person_proofing.process.barcode.caption_label: Code d’inscription
in_person_proofing.process.barcode.heading: Montrez votre code-barres %{app_name}
in_person_proofing.process.barcode.info: Le préposé doit scanner votre code-barres en haut de cette page. Vous pouvez imprimer cette page ou la montrer sur votre appareil mobile.
Expand Down
1 change: 1 addition & 0 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,7 @@ in_person_proofing.headings.state_id_milestone_2: 输入你州政府颁发身份
in_person_proofing.headings.switch_back: 切换回你的电脑,来准备亲身去验证身份。
in_person_proofing.headings.update_address: 更新你当前的住宅地址
in_person_proofing.headings.update_state_id: 更新你身份证件上的信息
in_person_proofing.info.choose_id_type: Select the type of document that you want to use. You’ll need to bring this document to the Post Office.
in_person_proofing.process.barcode.caption_label: 注册代码
in_person_proofing.process.barcode.heading: 出示你的 %{app_name} 条形码
in_person_proofing.process.barcode.info: 邮局工作人员需要扫描该页顶部的条形码你可以把该页打印出来,或在你的移动设备上显示。
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@
as: :capture_doc_dashes
get '/in_person' => 'in_person#index'
put '/in_person' => 'in_person#update'
get '/in_person/choose_id_type' => 'in_person/choose_id_type#show'
put '/in_person/choose_id_type' => 'in_person/choose_id_type#update'
get '/in_person/ready_to_verify' => 'in_person/ready_to_verify#show',
as: :in_person_ready_to_verify
post '/in_person/usps_locations' => 'in_person/usps_locations#index'
Expand Down
Loading