fix(api): 客户/群排序改回last_chat_time DESC(云客按最近沟通优先)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-15 14:18:42 +08:00
parent 854da6e566
commit 2d1943a74e
3 changed files with 5 additions and 6 deletions
+3 -6
View File
@@ -205,17 +205,14 @@ async def test_pagination_page_size_one(client: AsyncClient):
assert len(body["items"]) == 1
async def test_order_is_friend_id_asc(client: AsyncClient):
"""Order: ``friend_id ASC`` (natural API/云客 order).
Seeded IDs wa_c < wx_a < wx_b → expected order ``[wa_c, wx_a, wx_b]``.
"""
async def test_order_is_last_chat_time_desc_nulls_last(client: AsyncClient):
"""Order: ``last_chat_time DESC`` (nulls last) — 云客 sorts most-recent-chat-first."""
r = await client.get(
"/api/customers", params={"page": 1, "page_size": 20}
)
assert r.status_code == 200
ids = [it["friend_id"] for it in r.json()["items"]]
assert ids == ["wa_c", "wx_a", "wx_b"]
assert ids == ["wx_a", "wx_b", "wa_c"]
async def test_filter_by_owner_account_id(client: AsyncClient):