Checkpoint: Automatismes séparé en onglets Import et Export. Les règles d’export ciblent un destinataire ou une ventilation, avec destination locale, Teams ou SharePoint et ouverture navigateur optionnelle. La validation BAP unique ou en masse applique la première règle active par priorité puis conserve le paramétrage historique comme repli. Paramètres d’export déplacés vers Automatismes et page renommée Paramètres. Migration additive, tests, TypeScript, build et contrôles visuels validés.
This commit is contained in:
17
drizzle/0039_good_carmella_unuscione.sql
Normal file
17
drizzle/0039_good_carmella_unuscione.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE `exportAutomationRules` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`isActive` int NOT NULL DEFAULT 1,
|
||||
`priority` int NOT NULL DEFAULT 0,
|
||||
`conditionField` enum('recipientName','ventilationComptable') NOT NULL,
|
||||
`conditionValue` varchar(255) NOT NULL,
|
||||
`destinationType` enum('local','teams','sharepoint') NOT NULL,
|
||||
`destinationPath` text NOT NULL,
|
||||
`openInBrowser` int NOT NULL DEFAULT 0,
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `exportAutomationRules_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `export_rule_user_priority_idx` ON `exportAutomationRules` (`userId`,`priority`);
|
||||
2496
drizzle/meta/0039_snapshot.json
Normal file
2496
drizzle/meta/0039_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -274,6 +274,13 @@
|
||||
"when": 1788349114141,
|
||||
"tag": "0038_late_thunderbolt",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 39,
|
||||
"version": "5",
|
||||
"when": 1788350633569,
|
||||
"tag": "0039_good_carmella_unuscione",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { int, mysqlEnum, mysqlTable, text, timestamp, varchar, uniqueIndex, decimal } from "drizzle-orm/mysql-core";
|
||||
import { decimal, index, int, mysqlEnum, mysqlTable, text, timestamp, uniqueIndex, varchar } from "drizzle-orm/mysql-core";
|
||||
|
||||
/**
|
||||
* Core user table backing auth flow.
|
||||
@@ -324,6 +324,31 @@ export const automationRules = mysqlTable("automationRules", {
|
||||
export type AutomationRule = typeof automationRules.$inferSelect;
|
||||
export type InsertAutomationRule = typeof automationRules.$inferInsert;
|
||||
|
||||
/**
|
||||
* Règles de destination appliquées lors de la validation BAP.
|
||||
* Elles sont séparées des règles d’import, afin de ne jamais modifier les
|
||||
* champs d’une facture au moment de son export.
|
||||
*/
|
||||
export const exportAutomationRules = mysqlTable("exportAutomationRules", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
userId: int("userId").notNull(),
|
||||
name: varchar("name", { length: 255 }).notNull(),
|
||||
isActive: int("isActive").default(1).notNull(),
|
||||
priority: int("priority").default(0).notNull(),
|
||||
conditionField: mysqlEnum("conditionField", ["recipientName", "ventilationComptable"]).notNull(),
|
||||
conditionValue: varchar("conditionValue", { length: 255 }).notNull(),
|
||||
destinationType: mysqlEnum("destinationType", ["local", "teams", "sharepoint"]).notNull(),
|
||||
destinationPath: text("destinationPath").notNull(),
|
||||
openInBrowser: int("openInBrowser").default(0).notNull(),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
|
||||
}, (table) => ({
|
||||
userPriorityIdx: index("export_rule_user_priority_idx").on(table.userId, table.priority),
|
||||
}));
|
||||
|
||||
export type ExportAutomationRule = typeof exportAutomationRules.$inferSelect;
|
||||
export type InsertExportAutomationRule = typeof exportAutomationRules.$inferInsert;
|
||||
|
||||
/**
|
||||
* LLM Fields Configuration table
|
||||
* Stores configuration for each field used in invoice extraction
|
||||
|
||||
Reference in New Issue
Block a user