feat: add name field to SnapshotHoldingResponse, TransactionResponse, and backtest TransactionItem schemas
This commit is contained in:
parent
b92f8f298b
commit
b6c22f70ae
@ -121,6 +121,7 @@ class TransactionItem(BaseModel):
|
||||
id: int
|
||||
date: date
|
||||
ticker: str
|
||||
name: str | None = None
|
||||
action: str
|
||||
shares: int
|
||||
price: FloatDecimal
|
||||
|
||||
@ -71,6 +71,7 @@ class TransactionCreate(TransactionBase):
|
||||
|
||||
class TransactionResponse(TransactionBase):
|
||||
id: int
|
||||
name: str | None = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@ -113,6 +114,7 @@ class PortfolioDetail(PortfolioResponse):
|
||||
# Snapshot schemas
|
||||
class SnapshotHoldingResponse(BaseModel):
|
||||
ticker: str
|
||||
name: str | None = None
|
||||
quantity: int
|
||||
price: FloatDecimal
|
||||
value: FloatDecimal
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user