Class Order

All Implemented Interfaces:
Serializable

public class Order extends OrderExtended
The class Order contains the Order related information.
Since:
05-Jul-2018
Author:
Infosys Equinox
See Also:
  • Constructor Details

    • Order

      public Order()
  • Method Details

    • getOrderItem

      public OrderItem getOrderItem(String orderItemId, long lineId)
      This method searches and returns the order item for the given orderItemId and lineId.
      Parameters:
      orderItemId - - id of the item to get.
      lineId - - Item of the line id to get.
      Returns:
      OrderItem - Order Item for the given orderItemId, lineId.
    • getOrderItems

      public List<OrderItem> getOrderItems(String orderItemId, long originallineId)
      This method searches and returns the list of order item for the given orderItemId and originallineId.
      Parameters:
      orderItemId - - id of the item to get.
      originallineId - - Item of the originallineId to get.
      Returns:
      List of Order Items for the given orderItemId, originallineId.
    • getOrderItem

      public OrderItem getOrderItem(String orderItemId)
      This method is used to retrieve the given order item.
      Parameters:
      orderItemId - unique order item identifier
      Returns:
      OrderItem
    • transitionState

      public void transitionState(String responseCode, String responseMsg, String workItem, Map<String,String> statusMap, String[] nextPossibleStates, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap)
      This method updates order item status and order. Debug logger has been added to this method.
      Parameters:
      responseCode - code to be added while transition of state
      responseMsg - - message to be added while transition of state
      workItem - - operation for which the transition is made
      statusMap - - map containing nextstate and display status of the item/order after transition
      nextPossibleStates - - next possible states to set to the order
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
    • fulfilmentTypeBasedtransitionState

      public void fulfilmentTypeBasedtransitionState(String responseCode, String responseMsg, String workItem, Map<String,String> statusMap, OrderProcessData orderProcessData, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap)
      This method updates order item status and order. Debug logger has been added to this method.
      Parameters:
      responseCode - code to be added while transition of state
      responseMsg - - message to be added while transition of state
      workItem - - operation for which the transition is made
      statusMap - - map containing nextstate and display status of the item/order after transition
      orderProcessData - - orderProcessData
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
    • transitionState

      public void transitionState(String responseCode, String responseMsg, String workItem, String nextState, String[] nextPossibleStates, String displayStatus)
      This method updates order item status and order. Debug logger has been added to this method.
      Parameters:
      responseCode - code to be added while transition of state
      responseMsg - - message to be added while transition of state
      workItem - - operation for which the transition is made
      nextState - - nextstate of the item/order after transition
      displayStatus - - display status of the item/order after transition
      nextPossibleStates - - next possible states to set to the order Use transitionState(String, String, String, Map, String[], Map, Map) instead to update with orderstatus and orderdisplaystatus
    • transitionStateForItem

      public void transitionStateForItem(String responseCode, String responseMsg, Map<String,String> statusMap, String[] nextPossibleStates, OrderItem oi, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap)
      This method makes the orderitem transition from a state to another. Debug logger has been added to this method.
      Parameters:
      responseCode - - respoonseCode for transition
      responseMsg - - message for transition
      statusMap - - map conating state of the item to be mmoved to and status to be displayed
      nextPossibleStates - - next possible states of the item
      oi - - order item to be updated
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
    • transitionStateForItem

      public void transitionStateForItem(String responseCode, String responseMsg, String workItem, String nextState, String[] nextPossibleStates, OrderItem oi, String displayStatus)
      This method makes the orderitem transition from a state to another. Debug logger has been added to this method.
      Parameters:
      responseCode - - respoonseCode for transition
      responseMsg - - message for transition
      workItem - - workitem from which the transition is made
      nextState - - state of the item to be mmoved to
      nextPossibleStates - - next possible states of the item
      oi - - order item to be updated
      displayStatus - status to be displayed Use transitionStateForItem(String, String, Map, String[], OrderItem, Map, Map) instead to update with orderstatus and orderdisplaystatus
    • createTransaction

      public OrderTransaction createTransaction(TransactionType type, String description, String currentStatus, String updateStatus, String orderItemId, String errorCode, String errorMessage)
      Creates new transaction
      Parameters:
      type - - type of transaction
      description - - description given for adding a new transaction
      currentStatus - - current status of the order
      updateStatus - - updated status to the order
      orderItemId - - OrderItem for which the transaction to be amde
      errorCode - - errorCode if any
      errorMessage - - errormessage if any
      Returns:
      Transaction - transaction to be added
    • addTransaction

      public void addTransaction(OrderTransaction trans)
      Adds new transaction for every process available in order
      Parameters:
      trans - - transaction to be added Debug logger has been added to this method.
    • getOrderStatus

      public String[] getOrderStatus(OrderItem[] orderItems)
      This method returns the possible order status
      Parameters:
      orderItems - - orderItems for which the status to be fetched from
      Returns:
      String[] the status
    • getOrderNextStatus

      public String[] getOrderNextStatus(OrderItem[] orderItems)
      This method returns the next possible order status
      Parameters:
      orderItems - - orderItems for which the next status to be fetched from
      Returns:
      String[] the status
    • setOrderStatusAndDisplayStatus

      public void setOrderStatusAndDisplayStatus(Order order, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap, String workItemStatus)
      This method returns the possible order status
      Parameters:
      order - - orderItems for which the status to be fetched from
      orderStatusMap -
      orderDisplayStatusMap -
      workItemStatus -
    • splitForCancelOrReturn

      public List<OrderItem> splitForCancelOrReturn(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap)
      This method splits the orderitem. Debug logger has been added to this method.
      Parameters:
      orderItemPatch - - orderitem information to be updated
      nextPossibleStatus - - next status the item could be moved to
      displayStatus - - display status the item could be moved to
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
      Returns:
      the list of orderitem
    • splitForCancelOrReturn

      public List<OrderItem> splitForCancelOrReturn(OrderItemPatchDTO oiPatch, String[] nextPossibleStatus, String displayStatus, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap, OrderProcessData orderProcessData)
      This method splits the orderitem. Debug logger has been added to this method.
      Parameters:
      orderItemPatch - - orderitem information to be updated
      nextPossibleStatus - - next status the item could be moved to
      displayStatus - - display status the item could be moved to
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
      orderProcessData - orderProcessData
      Returns:
      the list of orderitem
    • updateTransitionStateForSpecialProductItem

      public void updateTransitionStateForSpecialProductItem(OrderItemPatchDTO orderItemPatch, OrderItem oi, Map<String,String> statusMap, String[] nextPossibleStatus, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap, List<OrderItem> mapReturns)
      This method is used to updateTransitionStateForSpecialProductItem
      Parameters:
      orderItemPatch - - orderitem information to be updated
      oi - - orderitem information
      statusMap - - map conataining nextState , displayStatus, responseCode and responseMessgae
      nextPossibleStatus - - next status the item could be moved to
      orderStatusMap - - orderStatusConfiguration for the Order status array.
      orderDisplayStatusMap - - order display status configuration for the orderstatus
      mapReturns - - list of orderIten
    • transitionStateForItem

      public void transitionStateForItem(Map<String,String> statusMap, String[] nextPossibleStatus, OrderItem oi, Map<String,String> orderStatusMap, Map<String,String> orderDisplayStatusMap, double updateQuantity, SpecialProducts spclProd)
    • splitForCancelOrReturn

      public List<OrderItem> splitForCancelOrReturn(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus)
      This method splits the orderitem.
      Parameters:
      orderItemPatch - - orderitem information to be updated
      nextPossibleStatus - - next status the item could be moved to
      displayStatus - - display status the item could be moved to
      Returns:
      the list if orderitem Use splitForCancelOrReturn(OrderItemPatchDTO, String[], String, Map, Map) instead to update with orderstatus and orderdisplaystatus
    • addOrderItem

      public void addOrderItem(OrderItem oi, OrderTransaction trans)
      This method adds an orderitem Debug logger has been added to this method.
      Parameters:
      oi - - orderitem to be updated
      trans - transaction to be added
    • validateOrderItemUsingIdSkuid

      public boolean validateOrderItemUsingIdSkuid(String orderItemId, String skuId, OrderItem oi)
      This method validates the order item usinf skuid
      Parameters:
      orderItemId - - item to be added
      skuId - - skuid to be updated
      oi - - orderitem to be added
      Returns:
      the true if valid
    • validateSplProductOrderItem

      public boolean validateSplProductOrderItem(String orderItemId, String skuId, OrderItem oi)
      This method validates the order item usinf skuid
      Parameters:
      orderItemId - - item to be added
      skuId - - skuid to be updated
      oi - - orderitem to be added
      Returns:
      the true if valid
    • canTransition

      public boolean canTransition(String[] nextstatus, String status)
      This method is used to compare the user requested status with next possible status
      Parameters:
      nextstatus - possible
      status - received from user
      Returns:
      boolean
    • canDeleteOrder

      public boolean canDeleteOrder(OrderItem[] orderitems)
    • getPayment

      public Payment getPayment(String paymentId)
      The method get the payment from the order for the given order item payment id.
      Parameters:
      paymentId - - Order item level payment id
      Returns:
      Payment object from order Debug logger has been added to this method.