This commit is contained in:
2026-08-19 09:42:07 +08:00
parent ff1d330c2d
commit b5864bfcda
56 changed files with 497 additions and 306 deletions
@@ -31,15 +31,13 @@ test('fee writes use verified Firstleg paths and do not fabricate historical IDs
assert.match(source, /chargeUnit === 'CBM'/)
})
test('PAYABLE fee selection uses the formal feeCode and feeTypeName fields', () => {
test('PAYABLE fee selection uses only the explicit nullable supplierCategory field', () => {
const selector = source.slice(source.indexOf('async function loadFeeItem'), source.indexOf('async function createManualFee'))
assert.match(selector, /item\.warehousePayable === true/)
assert.match(selector, /supplierCategoryForFeeItem\(item\)/)
assert.equal(supplierCategoryForFeeItem({ feeCode: 'FBA_HEAD_FREIGHT', feeTypeName: '头程运费' }), 'BOOKING')
assert.equal(supplierCategoryForFeeItem({ feeCode: 'FEE_TYPE_001', feeTypeName: '拖车费2' }), 'TRUCKING')
assert.equal(supplierCategoryForFeeItem({ feeCode: 'CUSTOMS_CLEARANCE', feeTypeName: '报关费' }), 'CUSTOMS')
assert.equal(supplierCategoryForFeeItem({ feeCode: 'UNSUPPORTED', feeTypeName: '操作费' }), null)
assert.equal(supplierCategoryForFeeItem({ feeCode: 'FEE_TYPE_001', feeName: '拖车费2' }), null)
assert.doesNotMatch(selector, /Boolean\(supplierCategoryForFeeItem/)
assert.equal(supplierCategoryForFeeItem({ supplierCategory: 'BOOKING', feeTypeName: '操作费' }), 'BOOKING')
assert.equal(supplierCategoryForFeeItem({ supplierCategory: null, feeTypeName: '拖车费' }), null)
assert.equal(supplierCategoryForFeeItem({ supplierCategory: 'INVALID' }), null)
})
test('Finance PAYABLE fixture creates an isolated ACTIVE supplier through the formal API', () => {
@@ -232,7 +230,7 @@ test('automatic fixture reuses the published review-chain source without recalcu
assert.match(source, /sourceType === 'FBA_PRICING'/)
assert.match(source, /reviewStatus === 'APPROVED'/)
assert.match(source, /publicationStatus === 'PUBLISHED'/)
assert.match(source, /settlementIncluded === true/)
assert.doesNotMatch(source, /settlementIncluded/)
assert.match(source, /const feeSourceId = id\(published\.sourceFeeId\)/)
assert.doesNotMatch(source, /\/fees\/calculate/)
assert.doesNotMatch(source, /\/fees\/confirm/)