feat(fulfillment): 区分普通代确认与人工强制确认
- 普通代确认走 refresh_binding + actBind,不填角色/备注 - 强制确认保留角色+依据,并校验账号当前角色一致 - 前端拆成“代客户确认”和红色“强制确认” - 补充普通代确认/角色不匹配回归测试与文档
This commit is contained in:
@@ -598,6 +598,35 @@ def _mark_reused_pair(
|
||||
return True
|
||||
|
||||
|
||||
def operator_confirm_binding_sync(
|
||||
db: Session,
|
||||
*,
|
||||
task_id: int,
|
||||
current: User,
|
||||
) -> dict[str, Any]:
|
||||
"""普通人工代确认:客户已扫码但没点确认,运营代为提交正常 actBind。
|
||||
|
||||
不填写角色/备注,不直接标 bound;复用客户确认的同一套确认任务。
|
||||
当前没有可确认的扫码角色时,要求客户扫码或走“强制确认”。
|
||||
"""
|
||||
task = _load_task_for_update(db, task_id)
|
||||
if _frozen(task):
|
||||
return get_task_detail(db, task.id)
|
||||
refresh_binding(db, task_id=task.id)
|
||||
task = _load_task(db, task.id)
|
||||
if task.binding_status == "bound":
|
||||
return get_task_detail(db, task.id)
|
||||
if task.binding_status != "role_ready":
|
||||
raise HTTPException(
|
||||
status_code=409,
|
||||
detail=(
|
||||
"当前没有可代确认的扫码角色。请让客户先扫码;"
|
||||
"只有账号已绑定到该角色、但缺少本次扫码证据时,才使用强制确认。"
|
||||
),
|
||||
)
|
||||
return confirm_binding_sync(db, task_id=task.id, current=current)
|
||||
|
||||
|
||||
def manual_confirm_binding_sync(
|
||||
db: Session,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user