test: align tail fee acceptance with current contract
This commit is contained in:
@@ -33,6 +33,12 @@ test('module covers the public tail-order write surface before PDA receiving', (
|
|||||||
assert.match(source, /creationMode === 'AUTO'/)
|
assert.match(source, /creationMode === 'AUTO'/)
|
||||||
assert.match(source, /requestOverseasBinary\('GET'/)
|
assert.match(source, /requestOverseasBinary\('GET'/)
|
||||||
assert.match(source, /palletMergeBatchId/)
|
assert.match(source, /palletMergeBatchId/)
|
||||||
|
assert.match(source, /feeItemCode/)
|
||||||
|
assert.match(source, /feeItemName/)
|
||||||
|
assert.match(source, /direction: 'RECEIVABLE'/)
|
||||||
|
assert.match(source, /businessDate:/)
|
||||||
|
assert.match(source, /reviewStatus === 'PENDING_REVIEW'/)
|
||||||
|
assert.doesNotMatch(source, /supplierDescription/)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('receiving warehouse verification reuses public master data and restores the original assignment', () => {
|
test('receiving warehouse verification reuses public master data and restores the original assignment', () => {
|
||||||
|
|||||||
@@ -168,17 +168,22 @@ async function verifyDestinationMergeFeeAndExport(context, details, producer) {
|
|||||||
{ orderIds: allIds, palletMergeRequired: false })
|
{ orderIds: allIds, palletMergeRequired: false })
|
||||||
context.assert(MODULE, '批量合托分组取消成功', batchCleared.response, batchCleared.data == null, trace(batchCleared.response), OPTIONS)
|
context.assert(MODULE, '批量合托分组取消成功', batchCleared.response, batchCleared.data == null, trace(batchCleared.response), OPTIONS)
|
||||||
|
|
||||||
const feeItem = `${context.marker}-TAIL-FEE`.slice(0, 128)
|
const feeItemCode = `${context.marker}-TAIL-FEE`.slice(0, 64)
|
||||||
|
const feeItemName = `尾程费用-${context.marker}`.slice(0, 200)
|
||||||
const fee = await api(context, 'POST', '新增本轮尾程订单费用',
|
const fee = await api(context, 'POST', '新增本轮尾程订单费用',
|
||||||
query(`${ORDERS}/${encodeURIComponent(id(representative.id))}/fees`, { customerId: id(representative.customerId) }),
|
query(`${ORDERS}/${encodeURIComponent(id(representative.id))}/fees`, { customerId: id(representative.customerId) }),
|
||||||
{ feeItem, currency: 'USD', amount: 0.01, status: 'PENDING_REVIEW', supplierDescription: context.marker })
|
{ feeItemCode, feeItemName, direction: 'RECEIVABLE', currency: 'USD', amount: 0.01,
|
||||||
|
businessDate: new Date().toISOString().slice(0, 10) })
|
||||||
context.assert(MODULE, '尾程费用冻结币种金额和审核状态', fee.response,
|
context.assert(MODULE, '尾程费用冻结币种金额和审核状态', fee.response,
|
||||||
id(fee.data?.orderId) === id(representative.id) && fee.data?.feeItem === feeItem
|
id(fee.data?.orderId) === id(representative.id) && fee.data?.feeItemCode === feeItemCode
|
||||||
&& fee.data?.currency === 'USD' && Number(fee.data?.amount) === 0.01 && fee.data?.status === 'PENDING_REVIEW',
|
&& fee.data?.feeItemName === feeItemName && fee.data?.direction === 'RECEIVABLE'
|
||||||
|
&& fee.data?.currency === 'USD' && Number(fee.data?.amount) === 0.01
|
||||||
|
&& fee.data?.reviewStatus === 'PENDING_REVIEW',
|
||||||
trace(fee.response), OPTIONS)
|
trace(fee.response), OPTIONS)
|
||||||
const feeRead = await detail(context, representative, '回查尾程订单费用明细')
|
const feeRead = await detail(context, representative, '回查尾程订单费用明细')
|
||||||
context.assert(MODULE, '尾程费用详情可追溯', feeRead.response,
|
context.assert(MODULE, '尾程费用详情可追溯', feeRead.response,
|
||||||
feeRead.data?.fees?.some((row) => row?.feeItem === feeItem && Number(row?.amount) === 0.01), trace(feeRead.response), OPTIONS)
|
feeRead.data?.fees?.some((row) => row?.feeItemCode === feeItemCode && row?.feeItemName === feeItemName
|
||||||
|
&& row?.direction === 'RECEIVABLE' && Number(row?.amount) === 0.01), trace(feeRead.response), OPTIONS)
|
||||||
|
|
||||||
const exported = await context.requestOverseasBinary('GET', query(`${ORDERS}/export`, {
|
const exported = await context.requestOverseasBinary('GET', query(`${ORDERS}/export`, {
|
||||||
customerId: id(representative.customerId), containerNo: producer.containerNo,
|
customerId: id(representative.customerId), containerNo: producer.containerNo,
|
||||||
|
|||||||
Reference in New Issue
Block a user