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) GeneratesOfferCodes
for voucher offers based on the givenVoucherCodeGenerationRequest
.com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult
validateVoucherOfferUsages
(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
- theOrder
containing theVouchers
to validate againstcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- an
OfferAndOfferCodeUsageValidationResult
containing details about any invalidOffers
and failure messages
-
generateCodesForVouchers
CodeGenerationResult generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) GeneratesOfferCodes
for voucher offers based on the givenVoucherCodeGenerationRequest
.This method will generate and return the
OfferCodes
in the same request, therefore it's meant for small batch of code generation only.- Parameters:
voucherCodeGenerationRequest
- theVoucherCodeGenerationRequest
to generate the voucherOfferCodes
withcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the
CodeGenerationResult
containing the generated voucherOfferCodes
based on the givenVoucherCodeGenerationRequest
-