feat(portfolio): expose corporate actions in unified ledger

This commit is contained in:
2026-09-13 13:52:50 +09:00
parent 77468631b1
commit a4664f5991
7 changed files with 96 additions and 8 deletions
+21 -1
View File
@@ -313,8 +313,28 @@ class DividendLedgerHistoryItem(BaseModel):
confirmation_evidence: str | None = None
class CorporateActionLedgerHistoryItem(BaseModel):
"""Auditable corporate-action event in the unified ledger read model."""
ledger_entry_id: int
portfolio_id: str
source: Literal["corporate_action"]
event_id: str
event_type: Literal["stock_consolidation"]
effective_date: date
quantity_before: Decimal
quantity_after: Decimal
average_price_before: Decimal
average_price_after: Decimal
total_cost_basis: Decimal
cash_balance: Decimal
profit_buffer: Decimal
evidence_ref: str
actor_user_id: str | None = None
recorded_at: datetime
class LedgerHistoryResponse(BaseModel):
items: list[LedgerHistoryItem | DividendLedgerHistoryItem]
items: list[LedgerHistoryItem | DividendLedgerHistoryItem | CorporateActionLedgerHistoryItem]
next_cursor: str | None = None