The day being written, as YYYY-MM-DD.
That day's stats keyed by supplier name.
Resolves once the write completes.
await putSupplierStatsEntry("2026-07-18", { Loudwolf: { queries: 3, results: 41 } });
export async function putSupplierStatsEntry(
dateKey: string,
suppliers: Record<string, SupplierDayStats>,
): Promise<void> {
try {
const db = await getDB();
await db.put(IDB_STORE.SUPPLIER_STATS, { dateKey, suppliers });
emitSupplierStatsUpdated();
} catch (error) {
logger.error('Failed to put supplier stats entry in IndexedDB', { error });
}
}
Writes one day's per-supplier stats and notifies open surfaces by dispatching IDB_SUPPLIER_STATS_UPDATED, so the stats panel re-reads without polling.