Package com.skava.oms.model.entity.order
Class Order
java.lang.Object
com.skava.oms.model.entity.order.OrderExtended
com.skava.oms.model.entity.order.Order
- All Implemented Interfaces:
Serializable
The class Order contains the Order related information.
- Since:
- 05-Jul-2018
- Author:
- Infosys Equinox
- See Also:
-
Field Summary
Fields inherited from class com.skava.oms.model.entity.order.OrderExtended
failedReason, itemLevelPatchAllowed, notes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOrderItem
(OrderItem oi, OrderTransaction trans) This method adds an orderitem Debug logger has been added to this method.void
addTransaction
(OrderTransaction trans) Adds new transaction for every process available in orderboolean
canDeleteOrder
(OrderItem[] orderitems) boolean
canTransition
(String[] nextstatus, String status) This method is used to compare the user requested status with next possible statuscreateTransaction
(TransactionType type, String description, String currentStatus, String updateStatus, String orderItemId, String errorCode, String errorMessage) Creates new transactionvoid
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.getOrderItem
(String orderItemId) This method is used to retrieve the given order item.getOrderItem
(String orderItemId, long lineId) This method searches and returns the order item for the given orderItemId and lineId.getOrderItems
(String orderItemId, long originallineId) This method searches and returns the list of order item for the given orderItemId and originallineId.String[]
getOrderNextStatus
(OrderItem[] orderItems) This method returns the next possible order statusString[]
getOrderStatus
(OrderItem[] orderItems) This method returns the possible order statusgetPayment
(String paymentId) The method get the payment from the order for the given order item payment id.void
setOrderStatusAndDisplayStatus
(Order order, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, String workItemStatus) This method returns the possible order statussplitForCancelOrReturn
(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus) This method splits the orderitem.splitForCancelOrReturn
(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap) This method splits the orderitem.splitForCancelOrReturn
(OrderItemPatchDTO oiPatch, String[] nextPossibleStatus, String displayStatus, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, OrderProcessData orderProcessData) This method splits the orderitem.void
transitionState
(String responseCode, String responseMsg, String workItem, String nextState, String[] nextPossibleStates, String displayStatus) This method updates order item status and order.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.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.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.void
transitionStateForItem
(Map<String, String> statusMap, String[] nextPossibleStatus, OrderItem oi, Map<String, String> orderStatusMap, Map<String, String> orderDisplayStatusMap, double updateQuantity, SpecialProducts spclProd) 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 updateTransitionStateForSpecialProductItemboolean
validateOrderItemUsingIdSkuid
(String orderItemId, String skuId, OrderItem oi) This method validates the order item usinf skuidboolean
validateSplProductOrderItem
(String orderItemId, String skuId, OrderItem oi) This method validates the order item usinf skuid
-
Constructor Details
-
Order
public Order()
-
-
Method Details
-
getOrderItem
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
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
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 stateresponseMsg
- - message to be added while transition of stateworkItem
- - operation for which the transition is madestatusMap
- - map containing nextstate and display status of the item/order after transitionnextPossibleStates
- - next possible states to set to the orderorderStatusMap
- - 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 stateresponseMsg
- - message to be added while transition of stateworkItem
- - operation for which the transition is madestatusMap
- - map containing nextstate and display status of the item/order after transitionorderProcessData
- - orderProcessDataorderStatusMap
- - 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 stateresponseMsg
- - message to be added while transition of stateworkItem
- - operation for which the transition is madenextState
- - nextstate of the item/order after transitiondisplayStatus
- - display status of the item/order after transitionnextPossibleStates
- - next possible states to set to the order UsetransitionState(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 transitionresponseMsg
- - message for transitionstatusMap
- - map conating state of the item to be mmoved to and status to be displayednextPossibleStates
- - next possible states of the itemoi
- - order item to be updatedorderStatusMap
- - 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 transitionresponseMsg
- - message for transitionworkItem
- - workitem from which the transition is madenextState
- - state of the item to be mmoved tonextPossibleStates
- - next possible states of the itemoi
- - order item to be updateddisplayStatus
- status to be displayed UsetransitionStateForItem(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 transactiondescription
- - description given for adding a new transactioncurrentStatus
- - current status of the orderupdateStatus
- - updated status to the orderorderItemId
- - OrderItem for which the transaction to be amdeerrorCode
- - errorCode if anyerrorMessage
- - errormessage if any- Returns:
- Transaction - transaction to be added
-
addTransaction
Adds new transaction for every process available in order- Parameters:
trans
- - transaction to be added Debug logger has been added to this method.
-
getOrderStatus
This method returns the possible order status- Parameters:
orderItems
- - orderItems for which the status to be fetched from- Returns:
- String[] the status
-
getOrderNextStatus
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 fromorderStatusMap
-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 updatednextPossibleStatus
- - next status the item could be moved todisplayStatus
- - display status the item could be moved toorderStatusMap
- - 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 updatednextPossibleStatus
- - next status the item could be moved todisplayStatus
- - display status the item could be moved toorderStatusMap
- - orderStatusConfiguration for the Order status array.orderDisplayStatusMap
- - order display status configuration for the orderstatusorderProcessData
- 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 updatedoi
- - orderitem informationstatusMap
- - map conataining nextState , displayStatus, responseCode and responseMessgaenextPossibleStatus
- - next status the item could be moved toorderStatusMap
- - orderStatusConfiguration for the Order status array.orderDisplayStatusMap
- - order display status configuration for the orderstatusmapReturns
- - list of orderIten
-
transitionStateForItem
-
splitForCancelOrReturn
public List<OrderItem> splitForCancelOrReturn(OrderItemPatchDTO orderItemPatch, String[] nextPossibleStatus, String displayStatus) This method splits the orderitem.- Parameters:
orderItemPatch
- - orderitem information to be updatednextPossibleStatus
- - next status the item could be moved todisplayStatus
- - 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
This method adds an orderitem Debug logger has been added to this method.- Parameters:
oi
- - orderitem to be updatedtrans
- transaction to be added
-
validateOrderItemUsingIdSkuid
This method validates the order item usinf skuid- Parameters:
orderItemId
- - item to be addedskuId
- - skuid to be updatedoi
- - orderitem to be added- Returns:
- the true if valid
-
validateSplProductOrderItem
This method validates the order item usinf skuid- Parameters:
orderItemId
- - item to be addedskuId
- - skuid to be updatedoi
- - orderitem to be added- Returns:
- the true if valid
-
canTransition
This method is used to compare the user requested status with next possible status- Parameters:
nextstatus
- possiblestatus
- received from user- Returns:
- boolean
-
canDeleteOrder
-
getPayment
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.
-