fix: scope smart loading recommendations

This commit is contained in:
2026-09-14 17:22:09 +08:00
parent 8a1e587ee4
commit 64bddb1f81
10 changed files with 199 additions and 44 deletions
+14 -9
View File
@@ -1344,18 +1344,19 @@ export class AcceptanceRun {
}
}
const orders = await import(new URL('./admin-test-env-modules/orders.mjs', import.meta.url))
// One-click dropship has a physically indivisible sealed pallet. The phase-three loading
// fixture normally creates four one-carton SKUs so it can exercise partial loading, but that
// would intentionally leave three cartons outside the sealed pallet and make the later
// cross-region handover invalid. Keep this producer variant to one carton only; the separate
// STANDARD incremental fixture below continues to cover SKIP/PARTIAL/dynamic mutations.
// Keep the primary one-click producer deliberately multi-pallet. This is the regression
// fixture for the real business shape where one inbound has more than one sealed DP pallet:
// every pallet must remain independently assignable while the handover stays indivisible.
// The separate STANDARD incremental fixture below continues to cover SKIP/PARTIAL mutations.
const primaryDropship = this.context.orderFulfillmentType === 'ONE_CLICK_DROPSHIP'
const hadWaitSplitVariant = Object.hasOwn(this.context, 'waitSplitVariant')
const savedWaitSplitVariant = this.context.waitSplitVariant
const primaryDropshipVariant = {
...(savedWaitSplitVariant || {}), skuCount: 1, packageCountPerSku: 4,
packageCounts: [4], palletCount: 2,
}
if (primaryDropship) {
this.context.waitSplitVariant = {
...(savedWaitSplitVariant || {}), skuCount: 1, packageCountPerSku: 1, packageCounts: [1],
}
this.context.waitSplitVariant = primaryDropshipVariant
}
try {
await this.executeModule('orders-phase3-loading-fixture', () => orders.run(this))
@@ -1368,11 +1369,13 @@ export class AcceptanceRun {
this.assert('phase3-loading-fixture', 'A0 隔离使用本轮订单收货仓', null,
Boolean(warehouseId), `warehouseId=${warehouseId || 'missing'}`,
{ scenario: 'phase3-loading-a0-fixture', deploymentBlocker: true })
const requiredPalletCount = Math.max(1, Number(this.context?.waitSplitVariant?.palletCount || 1))
const requiredPalletCount = primaryDropship ? primaryDropshipVariant.palletCount
: Math.max(1, Number(this.context?.waitSplitVariant?.palletCount || 1))
const isolation = requireSharedOverflow
? await this.disableAvailableLocationsForA0(warehouseId, requiredPalletCount)
: { forced: false, disabled: [] }
this.context.phase3LoadingRequireSharedOverflow = requireSharedOverflow
if (primaryDropship) this.context.waitSplitVariant = primaryDropshipVariant
try {
const measurement = await import(new URL('./admin-test-env-modules/inbound-measurement.mjs', import.meta.url))
await this.executeModule('inbound-measurement-phase3-loading-fixture', () => measurement.run(this))
@@ -1380,6 +1383,8 @@ export class AcceptanceRun {
if (requireSharedOverflow) {
await this.restoreAvailableLocationsAfterA0(warehouseId, isolation)
}
if (hadWaitSplitVariant) this.context.waitSplitVariant = savedWaitSplitVariant
else delete this.context.waitSplitVariant
}
const fixture = this.createdResources.inboundMeasurement || this.createdResources.orders
const fixtureOrder = this.createdResources.orders || {}