demarches-normaliennes/app/services/dossiers_list_gestionnaire_service.rb
Xavier J 1a92382259 - Add new status for a dossier : received, refused and without_continuation
- Add new and rename tabs on gestionnaire all dossiers view
/!\ WARNING : One test does not pasted. He will be corrected in the next commit
2016-08-11 15:27:35 +02:00

44 lines
No EOL
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