summaryrefslogtreecommitdiff
path: root/backend/app/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend/app/main.py')
-rw-r--r--backend/app/main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/app/main.py b/backend/app/main.py
index eb5fa40..1cc127e 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, SearchResult, TickerOverview, WatchlistResponse
+from app.schemas import FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse
from app.services import data_service
load_dotenv()
@@ -70,6 +70,11 @@ def ticker_financials(symbol: str, period: str = Query(default="annual", pattern
return data_service.get_financials(symbol, period=period)
+@app.get("/api/tickers/{symbol}/valuation", response_model=ValuationResponse)
+def ticker_valuation(symbol: str) -> dict:
+ return data_service.get_valuation(symbol)
+
+
@app.get("/api/watchlist", response_model=WatchlistResponse)
def get_watchlist() -> dict:
items = []