Interface StockLevelSelectionStrategy
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultStockLevelSelectionStrategy
Strategy used to select a stock level to be associated with an inventory event
-
Method Summary
Modifier and TypeMethodDescriptiongetStockLevelsForAllocation(Collection<StockLevelModel> stockLevels, Long quantityToAllocate) Sorts and splits theStockLevelModeland returns a Map ofStockLevelModelto fulfill the quantity passed.getStockLevelsForCancellation(Collection<AllocationEventModel> allocationEvents, Long quantityToCancel) Extracts the stock levels out of the listAllocationEventModel.
-
Method Details
-
getStockLevelsForAllocation
Map<StockLevelModel,Long> getStockLevelsForAllocation(Collection<StockLevelModel> stockLevels, Long quantityToAllocate) Sorts and splits theStockLevelModeland returns a Map ofStockLevelModelto fulfill the quantity passed.- Parameters:
stockLevels- collection of stock level modelquantityToAllocate- total quantity to be allocated- Returns:
- a map of
StockLevelModeland quantity to be allocated per stock level
-
getStockLevelsForCancellation
Map<StockLevelModel,Long> getStockLevelsForCancellation(Collection<AllocationEventModel> allocationEvents, Long quantityToCancel) Extracts the stock levels out of the listAllocationEventModel. Sorts, splits and returns a Map ofStockLevelModelto fulfill the quantity passed.- Parameters:
allocationEvents- collection of allocation eventsquantityToCancel- total quantity to be cancelled- Returns:
- a map of
StockLevelModela the quantity to cancel for this stock level.
-