Checkpoint: Refonte majeure : transformation du système de sessions en séquences avec support de jusqu'à 4 dates par séquence. L'inscription à une séquence inscrit automatiquement l'apprenant à toutes les dates. Mise à jour complète du backend (schéma DB, procédures tRPC, emails, exports) et du frontend (AdminSequences, AdminSequenceInscrits, Inscription, Admin). Toutes les fonctionnalités existantes (filtres, statistiques, exports PDF/Excel, emails automatiques) sont préservées et adaptées au nouveau modèle.

This commit is contained in:
Manus Sandbox
2025-11-12 09:57:58 -05:00
parent ca9b1c3d37
commit 5c9b6637c4
20 changed files with 2445 additions and 1410 deletions

View File

@@ -0,0 +1,32 @@
CREATE TABLE `datesFormation` (
`id` int AUTO_INCREMENT NOT NULL,
`sequenceId` int NOT NULL,
`dateDebut` datetime NOT NULL,
`dateFin` datetime NOT NULL,
`ordre` int NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT (now()),
CONSTRAINT `datesFormation_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `sequences` (
`id` int AUTO_INCREMENT NOT NULL,
`formationId` int NOT NULL,
`nom` varchar(255) NOT NULL,
`lieu` varchar(500) NOT NULL,
`capaciteMax` int NOT NULL DEFAULT 12,
`dateBlocage` datetime NOT NULL,
`statut` enum('ouverte','bloquee','terminee') NOT NULL DEFAULT 'ouverte',
`createdAt` timestamp NOT NULL DEFAULT (now()),
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT `sequences_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
DROP TABLE `sessions`;--> statement-breakpoint
ALTER TABLE `inscriptions` DROP INDEX `inscriptions_apprenantId_sessionId_unique`;--> statement-breakpoint
ALTER TABLE `inscriptions` MODIFY COLUMN `statut` enum('confirmee','liste_attente','annulee') NOT NULL;--> statement-breakpoint
ALTER TABLE `inscriptions` ADD `sequenceId` int NOT NULL;--> statement-breakpoint
ALTER TABLE `inscriptions` DROP COLUMN `sessionId`;--> statement-breakpoint
ALTER TABLE `inscriptions` DROP COLUMN `invitationEnvoyee`;--> statement-breakpoint
ALTER TABLE `inscriptions` DROP COLUMN `emailConfirmationEnvoye`;--> statement-breakpoint
ALTER TABLE `inscriptions` DROP COLUMN `emailTeaserEnvoye`;--> statement-breakpoint
ALTER TABLE `inscriptions` DROP COLUMN `emailRappelEnvoye`;