feat(portfolios): add unified ledger history API
This commit is contained in:
@@ -220,6 +220,35 @@ class ManualLedgerHistoryResponse(BaseModel):
|
||||
total: int
|
||||
|
||||
|
||||
class LedgerHistoryItem(BaseModel):
|
||||
"""Source-neutral, owner-visible ledger fact for GET /ledger."""
|
||||
|
||||
ledger_entry_id: int
|
||||
portfolio_id: str
|
||||
source: str
|
||||
action: str
|
||||
recorded_at: datetime
|
||||
executed_at: datetime | None = None
|
||||
order_id: str | None = None
|
||||
execution_id: str | None = None
|
||||
quantity: float | None = None
|
||||
price: float | None = None
|
||||
fee_amount: float | None = None
|
||||
tax_amount: float | None = None
|
||||
note: str | None = None
|
||||
cash_balance_after: float | None = None
|
||||
asset_quantity_after: float | None = None
|
||||
profit_buffer_after: float | None = None
|
||||
total_value_after: float | None = None
|
||||
target_ledger_entry_id: int | None = None
|
||||
confirmation_evidence: str | None = None
|
||||
|
||||
|
||||
class LedgerHistoryResponse(BaseModel):
|
||||
items: list[LedgerHistoryItem]
|
||||
next_cursor: str | None = None
|
||||
|
||||
|
||||
class PortfolioReturnSummaryResponse(BaseModel):
|
||||
portfolio_id: str
|
||||
total_invested: float = Field(
|
||||
|
||||
Reference in New Issue
Block a user