优化(斗鱼预售台账): 统一命名并同步客户主页图

同步履约客户游戏主页截图,兼容 order_site 绝对 URL 与 objectKey;统一预售台账用户可见文案和保护标签;移除 CK 检测与重登前端页面入口。
This commit is contained in:
yml
2026-11-26 19:11:30 +08:00
parent 7a20c63464
commit 82e1944a33
44 changed files with 204 additions and 428 deletions
+26 -3
View File
@@ -682,6 +682,7 @@ class TestFulfillmentCollabSync(_Base):
def test_manual_sync_creates_projected_collab_order(self):
task = self._task_with_account()
self.complete_customer_profile(task)
mapping = self.session.query(PlatformCommodityMapping).one()
mapping.goods_name = "套装-兔兔白日梦(斗鱼)"
self.session.add(
@@ -730,6 +731,7 @@ class TestFulfillmentCollabSync(_Base):
assert order.required_points == 1280
assert order.account_id == task.account_id
assert order.account_username == "collab-sync-account"
assert order.home_images == ["https://example.com/game-home.png"]
assert order.bind_game_role == "已确认角色"
assert order.bind_game_channel == "微信 / 苹果(iOS)"
assert order.status == collab.STATUS_INCOMPLETE
@@ -738,6 +740,8 @@ class TestFulfillmentCollabSync(_Base):
).model_dump()
assert payload["source_task_id"] == task.id
assert payload["source_platform_order_id"] == task.platform_order_id
assert payload["home_image_urls"] == ["https://example.com/game-home.png"]
assert payload["home_image_thumb_urls"] == ["https://example.com/game-home.png"]
assert (
self.session.query(AccountEvent)
.filter(AccountEvent.event_type == "collab_synced")
@@ -768,6 +772,25 @@ class TestFulfillmentCollabSync(_Base):
assert synced.account_id == account.id
assert synced.account_username == account.username
def test_manual_sync_backfills_customer_home_images(self):
task = self._task_with_account()
order, _ = collab.sync_platform_fulfillment_order(
self.session,
self.admin,
task,
)
assert not order.home_images
self.complete_customer_profile(task)
synced, action = collab.sync_platform_fulfillment_order(
self.session,
self.admin,
task,
)
assert action == "updated"
assert synced.home_images == ["https://example.com/game-home.png"]
def test_manual_sync_is_idempotent_and_preserves_human_fields(self):
task = self._task_with_account()
order, _ = collab.sync_platform_fulfillment_order(
@@ -3011,7 +3034,7 @@ class TestBindingAndCompletion(_Base):
assert task.execution_status == "manual_required"
assert task.issue_code == "customer_role_bound_elsewhere"
assert "role-lock-holder" in task.last_error
assert "协作单" in task.last_error
assert "预售台账" in task.last_error
assert event.detail_json["roleLockAccountId"] == lock_account.id
assert event.detail_json["roleLockAccountName"] == "role-lock-holder"
assert event.detail_json["roleLockLeasePurpose"] == "douyu_collab"
@@ -4418,7 +4441,7 @@ class TestBindingAndCompletion(_Base):
)
assert exc_info.value.status_code == 409
assert "外部协作单已在人工处理" in str(exc_info.value.detail)
assert "关联预售单已在人工处理" in str(exc_info.value.detail)
def test_restore_rejects_terminal_source_order(self, monkeypatch):
task = self.task()
@@ -4559,7 +4582,7 @@ class TestBindingAndCompletion(_Base):
self.session,
task_id=task.id,
current=self.admin,
reason="以外部协作单的人工处理为准",
reason="以斗鱼预售台账的人工处理为准",
)
self.session.refresh(task)