diff --git a/scripts/admin-test-env-acceptance.mjs b/scripts/admin-test-env-acceptance.mjs index d1f6dc084..f76b6f140 100644 --- a/scripts/admin-test-env-acceptance.mjs +++ b/scripts/admin-test-env-acceptance.mjs @@ -1633,6 +1633,11 @@ export class AcceptanceRun { if (!hasSecondStandardFbaProducer()) { await this.runPhase4ProducerVariant('FBA-SECOND', 'FBA', 'STANDARD', true) } + const hasOperationsFbaProducer = () => (this.createdResources.phase4InboundProducerFixtures?.containers || []) + .some((item) => /-P4-FBA-OPERATIONS(?:-R\d+)?:/.test(String(item?.resourceKey || ''))) + if (!hasOperationsFbaProducer()) { + await this.runPhase4ProducerVariant('FBA-OPERATIONS', 'FBA', 'STANDARD', true) + } if (Number(readiness().overseasContainerCount || 0) < 1) { await this.runPhase4ProducerVariant('OVERSEAS-PRIMARY', 'OVERSEAS', 'ONE_CLICK_DROPSHIP', true) } @@ -1650,12 +1655,15 @@ export class AcceptanceRun { const overseasReady = containers.find((item) => item?.destinationType === 'OVERSEAS') const secondStandardFbaReady = containers.find((item) => /-P4-FBA-SECOND(?:-R\d+)?:/.test(String(item?.resourceKey || ''))) + const operationsFbaReady = containers.find((item) => + /-P4-FBA-OPERATIONS(?:-R\d+)?:/.test(String(item?.resourceKey || ''))) const awaitingVariants = containers.filter((item) => ['SECONDARY'] .some((label) => new RegExp(`-P4-${label}(?:-R\\d+)?:`).test(String(item?.resourceKey || '')))) const shippingMatrixReady = dropshipReady?.shippingReady === true && Boolean(dropshipReady?.carrierScheduleQueryId) && standardFbaReady?.shippingReady === true && Boolean(standardFbaReady?.carrierScheduleQueryId) && secondStandardFbaReady?.shippingReady === true && Boolean(secondStandardFbaReady?.carrierScheduleQueryId) + && operationsFbaReady?.shippingReady === true && Boolean(operationsFbaReady?.carrierScheduleQueryId) && overseasReady?.shippingReady === true && Boolean(overseasReady?.carrierScheduleQueryId) && awaitingVariants.length >= 1 && awaitingVariants.every((item) => item.shippingReady === false diff --git a/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs b/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs index 55b5fac54..c3a878e98 100644 --- a/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase3-phase4-producer-fixture-contract.test.mjs @@ -130,6 +130,7 @@ test('only PDA-operated variants traverse real outbound and carrier nodes before assert.match(entry, /runPhase4ProducerVariant\('OVERSEAS-PRIMARY', 'OVERSEAS', 'ONE_CLICK_DROPSHIP', true\)/) assert.match(entry, /runPhase4ProducerVariant\('FBA-STANDARD', 'FBA', 'STANDARD', true\)/) assert.match(entry, /runPhase4ProducerVariant\('FBA-SECOND', 'FBA', 'STANDARD', true\)/) + assert.match(entry, /runPhase4ProducerVariant\('FBA-OPERATIONS', 'FBA', 'STANDARD', true\)/) assert.match(entry, /secondStandardFbaReady\?\.shippingReady === true/) assert.match(entry, /runPhase4ProducerVariant\('SECONDARY', 'FBA', 'STANDARD', false\)/) assert.match(entry, /const hasSecondaryProducer =/) diff --git a/scripts/admin-test-env-modules/phase4-overseas-pda-contract.test.mjs b/scripts/admin-test-env-modules/phase4-overseas-pda-contract.test.mjs index 924704054..f873cb56c 100644 --- a/scripts/admin-test-env-modules/phase4-overseas-pda-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase4-overseas-pda-contract.test.mjs @@ -152,7 +152,8 @@ test('PDA module covers the container-number receiving contract and excludes out assert.match(source, /generatedPalletsByInbound/) assert.match(source, /standardFbaProducers = \(Array\.isArray\(matrix\?\.containers\) \? matrix\.containers : \[\]\)/) assert.match(source, /item\?\.fulfillmentType !== 'ONE_CLICK_DROPSHIP'/) - assert.match(source, /\.slice\(0, 2\)/) + assert.match(source, /FBA-OPERATIONS/) + assert.match(source, /\.slice\(0, 3\)/) assert.match(source, /const producers = \[dropship, \.\.\.standardFbaProducers,/) assert.doesNotMatch(source, /创建当前柜实收托盘|创建当前柜实收库位|async function createPallet/) assert.match(source, /retained as acceptance evidence/) diff --git a/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs b/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs index 7527543ac..41f2ab370 100644 --- a/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs +++ b/scripts/admin-test-env-modules/phase4-overseas-pda-operations.mjs @@ -757,6 +757,10 @@ export async function run(context) { // 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' + && /-P4-FBA-OPERATIONS(?:-R\d+)?:/.test(String(item?.resourceKey || '')) + && (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?.fbaWarehouseCode === 'ABE4' && (item?.auxiliaryPallets?.length || 0) > 0 && Array.isArray(item?.inventory) && item.inventory.reduce((sum, line) => sum + Number(line?.availablePackages || 0), 0) > 3) diff --git a/scripts/admin-test-env-modules/phase4-overseas-pda.mjs b/scripts/admin-test-env-modules/phase4-overseas-pda.mjs index 12fb69032..f944afd0c 100644 --- a/scripts/admin-test-env-modules/phase4-overseas-pda.mjs +++ b/scripts/admin-test-env-modules/phase4-overseas-pda.mjs @@ -935,9 +935,9 @@ export async function run(context) { const standardFbaProducers = (Array.isArray(matrix?.containers) ? matrix.containers : []) .filter((item) => item?.destinationType === 'FBA') .filter((item) => item?.fulfillmentType !== 'ONE_CLICK_DROPSHIP') - .filter((item) => /-P4-(?:FBA-STANDARD|FBA-SECOND)(?:-R\d+)?:/.test(String(item?.resourceKey || ''))) + .filter((item) => /-P4-(?:FBA-STANDARD|FBA-SECOND|FBA-OPERATIONS)(?:-R\d+)?:/.test(String(item?.resourceKey || ''))) .sort((left, right) => String(left?.resourceKey).localeCompare(String(right?.resourceKey))) - .slice(0, 2) + .slice(0, 3) // The sealed dropship pallet proves the indivisible handover. A separate standard FBA // fixture supplies multiple cartons for reversible operations. The second standard FBA // fixture remains available for the multi-destination dispatch and delivery split proof. diff --git a/scripts/phase4-overseas-acceptance-entry-contract.test.mjs b/scripts/phase4-overseas-acceptance-entry-contract.test.mjs index e41b14063..c21e5a98f 100644 --- a/scripts/phase4-overseas-acceptance-entry-contract.test.mjs +++ b/scripts/phase4-overseas-acceptance-entry-contract.test.mjs @@ -176,6 +176,7 @@ test('PDA entry expands the real phase-three producer chain and builds an FBA/OV assert.match(source, /runPhase4ProducerVariant\('DROPSHIP-PRIMARY', 'FBA', 'ONE_CLICK_DROPSHIP', true\)/) assert.match(source, /runPhase4ProducerVariant\('OVERSEAS-PRIMARY', 'OVERSEAS', 'ONE_CLICK_DROPSHIP', true\)/) assert.match(source, /runPhase4ProducerVariant\('FBA-STANDARD', 'FBA', 'STANDARD', true\)/) + assert.match(source, /runPhase4ProducerVariant\('FBA-OPERATIONS', 'FBA', 'STANDARD', true\)/) assert.match(source, /-P4-FBA-STANDARD\(\?:-R\\d\+\)\?:/) assert.match(source, /runPhase4ProducerVariant\('SECONDARY', 'FBA', 'STANDARD', false\)/) assert.match(source, /runUntilPickupReady\(this\)/)