2 Commits

Author SHA1 Message Date
Elie Habib
9a0f265db3 chore(scripts): replace xlsx with exceljs (#2575)
* chore(scripts): replace xlsx with exceljs

xlsx has known vulnerabilities with no patched version available.
exceljs is actively maintained (~6M weekly downloads) and covers
the same read-only parsing needs in seed-fuel-prices.mjs and
backfill-fuel-prices-prev.mjs.

* fix(scripts): handle ExcelJS Date cells and add Czechia mapping

ExcelJS returns Date objects for date cells (unlike xlsx which returned
raw strings). Convert to DD/MM/YYYY format to preserve downstream regex
parsing. Also add 'Czechia' alias to EU country map since the EU XLSX
now uses the short form instead of 'Czech Republic' (27/27 countries).

* fix(scripts): handle ExcelJS rich-text cell values

ExcelJS returns {richText: [{text: '...'}]} for formatted cells.
String() on these produces '[object Object]', breaking header
detection regex. Extract plain text from rich-text arrays.
2026-03-31 13:09:21 +04:00
Elie Habib
67d4cd52e1 fix(fuel-prices): read :prev key for WoW, always write new data to :prev (#2163)
- readSeedSnapshot now reads CANONICAL_KEY:prev (not main key) so
  manually backfilled :prev snapshots are used for WoW computation
- extraKeys always writes new seed data to :prev (removed prevSnapshot
  guard) so every run primes the next run's WoW reference point
- adds backfill-fuel-prices-prev.mjs one-off script to seed last week's
  prices (EIA March 10-16, Malaysia prev week, EU March 16 current)
2026-03-24 00:34:49 +04:00