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 Details

    • 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

      List<ReturnRequestModel> getReturnRequests(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

      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

      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
    • getReplacementOrder

      ReplacementOrderModel getReplacementOrder(String rma)
      Returns the ReplacementOrderModel by the specified 'RMA value'
      Parameters:
      rma - rma value
      Returns:
      replacement order
    • createReplacementOrder

      ReplacementOrderModel createReplacementOrder(ReturnRequestModel request)
      Parameters:
      request - the return request to which the order will be assigned
      Returns:
      the Replacement Order'
    • addReplacementOrderEntries

      void addReplacementOrderEntries(ReplacementOrderModel order, List<ReplacementEntryModel> replacements)
      Adds ReplacementOrderEntryModel entries from the specified ReplacementEntryModel.
      Parameters:
      order - the replacement order
      replacements - the 'replacement' entries (instances which are on HOLD will be ignored)
    • createReplacement

      ReplacementEntryModel createReplacement(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, 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, String notes, 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

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

      Returns the ReturnEntries for the specified order entry
      Parameters:
      entry - the OrderEntry
      Returns:
      the return entry instance
    • getReplacements

      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'
    • maxReturnQuantity

      default long maxReturnQuantity(OrderModel order, AbstractOrderEntryModel entry)
      Determines the max returnable quantity of the product by using the injected ReturnableCheck impl.
      Parameters:
      order - the related original order
      entry - the ordered product which will be returned
      Returns:
      max returnable quantity of the product
    • processReturnEntries

      void processReturnEntries(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

      Map<AbstractOrderEntryModel,Long> getAllReturnableEntries(OrderModel order)
      Returns all returnable OrderEntry's
      Parameters:
      order - the related order
      Returns:
      all returnable OrderEntry and their returnable quantity
    • getOrderReturnRecordForOrder

      OrderReturnRecordModel getOrderReturnRecordForOrder(OrderModel order) throws OrderReturnException
      Gets order return record for a given order.
      Parameters:
      order - instance of OrderModel to get the return record for
      Returns:
      order return record for the given order
      Throws:
      OrderReturnException - in the case of error during service call
    • 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