Restored to 'd418fda3c966ae0ab78451c384bd2504f82bcd1f'

Replit-Restored-To: d418fda3c9
This commit is contained in:
michaelschal committed 2025-08-13 10:00:17 +00:00
1 parent 3721ea9a14
commit 695cd8ad7c
10 files changed
+44 -1260

No files matched your search

+6 -53
View File
@@ -143,16 +143,16 @@ export const publicityParticipations = pgTable("publicity_participations", {
// NocoDB configuration globale - Structure correspondant à la production
// NocoDB configuration globale (une seule instance NocoDB partagée)
export const nocodbConfig = pgTable("nocodb_config", {
id: serial("id").primaryKey(),
name: varchar("name", { length: 255 }).notNull(), // Nom de la configuration
baseUrl: varchar("base_url", { length: 255 }).notNull(), // URL de l'instance NocoDB
projectId: varchar("project_id", { length: 255 }).notNull(), // NocoDB Project ID
apiToken: varchar("api_token", { length: 255 }).notNull(), // Personal API Token
name: varchar("name").notNull(), // Nom de la configuration
baseUrl: varchar("base_url").notNull(), // URL de l'instance NocoDB
projectId: varchar("project_id").notNull(), // NocoDB Project ID
apiToken: varchar("api_token").notNull(), // Personal API Token
description: text("description"), // Description de la configuration
isActive: boolean("is_active").default(true), // Configuration active ou non
createdBy: varchar("created_by", { length: 255 }), // Créateur (nullable en production)
createdBy: varchar("created_by").notNull(),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
});
@@ -217,37 +217,6 @@ export const dlcProducts = pgTable("dlc_products", {
updatedAt: timestamp("updated_at").defaultNow(), // Date de mise à jour
});
// Invoice Verification Cache - Table existante en production
export const invoiceVerificationCache = pgTable("invoice_verification_cache", {
id: serial("id").primaryKey(),
cacheKey: varchar("cache_key", { length: 255 }).notNull(),
groupId: integer("group_id").notNull(),
invoiceReference: varchar("invoice_reference", { length: 255 }).notNull(),
supplierName: varchar("supplier_name", { length: 255 }),
exists: boolean("exists").notNull(),
matchType: varchar("match_type", { length: 50 }).notNull(),
errorMessage: text("error_message"),
cacheHit: boolean("cache_hit").default(false),
apiCallTime: integer("api_call_time"),
expiresAt: timestamp("expires_at").notNull(),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
});
// Invoice Verifications - Table existante en production
export const invoiceVerifications = pgTable("invoice_verifications", {
id: serial("id").primaryKey(),
deliveryId: integer("delivery_id").notNull(),
groupId: integer("group_id").notNull(),
invoiceReference: varchar("invoice_reference", { length: 255 }).notNull(),
supplierName: varchar("supplier_name", { length: 255 }),
exists: boolean("exists").notNull(),
matchType: varchar("match_type", { length: 50 }),
verifiedAt: timestamp("verified_at").defaultNow(),
isValid: boolean("is_valid").default(true),
lastCheckedAt: timestamp("last_checked_at").defaultNow(),
});
// Tasks table
export const tasks = pgTable("tasks", {
id: serial("id").primaryKey(),
@@ -512,18 +481,6 @@ export const insertDlcProductFrontendSchema = insertDlcProductSchema
.omit({ expiryDate: true })
.extend({ dlcDate: z.coerce.date() });
export const insertInvoiceVerificationCacheSchema = createInsertSchema(invoiceVerificationCache).omit({
id: true,
createdAt: true,
updatedAt: true,
});
export const insertInvoiceVerificationsSchema = createInsertSchema(invoiceVerifications).omit({
id: true,
verifiedAt: true,
lastCheckedAt: true,
});
export const insertTaskSchema = createInsertSchema(tasks).omit({
id: true,
createdAt: true,
@@ -559,10 +516,6 @@ export type DlcProduct = typeof dlcProducts.$inferSelect;
export type InsertDlcProduct = z.infer<typeof insertDlcProductSchema>;
export type DlcProductFrontend = Omit<DlcProduct, 'expiryDate'> & { dlcDate: Date };
export type InsertDlcProductFrontend = z.infer<typeof insertDlcProductFrontendSchema>;
export type InvoiceVerificationCache = typeof invoiceVerificationCache.$inferSelect;
export type InsertInvoiceVerificationCache = z.infer<typeof insertInvoiceVerificationCacheSchema>;
export type InvoiceVerification = typeof invoiceVerifications.$inferSelect;
export type InsertInvoiceVerification = z.infer<typeof insertInvoiceVerificationsSchema>;
export type Task = typeof tasks.$inferSelect;
export type InsertTask = z.infer<typeof insertTaskSchema>;