put dossier_pdf apart

This commit is contained in:
simon lehericey 2022-04-04 22:24:14 +02:00
parent d5241381eb
commit 51a6145d96

View file

@ -1,10 +1,13 @@
class ActiveStorage::DownloadableFile
def self.create_list_from_dossiers(dossiers, for_expert = false)
dossiers.flat_map do |dossier|
dossier_export = PiecesJustificativesService.generate_dossier_export(dossier)
pjs = [dossier_export] + PiecesJustificativesService.liste_documents(dossier, for_expert)
pj_and_paths = dossiers.map { |d| pj_and_path(d, PiecesJustificativesService.generate_dossier_export(d)) }
pj_and_paths += dossiers.flat_map do |dossier|
pjs = PiecesJustificativesService.liste_documents(dossier, for_expert)
pjs.map { |piece_justificative| pj_and_path(dossier, piece_justificative) }
end
pj_and_paths
end
private