Interface OrderCancelService

All Known Implementing Classes:
DefaultOrderCancelService

public interface OrderCancelService
Order Cancel Service interface
  • Method Details

    • getConfiguration

      OrderCancelConfigModel getConfiguration()
      Return current configuration
      Returns:
      current configuration
    • getCancelRecordForOrder

      OrderCancelRecordModel getCancelRecordForOrder(OrderModel order) throws OrderCancelException
      Gets Cancellation record for a given order.
      Parameters:
      order - instance of OrderModel to 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 of OrderModel to 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 order
      partialEntryCancel - 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 of PrincipalModel, containing the principal of a requestor
      Returns:
      instance of CancelDecision containing 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 instance
      requestor - instance of PrincipalModel, 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 cancellable OrderEntry
      Parameters:
      order - Order that is subject to cancel
      requestor - Principal that originates the request ("issuer of the request"). It might be different from current session user.
      Returns:
      the cancellable AbstractOrderEntryModel and their cancellable quantity