diff --git a/attached_assets/Pasted--dbHost-logiflow-db-PRODUCTION-Using-standard-PostgreSQL-PostgreSQL-c-1755171899964_1755171899964.txt b/attached_assets/Pasted--dbHost-logiflow-db-PRODUCTION-Using-standard-PostgreSQL-PostgreSQL-c-1755171899964_1755171899964.txt new file mode 100644 index 0000000..93cdeb3 --- /dev/null +++ b/attached_assets/Pasted--dbHost-logiflow-db-PRODUCTION-Using-standard-PostgreSQL-PostgreSQL-c-1755171899964_1755171899964.txt @@ -0,0 +1,201 @@ + + + dbHost: 'logiflow-db' + +} + +๐Ÿณ PRODUCTION: Using standard PostgreSQL + +โœ… PostgreSQL connection test successful + +๐Ÿ”— Database initialization: { + + NODE_ENV: 'production', + + isProduction: true, + + hasDbUrl: true, + + dbHost: 'logiflow-db:5432' + +} + +โœ… Using DatabaseStorage (production PostgreSQL) + +โฐ Automatic backup scheduled for 2:00 AM daily (native timer) + +๐Ÿ” Using development storage and authentication + +๐Ÿณ PRODUCTION: Starting LogiFlow application + +๐Ÿณ Environment: { NODE_ENV: 'production', DATABASE_URL: 'Present', PORT: '3000' } + +๐Ÿ”ง Registering all production routes... + +๐Ÿ”„ Running automatic production migrations... + +๐Ÿ”„ MIGRATION: Starting SAV production migrations... + +๐Ÿ”„ MIGRATION: Database URL configured: postgresql://logiflow_admin:Lo... + +โœ… MIGRATION: Connected to PostgreSQL database + +๐Ÿ”„ MIGRATION: Checking if priority column exists... + +๐Ÿ”„ MIGRATION: Priority column check result: 1 + +โœ… MIGRATION: Priority column already exists, skipping migration + +๐Ÿ”Œ MIGRATION: Database connection closed + +๐Ÿ”ง Using memory session store for development + +Warning: connect.session() MemoryStore is not + +designed for a production environment, as it will leak + +memory, and will not scale past a single process. + +โœ… All routes registered successfully for production + +๐Ÿณ Serving static files from: /app/dist/public + +๐Ÿณ PRODUCTION: LogiFlow serving on port 3000 + +HEAD /api/health 200 in 4ms + +๐Ÿ“„ SPA: Serving index.html for /customer-orders + +GET /api/user 401 in 1ms + +๐Ÿ“„ SPA: Serving index.html for /auth + +GET /api/user 401 in 1ms + +GET /api/user 401 in 1ms + +GET /api/default-credentials-check 304 in 4ms + +๐Ÿ” comparePasswords: { + + supplied: 'HIDDEN', + + stored: 'b23ec450a63faf3957a1...', + + hasFormat: true + +} + +๐Ÿ” Password comparison result: true + +POST /api/login 200 in 53ms + +GET /api/user 304 in 4ms + +GET /api/user 304 in 12ms + +Deliveries API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: undefined, + + withBL: undefined, + + userRole: 'employee' + +} + +Non-admin filtering deliveries with groupIds: [ 2 ] + +Orders API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: undefined, + + userRole: 'employee' + +} + +Non-admin filtering with groupIds: [ 2 ] + +GET /api/user 304 in 43ms + +๐Ÿ“Š Calcul statistiques mensuelles: { + + year: 2025, + + month: 8, + + startDate: '2025-08-01', + + endDate: '2025-09-01', + + groupIds: [ 2 ] + +} + +GET /api/user 304 in 24ms + +Tasks API called with: { groupIds: [ 2 ], userRole: 'employee' } + +๐Ÿ”— PRODUCTION: getOrders() rรฉcupรฉrรฉ 18 commandes avec relations + +Orders returned: 18 items + +GET /api/orders 304 in 221ms + +Customer Orders API called with: { groupIds: [ 2 ], userRole: 'employee' } + +GET /api/publicities 304 in 218ms + +GET /api/dlc-products/stats 304 in 216ms + +Customer Orders returned: 25 items + +GET /api/customer-orders 304 in 228ms + +Tasks returned: 9 items + +GET /api/tasks 304 in 220ms + +๐Ÿ”— PRODUCTION: getDeliveries() rรฉcupรฉrรฉ 38 livraisons avec relations + +Deliveries returned: 38 items + +GET /api/deliveries 304 in 236ms + +๐Ÿ“Š Statistiques calculรฉes: { + + ordersCount: 8, + + deliveriesCount: 21, + + pendingOrdersCount: 4, + + averageDeliveryTime: 0.17647058823529413, + + totalPalettes: 57, + + totalPackages: 17 + +} + +GET /api/stats/monthly 304 in 246ms + +GET /api/groups 304 in 4ms + +GET /api/publicities 304 in 11ms + +GET /api/user 304 in 5ms + +GET /api/suppliers 304 in 8ms + +GET /api/user 304 in 3ms + +HEAD /api/health 200 in 1ms \ No newline at end of file diff --git a/attached_assets/{2416E2D5-47C8-430C-BA9A-2E57A4A77EEB}_1755171889832.png b/attached_assets/{2416E2D5-47C8-430C-BA9A-2E57A4A77EEB}_1755171889832.png new file mode 100644 index 0000000..5c09364 Binary files /dev/null and b/attached_assets/{2416E2D5-47C8-430C-BA9A-2E57A4A77EEB}_1755171889832.png differ diff --git a/client/src/components/CustomerOrderForm.tsx b/client/src/components/CustomerOrderForm.tsx index 1540ddb..6b73dd3 100644 --- a/client/src/components/CustomerOrderForm.tsx +++ b/client/src/components/CustomerOrderForm.tsx @@ -25,9 +25,21 @@ import { Checkbox } from "@/components/ui/checkbox"; import { insertCustomerOrderFrontendSchema, type CustomerOrderWithRelations, type Group, type Supplier } from "@shared/schema"; import { useStore } from "@/components/Layout"; -const customerOrderFormSchema = insertCustomerOrderFrontendSchema.extend({ - groupId: z.coerce.number().int().positive().optional(), - createdBy: z.string().optional(), +const customerOrderFormSchema = z.object({ + orderTaker: z.string().min(1, "Qui a pris la commande est requis"), + customerName: z.string().min(1, "Nom du client est requis"), + contactNumber: z.string().optional(), + productName: z.string().min(1, "Dรฉsignation du produit est requise"), + productReference: z.string().optional(), + gencode: z.string().optional(), + quantity: z.coerce.number().int().positive().default(1), + supplierId: z.coerce.number().int().positive().default(1), + groupId: z.coerce.number().int().positive(), + deposit: z.coerce.number().default(0), + isPromotionalPrice: z.boolean().default(false), + customerNotified: z.boolean().default(false), + notes: z.string().optional(), + customerEmail: z.string().optional(), }); type CustomerOrderFormData = z.infer; @@ -96,12 +108,12 @@ export function CustomerOrderForm({ productReference: order?.productReference || "", gencode: order?.gencode || "", quantity: order?.quantity || 1, - supplierId: order?.supplierId || undefined, + supplierId: order?.supplierId || 1, status: "En attente de Commande", // Statut fixe deposit: order?.deposit || 0, isPromotionalPrice: order?.isPromotionalPrice || false, customerNotified: order?.customerNotified || false, - groupId: order?.groupId || getUserAssignedGroupId(), + groupId: order?.groupId || getUserAssignedGroupId() || 1, }, }); @@ -223,7 +235,7 @@ export function CustomerOrderForm({ render={({ field }) => ( Fournisseur -