fix: align PDA inventory with pallet location blocks
This commit is contained in:
@@ -124,8 +124,10 @@ function inventorySignature(snapshot) {
|
||||
inboundId: id(inbound?.inboundId),
|
||||
availablePackageCount: Number(inbound?.availablePackageCount),
|
||||
resources: (inbound?.resources || []).map((resource) => ({
|
||||
reservationId: id(resource?.reservationId), occupancyId: id(resource?.occupancyId),
|
||||
palletId: id(resource?.palletId), locationId: id(resource?.locationId),
|
||||
blockId: id(resource?.blockId), slotNo: Number(resource?.slotNo),
|
||||
reservationId: id(resource?.reservationId), weightResultId: id(resource?.weightResultId),
|
||||
palletSequence: Number(resource?.palletSequence), palletId: id(resource?.palletId),
|
||||
locationId: id(resource?.locationId), slotStatus: resource?.slotStatus || null,
|
||||
sharedOverflow: resource?.sharedOverflow === true,
|
||||
availablePackageCount: Number(resource?.availablePackageCount),
|
||||
})),
|
||||
@@ -622,8 +624,9 @@ export async function run(context) {
|
||||
&& id(inventory?.warehouseId) === warehouseId
|
||||
&& Boolean(inventory?.capturedAt) && typeof inventory?.snapshotToken === 'string'
|
||||
&& inventory.snapshotToken.length === 64 && Number(inventoryInbound?.availablePackageCount) >= 1
|
||||
&& (inventoryInbound?.resources || []).every((resource) => id(resource?.reservationId)
|
||||
&& id(resource?.occupancyId) && id(resource?.palletId) && id(resource?.locationId)
|
||||
&& (inventoryInbound?.resources || []).every((resource) => id(resource?.blockId)
|
||||
&& Number(resource?.slotNo) >= 1 && id(resource?.reservationId) && id(resource?.locationId)
|
||||
&& ['RESERVED_EMPTY', 'BOUND'].includes(resource?.slotStatus)
|
||||
&& Number(resource?.availablePackageCount) >= 0)
|
||||
&& Number(inventoryInbound?.availablePackageCount) === (inventoryInbound?.resources || [])
|
||||
.reduce((total, resource) => total + Number(resource?.availablePackageCount || 0), 0)
|
||||
|
||||
Reference in New Issue
Block a user