summaryrefslogtreecommitdiff
path: root/backend/app/schemas.py
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-06-22 15:11:45 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-06-22 15:11:45 -0700
commit911765d8d1094df1baed4c3a313988e18cc31755 (patch)
treee209289341237a9769e84158df36cc16937bdcae /backend/app/schemas.py
parent570b2ec7c5890ef6f11eab5ac1c56eb3ec90911f (diff)
feat: add backend news service with Finnhub/FMP fallback and sentiment
Diffstat (limited to 'backend/app/schemas.py')
-rw-r--r--backend/app/schemas.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/backend/app/schemas.py b/backend/app/schemas.py
index 86664e4..351de06 100644
--- a/backend/app/schemas.py
+++ b/backend/app/schemas.py
@@ -273,3 +273,27 @@ class FilingsResponse(BaseModel):
class ErrorResponse(BaseModel):
detail: str
+
+
+class NewsItem(BaseModel):
+ id: str
+ title: str
+ summary: str
+ source: str
+ url: str
+ sentiment: Literal["bullish", "neutral", "bearish"]
+ published_at: str
+
+
+class NewsAggregate(BaseModel):
+ buzz_articles_last_week: int
+ bullish_pct: float
+ neutral_pct: float
+ bearish_pct: float
+
+
+class NewsResponse(BaseModel):
+ items: list[NewsItem] = Field(default_factory=list)
+ aggregate: NewsAggregate | None = None
+ provider: Literal["finnhub", "fmp"] | None = None
+ fetched_at: str