From f9198a06652109263ea922236044a95eea9e8b6b Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 3 Sep 2025 12:49:29 +0000 Subject: [PATCH] Improve production logging and data retrieval processes The attached log file reveals detailed production events, including database messages, user lookups, API call responses for announcements, groups, and user data, monthly statistics calculation, and order/delivery data retrieval. It also shows the API calls made for publicities and the statistics calculated from these. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cfbfe47c-0c9a-4ebf-8a41-2937407eccff Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cfbfe47c-0c9a-4ebf-8a41-2937407eccff/uD8abDf --- ...essages-fr-1756903729633_1756903729634.txt | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 attached_assets/Pasted--PRODUCTION-Using-PostgreSQL-DASHBOARD-MESSAGES-table-PRODUCTION-Raw-messages-fr-1756903729633_1756903729634.txt diff --git a/attached_assets/Pasted--PRODUCTION-Using-PostgreSQL-DASHBOARD-MESSAGES-table-PRODUCTION-Raw-messages-fr-1756903729633_1756903729634.txt b/attached_assets/Pasted--PRODUCTION-Using-PostgreSQL-DASHBOARD-MESSAGES-table-PRODUCTION-Raw-messages-fr-1756903729633_1756903729634.txt new file mode 100644 index 0000000..153d4c3 --- /dev/null +++ b/attached_assets/Pasted--PRODUCTION-Using-PostgreSQL-DASHBOARD-MESSAGES-table-PRODUCTION-Raw-messages-fr-1756903729633_1756903729634.txt @@ -0,0 +1,199 @@ + +🎯 [PRODUCTION] Using PostgreSQL DASHBOARD_MESSAGES table + +🔍 [PRODUCTION] Raw messages from DB: 2 items: [ + + { + + id: 16, + + title: 'Mise à jour Prix', + + content: 'Merci de mettre vos prix a jour tous les matins, certain magasin ne le font pas.', + + type: 'success', + + storeId: null, + + createdBy: 'admin', + + createdAt: 2025-08-18T10:45:08.585Z + + }, + + { + + id: 8, + + title: 'Bon de Livraison', + + content: 'Lorsque vous rentrez un numéro de bon de livraison, faite le a l identique, même les majuscules. Pour My candy Shop, prendre le numéro de commande.', + + type: 'info', + + storeId: null, + + createdBy: 'admin_local', + + createdAt: 2025-08-07T11:04:38.123Z + + } + +] + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin_local + +🔍 [PRODUCTION] User search result: Found + +🔍 [PRODUCTION] User search result: Not found + +❌ [PRODUCTION] User not found with username: admin_local + +🎯 [PRODUCTION] Found announcements: 2 + +GET /api/announcements 304 in 8ms + +GET /api/groups 200 in 4ms + +GET /api/user 304 in 7ms + +📊 Calcul statistiques mensuelles: { + + year: 2025, + + month: 9, + + startDate: '2025-09-01', + + endDate: '2025-10-01', + + groupIds: [ 1 ] + +} + +Orders API called with: { + + startDate: '2025-09-01', + + endDate: '2025-09-30', + + storeId: '1', + + userRole: 'manager' + +} + +🔍 Non-admin orders - filtering by accessible store: { userId: '_1754943032954', role: 'manager', requestedStoreId: 1 } + +Deliveries API called with: { + + startDate: '2025-09-01', + + endDate: '2025-09-30', + + storeId: '1', + + withBL: undefined, + + userRole: 'manager' + +} + +🔍 Non-admin deliveries - filtering by accessible store: { userId: '_1754943032954', role: 'manager', requestedStoreId: 1 } + +📋 API PUBLICITIES REQUEST: { + + year: '2025', + + filterYear: 2025, + + storeId: undefined, + + userRole: 'manager' + +} + +📋 CALLING storage.getPublicities: { filterYear: 2025, groupIds: [ 1 ] } + +📋 PUBLICITES FETCHED: 29 résultats pour année 2025 + +🔍 PREMIERS RESULTATS: [ + + '1. N°2501 - Blanc', + + '2. N°2502 - Moins de 1€ 2€ 3€ 4€ 5€', + + '3. N°2503 - Imbattables' + +] + +📋 PUBLICITIES RETURNED: { count: 29 } + +GET /api/publicities 304 in 22ms + +📊 Statistiques calculées: { + + ordersCount: 12, + + deliveriesCount: 10, + + pendingOrdersCount: 10, + + averageDeliveryTime: 3.6666666666666665, + + totalPalettes: 29, + + totalPackages: 3 + +} + +GET /api/stats/monthly 200 in 31ms + +Orders returned: 12 items + +GET /api/orders 200 in 33ms + +Deliveries returned: 10 items + +GET /api/deliveries 304 in 34ms + +GET /api/user 304 in 5ms + +GET /api/user 304 in 3ms + +HEAD /api/health 200 in 1ms + +Orders API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: undefined, + + userRole: 'manager' + +} + +🔍 Manager orders - using assigned store automatically: { + + userId: '_1754943032954', + + role: 'manager', + + assignedStore: 1, + + allUserGroups: [ 1 ] + +} + +GET /api/suppliers 200 in 8ms + +GET /api/user 304 in 9ms + +🔗 PRODUCTION: getOrders() récupéré 56 commandes avec relations + +Orders returned: 56 items +