Files
2026-05-27 23:29:53 +01:00

69 lines
3.9 KiB
Markdown

# Tasks — add @suaveplan/currency-providers
> Every checkbox MUST reflect work actually done in this change.
## 1. Spec authoring
- [x] 1.1 Read `../suaveplan/enterprise/currency-providers.md` end-to-end
- [x] 1.2 `openspec/specs/currency-providers/spec.md` does not exist — confirmed
- [x] 1.3 Read `openspec/AGENTS.md` Sections 13 and 14
- [x] 1.4 Draft `proposal.md` from `openspec/templates/proposal.md`
- [x] 1.5 Fill in `## Source mapping` table — every requirement cites line range or is in "no source line" table
- [x] 1.6 Draft `specs/currency-providers/spec.md` from `openspec/templates/spec-delta.md`
- [x] 1.7 Every requirement carries a `**Verified by:**` line naming concrete `it(...)` titles
## 2. Implementation
- [x] 2.1 Scaffold `packages/finance/currency-providers/` (`package.json`, `tsconfig.json`, `tsconfig.lib.json`, `vite.config.ts`, `vitest.config.ts`, `tests/setup/polyfills.ts`, `README.md`)
- [x] 2.2 `src/types/configs.ts` — `ApiKeyConfig`, `NoKeyConfig`, `HttpFetchOptions` (named interfaces, no inline shapes)
- [x] 2.3 `src/error-codes/error-codes.ts` — `CURRENCY_PROVIDER_CODES` registry + `CurrencyProviderError` discriminated class
- [x] 2.4 `src/providers/ecb/ecb.ts` — ECB XML provider with injectable `FetchLike`
- [x] 2.5 `src/providers/fixer/fixer.ts` — Fixer.io provider with API key
- [x] 2.6 `src/providers/open-exchange-rates/open-exchange-rates.ts`
- [x] 2.7 `src/providers/binance/binance.ts`
- [x] 2.8 `src/providers/coingecko/coingecko.ts` + `getCoinGeckoId`
- [x] 2.9 `src/providers/coinmarketcap/coinmarketcap.ts`
- [x] 2.10 `src/providers/cryptocompare/cryptocompare.ts`
- [x] 2.11 `src/providers/kraken/kraken.ts`
- [x] 2.12 `src/providers/virtual/virtual.ts` — virtual-currency provider with runtime mutators
- [x] 2.13 `src/index.ts` — explicit named re-exports (no `export *`)
- [x] 2.14 Subpath exports declared in `package.json` for every public module
## 3. Tests
- [x] 3.1 Per-provider `<name>.test.ts` covering every scenario, with real `FetchLike` injection (no `vi.mock` / `vi.stubGlobal`)
- [x] 3.2 `src/error-codes/error-codes.test.ts` — every `CURRENCY_PROVIDER.*` code reachable; SuaveplanError contract preserved
- [x] 3.3 Every `it(...)` carries `{ timeout: 5000 }`
- [x] 3.4 All test files import runner primitives from `@suaveplan/testing/runner`
## 4. Documentation
- [x] 4.1 Sibling `.md` for every implementation `.ts` (≥200 words, basic + advanced examples, full API reference)
- [x] 4.2 `README.md` links every co-located `.md` under `## Modules`
## 5. Pre-archive verification (the 5-gate triple)
- [x] 5.1 `bun run check` — Biome 0 errors / 0 warnings / 0 info
- [x] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/currency-providers` — green
- [x] 5.3 `bunx turbo test:coverage --filter=@suaveplan/currency-providers` — 100/100/100/100
- [x] 5.4 `bun scripts/openspec-conformance.ts @suaveplan/currency-providers` — exit 0
- [x] 5.5 `bunx turbo build --filter=@suaveplan/currency-providers` — green
## 6. Pre-archive checklist (AGENTS.md Section 13)
- [x] 6.1 Generics threaded — every public type uses named interfaces
- [x] 6.2 Zod schemas N/A — package uses no Zod at boundary (configs are plain interfaces)
- [x] 6.3 Every error code in `error-codes.ts` thrown by at least one production path
- [x] 6.4 No strict-mode behaviors to test on/off — providers have no strict-mode setting
- [x] 6.5 OTel N/A — deferred per `## Out of scope`
- [x] 6.6 No lifecycle dedup claimed (deferred coalescing — see `## Out of scope`)
- [x] 6.7 No retroactive tick
- [x] 6.8 No `export *` in any feature-module barrel
- [x] 6.9 No direct `vitest` / `bun:test` imports
## 7. Archive
- [x] 7.1 Fold spec delta into `openspec/specs/currency-providers/spec.md`
- [x] 7.2 Move `openspec/changes/add-currency-providers/` → `openspec/archive/2026-05-17-add-currency-providers/`
- [x] 7.3 Refresh `MANIFEST.md`, `MISSING.yml`, `STATUS.md`, `SUMMARY.md`