fix(pdd): 拼多多商品名称仅展示规格spec,过滤冗长原标题

This commit is contained in:
yml2213
2026-09-12 16:53:30 +08:00
parent 71912ef5d0
commit 8cc3aa2a35
2 changed files with 3 additions and 2 deletions
@@ -45,7 +45,7 @@ test('mapPddOrderToSourceEvent maps PDD order into SourceOrderEvent', () => {
const item = event.items[0]!
assert.equal(item.itemId, '987654321')
assert.equal(item.skuCode, '987654321')
assert.equal(item.skuName, '和平精英 198点券 (特惠礼包; 198点券)')
assert.equal(item.skuName, '特惠礼包; 198点券')
assert.equal(item.quantity, 1)
assert.equal((item.snapshot as Record<string, unknown>).buyerMemo, '游戏账号: 1008611')
})
@@ -77,7 +77,8 @@ export function mapPddOrderToSourceEvent(
const spec = String(rawOrder.spec || '').trim()
const quantity = Math.max(1, Number(rawOrder.goods_number || 1))
const skuName = spec ? `${goodsName} (${spec})` : goodsName
// 只展示规格 spec(若无规格则回退使用商品原名)
const skuName = spec || goodsName
const externalSkuCode = goodsIdStr
// Retain the entire raw snapshot dictionary as requested / 保留原始报文完整快照