From 10cea8c528530baaafe088f38a2e141c7019ba6c Mon Sep 17 00:00:00 2001 From: R0m1k3 Date: Tue, 10 Mar 2026 15:52:29 +0100 Subject: [PATCH] feat: Implement product grid with a new API for fetching and processing product sales data, including schema initialization and score computation, and a dashboard page for display. --- src/app/(dashboard)/grid/page.tsx | 2 ++ src/features/grid/api/get-product-rows.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/(dashboard)/grid/page.tsx b/src/app/(dashboard)/grid/page.tsx index 5e2cc64..c6f8c5b 100644 --- a/src/app/(dashboard)/grid/page.tsx +++ b/src/app/(dashboard)/grid/page.tsx @@ -35,7 +35,9 @@ export default async function GridPage({ searchParams }: GridPageProps) { } // 3. Load real product data for the selected supplier + console.log(`\n>>> [GridPage] Fetching data for: ${codeFournisseur}, shop: ${magasin}`); const rows = await getGridData(codeFournisseur, magasin, filters); + console.log(`>>> [GridPage] Received ${rows.length} rows from getGridData`); const selectedFournisseur = fournisseurs.find((f: { code: string; nom: string }) => f.code === codeFournisseur); return ( diff --git a/src/features/grid/api/get-product-rows.ts b/src/features/grid/api/get-product-rows.ts index 025f539..b02fad0 100644 --- a/src/features/grid/api/get-product-rows.ts +++ b/src/features/grid/api/get-product-rows.ts @@ -18,7 +18,9 @@ interface GetProductRowsInput { export async function getProductRows(input: GetProductRowsInput): Promise { const { codeFournisseur, magasin = "TOTAL", filters } = input; - + console.log(`\n>>> [getProductRows] RECEIVED CALL for supplier: ${codeFournisseur}, magasin: ${magasin}`); + console.log(`>>> [getProductRows] filters:`, JSON.stringify(filters)); + try { // Self-healing: Ensure codeGammeInit column exists and is populated if (!isSchemaInitialized) {