chore(release): prepare v0.3.1

This commit is contained in:
2026-09-13 15:32:27 +09:00
parent 5b443f718e
commit 1010d257ad
18 changed files with 176 additions and 42 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import json
import logging
import uuid
from dataclasses import dataclass
from datetime import UTC, date, datetime
from datetime import UTC, datetime
from decimal import ROUND_HALF_UP, Decimal, InvalidOperation
from typing import Any
@@ -22,10 +22,10 @@ from app.domain.errors import (
StrategyNotFoundError,
)
from app.domain.models import (
CorporateAction,
Asset,
AuthToken,
BrokerCredential,
CorporateAction,
Daemon,
LedgerEntry,
Portfolio,
@@ -1631,7 +1631,7 @@ class PostgresPortfolioRepository:
def record_corporate_action(self, portfolio_id: str, *, action: CorporateAction, idempotency_key: str, payload_hash: str) -> CorporateAction:
"""Persist an immutable action and snapshot atomically."""
self.ensure_schema()
with self._connect() as conn:
with self._connect() as conn: # noqa: SIM117 - keep transaction and cursor lifetimes explicit
with conn.cursor() as cur:
cur.execute("SELECT asset_quantity, cash_balance, profit_buffer, asset_id, status FROM portfolios WHERE portfolio_id=%s FOR UPDATE", (portfolio_id,))
row = cur.fetchone()