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