Class CartPropertiesHelper

java.lang.Object
com.skava.helper.CartPropertiesHelper

@Component public class CartPropertiesHelper extends Object
The Class CartPropertiesHelper. Used conversion from one entity to other.
  • 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 properties
      cartId - 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 properties
      itemId - 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 properties
      id - 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 properties
      otherChangesMap - holds the other charges
      paymentsMap - holds the payments information
      promotionsMap - holds the promotion information
      loyaltyDetailsMap - holds the loyalty information
      Returns:
      List.
    • setUserId

      public void setUserId(CartDataRequest cartRequest, CartDomain cartDomain)
      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

      public void setUserId(CartCheckoutDataRequest checkoutRequest, CartCheckoutDomain checkoutDomain)
      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.