修复(履约绑定): 恢复已超时扫码后的成功确认

This commit is contained in:
yml
2026-11-26 22:25:41 +08:00
parent 53ff37bbcd
commit d17c14b84f
5 changed files with 79 additions and 5 deletions
@@ -104,6 +104,12 @@ ACTIVE_BINDING_STATUSES = frozenset(
"role_ready",
}
)
#: 已归属本单的成功确认任务可以让这些状态重新收敛。failed 包含旧二维码已超时,
#: 但精英宝典工作台随后已经确认成功的情况。
CONFIRM_EVIDENCE_BINDING_STATUSES = ACTIVE_BINDING_STATUSES | {
"confirming",
"failed",
}
#: 订单的权威绑定任务类型。查询任务只能展示,不能结算。
BINDING_EVIDENCE_TASK_TYPES = frozenset({"get_bind_qr", "confirm_bind"})
assert BINDING_EVIDENCE_TASK_TYPES <= BINDING_TASK_TYPES
@@ -1212,7 +1218,7 @@ def _apply_binding_task(
accepted = False
elif source.task_type == "confirm_bind":
accepted = (
phase in ACTIVE_BINDING_STATUSES | {"confirming"}
phase in CONFIRM_EVIDENCE_BINDING_STATUSES
and bool(expected_role)
and role_names_match(confirmed_role, expected_role)
)
@@ -1230,7 +1236,7 @@ def _apply_binding_task(
if (
source.task_type == "confirm_bind"
and (owned or is_current)
and phase in ACTIVE_BINDING_STATUSES | {"confirming"}
and phase in CONFIRM_EVIDENCE_BINDING_STATUSES
):
message = _binding_target_mismatch_message(
confirmed_role,