Checkpoint: Ajout de 3 améliorations pour le système de notifications :
1. Interface de gestion des emails formateurs (Configuration > Formateurs) - permet de gérer les adresses email des formateurs pour activer/désactiver les notifications 2. Tableau de bord des notifications (Configuration > Notifications) - historique complet des emails envoyés avec filtres et statistiques 3. Lien vers questionnaire de satisfaction automatiquement inclus dans l'email de remerciement post-formation
This commit is contained in:
@@ -482,3 +482,41 @@ export const logsRappels = mysqlTable("logsRappels", {
|
||||
|
||||
export type LogRappel = typeof logsRappels.$inferSelect;
|
||||
export type InsertLogRappel = typeof logsRappels.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table des logs des notifications envoyées
|
||||
* Stocke l'historique de toutes les notifications (remerciements, alertes formateurs, etc.)
|
||||
*/
|
||||
export const logsNotifications = mysqlTable("logsNotifications", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
/** Type de notification (remerciement, notification_formateur_inscription, notification_formateur_annulation, alerte_capacite, notification_liste_attente) */
|
||||
type: mysqlEnum("type", [
|
||||
"remerciement",
|
||||
"notification_formateur_inscription",
|
||||
"notification_formateur_annulation",
|
||||
"alerte_capacite",
|
||||
"notification_liste_attente"
|
||||
]).notNull(),
|
||||
/** ID de la séquence concernée (si applicable) */
|
||||
sequenceId: int("sequenceId"),
|
||||
/** ID de l'apprenant concerné (si applicable) */
|
||||
apprenantId: int("apprenantId"),
|
||||
/** ID du formateur concerné (si applicable) */
|
||||
formateurId: int("formateurId"),
|
||||
/** Email du destinataire */
|
||||
emailDestinataire: varchar("emailDestinataire", { length: 320 }).notNull(),
|
||||
/** Sujet de l'email */
|
||||
sujet: varchar("sujet", { length: 500 }).notNull(),
|
||||
/** Date d'envoi */
|
||||
dateEnvoi: timestamp("dateEnvoi").defaultNow().notNull(),
|
||||
/** Statut de l'envoi (success, failed) */
|
||||
statut: mysqlEnum("statut", ["success", "failed"]).notNull(),
|
||||
/** Message d'erreur en cas d'échec */
|
||||
messageErreur: text("messageErreur"),
|
||||
/** Informations supplémentaires (JSON) */
|
||||
metadata: text("metadata"),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export type LogNotification = typeof logsNotifications.$inferSelect;
|
||||
export type InsertLogNotification = typeof logsNotifications.$inferInsert;
|
||||
|
||||
Reference in New Issue
Block a user