Class CartUtils

java.lang.Object
com.skava.cart.orchestration.utils.CartUtils

@Service public final class CartUtils extends Object

The Class CartUtils.

This class is used for handling common cart related functionality
Author:
Infosys Equinox
  • Method Details

    • checkEmail

      public static void checkEmail(String email, String locale)
      This method is used to email checking
      Parameters:
      email - Indicates an email which is used for validating
      locale - Indicates the locale based on which the validation exception can be thrown when the email is not valid
    • checkPhone

      public static void checkPhone(String phone, String locale)
      This method is used to phone number checking
      Parameters:
      phone - Indicates the phone number which is used for validating
      locale - Indicates the locale based on which the validation exception can be thrown when the phone number is not valid
    • calculateDiscount

      public static BigDecimal calculateDiscount(PromotionDetails promotionDetails, PromotionBreakUpType type, BigDecimal quantity)
      This method is used for calculating promotion
      Parameters:
      promotionDetails - Indicates a PromotionDetails instance, contains all promotion details of the item or the cart
      type - Indicates a PromotionBreakUpType instance, which contains promotion breakUp type details
      quantity - Indicates the quantity of the cart items
      Returns:
      Returns the calculated discount.
    • checkValueOrUpdateDefault

      public static String checkValueOrUpdateDefault(String checkAttribute, String defaultValue)
      The function checks null and returns value
      Parameters:
      checkAttribute - Indicates a String to be checked
      defaultValue - Indicates a String default value
      Returns:
      Indicates a String response
    • isPreOrderSku

      public static boolean isPreOrderSku(SkuOrchestration sku)
      The function checks whether sku is preOrder or not
      Parameters:
      sku - Indicates a SkuOrchestration to be checked
      Returns:
      boolean - true if provided sku is preorder
    • isCartGiftItem

      public static boolean isCartGiftItem(SFItem sfItem)
      This method is to check whether the items present in cart is gift item or not
      Parameters:
      sfItem - cart item object
      Returns:
      Boolean isGiftItem returns true if the item is a gift item