fix(expense): narrow travel route risk indicators
This commit is contained in:
@@ -659,6 +659,22 @@ test('legacy route-level risk cards infer affected travel rows when backend has
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'transfer.png'
|
||||
},
|
||||
{
|
||||
id: 'train-transfer-return',
|
||||
name: '火车票',
|
||||
category: '火车票',
|
||||
desc: '深圳-上海',
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'transfer-return.png'
|
||||
},
|
||||
{
|
||||
id: 'train-return',
|
||||
name: '火车票',
|
||||
category: '火车票',
|
||||
desc: '上海-武汉',
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'return.png'
|
||||
},
|
||||
{
|
||||
id: 'allowance-row',
|
||||
name: '出差补贴',
|
||||
@@ -678,7 +694,59 @@ test('legacy route-level risk cards infer affected travel rows when backend has
|
||||
})
|
||||
|
||||
assert.equal(riskCards.length, 1)
|
||||
assert.deepEqual(riskCards[0].itemIds, ['train-outbound', 'train-transfer'])
|
||||
assert.deepEqual(riskCards[0].itemIds, ['train-transfer', 'train-transfer-return'])
|
||||
})
|
||||
|
||||
test('route-level risk cards narrow broad backend item ids to abnormal route rows', () => {
|
||||
const expenseItems = [
|
||||
{
|
||||
id: 'train-outbound',
|
||||
name: '火车票',
|
||||
category: '火车票',
|
||||
desc: '武汉-上海',
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'outbound.png'
|
||||
},
|
||||
{
|
||||
id: 'train-transfer',
|
||||
name: '火车票',
|
||||
category: '火车票',
|
||||
desc: '上海-深圳',
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'transfer.png'
|
||||
},
|
||||
{
|
||||
id: 'train-transfer-return',
|
||||
name: '火车票',
|
||||
category: '火车票',
|
||||
desc: '深圳-上海',
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'transfer-return.png'
|
||||
},
|
||||
{
|
||||
id: 'train-return',
|
||||
name: '火车票',
|
||||
category: '火车票',
|
||||
desc: '上海-武汉',
|
||||
detail: '起始地-目的地',
|
||||
invoiceId: 'return.png'
|
||||
}
|
||||
]
|
||||
const riskCards = buildAttachmentRiskCards({
|
||||
expenseItems,
|
||||
claimRiskFlags: [
|
||||
{
|
||||
source: 'submission_review',
|
||||
severity: 'high',
|
||||
label: '多城市行程待说明',
|
||||
message: '本次报销识别到多城市行程(上海、武汉、深圳),但事由中未说明中转、多地拜访或改签原因。',
|
||||
item_ids: expenseItems.map((item) => item.id)
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
assert.equal(riskCards.length, 1)
|
||||
assert.deepEqual(riskCards[0].itemIds, ['train-transfer', 'train-transfer-return'])
|
||||
})
|
||||
|
||||
test('AI advice shows only the latest manual return while preserving return count context', () => {
|
||||
|
||||
Reference in New Issue
Block a user