Package com.skava.oms.flow.util
Class ConstructLoyaltyRequestPayloadUtil
java.lang.Object
com.skava.oms.flow.util.ConstructLoyaltyRequestPayloadUtil
This class contains the common methods needed for order process.
- Since:
- Feb 28, 2019
- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionconstructSubscriptionInfo
(List<OrderItem> itemsShipped) This method is used to construct subscription info for the items shippedstatic String
getLoyaltyOrderItemsValue
(Order order, String loyaltyAttributeName, List<OrderItem> itemsShipped) Fetches loyalty eligible orderItem value from ordergetLoyaltyPayload
(Order order, String loyaltyEventName, String loyaltyOrderItemsValue, String totalOrderItemsValue, String voucherOrderItemsValue, List<OrderItem> itemsShipped, String processMode) Fetches the payload for loyalty event to create transactiongetLoyaltyRequestBody
(Order order, String loyaltyEventName, String loyaltyOrderItemsValue, String totalOrderItemsValue, String voucherOrderItemsValue, List<OrderItem> itemsShipped) Fetches the request body params for loyalty event payloadstatic BigDecimal
getOrderValueFromItems
(OrderItem orderItem, String loyaltyAttributeName) getShipmentDetails
(List<OrderItem> itemsShipped) build shipmentdetails for the list of items shippedstatic boolean
isValidLoyaltyItem
(OrderItem orderItem, String loyaltyAttributeName) Checks for valid loyalty item
-
Method Details
-
getLoyaltyOrderItemsValue
public static String getLoyaltyOrderItemsValue(Order order, String loyaltyAttributeName, List<OrderItem> itemsShipped) Fetches loyalty eligible orderItem value from order- Parameters:
order
-execution
-loyaltyAttributeName
-itemsShipped
-- Returns:
-
getOrderValueFromItems
- Parameters:
totalValue
-orderItem
-loyaltyAttributeName
-- Returns:
-
isValidLoyaltyItem
Checks for valid loyalty item- Parameters:
orderItem
-loyaltyAttributeName
-- Returns:
-
getLoyaltyPayload
public static PreProcessLoyaltyEventRequestPayload getLoyaltyPayload(Order order, String loyaltyEventName, String loyaltyOrderItemsValue, String totalOrderItemsValue, String voucherOrderItemsValue, List<OrderItem> itemsShipped, String processMode) Fetches the payload for loyalty event to create transaction- Parameters:
order
-loyaltyEventName
-loyaltyOrderItemsValue
-totalOrderItemsValue
-voucherOrderItemsValue
-itemsShipped
-- Returns:
-
getLoyaltyRequestBody
public static PreProcessLoyaltyEventRequest getLoyaltyRequestBody(Order order, String loyaltyEventName, String loyaltyOrderItemsValue, String totalOrderItemsValue, String voucherOrderItemsValue, List<OrderItem> itemsShipped) Fetches the request body params for loyalty event payload- Parameters:
order
-loyaltyEventName
-loyaltyOrderItemsValue
-totalOrderItemsValue
-voucherOrderItemsValue
-itemsShipped
-- Returns:
-
constructSubscriptionInfo
This method is used to construct subscription info for the items shipped- Parameters:
itemsShipped
- - holds the list of shipped items- Returns:
- subscriptionInfo subscription info
-
getShipmentDetails
public static List<PreProcessLoyaltyEventRequest.ShipmentDetail> getShipmentDetails(List<OrderItem> itemsShipped) build shipmentdetails for the list of items shipped- Parameters:
itemsShipped
-- Returns:
-