diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-06-09 19:19:44 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-06-09 19:19:44 -0700 |
| commit | d5e321089b6b82f5425c2b3fae142db5223ce599 (patch) | |
| tree | afdb1e7753938d00bb0a7adb2275525c76482dd9 /backend/app/main.py | |
| parent | 9e2a23855d29d9763044b8a0a9e5f326cfcad878 (diff) | |
Add Insiders tab with diverging bar chart and transaction table
- Backend: get_insider_transactions() in data_service (yfinance, 1hr TTL)
- Backend: InsidersResponse schema + GET /api/tickers/{symbol}/insiders
- Frontend: InsidersPage with 4-KPI strip, SVG diverging bar chart (),
psm-insider transaction rows, pill filter toggles, shimmer skeleton,
empty/error states
- Enable Insiders nav item (remove disabled flag)
Diffstat (limited to 'backend/app/main.py')
| -rw-r--r-- | backend/app/main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/app/main.py b/backend/app/main.py index 7e02cbe..386a695 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -9,7 +9,7 @@ from fastapi import FastAPI, HTTPException, Query, status from fastapi.middleware.cors import CORSMiddleware from app.db import watchlist -from app.schemas import FinancialsResponse, HistoryPoint, MarketIndex, RatiosResponse, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse +from app.schemas import FinancialsResponse, HistoryPoint, InsidersResponse, MarketIndex, RatiosResponse, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse from app.services import data_service load_dotenv() @@ -80,6 +80,11 @@ def ticker_ratios(symbol: str) -> dict: return data_service.get_ratios(symbol) +@app.get("/api/tickers/{symbol}/insiders", response_model=InsidersResponse) +def ticker_insiders(symbol: str) -> dict: + return data_service.get_insider_transactions(symbol) + + @app.get("/api/watchlist", response_model=WatchlistResponse) def get_watchlist() -> dict: items = [] |
