"""Ticker request/response schemas.""" from datetime import date, 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 # NULL == actively traded. Delisted symbols stay in the registry with their # history and are excluded from signals — the date is what makes that # visible instead of the row silently disappearing. delisted_on: date | None = None delisted_reason: str | None = None model_config = {"from_attributes": True} class TickerDelistingUpdate(BaseModel): delisted_on: date = Field( ..., description="Effective date the symbol stopped trading" ) class TickerTrackingUpdate(BaseModel): tracked: bool = Field( ..., description=( "True to scan this symbol, False to exclude it from the live path. " "History is retained either way — this is not a delisting." ), )