From 43776944cb40808ce049d8df50cc7d5f7d76cf6a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 18 Aug 2025 09:36:03 +0000 Subject: [PATCH] Fix error when fetching product stock information Address a database error where the `stock_epuise` column is missing in the `dlc_products` table, preventing product stock data from being retrieved. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/i2gFnxm --- ...l-orders-C-1755509679309_1755509679309.txt | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 attached_assets/Pasted--userRole-admin-Admin-filtering-with-groupIds-1-Fetching-all-orders-C-1755509679309_1755509679309.txt diff --git a/attached_assets/Pasted--userRole-admin-Admin-filtering-with-groupIds-1-Fetching-all-orders-C-1755509679309_1755509679309.txt b/attached_assets/Pasted--userRole-admin-Admin-filtering-with-groupIds-1-Fetching-all-orders-C-1755509679309_1755509679309.txt new file mode 100644 index 0000000..b375805 --- /dev/null +++ b/attached_assets/Pasted--userRole-admin-Admin-filtering-with-groupIds-1-Fetching-all-orders-C-1755509679309_1755509679309.txt @@ -0,0 +1,196 @@ + + userRole: 'admin' + +} + +Admin filtering with groupIds: [ 1 ] + +Fetching all orders + +Customer Orders API called with: { groupIds: [ 1 ], userRole: 'admin' } + +Deliveries API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: '1', + + withBL: undefined, + + userRole: 'admin' + +} + +Admin filtering deliveries with groupIds: [ 1 ] + +Fetching all deliveries + +Customer Orders returned: 10 items + +GET /api/customer-orders 200 in 16ms + +🔗 PRODUCTION: getOrders() récupéré 33 commandes avec relations + +Orders returned: 33 items + +GET /api/orders 200 in 124ms + +🔗 PRODUCTION: getDeliveries() récupéré 49 livraisons avec relations + +Deliveries returned: 49 items + +GET /api/deliveries 200 in 140ms + +GET /api/groups 304 in 48ms + +GET /api/user 304 in 4ms + +GET /api/suppliers 304 in 9ms + +Error fetching DLC products: error: column dlc_products.stock_epuise does not exist + + at /app/node_modules/pg-pool/index.js:45:11 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22 + + at async DatabaseStorage.getDlcProducts (file:///app/dist/index.js:2187:25) + + at async file:///app/dist/index.js:6178:28 { + + length: 124, + + severity: 'ERROR', + + code: '42703', + + detail: undefined, + + hint: undefined, + + position: '337', + + internalPosition: undefined, + + internalQuery: undefined, + + where: undefined, + + schema: undefined, + + table: undefined, + + column: undefined, + + dataType: undefined, + + constraint: undefined, + + file: 'parse_relation.c', + + line: '3665', + + routine: 'errorMissingColumn' + +} + +GET /api/dlc-products 500 in 15ms + +GET /api/dlc-products 500 in 7ms + +Error fetching DLC products: error: column dlc_products.stock_epuise does not exist + + at /app/node_modules/pg-pool/index.js:45:11 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22 + + at async DatabaseStorage.getDlcProducts (file:///app/dist/index.js:2187:25) + + at async file:///app/dist/index.js:6178:28 { + + length: 124, + + severity: 'ERROR', + + code: '42703', + + detail: undefined, + + hint: undefined, + + position: '337', + + internalPosition: undefined, + + internalQuery: undefined, + + where: undefined, + + schema: undefined, + + table: undefined, + + column: undefined, + + dataType: undefined, + + constraint: undefined, + + file: 'parse_relation.c', + + line: '3665', + + routine: 'errorMissingColumn' + +} + +Error fetching DLC products: error: column dlc_products.stock_epuise does not exist + + at /app/node_modules/pg-pool/index.js:45:11 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22 + + at async DatabaseStorage.getDlcProducts (file:///app/dist/index.js:2187:25) + + at async file:///app/dist/index.js:6178:28 { + + length: 124, + + severity: 'ERROR', + + code: '42703', + + detail: undefined, + + hint: undefined, + + position: '337', + + internalPosition: undefined, + + internalQuery: undefined, + + where: undefined, + + schema: undefined, + + table: undefined, + + column: undefined, + + dataType: undefined, + + constraint: undefined, + + file: 'parse_relation.c', + + line: '3665', + + routine: 'errorMissingColumn' \ No newline at end of file