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 theCodeGenerationResult
containing generated and/or existingOfferCodes
for voucher offers based on the givenVoucherCodeGenerationRequest
.markInProgressAndGenerateAndGetCodes
(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest) Updates theCodeGenerator
to have a status ofCodeGenerationStatusType.IN_PROCESS
, then performs the code generation.default void
markInProgressAndGenerateCodes
(CodeGenerator info, com.broadleafcommerce.data.tracking.core.context.ContextRequest contextRequest) Updates theCodeGenerator
to 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 theCodeGenerator
to 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 theCodeGenerator
to 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
CodeGenerationResult
containing the generatedOfferCodes
and error message based on the givenCodeGenerator
-
generateCodesForVouchers
CodeGenerationResult generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationReq, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns theCodeGenerationResult
containing generated and/or existingOfferCodes
for voucher offers based on the givenVoucherCodeGenerationRequest
.This will use the existing
CodeGenerator
for the voucher campaign if exists, otherwise it will create a new one.This method will generate the
OfferCodes
and waits for its completion in the same request, therefore it's meant for small batch of code generation only.- Parameters:
voucherCodeGenerationReq
- theVoucherCodeGenerationRequest
to generate the voucherOfferCodes
withcontextInfo
- The context of the request with which to generate codes- Returns:
- the
CodeGenerationResult
containing generated and/or existingOfferCodes
for voucher offers based on the givenVoucherCodeGenerationRequest
.
-