Interface CodeGenerationService
- All Known Implementing Classes:
DefaultCodeGenerationService
public interface CodeGenerationService
Performs operations on a
CodeGenerator, such as validation and code generation.- Author:
- Chad Harchar (charchar)
-
Method Summary
Modifier and TypeMethodDescriptiongenerateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationReq, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns theCodeGenerationResultcontaining generated and/or existingOfferCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.markInProgressAndGenerateAndGetCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest) Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.default voidmarkInProgressAndGenerateCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest) Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.
-
Method Details
-
markInProgressAndGenerateCodes
default void markInProgressAndGenerateCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest) Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.- Parameters:
info- The CodeGenerator that holds the information needed in order to generate the expected number of codes with the expected formatcontextRequest- The context of the request with which to generate codes
-
markInProgressAndGenerateAndGetCodes
CodeGenerationResult markInProgressAndGenerateAndGetCodes(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest) Updates theCodeGeneratorto have a status ofCodeGenerationStatusType.IN_PROCESS, then performs the code generation.- Parameters:
info- The CodeGenerator that holds the information needed in order to generate the expected number of codes with the expected formatcontextRequest- The context of the request with which to generate codes- Returns:
- the
CodeGenerationResultcontaining the generatedOfferCodesand error message based on the givenCodeGenerator
-
generateCodesForVouchers
CodeGenerationResult generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationReq, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns theCodeGenerationResultcontaining generated and/or existingOfferCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.This will use the existing
CodeGeneratorfor the voucher campaign if exists, otherwise it will create a new one.This method will generate the
OfferCodesand waits for its completion in the same request, therefore it's meant for small batch of code generation only.- Parameters:
voucherCodeGenerationReq- theVoucherCodeGenerationRequestto generate the voucherOfferCodeswithcontextInfo- The context of the request with which to generate codes- Returns:
- the
CodeGenerationResultcontaining generated and/or existingOfferCodesfor voucher offers based on the givenVoucherCodeGenerationRequest.
-