fix(scripts): align dropship container acceptance
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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/)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user