first commit
This commit is contained in:
36
app/schemas/watchlist.py
Normal file
36
app/schemas/watchlist.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""Pydantic schemas for watchlist endpoints."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class SRLevelSummary(BaseModel):
|
||||
"""Compact SR level for watchlist entry."""
|
||||
|
||||
price_level: float
|
||||
type: Literal["support", "resistance"]
|
||||
strength: int = Field(ge=0, le=100)
|
||||
|
||||
|
||||
class DimensionScoreSummary(BaseModel):
|
||||
"""Compact dimension score for watchlist entry."""
|
||||
|
||||
dimension: str
|
||||
score: float
|
||||
|
||||
|
||||
class WatchlistEntryResponse(BaseModel):
|
||||
"""A single watchlist entry with enriched data."""
|
||||
|
||||
symbol: str
|
||||
entry_type: Literal["auto", "manual"]
|
||||
composite_score: float | None = None
|
||||
dimensions: list[DimensionScoreSummary] = []
|
||||
rr_ratio: float | None = None
|
||||
rr_direction: str | None = None
|
||||
sr_levels: list[SRLevelSummary] = []
|
||||
added_at: datetime
|
||||
Reference in New Issue
Block a user