2016-08-11 15:27:35 +02:00
|
|
|
class DossiersListGestionnaireService
|
|
|
|
def initialize current_devise_profil, liste
|
|
|
|
@current_devise_profil = current_devise_profil
|
|
|
|
@liste = liste
|
|
|
|
end
|
|
|
|
|
|
|
|
def dossiers_to_display
|
|
|
|
{'nouveaux' => nouveaux,
|
|
|
|
'a_traiter' => waiting_for_gestionnaire,
|
|
|
|
'en_attente' => waiting_for_user,
|
|
|
|
'deposes' => deposes,
|
|
|
|
'a_instruire' => a_instruire,
|
|
|
|
'termine' => termine,
|
|
|
|
'suivi' => suivi}[@liste]
|
|
|
|
end
|
|
|
|
|
|
|
|
def nouveaux
|
2016-08-22 16:36:25 +02:00
|
|
|
@nouveaux ||= @current_devise_profil.dossiers.nouveaux
|
2016-08-11 15:27:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def waiting_for_gestionnaire
|
2016-08-22 16:36:25 +02:00
|
|
|
@waiting_for_gestionnaire ||= @current_devise_profil.dossiers.waiting_for_gestionnaire
|
2016-08-11 15:27:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def waiting_for_user
|
2016-08-22 16:36:25 +02:00
|
|
|
@waiting_for_user ||= @current_devise_profil.dossiers.waiting_for_user
|
2016-08-11 15:27:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def deposes
|
2016-08-22 16:36:25 +02:00
|
|
|
@deposes ||= @current_devise_profil.dossiers.deposes
|
2016-08-11 15:27:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def a_instruire
|
2016-08-22 16:36:25 +02:00
|
|
|
@a_instruire ||= @current_devise_profil.dossiers.a_instruire
|
2016-08-11 15:27:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def termine
|
2016-08-22 16:36:25 +02:00
|
|
|
@termine ||= @current_devise_profil.dossiers.termine
|
2016-08-11 15:27:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def suivi
|
|
|
|
@suivi ||= @current_devise_profil.dossiers_follow
|
|
|
|
end
|
|
|
|
end
|