44 lines
1.1 KiB
Ruby
44 lines
1.1 KiB
Ruby
|
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
|
||
|
@nouveaux ||= @current_devise_profil.dossiers_filter.nouveaux
|
||
|
end
|
||
|
|
||
|
def waiting_for_gestionnaire
|
||
|
@waiting_for_gestionnaire ||= @current_devise_profil.dossiers_filter.waiting_for_gestionnaire
|
||
|
end
|
||
|
|
||
|
def waiting_for_user
|
||
|
@waiting_for_user ||= @current_devise_profil.dossiers_filter.waiting_for_user
|
||
|
end
|
||
|
|
||
|
def deposes
|
||
|
@deposes ||= @current_devise_profil.dossiers_filter.deposes
|
||
|
end
|
||
|
|
||
|
def a_instruire
|
||
|
@a_instruire ||= @current_devise_profil.dossiers_filter.a_instruire
|
||
|
end
|
||
|
|
||
|
def termine
|
||
|
@termine ||= @current_devise_profil.dossiers_filter.termine
|
||
|
end
|
||
|
|
||
|
def suivi
|
||
|
@suivi ||= @current_devise_profil.dossiers_follow
|
||
|
end
|
||
|
end
|