O - as OrderI - as OrderItempublic interface OrderService<O extends Order<? extends I>,I extends OrderItem> extends ChangeGenerator<Object>
Order management
| Modifier and Type | Method and Description |
|---|---|
void |
adjustInventory(I item,
Number updateCnt,
String causeSource)
Using a + or a - value for countUpdate we can change the Stock position from its current position.
|
void |
checkItemProductsStillLocked(O order)
For some operations like sending invoice etc it may be necessary for the order to have a lock on all its products;
Warn by throwing
PartialTransactionException.getFailed() of all Products that are not locked. |
OrderDao<O> |
getDao()
The Actions on the service layer can trigger events.
Useful if we want to easily create intermediate save points without having to worry about triggering events. |
boolean |
isExists(Long orderId)
Check to see if an Order exists or not
|
O |
load(Long orderId)
Load an existing Order
|
void |
lockProductsForOrder(O order,
String causeSource)
Orders maintain referential integrity over Products that are used by them. |
<D extends DeliveryDetails> |
save(D deliveryDetails,
String causeSource)
Explicitly update the Delivery Details only
|
<T extends O> |
save(T order,
String causeSource,
Object... context)
|
void |
unlockProductsForOrder(O order,
String causeSource)
Orders maintain referential integrity over Products that are used by them. |
I |
update(I item,
String causeSource)
|
addChangeListener, getListeners, notifyAllListeners, setListeners<T extends O> T save(T order, String causeSource, Object... context) throws OrderPlacementException
order - as OrdercauseSource - as Source of Change @nullable true will cause no subsequent event firingpropagateNotificatons - as boolean; if false will NOT call event listeners. This can be useful to prevent recursion from Event-Listenerscontext - as Object varags; typically sent to the ChangeGenerator.getListeners()Order objectOrderPlacementExceptionboolean isExists(Long orderId)
orderId - I update(I item, String causeSource) throws OrderPlacementException
item - as OrderItemcauseSource - as Source of Change @nullable true will cause no subsequent event firingOrderItem objectOrderPlacementException<D extends DeliveryDetails> D save(D deliveryDetails, String causeSource)
deliveryDetails - as DeliveryDetailscauseSource - as Source of Change @nullable true will cause no subsequent event firingvoid lockProductsForOrder(O order, String causeSource) throws PartialTransactionException, OrderPlacementException
Orders maintain referential integrity over Products that are used by them. OrderItems in the Orderorder - as OrdercauseSource - as String @nullable true will cause no subsequent event firingPartialTransactionExceptionOrderPlacementExceptionvoid unlockProductsForOrder(O order, String causeSource) throws OrderPlacementException
Orders maintain referential integrity over Products that are used by them. OrderItems in the Orderorder - as OrdercauseSource - @nullable true will cause no subsequent event firingOrderPlacementExceptionvoid checkItemProductsStillLocked(O order) throws PartialTransactionException
PartialTransactionException.getFailed() of all Products that are not locked.order - PartialTransactionExceptionvoid adjustInventory(I item, Number updateCnt, String causeSource)
adjustInventory(OrderItem, Number, String) for an Order ensure they are called within one Transaction.
RuntimeExceptions if Products don't exist, difficulty in modifying count on underlying DB etc; so any calling API Post Order placement should ideally account
for RuntimeException use casesitem - as OrderItemupdateCnt - as Number (Integer) that will be adjusted from the current stock position. A position # will ADD to current position, Negative will deduct from current position.
Note: The update count is not an absolute position; this is to ensure in high volume cases the Adjustments dont overwrite each other and each transaction is responsible for its own adjustment.causeSource - as String @nullable true will cause no subsequent event firingCopyright © 2018. All rights reserved.