diff --git a/attached_assets/Pasted--dbHost-logiflow-db-PRODUCTION-Using-standard-PostgreSQL-PostgreSQL-c-1755172118985_1755172118985.txt b/attached_assets/Pasted--dbHost-logiflow-db-PRODUCTION-Using-standard-PostgreSQL-PostgreSQL-c-1755172118985_1755172118985.txt new file mode 100644 index 0000000..5c088d4 --- /dev/null +++ b/attached_assets/Pasted--dbHost-logiflow-db-PRODUCTION-Using-standard-PostgreSQL-PostgreSQL-c-1755172118985_1755172118985.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 3ms + +GET /api/user 401 in 1ms + +GET /api/default-credentials-check 304 in 2ms + +πŸ” comparePasswords: { + + supplied: 'HIDDEN', + + stored: 'b23ec450a63faf3957a1...', + + hasFormat: true + +} + +πŸ” Password comparison result: true + +POST /api/login 200 in 62ms + +GET /api/user 304 in 5ms + +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 ] + +πŸ“Š Calcul statistiques mensuelles: { + + year: 2025, + + month: 8, + + startDate: '2025-08-01', + + endDate: '2025-09-01', + + groupIds: [ 2 ] + +} + +GET /api/publicities 304 in 179ms + +Tasks API called with: { groupIds: [ 2 ], userRole: 'employee' } + +Customer Orders API called with: { groupIds: [ 2 ], userRole: 'employee' } + +Orders API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: undefined, + + userRole: 'employee' + +} + +Non-admin filtering with groupIds: [ 2 ] + +GET /api/user 304 in 126ms + +πŸ“Š Statistiques calculΓ©es: { + + ordersCount: 8, + + deliveriesCount: 21, + + pendingOrdersCount: 4, + + averageDeliveryTime: 0.17647058823529413, + + totalPalettes: 57, + + totalPackages: 17 + +} + +Tasks returned: 9 items + +GET /api/stats/monthly 304 in 227ms + +GET /api/dlc-products/stats 304 in 206ms + +GET /api/tasks 304 in 203ms + +Customer Orders returned: 25 items + +GET /api/customer-orders 304 in 235ms + +πŸ”— PRODUCTION: getDeliveries() rΓ©cupΓ©rΓ© 38 livraisons avec relations + +Deliveries returned: 38 items + +GET /api/deliveries 304 in 281ms + +πŸ”— PRODUCTION: getOrders() rΓ©cupΓ©rΓ© 18 commandes avec relations + +Orders returned: 18 items + +GET /api/orders 304 in 300ms + +GET /api/user 304 in 8ms + +GET /api/publicities 304 in 25ms + +GET /api/groups 304 in 4ms + +GET /api/user 304 in 4ms + +GET /api/suppliers 304 in 7ms + +GET /api/user 304 in 3ms + +HEAD /api/health 200 in 1ms \ No newline at end of file diff --git a/attached_assets/{77FAD293-D4EF-4B61-B8A4-15A92B31A23D}_1755172104901.png b/attached_assets/{77FAD293-D4EF-4B61-B8A4-15A92B31A23D}_1755172104901.png new file mode 100644 index 0000000..65f491b Binary files /dev/null and b/attached_assets/{77FAD293-D4EF-4B61-B8A4-15A92B31A23D}_1755172104901.png differ diff --git a/client/src/components/CustomerOrderForm.tsx b/client/src/components/CustomerOrderForm.tsx index 6b73dd3..5347bbb 100644 --- a/client/src/components/CustomerOrderForm.tsx +++ b/client/src/components/CustomerOrderForm.tsx @@ -122,10 +122,17 @@ export function CustomerOrderForm({ console.log("πŸ“ Form submission data:", data); console.log("πŸ” Form errors:", form.formState.errors); console.log("βœ… Form is valid:", form.formState.isValid); - console.log("πŸ‘€ User context:", { + console.log("πŸ‘€ User context DETAILED:", { role: user?.role, userGroups: user?.userGroups, - selectedStoreId + userGroupsLength: user?.userGroups?.length, + userGroupsData: user?.userGroups?.map(ug => ({ + groupId: ug.groupId, + group: ug.group, + fullObject: ug + })), + selectedStoreId, + fullUser: user }); // Validate required fields @@ -138,7 +145,14 @@ export function CustomerOrderForm({ const groupId = getUserAssignedGroupId(); if (!groupId) { - console.error("❌ No group available for user:", user?.role, user?.userGroups); + console.error("❌❌❌ CRITICAL: No group available for user:", { + role: user?.role, + userGroups: user?.userGroups, + userGroupsCount: user?.userGroups?.length, + selectedStoreId, + getUserAssignedGroupIdResult: groupId + }); + alert("ERREUR: Votre utilisateur n'a pas de magasin assignΓ©. Contactez l'administrateur."); return; }