Package com.skava.helper
Class CartPropertiesHelper
java.lang.Object
com.skava.helper.CartPropertiesHelper
The Class CartPropertiesHelper. Used conversion from one entity to other.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Instantiates a new cart properties helper. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<CartDomain>
convertCartEntityListToCartDomainList
(List<CartEntity> cartList, Map<Long, List<CartPropertiesEntity>> cartPropertiesMap, Map<Long, List<PromotionEntity>> promotionsMap, Map<Long, List<PaymentEntity>> paymentsMap, Map<Long, List<OtherChargesEntity>> otherChangesMap, Map<Long, List<LoyaltyDetailsEntity>> loyaltyDetailsMap) Convert CartEntity to CartDomain.convertCartItemPropertiesEntityListToMap
(List<ItemPropertiesEntity> itemPropertiesEntityList) Convert item properties entity to Map.convertCartPropertiesEntityListToMap
(List<CartPropertiesEntity> cartPropertiesEntityList) Convert cart properties entity to Map.static List<CartPropertiesEntity>
convertMapToCartPropertiesEntity
(Map<String, String> customProperties, long cartId) Convert map to cart properties entity.static List<ItemPropertiesEntity>
convertMapToItemPropertiesEntity
(Map<String, String> customProperties, long itemId) Convert map to item properties entity.static List<LoyaltyPropertiesEntity>
convertMapToLoyaltyDetailsPropertiesEntity
(Map<String, String> properties, long id) Convert map to loyalty details properties entity.void
setUserId
(CartCheckoutDataRequest checkoutRequest, CartCheckoutDomain checkoutDomain) This method is used to set the user Id from the user info, if the user is admin.void
setUserId
(CartDataRequest cartRequest, CartDomain cartDomain) This method is used to set the user Id from the user info, if the user is admin.
-
Constructor Details
-
CartPropertiesHelper
protected CartPropertiesHelper()Instantiates a new cart properties helper.
-
-
Method Details
-
convertMapToCartPropertiesEntity
public static List<CartPropertiesEntity> convertMapToCartPropertiesEntity(Map<String, String> customProperties, long cartId) Convert map to cart properties entity.- Parameters:
customProperties
- the custom propertiescartId
- the cart identifier- Returns:
- the list
-
convertCartPropertiesEntityListToMap
public static Map<String,String> convertCartPropertiesEntityListToMap(List<CartPropertiesEntity> cartPropertiesEntityList) Convert cart properties entity to Map.- Parameters:
cartPropertiesEntityList
- the custom properties list- Returns:
- the Map
-
convertCartItemPropertiesEntityListToMap
public static Map<String,String> convertCartItemPropertiesEntityListToMap(List<ItemPropertiesEntity> itemPropertiesEntityList) Convert item properties entity to Map.- Parameters:
itemPropertiesEntityList
- the custom properties list- Returns:
- the Map
-
convertMapToItemPropertiesEntity
public static List<ItemPropertiesEntity> convertMapToItemPropertiesEntity(Map<String, String> customProperties, long itemId) Convert map to item properties entity.- Parameters:
customProperties
- the custom propertiesitemId
- the item identifier- Returns:
- the list
-
convertMapToLoyaltyDetailsPropertiesEntity
public static List<LoyaltyPropertiesEntity> convertMapToLoyaltyDetailsPropertiesEntity(Map<String, String> properties, long id) Convert map to loyalty details properties entity.- Parameters:
properties
- the custom propertiesid
- the loyalty id- Returns:
- the list
-
convertCartEntityListToCartDomainList
public static List<CartDomain> convertCartEntityListToCartDomainList(List<CartEntity> cartList, Map<Long, List<CartPropertiesEntity>> cartPropertiesMap, Map<Long, List<PromotionEntity>> promotionsMap, Map<Long, List<PaymentEntity>> paymentsMap, Map<Long, List<OtherChargesEntity>> otherChangesMap, Map<Long, List<LoyaltyDetailsEntity>> loyaltyDetailsMap) Convert CartEntity to CartDomain.- Parameters:
cartList
- the cart entities list.cartPropertiesMap
- holds the cart propertiesotherChangesMap
- holds the other chargespaymentsMap
- holds the payments informationpromotionsMap
- holds the promotion informationloyaltyDetailsMap
- holds the loyalty information- Returns:
- List.
-
setUserId
This method is used to set the user Id from the user info, if the user is admin.- Parameters:
cartRequest
- to get user info.cartDomain
- to set userId in domain.
-
setUserId
This method is used to set the user Id from the user info, if the user is admin.- Parameters:
checkoutRequest
- to get user info.checkoutDomain
- to set userId in domain.
-