Checkpoint: Ajout de la table deletedInvoices (blacklist) : quand une facture est supprimée, son numéro est enregistré et l'import email/fichier ne la réimporte plus.
This commit is contained in:
@@ -508,3 +508,19 @@ export const freeproSettings = mysqlTable("freeproSettings", {
|
||||
});
|
||||
export type FreeproSettings = typeof freeproSettings.$inferSelect;
|
||||
export type InsertFreeproSettings = typeof freeproSettings.$inferInsert;
|
||||
|
||||
/**
|
||||
* Deleted invoices blacklist — prevents re-import of manually deleted invoices.
|
||||
* When a user deletes an invoice, its invoiceNumber + totalAmount are stored here.
|
||||
* The email/file import service checks this table before inserting a new invoice.
|
||||
*/
|
||||
export const deletedInvoices = mysqlTable("deletedInvoices", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
userId: int("userId").notNull(),
|
||||
invoiceNumber: varchar("invoiceNumber", { length: 100 }).notNull(),
|
||||
totalAmount: varchar("totalAmount", { length: 50 }),
|
||||
supplierName: varchar("supplierName", { length: 255 }),
|
||||
deletedAt: timestamp("deletedAt").defaultNow().notNull(),
|
||||
});
|
||||
export type DeletedInvoice = typeof deletedInvoices.$inferSelect;
|
||||
export type InsertDeletedInvoice = typeof deletedInvoices.$inferInsert;
|
||||
|
||||
Reference in New Issue
Block a user