This commit is contained in:
2026-08-12 12:35:29 +08:00
parent 0fceece378
commit e4f65dae5f
8 changed files with 434 additions and 41 deletions
@@ -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 })