修复 lewan 发货后 claim 轮询换号污染绑定与 UID 展示

发货成功时写入 shipped 身份快照,并冻结绑定资源变更;后台 UID 匹配优先使用发货快照,避免误报不一致。
This commit is contained in:
yml2213
2026-07-16 15:52:54 +08:00
parent be7347e600
commit 1216f252de
13 changed files with 384 additions and 11 deletions
@@ -2,13 +2,21 @@ import {
prepareFulfillmentBinding,
refreshFulfillmentRole,
} from '../fulfillment/executors/registry.js'
import { normalizeKuaishouCloudFlow } from '../fulfillment/kuaishou-cloud/index.js'
import {
isKuaishouCloudBindingMutationFrozen,
normalizeKuaishouCloudFlow,
} from '../fulfillment/kuaishou-cloud/index.js'
import type { TaskRow } from '../../types/repository/rows.js'
import { parseTaskContext as parseTaskContextValue } from '../../utils/task-json.js'
export async function syncKuaishouCloudRoleInfo(task: TaskRow) {
const flow = normalizeKuaishouCloudFlow(parseTaskContext(task).kuaishouCloudFulfillment)
// 已发货/兑换中:禁止 claim 轮询换号或覆盖角色(脏单 status 可能已回退 waiting_binding
if (isKuaishouCloudBindingMutationFrozen(task, flow)) {
return task
}
if (!flow.binding.vnId || !flow.binding.vnKey || !flow.binding.vnPhone) {
// ticket verified 或绑定尚未 ready:补 prepare(覆盖提前核销后未取号场景)
if (