Checkpoint: Module Ventilation FreePro complet : import Excel FreePro, transformation automatique (script/TTC/type XOAUTH2), tableau de ventilation par structure+type, historique par mois, export PDF. Menu Ventilations ajouté dans la navigation.

This commit is contained in:
Manus
2026-06-05 08:02:29 -04:00
parent 4ef130f21d
commit 7f56fa7045
13 changed files with 3123 additions and 3 deletions

View File

@@ -0,0 +1,24 @@
CREATE TABLE `freeproImports` (
`id` int AUTO_INCREMENT NOT NULL,
`userId` int NOT NULL,
`moisLabel` varchar(10) NOT NULL,
`annee` int NOT NULL,
`mois` int NOT NULL,
`refPiece` varchar(50),
`fileName` varchar(255) NOT NULL,
`nbLignes` int NOT NULL DEFAULT 0,
`totalTtc` varchar(30),
`createdAt` timestamp NOT NULL DEFAULT (now()),
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT `freeproImports_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `freeproVentilationLines` (
`id` int AUTO_INCREMENT NOT NULL,
`importId` int NOT NULL,
`structure` varchar(100),
`type` varchar(50) NOT NULL,
`montantCentimes` int NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT (now()),
CONSTRAINT `freeproVentilationLines_id` PRIMARY KEY(`id`)
);

File diff suppressed because it is too large Load Diff

View File

@@ -197,6 +197,13 @@
"when": 1780653000245,
"tag": "0027_complex_ultimo",
"breakpoints": true
},
{
"idx": 28,
"version": "5",
"when": 1780660548610,
"tag": "0028_dusty_kat_farrell",
"breakpoints": true
}
]
}

View File

@@ -421,3 +421,46 @@ export const invoiceLearnings = mysqlTable("invoiceLearnings", {
export type InvoiceLearning = typeof invoiceLearnings.$inferSelect;
export type InsertInvoiceLearning = typeof invoiceLearnings.$inferInsert;
/**
* FreePro ventilation imports — one record per imported monthly file
*/
export const freeproImports = mysqlTable("freeproImports", {
id: int("id").autoincrement().primaryKey(),
userId: int("userId").notNull(),
/** Label du mois, ex: "06/2025" */
moisLabel: varchar("moisLabel", { length: 10 }).notNull(),
/** Année (ex: 2025) */
annee: int("annee").notNull(),
/** Mois numérique (1-12) */
mois: int("mois").notNull(),
/** Référence de la pièce comptable, ex: F202506006010 */
refPiece: varchar("refPiece", { length: 50 }),
/** Nom du fichier Excel importé */
fileName: varchar("fileName", { length: 255 }).notNull(),
/** Nombre de lignes traitées */
nbLignes: int("nbLignes").default(0).notNull(),
/** Total général TTC calculé */
totalTtc: varchar("totalTtc", { length: 30 }),
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
});
export type FreeproImport = typeof freeproImports.$inferSelect;
export type InsertFreeproImport = typeof freeproImports.$inferInsert;
/**
* FreePro ventilation lines — aggregated result (structure + type → montant TTC)
*/
export const freeproVentilationLines = mysqlTable("freeproVentilationLines", {
id: int("id").autoincrement().primaryKey(),
importId: int("importId").notNull(), // FK to freeproImports.id
/** Code structure, ex: "1083ADV" ou null pour (vide) */
structure: varchar("structure", { length: 100 }),
/** Type: "Lien fibre" | "Lien 5G" | "Tél. mobile" */
type: varchar("type", { length: 50 }).notNull(),
/** Montant TTC agrégé en centimes (pour éviter les flottants) */
montantCentimes: int("montantCentimes").notNull(),
createdAt: timestamp("createdAt").defaultNow().notNull(),
});
export type FreeproVentilationLine = typeof freeproVentilationLines.$inferSelect;
export type InsertFreeproVentilationLine = typeof freeproVentilationLines.$inferInsert;