2023-12-19 16:31:57 +01:00
|
|
|
class RecoveriesController < ApplicationController
|
2023-12-12 15:25:22 +01:00
|
|
|
before_action :ensure_agent_connect_is_used, except: [:nature, :post_nature, :support]
|
|
|
|
|
2023-12-19 16:31:57 +01:00
|
|
|
def nature
|
|
|
|
end
|
|
|
|
|
|
|
|
def post_nature
|
|
|
|
if nature_params == 'collectivite'
|
|
|
|
redirect_to identification_recovery_path
|
|
|
|
else
|
2023-12-19 13:00:36 +01:00
|
|
|
redirect_to support_recovery_path(error: :other_nature)
|
2023-12-19 16:31:57 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def identification
|
|
|
|
end
|
|
|
|
|
|
|
|
def post_identification
|
|
|
|
redirect_to selection_recovery_path
|
|
|
|
end
|
|
|
|
|
|
|
|
def selection
|
|
|
|
end
|
|
|
|
|
|
|
|
def post_selection
|
|
|
|
redirect_to terminee_recovery_path
|
|
|
|
end
|
|
|
|
|
|
|
|
def terminee
|
|
|
|
end
|
|
|
|
|
|
|
|
def support
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def nature_params = params[:nature]
|
2023-12-12 15:25:22 +01:00
|
|
|
|
|
|
|
def ensure_agent_connect_is_used
|
|
|
|
if current_instructeur&.agent_connect_information.nil?
|
|
|
|
redirect_to support_recovery_path(error: :must_use_agent_connect)
|
|
|
|
end
|
|
|
|
end
|
2023-12-19 16:31:57 +01:00
|
|
|
end
|