Interface InventoryEventService
-
- All Known Implementing Classes:
DefaultInventoryEventService
public interface InventoryEventService
The 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 theAllocationEventModel
to account for the changes in stock quantities.java.util.Collection<AllocationEventModel>
createAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)
Create multipleAllocationEventModel
that are required to fulfill theConsignmentEntryModel
java.util.Collection<CancellationEventModel>
createCancellationEvents(CancellationEventModel cancellationEventModel)
Create multipleCancellationEventModel
IncreaseEventModel
createIncreaseEvent(IncreaseEventModel increaseEventModel)
Create an inventory increase eventShrinkageEventModel
createShrinkageEvent(ShrinkageEventModel shrinkageEventModel)
Create a shrinkage event.WastageEventModel
createWastageEvent(WastageEventModel wastageEventModel)
Create a wastage event.java.util.Collection<AllocationEventModel>
getAllocationEventsForConsignment(ConsignmentModel consignment)
Retrieves a collection ofAllocationEventModel
for the givenConsignmentModel
java.util.Collection<AllocationEventModel>
getAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)
Retrieves a collection ofAllocationEventModel
for aConsignmentEntryModel
java.util.Collection<AllocationEventModel>
getAllocationEventsForOrderEntry(OrderEntryModel orderEntry)
Retrieves a collection ofAllocationEventModel
for anOrderEntryModel
java.util.Map<AllocationEventModel,java.lang.Long>
getAllocationEventsForReallocation(java.util.Collection<AllocationEventModel> allocationEvents, java.lang.Long quantityToDecline)
Extracts theStockLevelModel
ofAllocationEventModel
and sorts them by quantity.<T extends InventoryEventModel>
java.util.Collection<T>getInventoryEventsForStockLevel(StockLevelModel stockLevel, java.lang.Class<T> eventClassType)
Retrieves a collection ofInventoryEventModel
for theStockLevelModel
void
reallocateAllocationEvent(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 theAllocationEventModel
to account for the changes in stock quantities.- Parameters:
consignment
- theConsignmentModel
where stock was allocated; never null- Returns:
- a collection of
AllocationEventModel
; never null
-
createAllocationEventsForConsignmentEntry
java.util.Collection<AllocationEventModel> createAllocationEventsForConsignmentEntry(ConsignmentEntryModel consignmentEntry)
Create multipleAllocationEventModel
that 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 ofAllocationEventModel
for aConsignmentEntryModel
- Parameters:
consignmentEntry
- theConsignmentEntryModel
for which to retrieve the event- Returns:
- the collection of
AllocationEventModel
associated to the consignment entry
-
getAllocationEventsForOrderEntry
java.util.Collection<AllocationEventModel> getAllocationEventsForOrderEntry(OrderEntryModel orderEntry)
Retrieves a collection ofAllocationEventModel
for anOrderEntryModel
- Parameters:
orderEntry
- theOrderEntryModel
for which to retrieve the events- Returns:
- the collection of
AllocationEventModel
for the order entry
-
getInventoryEventsForStockLevel
<T extends InventoryEventModel> java.util.Collection<T> getInventoryEventsForStockLevel(StockLevelModel stockLevel, java.lang.Class<T> eventClassType)
Retrieves a collection ofInventoryEventModel
for theStockLevelModel
- Parameters:
stockLevel
- theStockLevelModel
for 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
- theIncreaseEventModel
containing 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
- theDeclineEntry
to 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 theStockLevelModel
ofAllocationEventModel
and 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
AllocationEventModel
with the quantity to adjust for this stock level
-
getAllocationEventsForConsignment
java.util.Collection<AllocationEventModel> getAllocationEventsForConsignment(ConsignmentModel consignment)
Retrieves a collection ofAllocationEventModel
for the givenConsignmentModel
- Parameters:
consignment
- theConsignmentModel
for which all allocation events will be returned- Returns:
- the collection of
AllocationEventModel
-
-