feat(dossier): notify user by email about pending corrections

This commit is contained in:
Colin Darie 2023-03-14 18:48:19 +01:00
parent ca3b127942
commit 9565267170
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
9 changed files with 79 additions and 6 deletions

View file

@ -231,7 +231,7 @@ module Instructeurs
elsif !dossier.may_flag_as_pending_correction?
flash.alert = dossier.termine? ? "Impossible de demander de corriger un dossier terminé." : "Le dossier est déjà en attente de correction."
else
commentaire = CommentaireService.create(current_instructeur, dossier, { body: message, piece_jointe: })
commentaire = CommentaireService.build(current_instructeur, dossier, { body: message, piece_jointe: })
dossier.flag_as_pending_correction!(commentaire)
dossier.update!(last_commentaire_updated_at: Time.zone.now)
current_instructeur.follow(dossier)