Commit ba6cac59 by imwangxiaozhou Committed by 胡悦

fix(企业微信群组服务): 调整代理查询逻辑,返回删除状态并移除非删除过滤

同步更新测试用例以匹配新的返回数据结构
1 parent 26561575
......@@ -1416,7 +1416,6 @@ class WeComCustomerGroupOrchestrationService:
self.db.query(Agent)
.filter(
Agent.managed_user_id.in_(bot_row_ids),
Agent.is_deleted == False,
Agent.managed_user_id.isnot(None),
)
.all()
......@@ -1427,6 +1426,7 @@ class WeComCustomerGroupOrchestrationService:
"bot_id": bot_id_map.get(agent.managed_user_id, ""),
"is_steward": bool(agent.is_steward),
"status": agent.status.value if agent.status else "enable",
"is_deleted": agent.is_deleted or False,
}
for agent in agent_rows
if agent.managed_user_id in bot_id_map
......
......@@ -234,7 +234,7 @@ def test_dispatch_customer_group_messages_prefers_customer_group_id_and_marks_me
'group_name': 'alice-service',
},
'agents': [
{'agent_id': 10, 'bot_id': 'managed_1', 'is_steward': False, 'status': 'enable'},
{'agent_id': 10, 'bot_id': 'managed_1', 'is_steward': False, 'status': 'enable', 'is_deleted': False},
],
'messages': [
{
......@@ -993,7 +993,7 @@ def test_pull_group_messages_dispatches_customer_group_payload():
'group_name': '张三专属服务群',
},
'agents': [
{'agent_id': 10, 'bot_id': 'managed_1', 'is_steward': False, 'status': 'enable'},
{'agent_id': 10, 'bot_id': 'managed_1', 'is_steward': False, 'status': 'enable', 'is_deleted': False},
],
'messages': [
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!