Update: 2026-07-06 18:23:46

This commit is contained in:
Hamza-Ayed
2026-07-06 18:23:46 +03:00
parent 9d257c5d7d
commit d6ab09c19b
7 changed files with 505 additions and 202 deletions
+16 -3
View File
@@ -183,12 +183,25 @@ async function processCompetitor(
countryCode: row.country_code,
}));
// Known receipts for formula validation.
// Add real receipts here as they are collected — the engine will print
// predicted vs actual with % error so you can judge formula quality at a glance.
const knownReceipts = comp.competitor_name === 'com.taxif.passenger' ? [
{
label: 'TaxiF receipt 2026-06-11 (Amman)',
distanceKm: 2.17,
durationMin: 6 + 38 / 60, // 6 min 38 sec
actualPrice: 1.15, // 1.18 JOD total − 0.03 BookingFee
},
] : [];
const report = await runAnalysis(samples, {
competitorName: comp.competitor_name,
countryCode: comp.country_code,
cleanOutliers: true,
countryCode: comp.country_code,
cleanOutliers: true,
// surgeThresholdFraction defaults to 0.05 (5% of median price) — currency-agnostic
tierCount: 3,
tierCount: 3,
knownReceipts,
});
// --- Compute peak hours once, reuse in both formulas and surge insights ---