diff --git a/scripts/admin-test-env-acceptance.mjs b/scripts/admin-test-env-acceptance.mjs index 4e05e0ffe..e935bf781 100644 --- a/scripts/admin-test-env-acceptance.mjs +++ b/scripts/admin-test-env-acceptance.mjs @@ -1497,8 +1497,6 @@ export class AcceptanceRun { await this.executeModule(`phase3-loading-phase4-${label}`, () => loading.run(this)) const finalize = await import(new URL('./admin-test-env-modules/phase3-loading-finalize.mjs', import.meta.url)) await this.executeModule(`phase3-loading-finalize-phase4-${label}`, () => finalize.run(this)) - const documents = await import(new URL('./admin-test-env-modules/phase3-container-documents.mjs', import.meta.url)) - await this.executeModule(`phase3-container-documents-phase4-${label}`, () => documents.run(this)) const producerKey = this.createdResources.phase3LoadingCompletedProducer?.resourceKey const writeShippingEvidence = (shippingReady, carrierScheduleQueryId = null, carrierLatestActualAt = null) => { @@ -1527,6 +1525,8 @@ export class AcceptanceRun { await this.executeModule(`phase3-port-schedules-phase4-${label}`, () => portSchedules.run(this)) const outbound = await import(new URL('./admin-test-env-modules/phase3-outbound-dispatch.mjs', import.meta.url)) await this.executeModule(`phase3-outbound-dispatch-phase4-${label}`, () => outbound.run(this)) + const documents = await import(new URL('./admin-test-env-modules/phase3-container-documents.mjs', import.meta.url)) + await this.executeModule(`phase3-container-documents-phase4-${label}`, () => documents.run(this)) const carrierQueries = await import(new URL('./admin-test-env-modules/phase3-carrier-schedule-queries.mjs', import.meta.url)) await this.executeModule(`phase3-carrier-schedule-queries-phase4-${label}`, () => carrierQueries.run(this)) const carrierNodes = await import(new URL('./admin-test-env-modules/phase4-carrier-nodes.mjs', import.meta.url)) diff --git a/scripts/admin-test-env-modules/phase3-loading.mjs b/scripts/admin-test-env-modules/phase3-loading.mjs index f581ef115..858e58340 100644 --- a/scripts/admin-test-env-modules/phase3-loading.mjs +++ b/scripts/admin-test-env-modules/phase3-loading.mjs @@ -240,13 +240,14 @@ export async function run(context) { if (!loadingPlanId) return const dropshipAssignment = source?.fulfillmentType === 'ONE_CLICK_DROPSHIP' const initialAssignmentCount = dropshipAssignment - ? inboundCandidates.reduce((total, item) => total + Number(item.availablePackageCount || 0), 0) : 1 + ? inboundCandidates.filter((item) => id(item.palletId) === id(candidate.palletId)) + .reduce((total, item) => total + Number(item.availablePackageCount || 0), 0) : 1 const assignmentPath = dropshipAssignment - ? `${smartLoadingBase}/plans/${loadingPlanId}/inbound-assignments` + ? `${smartLoadingBase}/plans/${loadingPlanId}/pallet-assignments` : `${smartLoadingBase}/plans/${loadingPlanId}/assignments` const assignmentBody = dropshipAssignment - ? { inboundId, packageCount: initialAssignmentCount, expectedVersion: Number(loadingPlan.version), - operationId: `${context.marker}-${loadingPlanId}-bridge-assign-inbound`.slice(0, 128) } + ? { palletId: id(candidate.palletId), expectedVersion: Number(loadingPlan.version), + operationId: `${context.marker}-${loadingPlanId}-bridge-assign-pallet`.slice(0, 128) } : { inboundId, inboundDetailId: id(candidate.inboundDetailId), packageCount: initialAssignmentCount, expectedVersion: Number(loadingPlan.version), operationId: `${context.marker}-${loadingPlanId}-bridge-assign`.slice(0, 128) } const assignmentResponse = await request(context, 'POST', assignmentPath, assignmentBody) diff --git a/scripts/admin-test-env-modules/phase3-producer-chain-contract.test.mjs b/scripts/admin-test-env-modules/phase3-producer-chain-contract.test.mjs index b9239136a..e96b15374 100644 --- a/scripts/admin-test-env-modules/phase3-producer-chain-contract.test.mjs +++ b/scripts/admin-test-env-modules/phase3-producer-chain-contract.test.mjs @@ -502,6 +502,9 @@ test('PDA completion acceptance verifies immutable BATCH and COMPLETE_LOADING au assert.match(loading, new RegExp(key)) } assert.match(loading, /expectedBatchOperationIds = dropshipWholePallet[\s\S]*\? \[batchKey\][\s\S]*: \[batchKey, skipBatchKey, partialBatchKey, dynamicBatchKey\]/) + assert.match(loading, /dropshipAssignment[\s\S]*pallet-assignments/) + assert.match(loading, /palletId: id\(candidate\.palletId\)/) + assert.doesNotMatch(loading, /bridge-assign-inbound/) assert.match(loading, /skipBatchVerified, partialBatchVerified, dynamicIncrementVerified/) assert.match(convergence, /expectedBatchCount = fixture\?\.fulfillmentType === 'ONE_CLICK_DROPSHIP' \? 1 : 4/) assert.match(convergence, /expectedBatchOperationIds\.length === expectedBatchCount/) diff --git a/scripts/phase4-overseas-acceptance-entry-contract.test.mjs b/scripts/phase4-overseas-acceptance-entry-contract.test.mjs index 7f7355b9b..83031a80b 100644 --- a/scripts/phase4-overseas-acceptance-entry-contract.test.mjs +++ b/scripts/phase4-overseas-acceptance-entry-contract.test.mjs @@ -162,6 +162,9 @@ test('PDA entry expands the real phase-three producer chain and builds an FBA/OV assert.match(source, /runPhase4ProducerVariant\('FBA-STANDARD', 'FBA', 'STANDARD', false\)/) assert.match(source, /runPhase4ProducerVariant\('SECONDARY', 'FBA', 'STANDARD', false\)/) assert.match(source, /runUntilPickupReady\(this\)/) + const variant = source.slice(source.indexOf('async runPhase4ProducerVariant'), source.indexOf('async ensurePhase4PdaProducerMatrix')) + assert.ok(variant.indexOf('phase3-outbound-dispatch-phase4-') < variant.indexOf('phase3-container-documents-phase4-')) + assert.ok(variant.indexOf('phase3-container-documents-phase4-') < variant.indexOf('phase3-carrier-schedule-queries-phase4-')) assert.match(source, /carrierScheduleQueryId/) assert.match(source, /readyForPhase4Pda === true/) assert.equal(modules.indexOf('phase4-overseas-pda-operations'), modules.indexOf('phase4-overseas-pda') + 1)