Initial project structure: MarketScanner - Fear-to-Fortune Trading Intelligence
Features: - FastAPI backend with stocks, news, signals, watchlist, analytics endpoints - React frontend with TailwindCSS dark mode trading dashboard - Celery workers for news fetching, sentiment analysis, pattern detection - TimescaleDB schema for time-series stock data - Docker Compose setup for all services - OpenAI integration for sentiment analysis
This commit is contained in:
43
backend/app/schemas/news.py
Normal file
43
backend/app/schemas/news.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""News schemas."""
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class NewsBase(BaseModel):
|
||||
"""Base news schema."""
|
||||
title: str
|
||||
url: str
|
||||
source: str
|
||||
published_at: datetime
|
||||
|
||||
|
||||
class NewsCreate(NewsBase):
|
||||
"""Schema for creating a news article."""
|
||||
content: Optional[str] = None
|
||||
summary: Optional[str] = None
|
||||
author: Optional[str] = None
|
||||
image_url: Optional[str] = None
|
||||
|
||||
|
||||
class NewsResponse(NewsBase):
|
||||
"""Schema for news response."""
|
||||
id: UUID
|
||||
summary: Optional[str] = None
|
||||
author: Optional[str] = None
|
||||
fetched_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class NewsWithSentiment(NewsResponse):
|
||||
"""News response with sentiment analysis."""
|
||||
content: Optional[str] = None
|
||||
image_url: Optional[str] = None
|
||||
sentiment_score: Optional[float] = None
|
||||
sentiment_label: Optional[str] = None
|
||||
sentiment_confidence: Optional[float] = None
|
||||
is_processed: bool = False
|
||||
Reference in New Issue
Block a user