refactor(fulfillment): 移除飞飞/乐玩通道,仅保留 affiliate_dash

新单只路由 affiliate_dash(未命中走 manual_dispatch);历史飞飞/乐玩任务保留只读 stub,避免订单重同步失败。同步清理 cloudtentacles 调度、Admin 写路径与相关 env。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-14 17:29:47 +08:00
co-authored by Cursor
parent 0cbcb89dd8
commit b3aad0044c
155 changed files with 661 additions and 23351 deletions
@@ -5,56 +5,55 @@ import { buildClaimUrl } from '../claim/claim-service.js'
import { resolveTaskDeliveryLink } from './delivery-link-service.js'
import type { TaskRow } from '../../types/repository/rows.js'
test('resolveTaskDeliveryLink 为 cloud 任务返回内部领取链接', async () => {
test('resolveTaskDeliveryLink 为 affiliate_dash 任务返回本站领取链接', async () => {
const result = await resolveTaskDeliveryLink(
createTask({
executor_key: 'kuaishou_ct_assisted',
primary_claim_token: 'cloud-token',
executor_key: 'affiliate_dash',
primary_claim_token: 'affiliate-token',
primary_claim_expires_at: '2026-07-09T00:00:00.000Z',
}),
)
assert.deepEqual(result, {
claimUrl: buildClaimUrl('cloud-token'),
claimUrl: buildClaimUrl('affiliate-token'),
expireTime: '2026-07-09T00:00:00.000Z',
})
})
test('resolveTaskDeliveryLink 兼容历史 kuaishou-industry cloud 任务', async () => {
test('resolveTaskDeliveryLink 兼容 claim_token 回落字段', async () => {
const result = await resolveTaskDeliveryLink(
createTask({
executor_key: 'kuaishou-industry',
claim_token: 'industry-token',
executor_key: 'affiliate_dash',
claim_token: 'legacy-token',
claim_expires_at: '2026-07-09T08:00:00.000Z',
}),
)
assert.deepEqual(result, {
claimUrl: buildClaimUrl('industry-token'),
claimUrl: buildClaimUrl('legacy-token'),
expireTime: '2026-07-09T08:00:00.000Z',
})
})
test('resolveTaskDeliveryLink 为 feifei 任务返回本站领取链接', async () => {
const result = await resolveTaskDeliveryLink(
createTask({
executor_key: 'kuaishou_feifei',
primary_claim_token: 'feifei-token',
primary_claim_expires_at: '2026-07-09T12:00:00.000Z',
context_json: {
kuaishouFeifei: {
h5: {
rechargeUrl: 'https://feifei.example.com/h5/bind?code=very-long',
},
},
},
}),
test('resolveTaskDeliveryLink 对已下线 lewan/feifei 任务返回 null', async () => {
assert.equal(
await resolveTaskDeliveryLink(
createTask({
executor_key: 'kuaishou_ct_assisted',
primary_claim_token: 'cloud-token',
}),
),
null,
)
assert.equal(
await resolveTaskDeliveryLink(
createTask({
executor_key: 'kuaishou_feifei',
primary_claim_token: 'feifei-token',
}),
),
null,
)
assert.deepEqual(result, {
claimUrl: buildClaimUrl('feifei-token'),
expireTime: '2026-07-09T12:00:00.000Z',
})
})
test('resolveTaskDeliveryLink 对人工履约任务返回 null', async () => {
@@ -76,8 +75,8 @@ function createTask(patch: Partial<TaskRow> = {}): TaskRow {
platform_order_id: '2614900602069169',
profile_id: 0,
task_no: 'DT-test',
executor_key: 'kuaishou_ct_assisted',
task_status: 'pending_binding_prepare',
executor_key: 'affiliate_dash',
task_status: 'waiting_binding',
delivery_status: 'pending',
result_code: '',
result_message: '',