export async function getStats(): Promise<SupplierStatsData> {
// Flush any pending increments first
await flushToStorage();
try {
return await getAllSupplierStats();
} catch (error) {
console.warn('Failed to read supplier stats:', error);
return {};
}
}
Read all stats from IndexedDB, returning the SupplierStatsData shape:
{ [dateKey]: { [supplier]: SupplierDayStats } }. Recording runs in every build; only the stats UI is gated (dev builds, or advanced mode).