feat: saxo price

This commit is contained in:
OpenSquared
2026-07-23 17:59:27 +02:00
parent 619f521b32
commit d3dc85fee9
4 changed files with 84 additions and 3 deletions

View File

@@ -107,6 +107,23 @@ def remove_ticker(ticker: str):
return {"removed": ticker.strip().upper()}
class RenameBody(BaseModel):
name: str
@router.put("/{ticker}/name")
def rename_ticker(ticker: str, body: RenameBody):
"""Free-form display name — no longer tied to yfinance's long_name lookup, since an
instrument can now be entirely Saxo-sourced."""
from services.database import rename_instrument_watchlist
if not body.name.strip():
raise HTTPException(400, "Name cannot be empty")
ok = rename_instrument_watchlist(ticker, body.name)
if not ok:
raise HTTPException(404, f"'{ticker}' is not in the instruments watchlist")
return {"ticker": ticker.strip().upper(), "name": body.name.strip()}
class ReorderBody(BaseModel):
tickers: List[str]