feat(douyu): 新增客户领取与角色绑定工作台

This commit is contained in:
yml
2026-11-18 11:00:28 +08:00
parent d0ec21ce16
commit 6de129d70a
29 changed files with 2119 additions and 5 deletions
@@ -0,0 +1,39 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { compareCustomerRole } from './douyu-fulfillment-service.js'
const task = {
customer_role_name: '狗鼻子弗尼亚bd',
customer_platform: 'wechat',
customer_system: 'android',
} as never
const live = {
roleName: '狗鼻子弗尼亚bd',
areaName: '微信',
platName: '安卓(android)',
} as never
test('斗鱼客户资料与平台角色一致', () => {
const result = compareCustomerRole(task, live)
assert.equal(result.matched, true)
assert.equal(result.roleMatched, true)
assert.equal(result.channelMatched, true)
})
test('斗鱼客户资料平台或系统不一致时禁止确认', () => {
const result = compareCustomerRole(task, {
...live,
areaName: 'QQ',
platName: '苹果(iOS)',
} as never)
assert.equal(result.matched, false)
assert.equal(result.channelMatched, false)
})
test('斗鱼客户资料角色名不一致时禁止确认', () => {
const result = compareCustomerRole(task, { ...live, roleName: '另一个角色' } as never)
assert.equal(result.matched, false)
assert.equal(result.roleMatched, false)
})