feat(fulfillment): 区分普通代确认与人工强制确认
- 普通代确认走 refresh_binding + actBind,不填角色/备注 - 强制确认保留角色+依据,并校验账号当前角色一致 - 前端拆成“代客户确认”和红色“强制确认” - 补充普通代确认/角色不匹配回归测试与文档
This commit is contained in:
@@ -3089,6 +3089,65 @@ class TestBindingAndCompletion(_Base):
|
||||
== 1
|
||||
)
|
||||
|
||||
def test_operator_confirm_uses_scanned_role_without_form(self):
|
||||
task = self._allocated()
|
||||
account = self.session.get(Account, task.account_id)
|
||||
account.game_name = "旧角色"
|
||||
account.role_bind_status = "bound"
|
||||
qr_task = DouyuTask(
|
||||
batch_id="operator-confirm-qr",
|
||||
account_id=task.account_id,
|
||||
account_assigned_to=self.admin_id,
|
||||
task_type="get_bind_qr",
|
||||
handbook_scope="elite",
|
||||
status="success",
|
||||
platform_task_id=task.id,
|
||||
result={
|
||||
"act_alias": "cjm",
|
||||
"role_name": "新角色",
|
||||
"current_role_name": "旧角色",
|
||||
"baseline_role_name": "旧角色",
|
||||
"action_act_aliases": ["20260120QYOOB"],
|
||||
"bind_ready_for_confirm": True,
|
||||
"bind_confirmed": False,
|
||||
"bind_phase": "role_ready",
|
||||
"bind_decision": {
|
||||
"alias": "cjm",
|
||||
"role_name": "新角色",
|
||||
"reason": "role_changed",
|
||||
"confirmable": True,
|
||||
"actionable_alias": False,
|
||||
},
|
||||
},
|
||||
created_by=self.admin_id,
|
||||
)
|
||||
self.session.add(qr_task)
|
||||
self.session.flush()
|
||||
task.bind_task_id = qr_task.id
|
||||
task.binding_status = "qr_pending"
|
||||
task.execution_status = "waiting_bind"
|
||||
self.session.commit()
|
||||
|
||||
detail = service.operator_confirm_binding_sync(
|
||||
self.session,
|
||||
task_id=task.id,
|
||||
current=self.admin,
|
||||
)
|
||||
|
||||
confirm_task = (
|
||||
self.session.query(DouyuTask)
|
||||
.filter_by(task_type="confirm_bind", platform_task_id=task.id)
|
||||
.one()
|
||||
)
|
||||
assert confirm_task.result["expected_role_name"] == "新角色"
|
||||
assert detail["task"]["bindingStatus"] in {"role_ready", "confirming"}
|
||||
assert (
|
||||
self.session.query(PlatformFulfillmentEvent)
|
||||
.filter_by(task_id=task.id, event_type="binding_manually_confirmed")
|
||||
.count()
|
||||
== 0
|
||||
)
|
||||
|
||||
def test_manual_confirm_rejects_role_not_currently_bound(self):
|
||||
task = self._allocated()
|
||||
account = self.session.get(Account, task.account_id)
|
||||
|
||||
Reference in New Issue
Block a user