优化
This commit is contained in:
@@ -17,6 +17,10 @@ test('finance fixture module is independently exported and marker isolated', ()
|
||||
|
||||
test('fixture covers weight, volume, manual order, and container allocation contracts', () => {
|
||||
for (const basis of ['WEIGHT_KG', 'VOLUME_CBM', 'MANUAL_ORDER_FEE', 'CONTAINER_SHARED']) assert.match(source, new RegExp(basis))
|
||||
assert.match(source, /chargeMode: pricingProfile\.chargeUnit/)
|
||||
assert.match(source, /customer-rules\/versions\?tenantId=/)
|
||||
assert.match(source, /taxMode: 'TAX_EXCLUDED'/)
|
||||
assert.match(source, /inbound\?\.summary\?\.businessType \|\| profile\.businessType/)
|
||||
assert.match(source, /direction === 'PAYABLE' \? \{ settlementMode: 'ON_ACCOUNT' \}/)
|
||||
assert.match(source, /supplierId: id\(supplier\.id\), settlementMode: 'ON_ACCOUNT'/)
|
||||
assert.match(source, /request\(context, 'POST', '\/api\/platform\/finance\/v1\/cost-entries'/)
|
||||
@@ -123,6 +127,7 @@ function hookSet({ missing = false } = {}) {
|
||||
let automaticIndex = 0
|
||||
return {
|
||||
loadPricingEvidence: async () => ({ activeVersionIds: ['PRICE-1'] }),
|
||||
ensureCustomerChargeRule: async () => ({ id: 'RULE-CBM', chargeMode: 'CBM' }),
|
||||
createOrder: async (context, suffix) => ({ marker: `${context.marker}-${suffix}`, tenantId: '701',
|
||||
orderId: `O-${suffix}`, orderNo: `NO-${suffix}`, waybillId: suffix === 'AUTO1' ? 'WB-1' : null, inboundId: `I-${suffix}` }),
|
||||
measureOrder: async (context, resource) => ({ ...resource, measurementId: `M-${resource.orderId}`, actualWeightKg: 12.5, totalVolumeCbm: 0.072 }),
|
||||
@@ -153,7 +158,7 @@ test('run behavior emits consumer shape, both billing bases, distinct dates, sup
|
||||
await run(context)
|
||||
const fixture = context.createdResources.financeFullFixtures
|
||||
assert.equal(fixture.customerId, '701')
|
||||
assert.equal(fixture.orders.length, 5)
|
||||
assert.equal(fixture.orders.length, 6)
|
||||
assert.equal(fixture.orders[0].orderNo, 'NO-AUTO1')
|
||||
assert.equal(fixture.orders[0].waybillId, 'WB-1')
|
||||
assert.equal(fixture.orders[0].actualWeightKg, 12.5)
|
||||
|
||||
Reference in New Issue
Block a user