Class TmaQuantityResourceStrategy

java.lang.Object
de.hybris.platform.b2ctelcoservices.order.resourcestrategies.impl.TmaQuantityResourceStrategy
All Implemented Interfaces:
TmaAbstractOrderResourceStrategy

public class TmaQuantityResourceStrategy extends Object implements TmaAbstractOrderResourceStrategy
Resource strategy implementation. Validates and updates quantity.
Since:
1911
  • Constructor Details

    • TmaQuantityResourceStrategy

      public TmaQuantityResourceStrategy(de.hybris.platform.commerceservices.stock.CommerceStockService commerceStockService, de.hybris.platform.order.CartService cartService, de.hybris.platform.servicelayer.model.ModelService modelService, de.hybris.platform.store.services.BaseStoreService baseStoreService, de.hybris.platform.commerceservices.strategies.ModifiableChecker<AbstractOrderEntryModel> entryOrderChecker, de.hybris.platform.commerceservices.order.dao.CartEntryDao cartEntryDao, de.hybris.platform.commerceservices.order.CommerceCartCalculationStrategy commerceCartCalculationStrategy, TmaPoService poService)
  • Method Details

    • validateResource

      public TmaCartValidationResult validateResource(CommerceCartParameter commerceCartParameter)
      Description copied from interface: TmaAbstractOrderResourceStrategy
      Validates that the resources from the CommerceCartParameter are valid to be stored on cart.
      Specified by:
      validateResource in interface TmaAbstractOrderResourceStrategy
      Parameters:
      commerceCartParameter - the commerce cart parameter storing information to be stored on cart
      Returns:
      TmaCartValidationResult
    • updateResource

      public void updateResource(CommerceCartParameter commerceCartParameter, CommerceCartModification commerceCartModification) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: TmaAbstractOrderResourceStrategy
      Updates the resource from the @CommerceCartParameter on the given order entry.
      Specified by:
      updateResource in interface TmaAbstractOrderResourceStrategy
      Parameters:
      commerceCartParameter - contains attributes used for cart entry updates
      commerceCartModification - contains the updates made on the cart
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - in case of any error occurs during cart update
    • updateQuantityForCartEntry

      protected void updateQuantityForCartEntry(CommerceCartParameter parameters, CommerceCartModification commerceCartModification) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • isOrderEntryUpdatable

      protected boolean isOrderEntryUpdatable(AbstractOrderEntryModel entryToUpdate)
    • modifyEntry

      protected void modifyEntry(CartModel cartModel, AbstractOrderEntryModel entryToUpdate, long actualAllowedQuantityChange, long newQuantity, Integer maxOrderQuantity, CommerceCartModification commerceCartModification)
    • removeEntryFromCart

      protected void removeEntryFromCart(CartModel cartModel, AbstractOrderEntryModel entryToUpdate, long newQuantity, CommerceCartModification commerceCartModification)
    • removeEntry

      protected CommerceCartModification removeEntry(AbstractOrderEntryModel entry, AbstractOrderModel abstractOrder)
    • getAllowedCartAdjustmentForProduct

      protected long getAllowedCartAdjustmentForProduct(CartModel cartModel, ProductModel productModel, long quantityToAdd, PointOfServiceModel pointOfServiceModel)
    • checkCartLevel

      protected long checkCartLevel(ProductModel productModel, CartModel cartModel, PointOfServiceModel pointOfServiceModel)
    • isMaxOrderQuantitySet

      protected boolean isMaxOrderQuantitySet(Integer maxOrderQuantity)
    • normalizeEntryNumbers

      protected void normalizeEntryNumbers(CartModel cartModel)
    • getAvailableStockLevel

      protected long getAvailableStockLevel(ProductModel productModel, PointOfServiceModel pointOfServiceModel)
    • getCommerceStockService

      protected de.hybris.platform.commerceservices.stock.CommerceStockService getCommerceStockService()
    • getCartService

      protected de.hybris.platform.order.CartService getCartService()
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
    • getBaseStoreService

      protected de.hybris.platform.store.services.BaseStoreService getBaseStoreService()
    • getEntryOrderChecker

      protected de.hybris.platform.commerceservices.strategies.ModifiableChecker<AbstractOrderEntryModel> getEntryOrderChecker()
    • getCartEntryDao

      protected de.hybris.platform.commerceservices.order.dao.CartEntryDao getCartEntryDao()
    • getCommerceCartCalculationStrategy

      protected de.hybris.platform.commerceservices.order.CommerceCartCalculationStrategy getCommerceCartCalculationStrategy()
    • getPoService

      protected TmaPoService getPoService()