← story.propek
STORY MI-1.1
MI-1.1
Epic: Market Intel Macro v1
PENDING
ACCEPTANCE CRITERIA (15/15)
1. Script `scripts/fetch-bcb-data.js` fetches 6 BCB SGS series (selic/432, usd_brl/1, ipca/433, igpm/189, pib/4380, industrial_production/21859) from config
2. Each series is fetched independently -- failure in one does not block others (FR-06)
3. Output `data/state/bcb-latest.json` with all indicator values, timestamps, statuses, and error array
4. Output appends to `data/timeseries/bcb-indicators.json` via `appendToSeries()` with dedup by `date_iso` (FR-07)
5. BCB date format `DD/MM/YYYY` is converted to ISO `YYYY-MM-DD`
6. BCB `valor` string is parsed to float
7. Supports `--dry-run` flag (preview without writing files)
8. Supports `--verbose` flag (debug-level logging)
9. Supports `--help` flag (shows usage information)
10. Supports `--series selic,ipca` flag (fetch only specified series)
11. Uses rate limiter at 1 req/sec via `createLimiter(1)`
12. Exit code 0 on partial or full success, exit code 1 if ALL series fail
13. Prints summary to stdout: "Completed: X/6 series OK"
14. No API key required (BCB SGS is open)
15. Uses `ultimos/{n}` endpoint format to avoid 10-year window limitation