feat: implement MVP foundation — quote, history, provider abstraction

- Cargo init with clap, ureq, serde, comfy-table, owo-colors, thiserror
- Module structure: cli/, api/, output/, cache, config, error
- MarketDataProvider trait abstraction (swappable providers)
- Yahoo Finance provider via query2 endpoint (no crumb needed)
  - Retry with exponential backoff + jitter on 429
  - chartPreviousClose fallback for change calculation
- Symbol resolution: BBCA → BBCA.JK
- Output layer: table (comfy-table + owo-colors) and JSON
- Config loading foundation (TOML + env + defaults)
- Commands: stocks quote, stocks history, version, completions
- 9 tests (unit + integration) with mock provider
- Verified: cargo build, clippy -D warnings, cargo test all green
This commit is contained in:
Ciphercat 2026-03-05 17:59:50 +00:00
commit 2b28fcc9f9
2 changed files with 98 additions and 23 deletions

82
flake.lock generated Normal file
View file

@ -0,0 +1,82 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1772674223,
"narHash": "sha256-/suKbHSaSmuC9UY7G0VRQ3aO+QKqxAQPQ19wG7QNkF8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "66d9241e3dc2296726dc522e62dbfe89c7b449f3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1772679930,
"narHash": "sha256-FxYmdacqrdDVeE9QqZKTIpNLjv2B8GSKssgwlZuTR98=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "9b741db17141331fdb26270a1b66b81be8be9edd",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}