Class TmaCouponResourceStrategy
java.lang.Object
de.hybris.platform.b2ctelcoservices.order.resourcestrategies.impl.TmaCouponResourceStrategy
- All Implemented Interfaces:
TmaAbstractOrderResourceStrategy
Resource strategy implementation. Validates and updates coupons.
- Since:
- 2003
-
Constructor Summary
ConstructorsConstructorDescriptionTmaCouponResourceStrategy(de.hybris.platform.couponservices.services.CouponService couponService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyCoupons(CartModel cart, Collection<String> couponsInCart, List<String> newCouponIds) Adds to the cart the coupons which are in the list of coupons of the request, but are not in the list of coupons of the cart.protected de.hybris.platform.couponservices.services.CouponServiceprotected voidremoveCoupons(CartModel cart, Collection<String> couponsInCart, List<String> newCouponIds) Removes from the cart the coupons which are in the list of coupons of the cart, but are not in the list of coupons of the request.voidupdateResource(CommerceCartParameter commerceCartParameter, CommerceCartModification commerceCartModification) Updates the resource from the @CommerceCartParameteron the given order entry.validateResource(CommerceCartParameter parameter) Validates that the resources from theCommerceCartParameterare valid to be stored on cart.
-
Constructor Details
-
TmaCouponResourceStrategy
public TmaCouponResourceStrategy(de.hybris.platform.couponservices.services.CouponService couponService)
-
-
Method Details
-
validateResource
Description copied from interface:TmaAbstractOrderResourceStrategyValidates that the resources from theCommerceCartParameterare valid to be stored on cart.- Specified by:
validateResourcein interfaceTmaAbstractOrderResourceStrategy- Parameters:
parameter- the commerce cart parameter storing information to be stored on cart- Returns:
TmaCartValidationResult
-
updateResource
public void updateResource(CommerceCartParameter commerceCartParameter, CommerceCartModification commerceCartModification) Description copied from interface:TmaAbstractOrderResourceStrategyUpdates the resource from the @CommerceCartParameteron the given order entry.- Specified by:
updateResourcein interfaceTmaAbstractOrderResourceStrategy- Parameters:
commerceCartParameter- contains attributes used for cart entry updatescommerceCartModification- contains the updates made on the cart
-
removeCoupons
protected void removeCoupons(CartModel cart, Collection<String> couponsInCart, List<String> newCouponIds) Removes from the cart the coupons which are in the list of coupons of the cart, but are not in the list of coupons of the request.- Parameters:
cart- The shopping cartcouponsInCart- The list of coupons in the cartnewCouponIds- The list of new coupons we want to add to the cart
-
applyCoupons
protected void applyCoupons(CartModel cart, Collection<String> couponsInCart, List<String> newCouponIds) Adds to the cart the coupons which are in the list of coupons of the request, but are not in the list of coupons of the cart.- Parameters:
cart- The shopping cartcouponsInCart- The list of coupons in the cartnewCouponIds- The list of new coupons we want to add to the cart
-
getCouponService
protected de.hybris.platform.couponservices.services.CouponService getCouponService()
-