mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-23 23:18:10 +02:00
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.
This commit is contained in:
1 parent
5009bd7612
commit
10cea8c528
2 files changed
+5
-1
No files matched your search
@@ -35,7 +35,9 @@ export default async function GridPage({ searchParams }: GridPageProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. Load real product data for the selected supplier
|
// 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);
|
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);
|
const selectedFournisseur = fournisseurs.find((f: { code: string; nom: string }) => f.code === codeFournisseur);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ interface GetProductRowsInput {
|
|||||||
|
|
||||||
export async function getProductRows(input: GetProductRowsInput): Promise<ProductRow[]> {
|
export async function getProductRows(input: GetProductRowsInput): Promise<ProductRow[]> {
|
||||||
const { codeFournisseur, magasin = "TOTAL", filters } = input;
|
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 {
|
try {
|
||||||
// Self-healing: Ensure codeGammeInit column exists and is populated
|
// Self-healing: Ensure codeGammeInit column exists and is populated
|
||||||
if (!isSchemaInitialized) {
|
if (!isSchemaInitialized) {
|
||||||
|
|||||||
Reference in new issue
Block a user