2016-08-12 13:56:10 +02:00
|
|
|
class DossiersListUserService
|
|
|
|
def initialize current_devise_profil, liste
|
|
|
|
@current_devise_profil = current_devise_profil
|
|
|
|
@liste = liste
|
|
|
|
end
|
|
|
|
|
|
|
|
def dossiers_to_display
|
2016-10-05 16:45:51 +02:00
|
|
|
{'brouillon' => brouillon,
|
2016-10-19 17:25:24 +02:00
|
|
|
'a_traiter' => en_construction,
|
2016-08-12 13:56:10 +02:00
|
|
|
'valides' => valides,
|
|
|
|
'en_instruction' => en_instruction,
|
|
|
|
'termine' => termine,
|
2016-10-24 16:00:03 +02:00
|
|
|
'invite' => invite,
|
|
|
|
'all_state' => all_state}[@liste]
|
2016-08-12 13:56:10 +02:00
|
|
|
end
|
|
|
|
|
2016-10-11 18:05:49 +02:00
|
|
|
def self.dossiers_liste_libelle
|
2016-10-24 16:00:03 +02:00
|
|
|
['brouillon', 'a_traiter', 'valides', 'en_instruction', 'termine', 'invite', 'all_state']
|
|
|
|
end
|
|
|
|
|
|
|
|
def all_state
|
|
|
|
@all_state ||= @current_devise_profil.dossiers.all_state
|
2016-10-11 18:05:49 +02:00
|
|
|
end
|
|
|
|
|
2016-10-05 16:45:51 +02:00
|
|
|
def brouillon
|
|
|
|
@brouillon ||= @current_devise_profil.dossiers.brouillon
|
|
|
|
end
|
|
|
|
|
2016-10-19 17:25:24 +02:00
|
|
|
def en_construction
|
|
|
|
@en_construction ||= @current_devise_profil.dossiers.en_construction
|
2016-08-12 13:56:10 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def invite
|
|
|
|
@invite ||= @current_devise_profil.invites
|
|
|
|
end
|
|
|
|
|
|
|
|
def valides
|
|
|
|
@valides ||= @current_devise_profil.dossiers.valides
|
|
|
|
end
|
|
|
|
|
|
|
|
def en_instruction
|
|
|
|
@en_instruction ||= @current_devise_profil.dossiers.en_instruction
|
|
|
|
end
|
|
|
|
|
|
|
|
def termine
|
|
|
|
@termine ||= @current_devise_profil.dossiers.termine
|
|
|
|
end
|
|
|
|
end
|