Interface InventoryEventService
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultInventoryEventService
The service related to the inventory events. The inventory events are used for ATP calculation and included
allocation and cancellation events.
-
Method Summary
Modifier and TypeMethodDescriptioncreateAllocationEvents(ConsignmentModel consignment) Persists theAllocationEventModelto account for the changes in stock quantities.createAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry) Create multipleAllocationEventModelthat are required to fulfill theConsignmentEntryModelcreateCancellationEvents(CancellationEventModel cancellationEventModel) Create multipleCancellationEventModelcreateIncreaseEvent(IncreaseEventModel increaseEventModel) Create an inventory increase eventcreateShrinkageEvent(ShrinkageEventModel shrinkageEventModel) Create a shrinkage event.createWastageEvent(WastageEventModel wastageEventModel) Create a wastage event.getAllocationEventsForConsignment(ConsignmentModel consignment) Retrieves a collection ofAllocationEventModelfor the givenConsignmentModelgetAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry) Retrieves a collection ofAllocationEventModelfor aConsignmentEntryModelgetAllocationEventsForOrderEntry(OrderEntryModel orderEntry) Retrieves a collection ofAllocationEventModelfor anOrderEntryModelgetAllocationEventsForReallocation(Collection<AllocationEventModel> allocationEvents, Long quantityToDecline) Extracts theStockLevelModelofAllocationEventModeland sorts them by quantity.<T extends InventoryEventModel>
Collection<T>getInventoryEventsForStockLevel(StockLevelModel stockLevel, Class<T> eventClassType) Retrieves a collection ofInventoryEventModelfor theStockLevelModelvoidreallocateAllocationEvent(DeclineEntry declineEntry, Long quantityToDecline) Delete or update the allocation event which has been created for a specific entry to decline
-
Method Details
-
createAllocationEvents
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
Collection<AllocationEventModel> createAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry) Create multipleAllocationEventModelthat are required to fulfill theConsignmentEntryModel- Parameters:
consignmentEntry- theConsignmentEntryModel- Returns:
- a list of persisted
AllocationEventModel
-
createShrinkageEvent
Create a shrinkage event.- Parameters:
shrinkageEventModel- the event containing information about the shrinkage- Returns:
- the shrinkage event; never null
-
createWastageEvent
Create a wastage event.- Parameters:
wastageEventModel- the event containing information about the wastage- Returns:
- the wastage event; never null
-
createCancellationEvents
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
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
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> Collection<T> getInventoryEventsForStockLevel(StockLevelModel stockLevel, 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
Create an inventory increase event- Parameters:
increaseEventModel- theIncreaseEventModelcontaining information about the increase event model- Returns:
- the increase event model
-
reallocateAllocationEvent
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
Map<AllocationEventModel,Long> getAllocationEventsForReallocation(Collection<AllocationEventModel> allocationEvents, 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
Retrieves a collection ofAllocationEventModelfor the givenConsignmentModel- Parameters:
consignment- theConsignmentModelfor which all allocation events will be returned- Returns:
- the collection of
AllocationEventModel
-