fix: aggregate investment totals across ledger sources
This commit is contained in:
+18
-6
@@ -222,10 +222,22 @@ class ManualLedgerHistoryResponse(BaseModel):
|
||||
|
||||
class PortfolioReturnSummaryResponse(BaseModel):
|
||||
portfolio_id: str
|
||||
total_invested: float = 0.0
|
||||
total_withdrawn: float = 0.0
|
||||
net_contributed_capital: float = 0.0
|
||||
cumulative_profit_withdrawn: float = 0.0
|
||||
total_invested: float = Field(
|
||||
default=0.0,
|
||||
description="총투자원금: source와 무관한 유효 INVEST의 gross 합계",
|
||||
)
|
||||
total_withdrawn: float = Field(
|
||||
default=0.0,
|
||||
description="총회수원금: source와 무관한 유효 WITHDRAW 합계",
|
||||
)
|
||||
net_contributed_capital: float = Field(
|
||||
default=0.0,
|
||||
description="순투자원금: total_invested - total_withdrawn (PROFIT 제외)",
|
||||
)
|
||||
cumulative_profit_withdrawn: float = Field(
|
||||
default=0.0,
|
||||
description="누적 수익 인출액: source와 무관한 유효 PROFIT 합계 (원금 계산 제외)",
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -273,11 +285,11 @@ class PortfolioItem(BaseModel):
|
||||
profit_buffer: float = 0.0
|
||||
net_contributed_capital: float = Field(
|
||||
default=0.0,
|
||||
description="순투자현금: 유효 manual INVEST 합계 - 유효 manual WITHDRAW 합계",
|
||||
description="순투자원금: source와 무관한 유효 INVEST 합계 - 유효 WITHDRAW 합계 (PROFIT 제외)",
|
||||
)
|
||||
cumulative_profit_withdrawn: float = Field(
|
||||
default=0.0,
|
||||
description="누적 수익 인출액: 유효 manual PROFIT 합계",
|
||||
description="누적 수익 인출액: source와 무관한 유효 PROFIT 합계 (원금 계산 제외)",
|
||||
)
|
||||
tag_ids: list[str] = Field(default_factory=list)
|
||||
managed_by_daemon_id: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user