feat: consolidate ledger trade writes into portfolio_ledger
- add ledger consolidation migration and remove ledger_trades usage - return portfolio state after v1 ledger trade writes - deprecate legacy buy/sell endpoints with deprecation headers - add BAT-016, DCY-006, and REQ-036~038 documentation - update repository models and tests for unified ledger entries
This commit is contained in:
+4
-2
@@ -122,8 +122,8 @@ class LedgerTradeRequest(BaseModel):
|
||||
class LedgerTradeResponse(BaseModel):
|
||||
ledger_entry_id: int
|
||||
portfolio_id: str
|
||||
order_id: str
|
||||
execution_id: str
|
||||
order_id: str | None
|
||||
execution_id: str | None
|
||||
side: str
|
||||
quantity: float
|
||||
price: float
|
||||
@@ -131,6 +131,8 @@ class LedgerTradeResponse(BaseModel):
|
||||
tax_amount: float
|
||||
executed_at: datetime
|
||||
recorded_at: datetime | None = None
|
||||
cash_balance_after: float = 0.0
|
||||
asset_quantity_after: float = 0.0
|
||||
status: Literal["new", "duplicate"] = "new"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user