da0bb3367e
Store an optional company name on Ticker (migration 014) and backfill it from Alpaca's asset list in a single Trading-API call for the whole universe — no per-ticker fetch. Runs automatically at the end of universe bootstrap and via a manual "Backfill Names" button (admin) / POST /admin/tickers/backfill-names. The name ships on /tickers; a shared symbol→name map (useTickerNames) lets any view show it without its own request. Displayed subtly next to the symbol — in the global search, the ticker header, and as a small muted line under the symbol in Top Setups and Open Trades (no extra column, truncated so it never widens the table). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
19 lines
381 B
Python
19 lines
381 B
Python
"""Ticker request/response schemas."""
|
|
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class TickerCreate(BaseModel):
|
|
symbol: str = Field(..., description="NASDAQ ticker symbol (e.g. AAPL)")
|
|
|
|
|
|
class TickerResponse(BaseModel):
|
|
id: int
|
|
symbol: str
|
|
name: str | None = None
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|