1) 配置改为开启自动匹配 + 匹配订单生效时间,移除内部匹配等待与定时轮询;2) 所有进入待抢单的路径统一先自动匹配一次,未命中进大厅;3) 手动匹配仅允许待抢单;4) 新增迁移 160 回填配置并迁移存量 internal_matching。
29 lines
1.5 KiB
TypeScript
29 lines
1.5 KiB
TypeScript
import assert from 'node:assert/strict'
|
|
import { readFileSync } from 'node:fs'
|
|
import { fileURLToPath } from 'node:url'
|
|
import test from 'node:test'
|
|
|
|
function readPanelSource() {
|
|
return readFileSync(
|
|
fileURLToPath(new URL('../src/pages/admin/panels/ConsignmentConfigPanel.tsx', import.meta.url)),
|
|
'utf8',
|
|
).replace(/\r\n/g, '\n')
|
|
}
|
|
|
|
test('自动匹配:开关 + 生效时间,不再有内部匹配等待与后台定时补配', () => {
|
|
const source = readPanelSource()
|
|
assert.ok(source.includes('label="开启自动匹配"'), '必须提供自动匹配开关')
|
|
assert.ok(source.includes('label="匹配订单生效时间"'), '必须提供匹配订单生效时间')
|
|
assert.ok(
|
|
source.includes("name={['matching', 'orderEffectiveFrom']}"),
|
|
'生效时间必须绑定配置字段',
|
|
)
|
|
assert.ok(source.includes('showTime'), '生效时间必须支持精确到时分秒')
|
|
assert.ok(source.includes('只自动匹配该时间之后创建的订单'), '必须说明生效时间作用范围')
|
|
assert.ok(!source.includes('匹配模式'), '旧的匹配模式选项必须移除')
|
|
assert.ok(!source.includes('手动匹配等待'), '内部匹配等待窗口必须移除')
|
|
assert.ok(!source.includes('label="内部匹配等待(分钟)"'), '旧文案必须移除')
|
|
assert.ok(!source.includes('fallbackToHall'), '配置与表单必须移除 fallbackToHall')
|
|
assert.ok(source.includes('不再后台定时补配'), '必须说明已取消后台定时补配')
|
|
})
|