Class WarehousingReturnService

java.lang.Object
de.hybris.platform.returns.impl.DefaultReturnService
de.hybris.platform.warehousing.returns.service.impl.WarehousingReturnService
All Implemented Interfaces:
ReturnCallbackService, ReturnService

public class WarehousingReturnService extends DefaultReturnService
Default OMS implementation of ReturnService. It adds validation to the return creation and can modify the newly created objects.
  • Constructor Details

    • WarehousingReturnService

      public WarehousingReturnService()
  • Method Details

    • createReturnRequest

      public ReturnRequestModel createReturnRequest(OrderModel order)
      Description copied from class: DefaultReturnService
      Creates an "authorization" object (@link ReturnRequest} for the order to be returned, if there doesn't exists one for that order so far
      Specified by:
      createReturnRequest in interface ReturnService
      Overrides:
      createReturnRequest in class DefaultReturnService
      Parameters:
      order - the order which should be returned
      Returns:
      ReturnRequest instance, which will deliver among others the RMA code of every processed "return order".
    • createRefund

      public RefundEntryModel createRefund(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, RefundReason reason)
      Description copied from class: DefaultReturnService
      Creates a ReplRefundacement based on the assigned OrderEntry instance
      Specified by:
      createRefund in interface ReturnService
      Overrides:
      createRefund in class DefaultReturnService
      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 got a refund.
      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 refund
      Returns:
      Refund entry instance
    • validateReturnRequest

      protected void validateReturnRequest(OrderModel order)
      Verifies the parameters of the createReturnRequest call
      Parameters:
      order - The order for which the return is created
    • finalizeReturnRequest

      protected void finalizeReturnRequest(ReturnRequestModel returnRequest)
      This updates ReturnRequestModel with ReturnStatus APPROVAL_PENDING
      Parameters:
      returnRequest - The newly created ReturnRequest
    • validateRefund

      protected void validateRefund(ReturnRequestModel request, OrderEntryModel entry, Long expectedQuantity, ReturnAction action, RefundReason reason)
      Verifies the parameters of the createRefund call
      Parameters:
      request - The ReturnRequest that will contain this RefundEntry
      entry - The OrderEntry with the products to be refunded
      expectedQuantity - The amount of items to be refunded
      action - The action to take on this refund
      reason - Reason code why the refund is requested
    • finalizeRefund

      protected void finalizeRefund(RefundEntryModel refundEntry, boolean isInStore)
      Handles whether or not the return is in store. For the in store return request, this method sets directly the "status" and "status" to ReturnStatus.RECEIVED and the received quantity to the expected quantity. For an online return request, the received quantity is set to 0 and the "status" and "status" is set to ReturnStatus.APPROVAL_PENDING
      Parameters:
      refundEntry - The newly created refundEntry
      isInStore - indicates if the return request is in store or online