Interface OrderCancelService

    • Method Detail

      • getConfiguration

        OrderCancelConfigModel getConfiguration()
        Return current configuration
        Returns:
        current configuration
      • 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

        java.util.Map<AbstractOrderEntryModel,​java.lang.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