Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5f905aa
Move GPO controllers into by_mail and rename
matthinz Sep 1, 2023
4cadcbe
Move GPO controller specs into by_mail and rename
matthinz Sep 1, 2023
e7b66ad
Get RequestLetterController spec passing
matthinz Sep 1, 2023
55162c8
Get LetterEnqueuedController spec passing
matthinz Sep 1, 2023
14cc998
Get EnterCodeController spec passing
matthinz Sep 1, 2023
f411f8d
come_back_later -> letter_enqueued
matthinz Sep 5, 2023
f8341f8
Update view specs
matthinz Sep 5, 2023
94ee59a
Analytics event naming
matthinz Sep 5, 2023
7a261bc
Rename some routes and add temporary redirects
matthinz Sep 5, 2023
7475623
'come back later visited' -> 'letter enqueued visited'
matthinz Sep 5, 2023
621061a
idv_letter_enqueued -> idv_gpo_letter_enqueued
matthinz Sep 6, 2023
25d1ca5
/by_mail -> /by_mail/enter_code
matthinz Sep 6, 2023
789a2be
Fix GpoPresenter spec
matthinz Sep 6, 2023
c03f7f9
'USPS address visited' -> 'gpo request letter visited'
matthinz Sep 6, 2023
1fdca1f
letter enqueued visited -> gpo letter enqueued visited'
matthinz Sep 6, 2023
5c1064e
`IdV: GPO verification visited` -> `IdV: gpo enter code visited`
matthinz Sep 6, 2023
9fd384b
enter code -> enter verify by mail code
matthinz Sep 6, 2023
91b2f41
'GPO verification submitted' -> 'enter verify by mail code submitted'
matthinz Sep 6, 2023
e8b8ceb
Remove GPO from a couple of analytics event names
matthinz Sep 6, 2023
12c97dd
Clarify temporary redirects
matthinz Sep 6, 2023
6e11451
Update app/services/analytics_events.rb
matthinz Sep 7, 2023
969874c
idv_gpo_url -> idv_request_letter_url
matthinz Sep 7, 2023
47224a7
idv_gpo_letter_enqueued_url -> idv_letter_enqueued_url
matthinz Sep 7, 2023
59b1f2b
idv_gpo_verify_url -> idv_enter_verify_by_mail_code_path
matthinz Sep 7, 2023
f65218c
idv_gpo_url fixup
matthinz Sep 7, 2023
8a75ad6
fixup idv_gpo_verify_url
matthinz Sep 7, 2023
49f82b4
Idv::GpoPresenter -> Idv::ByMail::RequestLetterPresenter
matthinz Sep 7, 2023
198616a
A couple of analytics methods
matthinz Sep 7, 2023
93c3216
Fix test
matthinz Sep 7, 2023
7301fa3
idv_enter_verify_by_mail_code_url -> idv_verify_by_mail_enter_code_url
matthinz Sep 8, 2023
5d2f930
Don't change routes yet
matthinz Sep 8, 2023
8602e6b
Fix presenter spec
matthinz Sep 8, 2023
d10f004
Update analytics method name
matthinz Sep 8, 2023
562373e
Add PUT/POST routes for new GPO locations
matthinz Sep 8, 2023
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
2 changes: 1 addition & 1 deletion app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def async_state_done(current_async_state)
end

def next_step_url
return idv_gpo_url if FeatureManagement.idv_by_mail_only?
return idv_request_letter_url if FeatureManagement.idv_by_mail_only?
idv_phone_url
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module IdvStepConcern
end

def confirm_no_pending_gpo_profile
redirect_to idv_gpo_verify_url if current_user&.gpo_verification_pending_profile?
redirect_to idv_verify_by_mail_enter_code_url if current_user&.gpo_verification_pending_profile?
end

def confirm_no_pending_in_person_enrollment
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/verify_profile_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module VerifyProfileConcern
private

def url_for_pending_profile_reason
return idv_gpo_verify_url if current_user.gpo_verification_pending_profile?
return idv_verify_by_mail_enter_code_url if current_user.gpo_verification_pending_profile?
return idv_in_person_ready_to_verify_url if current_user.in_person_pending_profile?
return idv_please_call_url if current_user.fraud_review_pending?
idv_not_verified_url if current_user.fraud_rejection?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Idv
class GpoVerifyController < ApplicationController
module Idv::ByMail
class EnterCodeController < ApplicationController
include IdvSession
include StepIndicatorConcern
include Idv::StepIndicatorConcern
include FraudReviewConcern

prepend_before_action :note_if_user_did_not_receive_letter
Expand All @@ -13,7 +13,7 @@ def index
# slightly different copy on this screen.
@user_did_not_receive_letter = !!params[:did_not_receive_letter]

analytics.idv_gpo_verification_visited(
analytics.idv_verify_by_mail_enter_code_visited(
source: if @user_did_not_receive_letter then 'gpo_reminder_email' end,
)

Expand Down Expand Up @@ -52,15 +52,15 @@ def create
@gpo_verify_form = build_gpo_verify_form

result = @gpo_verify_form.submit
analytics.idv_gpo_verification_submitted(**result.to_h)
analytics.idv_verify_by_mail_enter_code_submitted(**result.to_h)
irs_attempts_api_tracker.idv_gpo_verification_submitted(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if !result.success?
flash[:error] = @gpo_verify_form.errors.first.message
redirect_to idv_gpo_verify_url
redirect_to idv_verify_by_mail_enter_code_url
return
end

Expand Down Expand Up @@ -90,7 +90,7 @@ def note_if_user_did_not_receive_letter

if current_user && session.delete(:gpo_user_did_not_receive_letter)
# ...and we can pick things up here.
redirect_to idv_gpo_verify_path(did_not_receive_letter: 1)
redirect_to idv_verify_by_mail_enter_code_path(did_not_receive_letter: 1)
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Idv
class ComeBackLaterController < ApplicationController
module Idv::ByMail
class LetterEnqueuedController < ApplicationController
include IdvSession
include StepIndicatorConcern
include Idv::StepIndicatorConcern

before_action :confirm_two_factor_authenticated
before_action :confirm_user_needs_gpo_confirmation

def show
analytics.idv_come_back_later_visit
analytics.idv_letter_enqueued_visit
end

private
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Idv
class GpoController < ApplicationController
module Idv::ByMail
class RequestLetterController < ApplicationController
include IdvSession
include StepIndicatorConcern
include Idv::StepIndicatorConcern
include Idv::AbTestAnalyticsConcern

before_action :confirm_two_factor_authenticated
Expand All @@ -11,11 +11,11 @@ class GpoController < ApplicationController
before_action :confirm_profile_not_too_old

def index
@presenter = GpoPresenter.new(current_user, url_options)
@presenter = RequestLetterPresenter.new(current_user, url_options)
@step_indicator_current_step = step_indicator_current_step
Funnel::DocAuth::RegisterStep.new(current_user.id, current_sp&.issuer).
call(:usps_address, :view, true)
analytics.idv_gpo_address_visited(
analytics.idv_request_letter_visited(
letter_already_sent: @presenter.resend_requested?,
)
end
Expand All @@ -29,7 +29,7 @@ def create
elsif resend_requested?
resend_letter
flash[:success] = t('idv.messages.gpo.another_letter_on_the_way')
redirect_to idv_come_back_later_url
redirect_to idv_letter_enqueued_url
else
redirect_to idv_review_url
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/review_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def need_personal_key_confirmation?

def next_step
if gpo_user_flow?
idv_come_back_later_url
idv_letter_enqueued_url
else
idv_personal_key_url
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Idv
class GpoPresenter
module Idv::ByMail
class RequestLetterPresenter
include Rails.application.routes.url_helpers

attr_reader :current_user, :url_options
Expand All @@ -19,7 +19,7 @@ def button

def fallback_back_path
return idv_verify_info_path if OutageStatus.new.any_phone_vendor_outage?
user_needs_address_otp_verification? ? idv_gpo_verify_path : idv_phone_path
user_needs_address_otp_verification? ? idv_verify_by_mail_enter_code_path : idv_phone_path
end

def resend_requested?
Expand Down
158 changes: 81 additions & 77 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -603,16 +603,6 @@ def idv_cancellation_visited(
)
end

# The user visited the "come back later" page shown during the GPO mailing flow
# @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components
def idv_come_back_later_visit(proofing_components: nil, **extra)
track_event(
'IdV: come back later visited',
proofing_components: proofing_components,
**extra,
)
end

# The user checked or unchecked the "By checking this box..." checkbox on the idv agreement step.
# (This is a frontend event.)
# @param [Boolean] checked Whether the user checked the checkbox
Expand Down Expand Up @@ -993,19 +983,6 @@ def idv_gpo_address_letter_requested(
)
end

# @param [Boolean] letter_already_sent
# GPO address visited
def idv_gpo_address_visited(
letter_already_sent:,
**extra
)
track_event(
'IdV: USPS address visited',
letter_already_sent: letter_already_sent,
**extra,
)
end

# The user visited the gpo confirm cancellation screen
def idv_gpo_confirm_start_over_visited
track_event('IdV: gpo confirm start over visited')
Expand All @@ -1017,60 +994,6 @@ def idv_gpo_reminder_email_sent(user_id:, **extra)
track_event('IdV: gpo reminder email sent', user_id: user_id, **extra)
end

# @identity.idp.previous_event_name Account verification submitted
# @param [Boolean] success
# @param [Hash] errors
# @param [Hash] pii_like_keypaths
# @param [DateTime] enqueued_at When was this letter enqueued
# @param [Integer] which_letter Sorted by enqueue time, which letter had this code
# @param [Integer] letter_count How many letters did the user enqueue for this profile
# @param [Integer] attempts Number of attempts to enter a correct code
# @param [Boolean] pending_in_person_enrollment
# @param [Boolean] fraud_check_failed
# @see Reporting::IdentityVerificationReport#query This event is used by the identity verification
# report. Changes here should be reflected there.
# GPO verification submitted
def idv_gpo_verification_submitted(
success:,
errors:,
pii_like_keypaths:,
enqueued_at:,
which_letter:,
letter_count:,
attempts:,
pending_in_person_enrollment:,
fraud_check_failed:,
**extra
)
track_event(
'IdV: GPO verification submitted',
success: success,
errors: errors,
pii_like_keypaths: pii_like_keypaths,
enqueued_at: enqueued_at,
which_letter: which_letter,
letter_count: letter_count,
attempts: attempts,
pending_in_person_enrollment: pending_in_person_enrollment,
fraud_check_failed: fraud_check_failed,
**extra,
)
end

# @identity.idp.previous_event_name Account verification visited
# GPO verification visited
# @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email").
def idv_gpo_verification_visited(
source: nil,
**extra
)
track_event(
'IdV: GPO verification visited',
source: source,
**extra,
)
end

# Tracks emails that are initiated during InPerson::EmailReminderJob
# @param [String] email_type early or late
# @param [String] enrollment_id
Expand Down Expand Up @@ -1903,6 +1826,17 @@ def idv_intro_visit
track_event('IdV: intro visited')
end

# The user visited the "letter enqueued" page shown during the verify by mail flow
# @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components
# @identity.idp.previous_event_name IdV: come back later visited
def idv_letter_enqueued_visit(proofing_components: nil, **extra)
track_event(
'IdV: letter enqueued visited',
proofing_components: proofing_components,
**extra,
)
end

# Tracks when the user visits Mail only warning when vendor_status_sms is set to full_outage
def idv_mail_only_warning_visited(**extra)
track_event(
Expand Down Expand Up @@ -2311,6 +2245,20 @@ def idv_proofing_resolution_result_missing(proofing_components: nil, **extra)
)
end

# @param [Boolean] letter_already_sent
# GPO "request letter" page visited
# @identity.idp.previous_event_name IdV: USPS address visited
def idv_request_letter_visited(
letter_already_sent:,
**extra
)
track_event(
'IdV: request letter visited',
letter_already_sent: letter_already_sent,
**extra,
)
end

# User submitted IDV password confirm page
# @param [Boolean] success
# @param [Boolean] fraud_review_pending
Expand Down Expand Up @@ -2421,6 +2369,62 @@ def idv_usps_auth_token_refresh_job_started(**extra)
)
end

# @identity.idp.previous_event_name Account verification submitted
# @identity.idp.previous_event_name IdV: GPO verification submitted
# @param [Boolean] success
# @param [Hash] errors
# @param [Hash] pii_like_keypaths
# @param [DateTime] enqueued_at When was this letter enqueued
# @param [Integer] which_letter Sorted by enqueue time, which letter had this code
# @param [Integer] letter_count How many letters did the user enqueue for this profile
# @param [Integer] attempts Number of attempts to enter a correct code
# @param [Boolean] pending_in_person_enrollment
# @param [Boolean] fraud_check_failed
# @see Reporting::IdentityVerificationReport#query This event is used by the identity verification
# report. Changes here should be reflected there.
# GPO verification submitted
def idv_verify_by_mail_enter_code_submitted(
success:,
errors:,
pii_like_keypaths:,
enqueued_at:,
which_letter:,
letter_count:,
attempts:,
pending_in_person_enrollment:,
fraud_check_failed:,
**extra
)
track_event(
'IdV: enter verify by mail code submitted',
success: success,
errors: errors,
pii_like_keypaths: pii_like_keypaths,
enqueued_at: enqueued_at,
which_letter: which_letter,
letter_count: letter_count,
attempts: attempts,
pending_in_person_enrollment: pending_in_person_enrollment,
fraud_check_failed: fraud_check_failed,
**extra,
)
end

# @identity.idp.previous_event_name Account verification visited
# @identity.idp.previous_event_name IdV: GPO verification visited
# Visited page used to enter address verification code received via US mail.
# @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email").
def idv_verify_by_mail_enter_code_visited(
source: nil,
**extra
)
track_event(
'IdV: enter verify by mail code visited',
source: source,
**extra,
)
end

# @param [String] flow_path Document capture path ("hybrid" or "standard")
# The user clicked the troubleshooting option to start in-person proofing
def idv_verify_in_person_troubleshooting_option_clicked(flow_path:,
Expand Down
2 changes: 1 addition & 1 deletion app/services/idv/analytics_events_enhancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ module AnalyticsEventsEnhancer
idv_cancellation_confirmed
idv_cancellation_go_back
idv_cancellation_visited
idv_come_back_later_visit
idv_forgot_password
idv_forgot_password_confirmed
idv_final
idv_gpo_address_letter_enqueued
idv_gpo_address_letter_requested
idv_in_person_ready_to_verify_visit
idv_letter_enqueued_visit
idv_personal_key_acknowledgment_toggled
idv_personal_key_downloaded
idv_personal_key_submitted
Expand Down
2 changes: 1 addition & 1 deletion app/views/accounts/_pending_profile_gpo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<%= t('account.index.verification.instructions') %>
</p>
<p class="margin-bottom-0">
<%= link_to t('account.index.verification.reactivate_button'), idv_gpo_verify_path %>
<%= link_to t('account.index.verification.reactivate_button'), idv_verify_by_mail_enter_code_path %>
</p>
<% end %>
Loading