mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-19 13:08:11 +02:00
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:
1 parent
2a76745f29
commit
3ce22defa7
3 files changed
+185
-141
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user