From 137c1f0652f923c9766a6a01baf4dc5a1fd34bd7 Mon Sep 17 00:00:00 2001 From: Manus Date: Wed, 30 Sep 2026 13:26:07 +0000 Subject: [PATCH] =?UTF-8?q?Checkpoint:=20La=20migration=20de=20cr=C3=A9ati?= =?UTF-8?q?on=20de=20webImportSources=20est=20rendue=20idempotente=20avec?= =?UTF-8?q?=20CREATE=20TABLE=20IF=20NOT=20EXISTS.=20Un=20test=20garantit?= =?UTF-8?q?=20la=20pr=C3=A9sence=20des=20colonnes=20de=20connecteur=20et?= =?UTF-8?q?=20l=E2=80=99absence=20de=20modification=20de=20la=20table=20fa?= =?UTF-8?q?ctures.=2073=20tests,=20TypeScript=20et=20build=20valid=C3=A9s?= =?UTF-8?q?=20;=20aucune=20donn=C3=A9e=20m=C3=A9tier=20n=E2=80=99a=20?= =?UTF-8?q?=C3=A9t=C3=A9=20modifi=C3=A9e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drizzle/0036_broken_rattler.sql | 2 +- server/webImportSourcesMigration.test.ts | 21 +++++++++++++++++++++ todo.md | 7 ++++++- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 server/webImportSourcesMigration.test.ts diff --git a/drizzle/0036_broken_rattler.sql b/drizzle/0036_broken_rattler.sql index a98f2aa..ab22549 100644 --- a/drizzle/0036_broken_rattler.sql +++ b/drizzle/0036_broken_rattler.sql @@ -1,4 +1,4 @@ -CREATE TABLE `webImportSources` ( +CREATE TABLE IF NOT EXISTS `webImportSources` ( `id` int AUTO_INCREMENT NOT NULL, `userId` int NOT NULL, `name` varchar(100) NOT NULL, diff --git a/server/webImportSourcesMigration.test.ts b/server/webImportSourcesMigration.test.ts new file mode 100644 index 0000000..caf04b6 --- /dev/null +++ b/server/webImportSourcesMigration.test.ts @@ -0,0 +1,21 @@ +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { describe, expect, it } from "vitest"; + +const migration = readFileSync( + resolve(process.cwd(), "drizzle/0036_broken_rattler.sql"), + "utf8", +); + +describe("webImportSources migration", () => { + it("peut être appliquée sans échec si la table a déjà été créée", () => { + expect(migration).toMatch(/CREATE TABLE IF NOT EXISTS `webImportSources`/); + }); + + it("définit les colonnes nécessaires au connecteur sans modifier les factures", () => { + expect(migration).toContain("`portalUrl` varchar(500) NOT NULL"); + expect(migration).toContain("`loginPassword` text NOT NULL"); + expect(migration).toContain("`apiToken` varchar(128) NOT NULL"); + expect(migration).not.toContain("invoices"); + }); +}); diff --git a/todo.md b/todo.md index 317af7a..3373016 100644 --- a/todo.md +++ b/todo.md @@ -1,9 +1,14 @@ # Invoice Analyzer - TODO +## Correction création connecteur web en production — 30/09/2026 +- [ ] Diagnostiquer l’échec SQL d’insertion sans exposer les identifiants +- [ ] Corriger le schéma ou la persistance du connecteur web +- [ ] Valider la création puis déployer en recette et production sans toucher aux volumes PDF + ## Correction validation connecteur web — 30/09/2026 - [x] Reproduire l’erreur `portalUrl` invalide et identifier l’écart formulaire/API - [x] Corriger la normalisation et la validation de l’URL du portail -- [ ] Valider les tests, puis déployer en recette et production sans toucher à MySQL ni aux volumes +- [x] Valider les tests, puis déployer en recette et production sans toucher à MySQL ni aux volumes ## Diagnostic réception e-mail automatique — 24/09/2026 - [x] Reproduire le démarrage de la réception automatique et identifier le blocage interface → API → planificateur