修复(履约绑定): 后台人工绑定也必须先有客户游戏资料
- 工作台 start/confirm/代确认/强制确认入口统一校验角色和主页截图 - 仅 clean 任务强制,历史任务保持兼容 - 补充后台绑定资料校验测试
This commit is contained in:
@@ -403,6 +403,7 @@ async def start_binding(
|
||||
db: Session = Depends(get_db),
|
||||
current: User = Depends(require_permission("platform_fulfillment:use")),
|
||||
) -> dict[str, Any]:
|
||||
service.ensure_customer_profile_for_binding(db, task_id=task_id)
|
||||
result = await service.start_binding(db, task_id=task_id, current=current)
|
||||
record_audit(
|
||||
db,
|
||||
@@ -455,6 +456,7 @@ async def confirm_binding(
|
||||
db: Session = Depends(get_db),
|
||||
current: User = Depends(require_permission("platform_fulfillment:use")),
|
||||
) -> dict[str, Any]:
|
||||
service.ensure_customer_profile_for_binding(db, task_id=task_id)
|
||||
result = await service.confirm_binding(db, task_id=task_id, current=current)
|
||||
record_audit(
|
||||
db,
|
||||
@@ -474,6 +476,7 @@ def operator_confirm_binding(
|
||||
current: User = Depends(require_permission("platform_fulfillment:use")),
|
||||
) -> dict[str, Any]:
|
||||
"""普通人工代确认:客户已扫码但没点确认,运营代为提交正常 actBind。"""
|
||||
service.ensure_customer_profile_for_binding(db, task_id=task_id)
|
||||
result = service.operator_confirm_binding_sync(
|
||||
db,
|
||||
task_id=task_id,
|
||||
@@ -498,6 +501,7 @@ def manual_confirm_binding(
|
||||
current: User = Depends(require_permission("platform_fulfillment:use")),
|
||||
) -> dict[str, Any]:
|
||||
"""运营人工确认绑定:用于客户已在别处绑定、或账号当前角色已确认的场景。"""
|
||||
service.ensure_customer_profile_for_binding(db, task_id=task_id)
|
||||
result = service.manual_confirm_binding_sync(
|
||||
db,
|
||||
task_id=task_id,
|
||||
|
||||
@@ -44,7 +44,7 @@ from .binding_status import (
|
||||
_binding_failure_raw_message,
|
||||
_customer_task_message,
|
||||
)
|
||||
from .common import _now
|
||||
from .common import FLOW_VERSION_CLEAN, _has_game_home_profile, _now
|
||||
from .outbox import _emit_order_site_binding_state
|
||||
from .repository import (
|
||||
_binding_qr_expired,
|
||||
@@ -1494,6 +1494,12 @@ def reconcile_binding_state_outbox(
|
||||
}
|
||||
|
||||
|
||||
def ensure_customer_profile_for_binding(db: Session, *, task_id: int) -> None:
|
||||
task = _load_task(db, task_id)
|
||||
if task.flow_version == FLOW_VERSION_CLEAN and not _has_game_home_profile(task):
|
||||
raise HTTPException(status_code=409, detail="请先提交游戏角色和游戏主页截图")
|
||||
|
||||
|
||||
def confirm_binding_sync(db: Session, *, task_id: int, current: User) -> dict[str, Any]:
|
||||
task = _load_task_for_update(db, task_id)
|
||||
task = _load_task(db, refresh_binding(db, task_id=task.id)["task"]["id"])
|
||||
|
||||
@@ -29,6 +29,7 @@ from .allocation import ( # noqa: F401
|
||||
from .binding import ( # noqa: F401
|
||||
confirm_binding,
|
||||
confirm_binding_sync,
|
||||
ensure_customer_profile_for_binding,
|
||||
manual_confirm_binding_sync,
|
||||
operator_confirm_binding_sync,
|
||||
reconcile_binding_observations,
|
||||
|
||||
Reference in New Issue
Block a user