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:
9
drizzle/0035_eminent_dreadnoughts.sql
Normal file
9
drizzle/0035_eminent_dreadnoughts.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE `deletedInvoices` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`invoiceNumber` varchar(100) NOT NULL,
|
||||
`totalAmount` varchar(50),
|
||||
`supplierName` varchar(255),
|
||||
`deletedAt` timestamp NOT NULL DEFAULT (now()),
|
||||
CONSTRAINT `deletedInvoices_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
2229
drizzle/meta/0035_snapshot.json
Normal file
2229
drizzle/meta/0035_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -246,6 +246,13 @@
|
||||
"when": 1785167359371,
|
||||
"tag": "0034_black_shadowcat",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 35,
|
||||
"version": "5",
|
||||
"when": 1785404752594,
|
||||
"tag": "0035_eminent_dreadnoughts",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -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