fix(energy): lower JODI oil coverage threshold from 60 to 40 (#2764)

JODI 2026 CSVs return 404 (data not yet published). With only 2025
data, the seeder gets 49 countries which fails the >=60 gate.
Lowered to 40 to allow partial-year data through. The seeder already
fetches current + prior year and merges.
This commit is contained in:
Elie Habib
2026-04-06 13:58:54 +04:00
committed by GitHub
parent 891ed77444
commit 3a81ce2f28
2 changed files with 5 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ export const JODI_TTL = 3_024_000; // 35 days
const META_KEY = 'seed-meta:energy:jodi-oil';
const LOCK_DOMAIN = 'energy:jodi-oil';
const LOCK_TTL_MS = 10 * 60 * 1000;
const MIN_VALID_COUNTRIES = 60;
const MIN_VALID_COUNTRIES = 40;
const ANOMALY_DEMAND_KBD = 10_000;
const JODI_BASE = 'https://www.jodidata.org/_resources/files/downloads/oil-data/annual-csv/';

View File

@@ -343,13 +343,13 @@ describe('mergeSourceRows', () => {
});
describe('validateCoverage', () => {
it('returns true when 60+ countries provided', () => {
const countries = Array.from({ length: 60 }, (_, i) => ({ iso2: `C${i}` }));
it('returns true when 40+ countries provided', () => {
const countries = Array.from({ length: 40 }, (_, i) => ({ iso2: `C${i}` }));
assert.equal(validateCoverage(countries), true);
});
it('returns false when fewer than 60 countries', () => {
const countries = Array.from({ length: 59 }, (_, i) => ({ iso2: `C${i}` }));
it('returns false when fewer than 40 countries', () => {
const countries = Array.from({ length: 39 }, (_, i) => ({ iso2: `C${i}` }));
assert.equal(validateCoverage(countries), false);
});