Package de.hybris.platform.ordercancel
Interface OrderCancelService
- All Known Implementing Classes:
DefaultOrderCancelService
public interface OrderCancelService
Order Cancel Service interface
-
Method Summary
Modifier and TypeMethodDescriptiongetAllCancelableEntries(OrderModel order, PrincipalModel requestor) Returns all cancellableOrderEntryGets Cancellation record for a given order.Return current configurationGets cancellation record entry being currently in progress.isCancelPossible(OrderModel order, PrincipalModel requestor, boolean partialCancel, boolean partialEntryCancel) Verifies if order cancel is possible for given order and given conditionsrequestOrderCancel(OrderCancelRequest orderCancelRequest, PrincipalModel requestor) Requests complete cancel operation on an Order.
-
Method Details
-
getConfiguration
OrderCancelConfigModel getConfiguration()Return current configuration- Returns:
- current configuration
-
getCancelRecordForOrder
Gets Cancellation record for a given order.- Parameters:
order- instance ofOrderModelto get the cancel record for- Returns:
- Cancellation record for the given order
- Throws:
OrderCancelException- in the case of any error during order record cancellation
-
getPendingCancelRecordEntry
OrderCancelRecordEntryModel getPendingCancelRecordEntry(OrderModel order) throws OrderCancelException Gets cancellation record entry being currently in progress.- Parameters:
order- instance ofOrderModelto get the cancel record for- Returns:
- Cancellation record entry being currently in progress.
- Throws:
OrderCancelException- - if more than one entry is being in progress
-
isCancelPossible
CancelDecision isCancelPossible(OrderModel order, PrincipalModel requestor, boolean partialCancel, boolean partialEntryCancel) Verifies if order cancel is possible for given order and given conditions- Parameters:
order- order to be canceled.partialCancel- if true, the methods verifies if partial cancel can be performed on the given orderpartialEntryCancel- if true, the methods verifies if partial entry cancel can be performed on the given order. Partial entry cancel means that only part of order entry is canceled (i.e. only order entry quantity is reduced)requestor- instance ofPrincipalModel, containing the principal of a requestor- Returns:
- instance of
CancelDecisioncontaining the decision details
-
requestOrderCancel
OrderCancelRecordEntryModel requestOrderCancel(OrderCancelRequest orderCancelRequest, PrincipalModel requestor) throws OrderCancelException Requests complete cancel operation on an Order. Depending on current state, order might be canceled immediately or the cancellation decision might be delayed until the response from Warehouse arrives. Returned cancellation record allows to get information about order cancel request.- Parameters:
orderCancelRequest- order cancel request instancerequestor- instance ofPrincipalModel, containing the principal of a requestor- Returns:
- OrderCancelRecordEntryModel that represents the request and the result of cancel operation.
- Throws:
OrderCancelException- in the case the cancellation of order is not allowed
-
getAllCancelableEntries
Map<AbstractOrderEntryModel,Long> getAllCancelableEntries(OrderModel order, PrincipalModel requestor) Returns all cancellableOrderEntry- Parameters:
order- Order that is subject to cancelrequestor- Principal that originates the request ("issuer of the request"). It might be different from current session user.- Returns:
- the cancellable
AbstractOrderEntryModeland their cancellable quantity
-