fix: preserve sell event routing owner
This commit is contained in:
@@ -327,6 +327,16 @@ class SlotService:
|
||||
raise SlotTransitionError(
|
||||
f"sell() requires holding state, got: {slot.status.value}"
|
||||
)
|
||||
# req-0011 / ac-0038: autonomous sells have no SellIntent, so persist
|
||||
# the already-owned SELL identity or inherit the holding owner.
|
||||
sell_event_owner = next(
|
||||
(
|
||||
value
|
||||
for value in (slot.sell_strategy_id, slot.strategy_id)
|
||||
if isinstance(value, str) and value.strip()
|
||||
),
|
||||
None,
|
||||
)
|
||||
self.transit_slot(
|
||||
slot_id,
|
||||
SlotState.HOLDING,
|
||||
@@ -334,6 +344,7 @@ class SlotService:
|
||||
reason=reason,
|
||||
actor=actor,
|
||||
limit_price=limit_price,
|
||||
sell_strategy_id=sell_event_owner,
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user