Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: LG-12534 FSM clean up part 1 #11578

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
10 changes: 9 additions & 1 deletion app/controllers/concerns/idv/step_indicator_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ module StepIndicatorConcern
{ name: :secure_account },
].freeze

STEP_INDICATOR_STEPS_IPP = [
{ name: :find_a_post_office },
{ name: :verify_info },
{ name: :verify_phone },
{ name: :re_enter_password },
{ name: :go_to_the_post_office },
].freeze

included do
helper_method :step_indicator_steps
end

def step_indicator_steps
if in_person_proofing?
Idv::Flows::InPersonFlow::STEP_INDICATOR_STEPS
Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS_IPP
elsif gpo_address_verification?
Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO
else
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/idv/by_mail/request_letter_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ def confirm_letter_sends_allowed
end

def step_indicator_steps
if in_person_proofing?
Idv::Flows::InPersonFlow::STEP_INDICATOR_STEPS_GPO
else
StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO
end
StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO
end
end
end
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/idv/by_mail/resend_letter_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ def pii_locked?
end

def step_indicator_steps
if in_person_proofing?
Idv::Flows::InPersonFlow::STEP_INDICATOR_STEPS_GPO
else
StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO
end
StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO
end
end
end
Expand Down
25 changes: 10 additions & 15 deletions app/controllers/idv/in_person_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,25 @@ class InPersonController < ApplicationController

before_action :confirm_two_factor_authenticated
before_action :redirect_unless_enrollment

include IdvSessionConcern
include Flow::FlowStateMachine
include ThreatMetrixConcern

before_action :redirect_if_flow_completed

before_action :initialize_in_person_session
before_action :set_usps_form_presenter

FLOW_STATE_MACHINE_SETTINGS = {
step_url: :idv_in_person_step_url,
final_url: :idv_in_person_state_id_url,
flow: Idv::Flows::InPersonFlow,
analytics_id: 'In Person Proofing',
}.freeze
def index
redirect_to idv_in_person_state_id_url
end

def update
redirect_to idv_in_person_state_id_url
end

private

def redirect_unless_enrollment
redirect_to idv_url unless current_user.establishing_in_person_enrollment
end

def redirect_if_flow_completed
flow_finish if idv_session.applicant
def initialize_in_person_session
user_session['idv/in_person'] ||= { pii_from_user: { uuid: current_user.uuid } }
end

def set_usps_form_presenter
Expand Down
85 changes: 0 additions & 85 deletions app/services/flow/base_flow.rb

This file was deleted.

86 changes: 0 additions & 86 deletions app/services/flow/base_step.rb

This file was deleted.

14 changes: 0 additions & 14 deletions app/services/flow/failure.rb

This file was deleted.

Loading