优化
This commit is contained in:
@@ -38,12 +38,12 @@ function fakeContext(withFixture = true, permissions = financePermissions, denyF
|
||||
]
|
||||
const feeSources = [...receivables,
|
||||
{ feeSourceId: '105', orderId: '205', direction: 'PAYABLE', currency: 'CNY',
|
||||
businessDate: '2026-08-11', partnerId: '501', partnerName: 'Fixture Partner' },
|
||||
businessDate: '2026-08-11', supplierId: '501', supplierName: 'Fixture Supplier' },
|
||||
{ feeSourceId: null, sourceType: 'MANUAL', direction: 'PAYABLE', currency: 'CNY',
|
||||
businessDate: '2026-08-10', billingBasis: 'CONTAINER_SHARED', partnerId: '501',
|
||||
businessDate: '2026-08-10', billingBasis: 'CONTAINER_SHARED', supplierId: '501',
|
||||
containerBookingId: 'CB-FAILED' }]
|
||||
feeSources.push({ feeSourceId: '106', sourceType: 'MANUAL', direction: 'PAYABLE', currency: 'CNY',
|
||||
businessDate: '2026-08-10', billingBasis: 'CONTAINER_SHARED', partnerId: '501',
|
||||
businessDate: '2026-08-10', billingBasis: 'CONTAINER_SHARED', supplierId: '501',
|
||||
containerBookingId: 'CB-COST-RESPONSE' })
|
||||
const fixture = { marker, customerId: '11',
|
||||
orders: feeSources.filter((item) => item.orderId)
|
||||
@@ -109,7 +109,7 @@ function fakeContext(withFixture = true, permissions = financePermissions, denyF
|
||||
return ok(feeSources.filter((item) => item.feeSourceId && (!omitPayableSource || item.feeSourceId !== '105')).map((item, index) => {
|
||||
const { feeSourceId, ...rest } = item
|
||||
return { ...rest, poolItemId: `${item.direction}:${1001 + index}`, sourceId: feeSourceId,
|
||||
reviewStatus: 'APPROVED', settlementIncluded: true, sourceStatus: 'AVAILABLE' }
|
||||
reviewStatus: 'APPROVED', sourceStatus: 'AVAILABLE' }
|
||||
}))
|
||||
}
|
||||
if (method === 'POST' && requestPath.endsWith('/statements')) {
|
||||
@@ -252,7 +252,7 @@ test('run 发布一条日期链、三张独立已出账单、三张 AR 和一张
|
||||
assert.equal(new Set(fixture.receivableSettlements.map((item) => item.statementId)).size, 3)
|
||||
assert.equal(fixture.payableSettlements.length, 1)
|
||||
assert.equal(fixture.payableSettlements[0].supplierId, '501')
|
||||
assert.equal(fixture.payableSettlements[0].partnerId, '501')
|
||||
assert.equal(fixture.payableSettlements[0].supplierId, '501')
|
||||
assert.equal(fixture.payableSettlements[0].supplierName, 'Fixture Partner')
|
||||
assert.equal(context.coverageGaps.some((gap) => gap.category === 'incomplete-container-cost-attempt'
|
||||
&& gap.reason.includes('containerBookingId=CB-FAILED')
|
||||
@@ -292,12 +292,12 @@ test('run 在 fixture 缺失时记录 blocker 且不发送 HTTP 请求', async (
|
||||
assert.equal(context.coverageGaps[0].category, 'missing-marker-owned-finance-fixture')
|
||||
})
|
||||
|
||||
test('PAYABLE 接受 partnerId 及名称快照,不依赖 SUPPLIER 类型', async () => {
|
||||
test('PAYABLE 只接受 supplierId 及 Warehouse 名称快照', async () => {
|
||||
const context = fakeContext()
|
||||
await run(context)
|
||||
const payableRequest = context.calls.find((call) => call.path.endsWith('/payable-settlements'))
|
||||
assert.equal(payableRequest.body.supplierId, '501')
|
||||
assert.doesNotMatch(source, /partnerType|types\?\.includes|SUPPLIER.*阻断/)
|
||||
assert.doesNotMatch(source, /partnerId|partnerName|partnerType/)
|
||||
})
|
||||
|
||||
test('来源缺失逐条 customerId 时不得由 fixture 根字段静默补齐', async () => {
|
||||
|
||||
Reference in New Issue
Block a user