2015-12-24 15:10:20 +01:00
|
|
|
class DossierFacades
|
2018-01-15 19:14:09 +01:00
|
|
|
# TODO rechercher en fonction de la personne/email
|
2016-11-14 18:00:26 +01:00
|
|
|
def initialize(dossier_id, email, champ_id = nil)
|
2017-02-27 17:44:08 +01:00
|
|
|
@dossier = Dossier.find(dossier_id)
|
2016-11-14 18:00:26 +01:00
|
|
|
@champ_id = champ_id
|
2015-12-24 15:10:20 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def dossier
|
|
|
|
@dossier.decorate
|
|
|
|
end
|
|
|
|
|
|
|
|
def champs
|
|
|
|
@dossier.ordered_champs
|
|
|
|
end
|
|
|
|
|
|
|
|
def etablissement
|
|
|
|
@dossier.etablissement
|
|
|
|
end
|
|
|
|
|
|
|
|
def pieces_justificatives
|
2016-10-07 15:16:03 +02:00
|
|
|
@dossier.ordered_pieces_justificatives
|
2015-12-24 15:10:20 +01:00
|
|
|
end
|
|
|
|
|
2016-12-22 10:55:27 +01:00
|
|
|
def types_de_pieces_justificatives
|
|
|
|
@dossier.types_de_piece_justificative.order('order_place ASC')
|
|
|
|
end
|
|
|
|
|
2016-11-14 18:00:26 +01:00
|
|
|
def champ_id
|
|
|
|
@champ_id
|
|
|
|
end
|
|
|
|
|
2015-12-24 15:10:20 +01:00
|
|
|
def commentaires
|
2017-07-20 10:40:40 +02:00
|
|
|
@dossier.commentaires.where(champ_id: @champ_id).decorate
|
2015-12-24 15:10:20 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def procedure
|
|
|
|
@dossier.procedure
|
|
|
|
end
|
2016-02-08 18:16:18 +01:00
|
|
|
|
|
|
|
def invites
|
|
|
|
@dossier.invites
|
|
|
|
end
|
2016-07-18 18:48:59 +02:00
|
|
|
|
2016-08-08 12:52:30 +02:00
|
|
|
def champs_private
|
|
|
|
@dossier.ordered_champs_private
|
|
|
|
end
|
|
|
|
|
2016-08-30 11:18:43 +02:00
|
|
|
def individual
|
|
|
|
@dossier.individual
|
|
|
|
end
|
|
|
|
|
2016-07-18 18:48:59 +02:00
|
|
|
def commentaires_files
|
|
|
|
PieceJustificative.where(dossier_id: @dossier.id, type_de_piece_justificative_id: nil)
|
|
|
|
end
|
2016-07-19 16:44:26 +02:00
|
|
|
|
|
|
|
def followers
|
2018-07-11 16:28:54 +02:00
|
|
|
@dossier.followers_gestionnaires
|
2016-07-19 16:44:26 +02:00
|
|
|
end
|
2016-11-14 18:00:26 +01:00
|
|
|
end
|