extract operation_logs_and_signatures method

This commit is contained in:
simon lehericey 2022-04-01 16:21:38 +02:00
parent 9414d499b8
commit 437e871f79

View file

@ -146,13 +146,19 @@ class PiecesJustificativesService
].flatten.compact ].flatten.compact
if !for_expert if !for_expert
pjs += operation_logs_and_signatures(dossier)
end
pjs
end
def self.operation_logs_and_signatures(dossier)
bill_signatures = dossier.dossier_operation_logs.filter_map(&:bill_signature).uniq bill_signatures = dossier.dossier_operation_logs.filter_map(&:bill_signature).uniq
pjs += [
[
dossier.dossier_operation_logs.map(&:serialized), dossier.dossier_operation_logs.map(&:serialized),
bill_signatures.map(&:serialized), bill_signatures.map(&:serialized),
bill_signatures.map(&:signature) bill_signatures.map(&:signature)
].flatten.compact ].flatten.compact
end end
pjs
end
end end