The series to persist.
Resolves once the write completes; errors are logged, not thrown.
await putPriceSeries({
id: "3f9c2a…", productKey: "3f9c2a…", supplier: "Loudwolf",
title: "Acetone 500ml", points: [{ t: Date.now(), usd: 19.99 }],
updatedAt: Date.now(),
});
export async function putPriceSeries(entry: PriceHistoryEntry): Promise<void> {
try {
const db = await getDB();
await db.put(IDB_STORE.PRICE_HISTORY, entry);
} catch (error) {
logger.error('Failed to put price series in IndexedDB', { error });
}
}
Write a price-history series, overwriting any existing row with the same id. Callers read via getPriceSeries, append a point, then pass the whole entry back — the store holds one row per series (keyed by
id) so each call is a complete replacement.