1 Commits

Author SHA1 Message Date
Elie Habib
e86de6ffec feat(energy): EU country-level gas storage via GIE AGSI+ (#2709)
* feat(seeds): EU country-level gas storage via GIE AGSI+

* fix(seeds): use correct GIE AGSI+ country param (country=ISO2 not country_code=)

* fix(seeds): preserve old fetchedAt on failure, raise MIN_VALID_COUNTRIES to 24

- preservePreviousSnapshot now reads the existing seed-meta and reuses
  its fetchedAt instead of stamping Date.now(). A failed run that keeps
  extending the snapshot no longer resets the clock, so health staleness
  detection fires correctly after maxStaleMin elapses.
- health.js (both BOOTSTRAP_KEYS and STANDALONE_KEYS blocks): treat
  meta.status === 'error' as immediately stale, independent of fetchedAt.
- Raise MIN_VALID_COUNTRIES from 15 to 24 (85% of 28) so a partial
  upstream outage dropping several countries doesn't silently publish a
  truncated dataset. Tests updated to match.

* fix(seeds): empty-string fallthrough in parseFillEntry, drop unused watch path

- parseFillEntry: switch numeric field selectors from ?? to || so that
  empty-string API responses (full: "", gasInStorage: "") fall through to
  the next candidate instead of producing NaN and silently dropping the
  country. Date field keeps ?? since an empty string is the intended
  sentinel for missing dates.
- Add two tests covering the empty-string fallthrough for fill and gwh.
- preservePreviousSnapshot: remove GAS_STORAGE_META_KEY from
  extendExistingTtl — the SET that follows handles its TTL, making the
  EXPIRE redundant.
- railway-set-watch-paths: drop _country-resolver.mjs from the
  seed-gas-storage-countries watch list; the seed does not import it.
2026-04-05 12:32:13 +04:00