fix(ledger): preserve exact decimal amount in manual and unified responses

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-09 12:41:36 +00:00
committed by GitHub
co-authored by genichin
parent 7fc3386f3a
commit fde5b33f05
5 changed files with 32 additions and 8 deletions
+4 -1
View File
@@ -711,6 +711,7 @@ class PostgresPortfolioRepository:
side=row[2],
quantity=float(row[4]),
price=float(row[3]),
price_decimal=Decimal(str(row[3])) if row[3] is not None else None,
fee_amount=float(row[5]),
tax_amount=float(row[6]),
executed_at=row[1],
@@ -1864,6 +1865,7 @@ class PostgresPortfolioRepository:
def _row_to_ledger_entry(row: Any) -> LedgerEntry:
if row is None:
raise ValueError("원장 항목을 찾을 수 없습니다")
raw_price = row[6]
return LedgerEntry(
ledger_entry_id=int(row[0]),
portfolio_id=row[1],
@@ -1871,7 +1873,8 @@ class PostgresPortfolioRepository:
execution_id=row[3],
side=row[4],
quantity=float(row[5]),
price=float(row[6]),
price=float(raw_price),
price_decimal=Decimal(str(raw_price)) if raw_price is not None else None,
fee_amount=float(row[7]),
tax_amount=float(row[8]),
executed_at=row[9],