fix(attestation depot): run routing engine before sending notifications

This commit is contained in:
Eric Leroy-Terquem 2024-03-05 14:49:54 +01:00
parent 3f6b6ccc63
commit 43e870e9ec

View file

@ -891,11 +891,11 @@ class Dossier < ApplicationRecord
.passer_en_construction .passer_en_construction
.processed_at .processed_at
save! save!
RoutingEngine.compute(self)
MailTemplatePresenterService.create_commentaire_for_state(self, Dossier.states.fetch(:en_construction)) MailTemplatePresenterService.create_commentaire_for_state(self, Dossier.states.fetch(:en_construction))
NotificationMailer.send_en_construction_notification(self).deliver_later NotificationMailer.send_en_construction_notification(self).deliver_later
NotificationMailer.send_notification_for_tiers(self).deliver_later if self.for_tiers? NotificationMailer.send_notification_for_tiers(self).deliver_later if self.for_tiers?
procedure.compute_dossiers_count procedure.compute_dossiers_count
RoutingEngine.compute(self)
end end
def submit_en_construction! def submit_en_construction!