Interface OfferProvider
- All Known Implementing Classes:
ExternalOfferProvider
public interface OfferProvider
Provider for interfacing with
Offers and the Offer Engine.- Author:
- Sunny Yu
-
Method Summary
Modifier and TypeMethodDescriptiongenerateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) GeneratesOfferCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResultvalidateVoucherOfferUsages(com.broadleafcommerce.order.client.domain.Order order, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates existing vouchers stored inOrder.getVouchers()to ensure that they are still valid and applicable to the givenOrder.
-
Method Details
-
validateVoucherOfferUsages
com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateVoucherOfferUsages(com.broadleafcommerce.order.client.domain.Order order, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates existing vouchers stored inOrder.getVouchers()to ensure that they are still valid and applicable to the givenOrder.- Parameters:
order- theOrdercontaining theVouchersto validate againstcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- an
OfferAndOfferCodeUsageValidationResultcontaining details about any invalidOffersand failure messages
-
generateCodesForVouchers
CodeGenerationResult generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) GeneratesOfferCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.This method will generate and return the
OfferCodesin the same request, therefore it's meant for small batch of code generation only.- Parameters:
voucherCodeGenerationRequest- theVoucherCodeGenerationRequestto generate the voucherOfferCodeswithcontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- the
CodeGenerationResultcontaining the generated voucherOfferCodesbased on the givenVoucherCodeGenerationRequest
-