Interface ReturnService

  • All Known Implementing Classes:
    DefaultReturnService, WarehousingReturnService

    public interface ReturnService
    Service for handling 'Order Returns'. It offers ...
    • Configurable "Return Merchandise Authorization" aka "Return Material Authorization" (RMA) handling
    • Replacement Order handling
    • Refund handling incl. calculation
    • Configurable 'is returnable' check
    • Method Detail

      • createReturnRequest

        ReturnRequestModel createReturnRequest​(OrderModel order)
        Creates an "return request" object (@link ReturnRequest} for the order to be returned.
        Parameters:
        order - the order which should be returned
        Returns:
        ReturnRequest instance, which contains among others the RMA code.
      • getReturnRequests

        java.util.List<ReturnRequestModel> getReturnRequests​(java.lang.String orderCode)
        Returns the "return request" for the specified order
        Parameters:
        orderCode - code of the order we ask for the "return request"
        Returns:
        "return request" of the order
      • getRMA

        java.lang.String getRMA​(ReturnRequestModel request)
        returns a "Return Merchandise Authorization" aka "Return Material Authorization" (RMA).
        Parameters:
        request - reference of the related ReturnRequest
        Returns:
        Return Merchandise Authorization code
      • createRMA

        java.lang.String createRMA​(ReturnRequestModel request)
        creates "Return Merchandise Authorization" aka "Return Material Authorization" (RMA) and assigns it to the assigned ReturnRequestModel
        Parameters:
        request - reference of the related "ReturnRequest" for which this RMA will be created
        Returns:
        Return Merchandise Authorization code
      • createReplacement

        ReplacementEntryModel createReplacement​(ReturnRequestModel request,
                                                AbstractOrderEntryModel entry,
                                                java.lang.String notes,
                                                java.lang.Long expectedQuantity,
                                                ReturnAction action,
                                                ReplacementReason reason)
        Creates a Replacement based on the assigned OrderEntry instance
        Parameters:
        request - we use this for the verification process (order)
        entry - the original OrderEntry
        notes - some notes
        expectedQuantity - the amount of products which the customer wants to return.
        action - action which indicates if the 'returns process' will be executed immediately or is still on hold (waiting for the article to be send back)
        reason - reason for the replacement
        Returns:
        Replacement Entry instance
      • createRefund

        RefundEntryModel createRefund​(ReturnRequestModel request,
                                      AbstractOrderEntryModel entry,
                                      java.lang.String notes,
                                      java.lang.Long expectedQuantity,
                                      ReturnAction action,
                                      RefundReason reason)
        Creates a Refund based on the assigned OrderEntry instance
        Parameters:
        request - we use this for the verification process (order)
        entry - the original OrderEntry
        notes - some notes
        expectedQuantity - the amount of products which the customer wants to refund.
        action - action which indicates if the 'return process' will be executed immediately or is still on hold (waiting for the article to be send back)
        reason - reason for the refund
        Returns:
        Refund entry instance
      • getReturnEntries

        java.util.List<ReturnEntryModel> getReturnEntries​(ProductModel product)
        Returns the ReturnEntries for the specified product
        Parameters:
        product - the product
        Returns:
        the Return entry instance
      • getReturnEntry

        java.util.List<ReturnEntryModel> getReturnEntry​(AbstractOrderEntryModel entry)
        Returns the ReturnEntries for the specified order entry
        Parameters:
        entry - the OrderEntry
        Returns:
        the return entry instance
      • getReplacements

        java.util.List<ReplacementEntryModel> getReplacements​(ReturnRequestModel request)
        Returns all Replacements for the specified return request
        Parameters:
        request - the ReturnRequestModel
        Returns:
        the replacements
      • isReturnable

        boolean isReturnable​(OrderModel order,
                             AbstractOrderEntryModel entry,
                             long returnQuantity)
        Determines if the product is 'returnable' by using the injected ReturnableCheck impl.
        Parameters:
        order - the related original order
        entry - the ordered product which will be returned
        returnQuantity - the quantity of entries to be returned
        Returns:
        true if product is 'returnable'
      • processReturnEntries

        void processReturnEntries​(java.util.List<ReturnEntryModel> entries)
        Here you have the chance to 'inject' your final Return Entry processing. For example for handling consignment creation
        Parameters:
        entries - the entries to be processed
      • processReplacementOrder

        void processReplacementOrder​(ReplacementOrderModel order)
        Here you have the chance to 'inject' your final Replacement order processing. For example for handling consignment creation
        Parameters:
        order - the order to be processed
      • processRefundOrder

        void processRefundOrder​(OrderModel order)
        Here you have the chance to 'inject' your final Refund order processing. For example for handling consignment creation or initiating the final payment transaction.
        Parameters:
        order - the order to be processed
      • getAllReturnableEntries

        java.util.Map<AbstractOrderEntryModel,​java.lang.Long> getAllReturnableEntries​(OrderModel order)
        Returns all returnable OrderEntry's
        Parameters:
        order - the related order
        Returns:
        all returnable OrderEntry and their returnable quantity
      • requestManualPaymentReversalForReturnRequest

        void requestManualPaymentReversalForReturnRequest​(ReturnRequestModel returnRequest)
                                                   throws OrderReturnException
        Request manual payment reversal for the (@link ReturnRequest}.
        Parameters:
        returnRequest - the return request for which payment should be manually reversed
        Throws:
        OrderReturnException - in the case of error during service call
      • requestManualTaxReversalForReturnRequest

        void requestManualTaxReversalForReturnRequest​(ReturnRequestModel returnRequest)
                                               throws OrderReturnException
        Request manual tax reversal for the (@link ReturnRequest}.
        Parameters:
        returnRequest - the return request for which tax should be manually reversed
        Throws:
        OrderReturnException - in the case of error during service call