fix(cost-center): 允许移除纯数字等异常人工 SKU
This commit is contained in:
@@ -569,8 +569,8 @@ export async function deleteManualSkuClassification(
|
|||||||
skuKey: string,
|
skuKey: string,
|
||||||
): Promise<DeleteManualSkuResult> {
|
): Promise<DeleteManualSkuResult> {
|
||||||
const key = canonicalizeInternalSku(skuKey)
|
const key = canonicalizeInternalSku(skuKey)
|
||||||
if (!key || !containsCjk(key)) {
|
if (!key) {
|
||||||
throw createHttpError('必须使用包含中文的内部 SKU', {
|
throw createHttpError('内部 SKU 不能为空', {
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
errorCode: 'manual_config_sku_key_required',
|
errorCode: 'manual_config_sku_key_required',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -123,6 +123,13 @@ test('人工确认前必须自动匹配履约配置,配置保存/定时任务
|
|||||||
configSource.includes("0, '1970-01-01T00:00:00+08:00', 'manual', 'active'"),
|
configSource.includes("0, '1970-01-01T00:00:00+08:00', 'manual', 'active'"),
|
||||||
'人工履约固定成本版本必须同时写入 amount_fen 和 rate_bps,避免保存成功但后处理报错',
|
'人工履约固定成本版本必须同时写入 amount_fen 和 rate_bps,避免保存成功但后处理报错',
|
||||||
)
|
)
|
||||||
|
const deleteStart = configSource.indexOf('export async function deleteManualSkuClassification')
|
||||||
|
const deleteEnd = configSource.indexOf('export async function rematchManualFulfillments')
|
||||||
|
const deleteBody = configSource.slice(deleteStart, deleteEnd)
|
||||||
|
assert.ok(
|
||||||
|
!deleteBody.includes('containsCjk(key)'),
|
||||||
|
'移除错误人工分类不能要求 SKU 含中文,否则纯数字等脏数据永远删不掉',
|
||||||
|
)
|
||||||
assert.ok(
|
assert.ok(
|
||||||
migrationSource.includes("spec_json->>'skuNick'") &&
|
migrationSource.includes("spec_json->>'skuNick'") &&
|
||||||
migrationSource.includes("spec_json->>'outSkuSn'") &&
|
migrationSource.includes("spec_json->>'outSkuSn'") &&
|
||||||
|
|||||||
Reference in New Issue
Block a user