fix(consignment): 降价提示默认值统一为开启/24小时/按比例10%
- 迁移 147 的苏尔南种子配置 priceDrop 由 false/72 改为 true/24/percent/10, 与前端 emptyFormValues、后端 DEFAULT_CONSIGNMENT_PROFILE_CONFIG 保持一致; 新库初始化即与线上现状一致,已执行迁移的库不受影响。 - 补充迁移种子断言测试,防止三处默认值再次漂移。
This commit is contained in:
@@ -467,8 +467,8 @@ BEGIN
|
||||
"policy": "reopen"
|
||||
},
|
||||
"priceDrop": {
|
||||
"enabled": false,
|
||||
"hours": 72,
|
||||
"enabled": true,
|
||||
"hours": 24,
|
||||
"mode": "percent",
|
||||
"value": 10
|
||||
}
|
||||
|
||||
@@ -137,3 +137,15 @@ test('打手端寄卖分类:苏尔南手枪固定排第一', async () => {
|
||||
'苏尔南手枪必须排在打手端分类列表第一位',
|
||||
)
|
||||
})
|
||||
|
||||
test('合并迁移 147 的苏尔南种子:降价提示默认开启、24 小时、按比例 10%', async () => {
|
||||
const sql = await readFile(
|
||||
new URL('../../db/migrations/147_consignment_platform.sql', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
assert.match(
|
||||
sql,
|
||||
/"priceDrop":\s*\{\s*"enabled":\s*true,\s*"hours":\s*24,\s*"mode":\s*"percent",\s*"value":\s*10\s*\}/,
|
||||
'新库初始化必须与前端默认值一致(开启 / 24 小时 / 按比例 10%)',
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user