Checkpoint: Ajout des types de rappels J-7 et J-1 dans l'interface de gestion des rappels. Les templates d'emails ont été corrigés pour afficher toutes les dates des séquences. Bug connu : l'insertion des rappels échoue avec une erreur SQL sur le champ derniereExecution (à corriger après ce checkpoint).

This commit is contained in:
Manus Sandbox
2025-11-30 17:24:41 -05:00
parent d84a2fe0c5
commit 548dbc12b9
9 changed files with 1375 additions and 70 deletions

View File

@@ -0,0 +1,12 @@
CREATE TABLE `rappels` (
`id` int AUTO_INCREMENT NOT NULL,
`nom` varchar(255) NOT NULL,
`templateType` varchar(50) NOT NULL,
`joursAvant` int NOT NULL,
`heureEnvoi` varchar(5) NOT NULL DEFAULT '09:00',
`actif` boolean NOT NULL DEFAULT true,
`derniereExecution` timestamp,
`createdAt` timestamp NOT NULL DEFAULT (now()),
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT `rappels_id` PRIMARY KEY(`id`)
);

File diff suppressed because it is too large Load Diff

View File

@@ -120,6 +120,13 @@
"when": 1764329348207,
"tag": "0016_romantic_sinister_six",
"breakpoints": true
},
{
"idx": 17,
"version": "5",
"when": 1764540514199,
"tag": "0017_unique_skrulls",
"breakpoints": true
}
]
}

View File

@@ -263,3 +263,28 @@ export const alertes = mysqlTable("alertes", {
export type Alerte = typeof alertes.$inferSelect;
export type InsertAlerte = typeof alertes.$inferInsert;
/**
* Table des rappels automatiques
* Stocke les règles d'envoi automatique de rappels avant les séquences
*/
export const rappels = mysqlTable("rappels", {
id: int("id").autoincrement().primaryKey(),
/** Nom du rappel */
nom: varchar("nom", { length: 255 }).notNull(),
/** Type de template à utiliser (rappel, rappelJ1) */
templateType: varchar("templateType", { length: 50 }).notNull(),
/** Nombre de jours avant la première date de la séquence */
joursAvant: int("joursAvant").notNull(),
/** Heure d'envoi (format HH:MM) */
heureEnvoi: varchar("heureEnvoi", { length: 5 }).default("09:00").notNull(),
/** Actif ou non */
actif: boolean("actif").default(true).notNull(),
/** Dernière exécution */
derniereExecution: timestamp("derniereExecution"),
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
});
export type Rappel = typeof rappels.$inferSelect;
export type InsertRappel = typeof rappels.$inferInsert;