true message
This commit is contained in:
@@ -12,7 +12,7 @@ export const users = mysqlTable("users", {
|
||||
*/
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
/** Manus OAuth identifier (openId) returned from the OAuth callback. Unique per user. */
|
||||
openId: varchar("openId", { length: 64 }),
|
||||
openId: varchar("openId", { length: 64 }).notNull().unique(),
|
||||
name: text("name"),
|
||||
email: varchar("email", { length: 320 }),
|
||||
loginMethod: varchar("loginMethod", { length: 64 }),
|
||||
@@ -61,20 +61,6 @@ export const apprenants = mysqlTable("apprenants", {
|
||||
export type Apprenant = typeof apprenants.$inferSelect;
|
||||
export type InsertApprenant = typeof apprenants.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table des formateurs
|
||||
*/
|
||||
export const formateurs = mysqlTable("formateurs", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
nom: varchar("nom", { length: 255 }).notNull().unique(),
|
||||
actif: boolean("actif").default(true).notNull(),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
|
||||
});
|
||||
|
||||
export type Formateur = typeof formateurs.$inferSelect;
|
||||
export type InsertFormateur = typeof formateurs.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table des séquences de formation
|
||||
* Une séquence peut contenir jusqu'à 4 dates de formation
|
||||
@@ -85,10 +71,8 @@ export const sequences = mysqlTable("sequences", {
|
||||
nom: varchar("nom", { length: 255 }).notNull(),
|
||||
/** Lieu de la formation */
|
||||
lieu: varchar("lieu", { length: 500 }).notNull(),
|
||||
/** Public cible de la séquence (Directeur, Chef de service, Tous, Autre) */
|
||||
publicCible: mysqlEnum("publicCible", ["directeur", "chef_service", "tous", "autre"]).notNull(),
|
||||
/** Nom du formateur (optionnel) */
|
||||
formateur: varchar("formateur", { length: 255 }),
|
||||
/** Public cible de la séquence (Directeur, Chef de service, Autre) */
|
||||
publicCible: mysqlEnum("publicCible", ["directeur", "chef_service", "autre"]).notNull(),
|
||||
/** Capacité maximale (12 par défaut) */
|
||||
capaciteMax: int("capaciteMax").default(12).notNull(),
|
||||
/** Date de blocage des inscriptions (J-15 avant la première date) */
|
||||
@@ -158,41 +142,6 @@ export const passwordResetTokens = mysqlTable("passwordResetTokens", {
|
||||
export type PasswordResetToken = typeof passwordResetTokens.$inferSelect;
|
||||
export type InsertPasswordResetToken = typeof passwordResetTokens.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table des rappels automatiques
|
||||
* Configure les rappels à envoyer avant les formations
|
||||
*/
|
||||
export const rappels = mysqlTable("rappels", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
/** Nom du rappel (ex: "Rappel J-15") */
|
||||
nom: varchar("nom", { length: 255 }).notNull(),
|
||||
/** Nombre de jours avant la formation (ex: 15 pour J-15) */
|
||||
joursAvant: int("joursAvant").notNull(),
|
||||
/** Template d'email à utiliser */
|
||||
emailTemplate: text("emailTemplate").notNull(),
|
||||
/** Actif ou non */
|
||||
actif: boolean("actif").default(true).notNull(),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
|
||||
});
|
||||
|
||||
export type Rappel = typeof rappels.$inferSelect;
|
||||
export type InsertRappel = typeof rappels.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table des envois de rappels
|
||||
* Historique des rappels envoyés pour éviter les doublons
|
||||
*/
|
||||
export const rappelsEnvoyes = mysqlTable("rappelsEnvoyes", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
rappelId: int("rappelId").notNull(),
|
||||
inscriptionId: int("inscriptionId").notNull(),
|
||||
dateEnvoi: timestamp("dateEnvoi").defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export type RappelEnvoye = typeof rappelsEnvoyes.$inferSelect;
|
||||
export type InsertRappelEnvoye = typeof rappelsEnvoyes.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table des templates d'emails personnalisables
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user