修复电子凭证销毁与飞飞订单金额
This commit is contained in:
@@ -4,6 +4,7 @@ import assert from 'node:assert/strict'
|
||||
import {
|
||||
buildFeifeiPlatformOrderNo,
|
||||
resolveKuaishouFeifeiClaimUrl,
|
||||
resolveKuaishouFeifeiPlatformAmount,
|
||||
} from './index.js'
|
||||
import type { TaskRow } from '../../../types/repository/rows.js'
|
||||
|
||||
@@ -66,6 +67,27 @@ test('buildFeifeiPlatformOrderNo falls back to task number', () => {
|
||||
)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiPlatformAmount converts order fen amount to yuan', () => {
|
||||
assert.equal(resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 3800,
|
||||
quantity: 1,
|
||||
}), 38)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiPlatformAmount splits amount by item quantity', () => {
|
||||
assert.equal(resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 7600,
|
||||
quantity: 2,
|
||||
}), 38)
|
||||
})
|
||||
|
||||
test('resolveKuaishouFeifeiPlatformAmount skips empty amount', () => {
|
||||
assert.equal(resolveKuaishouFeifeiPlatformAmount({
|
||||
totalAmountFen: 0,
|
||||
quantity: 1,
|
||||
}), 0)
|
||||
})
|
||||
|
||||
function createTask(patch: Partial<TaskRow> = {}): TaskRow {
|
||||
return {
|
||||
id: 123,
|
||||
|
||||
Reference in New Issue
Block a user