feat: Introduce product scoring based on weighted sales metrics and store participation, integrated into the product grid API, and add a performance test script.

This commit is contained in:
Michael committed 2026-03-10 11:29:39 +01:00
1 parent 2a76745f29
commit 3ce22defa7
3 files changed
+185 -141

No files matched your search

+3 -3
View File
@@ -46,9 +46,9 @@ export function computeProductScores(
};
});
const maxQty = Math.max(...weightedData.map((d) => d.wQty));
const maxCa = Math.max(...weightedData.map((d) => d.wCa));
const maxMarge = Math.max(...weightedData.map((d) => d.wMarge));
const maxQty = weightedData.reduce((max, d) => Math.max(max, d.wQty), 0);
const maxCa = weightedData.reduce((max, d) => Math.max(max, d.wCa), 0);
const maxMarge = weightedData.reduce((max, d) => Math.max(max, d.wMarge), 0);
// 2. Calculer les moyennes et totaux globaux
const totalQty = weightedData.reduce((acc, d) => acc + d.wQty, 0);