chore(qlik): log raw sample of 4 new metrics to isolate empty columns

Adds a sample log of the first extracted rows (all 8 hypercube columns)
and a sample of the network metrics matched from cache in getProductRows,
to pinpoint whether the new measures return null from Qlik, fail to
persist, or fail to render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Opus 4.8 committed 2026-06-21 08:39:35 +02:00
1 parent bd9bc78f4c
commit 8bd45518f2
2 files changed
+7

No files matched your search

@@ -474,6 +474,8 @@ async function enrichWithNetworkMetrics(productMap: Map<string, ProductRow>): Pr
if (byCodeCentrale.size === 0) return; if (byCodeCentrale.size === 0) return;
const metrics = await getNetworkMetricsByCodeCentrale([...byCodeCentrale.keys()]); const metrics = await getNetworkMetricsByCodeCentrale([...byCodeCentrale.keys()]);
const firstMatch = [...byCodeCentrale.keys()].find((cc) => metrics.has(cc));
console.log(`[getProductRows] réseau: ${byCodeCentrale.size} codes centraux → ${metrics.size} matchés en cache. Sample:`, firstMatch ? JSON.stringify(metrics.get(firstMatch)) : "aucun match");
for (const [cc, products] of byCodeCentrale.entries()) { for (const [cc, products] of byCodeCentrale.entries()) {
const m = metrics.get(cc); const m = metrics.get(cc);
if (!m) continue; if (!m) continue;
+5
View File
@@ -147,6 +147,11 @@ export async function fetchNetworkMetricsPlaywright(
out.set(code, { codeCentrale: code, caReseau: Number(r[1]) || 0, qteReseau: Number(r[2]) || 0, nbMagasinsReseau: Number(r[3]) || 0, caParMagasinReseau: Number(r[4]) || 0, couvertureStockReseau: Number(r[5]) || 0, margePctReseau: Number(r[6]) || 0, rupturePctReseau: Number(r[7]) || 0 }); out.set(code, { codeCentrale: code, caReseau: Number(r[1]) || 0, qteReseau: Number(r[2]) || 0, nbMagasinsReseau: Number(r[3]) || 0, caParMagasinReseau: Number(r[4]) || 0, couvertureStockReseau: Number(r[5]) || 0, margePctReseau: Number(r[6]) || 0, rupturePctReseau: Number(r[7]) || 0 });
} }
console.log(`[qlik-pw] ${out.size} produits réseau (cube ${result.size})`); console.log(`[qlik-pw] ${out.size} produits réseau (cube ${result.size})`);
// Échantillon brut pour vérifier que les 4 nouvelles mesures (cols 4-7) renvoient des valeurs
const sample = (result.rows ?? []).slice(0, 3).map((r) => ({
code: r[0], ca: r[1], qte: r[2], nbMag: r[3], caMag: r[4], couv: r[5], margePct: r[6], ruptPct: r[7],
}));
console.log(`[qlik-pw] échantillon lignes:`, JSON.stringify(sample));
return out; return out;
} finally { } finally {
await ctx.close(); await ctx.close();