fix(reconcile): symbol을 슬롯 생성 시 함께 저장 + NULL 슬롯 backfill
reconcile_universe 시그니처를 set[str] → dict[str, str] (portfolio_id→symbol)로 변경. 기존 symbol=NULL 슬롯은 다음 reconcile 실행 시 자동 backfill. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ from trex_core.domain.slot.in_memory_repository import InMemorySlotRepository
|
||||
def _wire(items=None, *, max_active_slots=None):
|
||||
repo = InMemorySlotRepository()
|
||||
svc = SlotService(repo)
|
||||
repo.reconcile_universe("default", {"pf-A", "pf-B"})
|
||||
repo.reconcile_universe("default", {"pf-A": "SYM", "pf-B": "SYM"})
|
||||
store = SnapshotStore()
|
||||
store.swap(items or [
|
||||
PortfolioItem(portfolio_id="pf-A", symbol="005930",
|
||||
@@ -146,7 +146,7 @@ def test_warned_true_when_qty_diverges():
|
||||
PortfolioItem(portfolio_id="pf-A", symbol="005930",
|
||||
cash_balance=1_000_000, asset_quantity=3),
|
||||
])
|
||||
repo.reconcile_universe("default", {"pf-A"})
|
||||
repo.reconcile_universe("default", {"pf-A": "SYM"})
|
||||
slot_a = repo.find_slot_by_portfolio("default", "pf-A")
|
||||
pending = svc.transit_slot(slot_a.slot_id, SlotState.INACTIVE, SlotState.PENDING_BUY,
|
||||
reason="buy", actor="test", symbol="005930")
|
||||
|
||||
Reference in New Issue
Block a user