Package de.hybris.platform.voucher.impl
Class DefaultVoucherService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.voucher.impl.AbstractVoucherService
de.hybris.platform.voucher.impl.DefaultVoucherService
- All Implemented Interfaces:
VoucherService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
CouponVoucherService
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterOrderCreation(OrderModel order, CartModel cart) Transfers vouchers form cart to newly created order.booleancreateVoucherInvalidation(String voucherCode, OrderModel order) CreatesVoucherInvalidationafter the voucher is redeemed for the ordervoiddelete(VoucherModel voucher) Searches for all applied vouchers for the specific cartgetAppliedVoucherCodes(OrderModel order) Given the order get a list of applied vouchersgetPromotionVouchers(String voucherCode) given the voucher code get a collection of related promotion vouchersgetSerialVouchers(String voucherCode) given the voucher code get a collection of related serial vouchersgetVoucher(String voucherCode) Get a voucher for a given voucher codebooleanredeemVoucher(String voucherCode, CartModel cart) redeemVoucher(String voucherCode, OrderModel order) protected voidrefresh(AbstractOrderModel order) voidreleaseVoucher(String voucherCode, CartModel cart) Releases the voucher for the cartvoidreleaseVoucher(String voucherCode, OrderModel order) reserveVoucher(String voucherCode, OrderModel order) voidsave(VoucherModel voucher) protected voidsaveIfModified(AbstractOrderModel order) Methods inherited from class de.hybris.platform.voucher.impl.AbstractVoucherService
getAbstractOrder, getCart, getOrder, getProduct, getRestriction, getUser, getVoucherMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultVoucherService
public DefaultVoucherService()
-
-
Method Details
-
afterOrderCreation
Description copied from interface:VoucherServiceTransfers vouchers form cart to newly created order. Please make sure to call this always afterOrderManager.createOrder(de.hybris.platform.jalo.order.AbstractOrder).- Specified by:
afterOrderCreationin interfaceVoucherService- Parameters:
order- the newly created ordercart- the cart which this order has been created from
-
createVoucherInvalidation
Description copied from interface:VoucherServiceCreatesVoucherInvalidationafter the voucher is redeemed for the order- Specified by:
createVoucherInvalidationin interfaceVoucherService- Parameters:
voucherCode- voucher code to be redeemedorder- order for which the voucher will be redeemed- Returns:
- true if the voucher has been redeemed for the given order
-
getAllVouchers
- Specified by:
getAllVouchersin interfaceVoucherService- Returns:
- a Collection with all found
Vouchers
-
getAppliedVoucherCodes
Description copied from interface:VoucherServiceSearches for all applied vouchers for the specific cart- Specified by:
getAppliedVoucherCodesin interfaceVoucherService- Parameters:
cart- cart for which the vouchers are applied- Returns:
- all applied voucher codes
-
getAppliedVoucherCodes
- Specified by:
getAppliedVoucherCodesin interfaceVoucherService
-
getAppliedVouchers
Description copied from interface:VoucherServiceGiven the order get a list of applied vouchers- Specified by:
getAppliedVouchersin interfaceVoucherService- Parameters:
order- the given order- Returns:
- a Collection with all applied
Vouchers for this order
-
getPromotionVouchers
Description copied from interface:VoucherServicegiven the voucher code get a collection of related promotion vouchers- Specified by:
getPromotionVouchersin interfaceVoucherService- Parameters:
voucherCode- the code- Returns:
- a Collection of
PromotionVouchers
-
getSerialVouchers
Description copied from interface:VoucherServicegiven the voucher code get a collection of related serial vouchers- Specified by:
getSerialVouchersin interfaceVoucherService- Parameters:
voucherCode- the code- Returns:
- a Collection of
SerialVouchers
-
getVoucher
Description copied from interface:VoucherServiceGet a voucher for a given voucher code- Specified by:
getVoucherin interfaceVoucherService- Parameters:
voucherCode- the code- Returns:
- the first
Voucherfor the given code. This includesPromotionVoucherandSerialVoucher.
-
redeemVoucher
Description copied from interface:VoucherService- Specified by:
redeemVoucherin interfaceVoucherService- Parameters:
voucherCode- code of the Vouchercart- the cart- Returns:
- true if the redemption was successful
- Throws:
JaloPriceFactoryException- in the case of exception on Jalo layer
-
redeemVoucher
- Specified by:
redeemVoucherin interfaceVoucherService
-
releaseVoucher
Description copied from interface:VoucherServiceReleases the voucher for the cart- Specified by:
releaseVoucherin interfaceVoucherService- Parameters:
voucherCode- voucher code to be releasedcart- cart for which the voucher will be released- Throws:
JaloPriceFactoryException- in the case of exception on jalo layer
-
releaseVoucher
- Specified by:
releaseVoucherin interfaceVoucherService- Throws:
ConsistencyCheckException
-
reserveVoucher
- Specified by:
reserveVoucherin interfaceVoucherService
-
delete
- Specified by:
deletein interfaceVoucherService
-
save
- Specified by:
savein interfaceVoucherService
-
saveIfModified
-
refresh
-