Module Notification
RD7320 - Programmer une alerte
Ajouter un système de notification via une API externe (Brevo). Ce module pour le moment servira uniquement pour les alertes d'ouverture de billetterie sur un match donné.
MCD
classDiagram
class Notifiable {
+int id
}
class Contact {
+int id
+string email
+json external_infos
+bool repeat_match_notification
}
class NotificationSubscription {
+bool sended
}
NotificationSubscription "1" <--> "*" Contact : contact
class Notification {
+int status
+json external_infos
}
Notification "1" <--> "*" Notifiable : notifiable
Notification "*" <--> "1" NotificationSubscription : notification_subscriptions
Détail du MCD
Notifiable
Représente la relation polymorphique. Pour le moment, ça sera uniquement un Match mais plus tard on pourra l'associer à tout type de Model
Notification
status : Enum (en_attente, en_attente_traitement, traité)
-
en_attente : Vient d'être créé (Rien à faire)
-
en_attente_traitement : Sera défini par la source (Ex: le match vient de passer à billetterie_ouverte donc le match le change à cet état)
-
traité : Les mails ont été envoyé
external_infos :
-
template_id : ID du template brevo
-
folder_id : ID du dossier contenant la liste
-
list_id : ID de la liste créé
NotificationSubscription
sended : Permet de savoir si la notification à bien été envoyé à la personne.
Contact
email : Email transféré de User.
external_infos : Information importante pour l'envoie de la notification sur le service externe
- id : L'ID du compte brevo