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/schemas.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/schemas.py')
| -rw-r--r-- | backend/app/schemas.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/backend/app/schemas.py b/backend/app/schemas.py index c84b4c6..b1d934a 100644 --- a/backend/app/schemas.py +++ b/backend/app/schemas.py @@ -206,5 +206,33 @@ class RatiosResponse(BaseModel): dividend_payout: RatioPoint +class InsiderTransaction(BaseModel): + date: str | None = None + insider: str + position: str + direction: Literal["buy", "sell", "other"] + shares: int | None = None + value: float | None = None + + +class InsiderMonthPoint(BaseModel): + month: str + buy: float + sell: float + + +class InsiderSummary(BaseModel): + buy_count: int + sell_count: int + buy_value: float + sell_value: float + + +class InsidersResponse(BaseModel): + summary: InsiderSummary + monthly_chart: list[InsiderMonthPoint] = Field(default_factory=list) + transactions: list[InsiderTransaction] = Field(default_factory=list) + + class ErrorResponse(BaseModel): detail: str |
