fix: preserve sell event routing owner
This commit is contained in:
@@ -34,7 +34,7 @@ def _holding_slot(service, repo):
|
||||
slot = _inactive_slot(repo)
|
||||
pending = service.transit_slot(
|
||||
slot.slot_id, SlotState.INACTIVE, SlotState.PENDING_BUY,
|
||||
reason="buy", actor="test", symbol="005930",
|
||||
reason="buy", actor="test", symbol="005930", strategy_id="BUY-A",
|
||||
)
|
||||
return service.transit_slot(
|
||||
pending.slot_id, SlotState.PENDING_BUY, SlotState.HOLDING,
|
||||
@@ -49,6 +49,7 @@ class TestSell:
|
||||
service.sell(holding.slot_id, actor="safety-sell", reason="stop_loss")
|
||||
updated = repo.fetch_slot(holding.slot_id)
|
||||
assert updated.status is SlotState.PENDING_SELL
|
||||
assert updated.sell_strategy_id == "BUY-A"
|
||||
|
||||
def test_sell_records_transition_log(self, service, repo):
|
||||
"""sell() appends a transition log entry."""
|
||||
|
||||
Reference in New Issue
Block a user