test: harden admin acceptance fixtures and transport retries

This commit is contained in:
2026-09-24 04:38:38 +08:00
parent f5e53db24f
commit eb8662070a
6 changed files with 74 additions and 24 deletions
@@ -753,7 +753,14 @@ export async function run(context) {
}
const fixturesByAuxiliaryCapacity = [...handoff.completedFixtures]
.sort((left, right) => (right?.auxiliaryPallets?.length || 0) - (left?.auxiliaryPallets?.length || 0))
// P4/P5 deliberately consumes and rearranges one multi-carton source. Keep the
// ABE8 producer untouched when the matrix contains both destinations so the
// following dispatch module can still observe RECEIVED candidates for ABE4+ABE8.
const fixture = fixturesByAuxiliaryCapacity.find((item) => item?.destinationType === 'FBA'
&& item?.fbaWarehouseCode === 'ABE4'
&& (item?.auxiliaryPallets?.length || 0) > 0 && Array.isArray(item?.inventory)
&& item.inventory.reduce((sum, line) => sum + Number(line?.availablePackages || 0), 0) > 3)
|| fixturesByAuxiliaryCapacity.find((item) => item?.destinationType === 'FBA'
&& (item?.auxiliaryPallets?.length || 0) > 0 && Array.isArray(item?.inventory)
&& item.inventory.reduce((sum, line) => sum + Number(line?.availablePackages || 0), 0) > 3)
|| fixturesByAuxiliaryCapacity.find((item) => item?.destinationType === 'OVERSEAS'