Interface StockLevelSelectionStrategy

  • All Known Implementing Classes:
    DefaultStockLevelSelectionStrategy

    public interface StockLevelSelectionStrategy
    Strategy used to select a stock level to be associated with an inventory event
    • Method Detail

      • getStockLevelsForAllocation

        java.util.Map<StockLevelModel,​java.lang.Long> getStockLevelsForAllocation​(java.util.Collection<StockLevelModel> stockLevels,
                                                                                        java.lang.Long quantityToAllocate)
        Sorts and splits the StockLevelModel and returns a Map of StockLevelModel to fulfill the quantity passed.
        Parameters:
        stockLevels - collection of stock level model
        quantityToAllocate - total quantity to be allocated
        Returns:
        a map of StockLevelModel and quantity to be allocated per stock level
      • getStockLevelsForCancellation

        java.util.Map<StockLevelModel,​java.lang.Long> getStockLevelsForCancellation​(java.util.Collection<AllocationEventModel> allocationEvents,
                                                                                          java.lang.Long quantityToCancel)
        Extracts the stock levels out of the list AllocationEventModel. Sorts, splits and returns a Map of StockLevelModel to fulfill the quantity passed.
        Parameters:
        allocationEvents - collection of allocation events
        quantityToCancel - total quantity to be cancelled
        Returns:
        a map of StockLevelModel a the quantity to cancel for this stock level.