fix(fulfillment): 收口角色确认状态投影
This commit is contained in:
@@ -924,6 +924,40 @@ class TestBindingAndCompletion(_Base):
|
|||||||
assert detail["task"]["bindTask"]["roleName"] == "少和我较劲"
|
assert detail["task"]["bindTask"]["roleName"] == "少和我较劲"
|
||||||
assert detail["task"]["bindTask"]["bindReadyForConfirm"] is True
|
assert detail["task"]["bindTask"]["bindReadyForConfirm"] is True
|
||||||
|
|
||||||
|
def test_confirmed_binding_is_not_reported_as_waiting_for_confirmation(self):
|
||||||
|
task = self._allocated()
|
||||||
|
bind_task = DouyuTask(
|
||||||
|
batch_id="bind-confirmed",
|
||||||
|
account_id=task.account_id,
|
||||||
|
account_assigned_to=self.admin_id,
|
||||||
|
task_type="confirm_bind",
|
||||||
|
handbook_scope="elite",
|
||||||
|
status="success",
|
||||||
|
result={
|
||||||
|
"role_name": "洋崽想要躺鸡",
|
||||||
|
"need_bind_act": True,
|
||||||
|
"is_bound_act": True,
|
||||||
|
"bind_ready_for_confirm": True,
|
||||||
|
"bind_confirmed": True,
|
||||||
|
"bind_phase": "confirmed",
|
||||||
|
},
|
||||||
|
created_by=self.admin_id,
|
||||||
|
)
|
||||||
|
self.session.add(bind_task)
|
||||||
|
self.session.flush()
|
||||||
|
task.bind_task_id = bind_task.id
|
||||||
|
task.binding_status = "bound"
|
||||||
|
task.execution_status = "bound"
|
||||||
|
self.session.commit()
|
||||||
|
|
||||||
|
live = service.customer_binding_out(self.session, task.id)
|
||||||
|
detail = service.get_task_detail(self.session, task.id)
|
||||||
|
|
||||||
|
assert live["roleName"] == "洋崽想要躺鸡"
|
||||||
|
assert live["bindConfirmed"] is True
|
||||||
|
assert live["bindReadyForConfirm"] is False
|
||||||
|
assert detail["task"]["bindTask"]["bindReadyForConfirm"] is False
|
||||||
|
|
||||||
def test_refresh_binding_clears_stale_failure_when_qr_is_pending(self):
|
def test_refresh_binding_clears_stale_failure_when_qr_is_pending(self):
|
||||||
task = self._allocated()
|
task = self._allocated()
|
||||||
bind_task = DouyuTask(
|
bind_task = DouyuTask(
|
||||||
|
|||||||
@@ -515,7 +515,9 @@ def list_tasks(
|
|||||||
|
|
||||||
|
|
||||||
def _pending_binding_role_name(result: dict[str, Any]) -> str:
|
def _pending_binding_role_name(result: dict[str, Any]) -> str:
|
||||||
if not bool(result.get("bind_ready_for_confirm")):
|
if bool(result.get("bind_confirmed")) or not bool(
|
||||||
|
result.get("bind_ready_for_confirm")
|
||||||
|
):
|
||||||
return ""
|
return ""
|
||||||
role_name = str(result.get("role_name") or "").strip()
|
role_name = str(result.get("role_name") or "").strip()
|
||||||
if not role_name:
|
if not role_name:
|
||||||
|
|||||||
Reference in New Issue
Block a user