phase-8f: persistant cache locally

This commit is contained in:
Kazuma
2026-06-05 22:52:30 -04:00
committed by Kazuma
parent 7f2108129a
commit 8bdcb422aa
7 changed files with 551 additions and 24 deletions
+1 -5
View File
@@ -13,10 +13,6 @@ export class FinanceController {
private readonly advisor: PortfolioAdvisor,
) {}
private static normalizeYahoo(ticker: string): string {
return ticker.toUpperCase().replace(/\./g, '-');
}
register(app: FastifyInstance): void {
app.get('/api/finance/portfolio', this.portfolio.bind(this));
app.post('/api/finance/holdings', { schema: holdingSchema }, this.addHolding.bind(this));
@@ -38,7 +34,7 @@ export class FinanceController {
const screenable = holdings
.filter((h) => (h.type ?? 'stock') !== 'crypto')
.map((h) => FinanceController.normalizeYahoo(h.ticker));
.map((h) => h.ticker.toUpperCase());
const results =
screenable.length > 0