Interface InventoryEventService
-
- All Known Implementing Classes:
DefaultInventoryEventService
public interface InventoryEventServiceThe service related to the inventory events. The inventory events are used for ATP calculation and included allocation and cancellation events.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<AllocationEventModel>createAllocationEvents(ConsignmentModel consignment)Persists theAllocationEventModelto account for the changes in stock quantities.java.util.Collection<AllocationEventModel>createAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)Create multipleAllocationEventModelthat are required to fulfill theConsignmentEntryModeljava.util.Collection<CancellationEventModel>createCancellationEvents(CancellationEventModel cancellationEventModel)Create multipleCancellationEventModelIncreaseEventModelcreateIncreaseEvent(IncreaseEventModel increaseEventModel)Create an inventory increase eventShrinkageEventModelcreateShrinkageEvent(ShrinkageEventModel shrinkageEventModel)Create a shrinkage event.WastageEventModelcreateWastageEvent(WastageEventModel wastageEventModel)Create a wastage event.java.util.Collection<AllocationEventModel>getAllocationEventsForConsignment(ConsignmentModel consignment)Retrieves a collection ofAllocationEventModelfor the givenConsignmentModeljava.util.Collection<AllocationEventModel>getAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)Retrieves a collection ofAllocationEventModelfor aConsignmentEntryModeljava.util.Collection<AllocationEventModel>getAllocationEventsForOrderEntry(OrderEntryModel orderEntry)Retrieves a collection ofAllocationEventModelfor anOrderEntryModeljava.util.Map<AllocationEventModel,java.lang.Long>getAllocationEventsForReallocation(java.util.Collection<AllocationEventModel> allocationEvents, java.lang.Long quantityToDecline)Extracts theStockLevelModelofAllocationEventModeland sorts them by quantity.<T extends InventoryEventModel>
java.util.Collection<T>getInventoryEventsForStockLevel(StockLevelModel stockLevel, java.lang.Class<T> eventClassType)Retrieves a collection ofInventoryEventModelfor theStockLevelModelvoidreallocateAllocationEvent(DeclineEntry declineEntry, java.lang.Long quantityToDecline)Delete or update the allocation event which has been created for a specific entry to decline
-
-
-
Method Detail
-
createAllocationEvents
java.util.Collection<AllocationEventModel> createAllocationEvents(ConsignmentModel consignment)
Persists theAllocationEventModelto account for the changes in stock quantities.- Parameters:
consignment- theConsignmentModelwhere stock was allocated; never null- Returns:
- a collection of
AllocationEventModel; never null
-
createAllocationEventsForConsignmentEntry
java.util.Collection<AllocationEventModel> createAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)
Create multipleAllocationEventModelthat are required to fulfill theConsignmentEntryModel- Parameters:
consignmentEntry- theConsignmentEntryModel- Returns:
- a list of persisted
AllocationEventModel
-
createShrinkageEvent
ShrinkageEventModel createShrinkageEvent(ShrinkageEventModel shrinkageEventModel)
Create a shrinkage event.- Parameters:
shrinkageEventModel- the event containing information about the shrinkage- Returns:
- the shrinkage event; never null
-
createWastageEvent
WastageEventModel createWastageEvent(WastageEventModel wastageEventModel)
Create a wastage event.- Parameters:
wastageEventModel- the event containing information about the wastage- Returns:
- the wastage event; never null
-
createCancellationEvents
java.util.Collection<CancellationEventModel> createCancellationEvents(CancellationEventModel cancellationEventModel)
Create multipleCancellationEventModel- Parameters:
cancellationEventModel- the event containing information about the cancelled consignment entry- Returns:
- the collection of persisted
CancellationEventModel
-
getAllocationEventsForConsignmentEntry
java.util.Collection<AllocationEventModel> getAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)
Retrieves a collection ofAllocationEventModelfor aConsignmentEntryModel- Parameters:
consignmentEntry- theConsignmentEntryModelfor which to retrieve the event- Returns:
- the collection of
AllocationEventModelassociated to the consignment entry
-
getAllocationEventsForOrderEntry
java.util.Collection<AllocationEventModel> getAllocationEventsForOrderEntry(OrderEntryModel orderEntry)
Retrieves a collection ofAllocationEventModelfor anOrderEntryModel- Parameters:
orderEntry- theOrderEntryModelfor which to retrieve the events- Returns:
- the collection of
AllocationEventModelfor the order entry
-
getInventoryEventsForStockLevel
<T extends InventoryEventModel> java.util.Collection<T> getInventoryEventsForStockLevel(StockLevelModel stockLevel, java.lang.Class<T> eventClassType)
Retrieves a collection ofInventoryEventModelfor theStockLevelModel- Parameters:
stockLevel- theStockLevelModelfor which the events need to be extractedeventClassType- the class representing the type of inventory event- Returns:
- the collection of inventory events for the given
StockLevelModel
-
createIncreaseEvent
IncreaseEventModel createIncreaseEvent(IncreaseEventModel increaseEventModel)
Create an inventory increase event- Parameters:
increaseEventModel- theIncreaseEventModelcontaining information about the increase event model- Returns:
- the increase event model
-
reallocateAllocationEvent
void reallocateAllocationEvent(DeclineEntry declineEntry, java.lang.Long quantityToDecline)
Delete or update the allocation event which has been created for a specific entry to decline- Parameters:
declineEntry- theDeclineEntryto decline/reallocatequantityToDecline- the quantity to decline/reallocate
-
getAllocationEventsForReallocation
java.util.Map<AllocationEventModel,java.lang.Long> getAllocationEventsForReallocation(java.util.Collection<AllocationEventModel> allocationEvents, java.lang.Long quantityToDecline)
Extracts theStockLevelModelofAllocationEventModeland sorts them by quantity. Tries to map quantity to a stock level for adjustement- Parameters:
allocationEvents- collection of allocation eventsquantityToDecline- total quantity to be adjusted- Returns:
- a map of
AllocationEventModelwith the quantity to adjust for this stock level
-
getAllocationEventsForConsignment
java.util.Collection<AllocationEventModel> getAllocationEventsForConsignment(ConsignmentModel consignment)
Retrieves a collection ofAllocationEventModelfor the givenConsignmentModel- Parameters:
consignment- theConsignmentModelfor which all allocation events will be returned- Returns:
- the collection of
AllocationEventModel
-
-