From 590232be899b9a5eed551cbda1a3e4536dd287da Mon Sep 17 00:00:00 2001 From: Manus Date: Sun, 25 Jan 2026 11:44:14 -0500 Subject: [PATCH] =?UTF-8?q?Checkpoint:=20Correction=20d=C3=A9finitive=20de?= =?UTF-8?q?=20la=20page=20de=20gestion=20des=20attestations=20:=20-=20Affi?= =?UTF-8?q?chage=20correct=20de=20la=20liste=20des=20apprenants=20par=20s?= =?UTF-8?q?=C3=A9quence=20-=20Date=20de=20d=C3=A9but=20affich=C3=A9e=20dan?= =?UTF-8?q?s=20l'en-t=C3=AAte=20de=20chaque=20s=C3=A9quence=20-=20Tri=20ch?= =?UTF-8?q?ronologique=20des=20s=C3=A9quences=20par=20date=20de=20d=C3=A9b?= =?UTF-8?q?ut=20-=20Filtre=20fonctionnel=20:=20Toutes=20les=20s=C3=A9quenc?= =?UTF-8?q?es=20/=20S=C3=A9quences=20termin=C3=A9es=20/=20S=C3=A9quences?= =?UTF-8?q?=20=C3=A0=20venir=20-=20Badge=20de=20statut=20visuel=20(Termin?= =?UTF-8?q?=C3=A9e=20en=20vert,=20=C3=80=20venir=20en=20orange)=20-=20Comp?= =?UTF-8?q?teur=20d'envois=20par=20s=C3=A9quence=20-=20Bouton=20"Tout=20re?= =?UTF-8?q?nvoyer"=20pour=20envoi=20group=C3=A9=20par=20s=C3=A9quence=20-?= =?UTF-8?q?=20Les=20donn=C3=A9es=20sont=20maintenant=20correctement=20r?= =?UTF-8?q?=C3=A9cup=C3=A9r=C3=A9es=20et=20affich=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check-inscriptions.mjs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 check-inscriptions.mjs diff --git a/check-inscriptions.mjs b/check-inscriptions.mjs new file mode 100644 index 0000000..7838eaf --- /dev/null +++ b/check-inscriptions.mjs @@ -0,0 +1,41 @@ +import { drizzle } from 'drizzle-orm/mysql2'; +import { inscriptions, sequences, apprenants } from './drizzle/schema.js'; +import { eq, and } from 'drizzle-orm'; + +const db = drizzle(process.env.DATABASE_URL); + +console.log('=== Vérification des inscriptions pour formationId=1 ===\n'); + +// Vérifier toutes les inscriptions +const allInscriptions = await db + .select({ + inscriptionId: inscriptions.id, + apprenantId: inscriptions.apprenantId, + sequenceId: inscriptions.sequenceId, + statut: inscriptions.statut, + sequenceNom: sequences.nom, + formationId: sequences.formationId, + apprenantNom: apprenants.nom, + apprenantPrenom: apprenants.prenom, + }) + .from(inscriptions) + .innerJoin(sequences, eq(inscriptions.sequenceId, sequences.id)) + .innerJoin(apprenants, eq(inscriptions.apprenantId, apprenants.id)) + .where(eq(sequences.formationId, 1)); + +console.log(`Total inscriptions trouvées: ${allInscriptions.length}\n`); + +allInscriptions.forEach(i => { + console.log(`- ${i.apprenantPrenom} ${i.apprenantNom} | Séquence: ${i.sequenceNom} | Statut: ${i.statut}`); +}); + +console.log('\n=== Inscriptions confirmées uniquement ===\n'); + +const confirmedInscriptions = allInscriptions.filter(i => i.statut === 'confirmee'); +console.log(`Total confirmées: ${confirmedInscriptions.length}\n`); + +confirmedInscriptions.forEach(i => { + console.log(`- ${i.apprenantPrenom} ${i.apprenantNom} | Séquence: ${i.sequenceNom}`); +}); + +process.exit(0);