优化
This commit is contained in:
@@ -102,6 +102,27 @@ test('run behavior emits consumer shape, both billing bases, distinct dates, sup
|
||||
assert.ok(new Set(fixture.feeSources.filter((item) => item.direction === 'RECEIVABLE').map((item) => item.businessDate)).size >= 2)
|
||||
})
|
||||
|
||||
test('run preserves real price-row profiles when creating automatic orders', async () => {
|
||||
const context = fakeContext()
|
||||
const profiles = [
|
||||
{ versionId: 'PRICE-1', rateId: 'RATE-KG', chargeUnit: 'KG', originWarehouseId: '11', channelCode: 'SEA-KG', pricingTaxMode: 'BUY_DECLARATION', destinationCode: 'USLAX' },
|
||||
{ versionId: 'PRICE-1', rateId: 'RATE-CBM', chargeUnit: 'CBM', originWarehouseId: '11', channelCode: 'SEA-CBM', pricingTaxMode: 'BUY_DECLARATION', destinationCode: 'USLAX' },
|
||||
]
|
||||
const seen = []
|
||||
context.financeFixtureHooks = {
|
||||
...hookSet(),
|
||||
loadPricingEvidence: async () => ({ activeVersionIds: ['PRICE-1'], profiles }),
|
||||
createOrder: async (ctx, suffix, profile) => {
|
||||
seen.push(profile)
|
||||
return { marker: `${ctx.marker}-${suffix}`, tenantId: '701', orderId: `O-${suffix}`, orderNo: `NO-${suffix}`, inboundId: `I-${suffix}` }
|
||||
},
|
||||
}
|
||||
await run(context)
|
||||
assert.equal(seen[0].chargeUnit, 'KG')
|
||||
assert.equal(seen[1].chargeUnit, 'CBM')
|
||||
assert.deepEqual(context.createdResources.financeFullFixtures.pricingEvidence.profiles, profiles)
|
||||
})
|
||||
|
||||
test('run behavior preserves null IDs and deployment blockers when supplier, voucher and container are unavailable', async () => {
|
||||
const context = fakeContext()
|
||||
context.financeFixtureHooks = hookSet({ missing: true })
|
||||
|
||||
Reference in New Issue
Block a user