mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-22 22:58:16 +02:00
Add customer order tracking and management features to the platform
Adds customerOrders and customerOrderProducts tables to shared/schema.ts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 4b008663-bd72-492b-b0b6-fa252367e730 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/4b008663-bd72-492b-b0b6-fa252367e730/gfGF2TH
This commit is contained in:
1 parent
e03165bcc0
commit
430ab669aa
2 files changed
+36
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 294 KiB |
@@ -91,6 +91,42 @@ export const saleProducts = pgTable("sale_products", {
|
|||||||
createdAt: timestamp("created_at").defaultNow(),
|
createdAt: timestamp("created_at").defaultNow(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Customer Orders table
|
||||||
|
export const customerOrders = pgTable("customer_orders", {
|
||||||
|
id: serial("id").primaryKey(),
|
||||||
|
storeId: integer("store_id").references(() => stores.id).notNull(),
|
||||||
|
userId: integer("user_id").references(() => users.id).notNull(),
|
||||||
|
timestamp: timestamp("timestamp").defaultNow(),
|
||||||
|
|
||||||
|
// Client information
|
||||||
|
nom: varchar("nom", { length: 255 }).notNull(),
|
||||||
|
prenom: varchar("prenom", { length: 255 }).notNull(),
|
||||||
|
telephone: varchar("telephone", { length: 20 }),
|
||||||
|
email: varchar("email", { length: 255 }),
|
||||||
|
adresse: text("adresse"),
|
||||||
|
|
||||||
|
// Order details
|
||||||
|
statut: varchar("statut", { length: 50 }).notNull().default("En attente de commande"),
|
||||||
|
dateCommande: timestamp("date_commande"),
|
||||||
|
dateLivraison: timestamp("date_livraison"),
|
||||||
|
montant: integer("montant"), // En centimes
|
||||||
|
commentaire: text("commentaire"), // Champ commentaire principal
|
||||||
|
|
||||||
|
createdAt: timestamp("created_at").defaultNow(),
|
||||||
|
updatedAt: timestamp("updated_at").defaultNow(),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Customer Order Products table
|
||||||
|
export const customerOrderProducts = pgTable("customer_order_products", {
|
||||||
|
id: serial("id").primaryKey(),
|
||||||
|
orderId: integer("order_id").references(() => customerOrders.id, { onDelete: "cascade" }).notNull(),
|
||||||
|
produit: varchar("produit", { length: 255 }).notNull(),
|
||||||
|
quantite: integer("quantite").notNull().default(1),
|
||||||
|
prixUnitaire: integer("prix_unitaire"), // En centimes
|
||||||
|
total: integer("total"), // En centimes
|
||||||
|
createdAt: timestamp("created_at").defaultNow(),
|
||||||
|
});
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
export const storesRelations = relations(stores, ({ many }) => ({
|
export const storesRelations = relations(stores, ({ many }) => ({
|
||||||
users: many(users),
|
users: many(users),
|
||||||
|
|||||||
Reference in new issue
Block a user