feat: notify administrateur and gestionnaire by email when new commentaire + for administrateur highlight card and commentaires if any unread

This commit is contained in:
seb-by-ouidou 2023-11-06 13:55:31 +00:00 committed by seb-by-ouidou
parent 86fb28bda0
commit 46c19014f9
20 changed files with 159 additions and 34 deletions

View file

@ -145,4 +145,12 @@ class Administrateur < ApplicationRecord
# required to display feature flags field in manager
def features
end
def unread_commentaires?
commentaire_seen_at.nil? || commentaire_seen_at < commentaire_groupe_gestionnaires.last.created_at
end
def mark_commentaire_as_seen
update(commentaire_seen_at: Time.zone.now)
end
end