Interface OfferCodeGenerationInfo
- All Superinterfaces:
org.broadleafcommerce.common.copy.MultiTenantCloneable<OfferCodeGenerationInfo>,Serializable
- All Known Implementing Classes:
OfferCodeGenerationInfoImpl
public interface OfferCodeGenerationInfo
extends Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<OfferCodeGenerationInfo>
When offer codes are being generated, we keep track of the overall status.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the Active Start Date for a code group that is used if an offer code does not have an Active DateReturns the additional offers that are associated to this generator.Returns the custom formatter for generating codes.Returns the CodeGenerationType being used to generate offer codes.Returns a String withgetNumberOfCodesGenerated()/#getNumberOfCodesRequested()If those values = just returnsgetNumberOfCodesGenerated()Returns the CodeGenerationType being used to generate offer codes.Returns the length of the code the generator should generated (not including the length of the prefix).Returns the code prefix the generator should use to prepend to any generated offer code.Return date this generator was created.Returns the descriptionReturns the EmailRegEx used to validate an offerCodeReturns the End Date for a code group that is used if an offer code does not have an End DategetId()Returns the unique idbooleanIf set, allows codes to be generated that might be easily guessed.Returns the maximum number of uses to set for each code generated.intReturns the number of codes actually generated by this code generator.Number of codes that should be generated.org.broadleafcommerce.core.offer.domain.OffergetOffer()Returns the associated offer for which codes are being generated.List<org.broadleafcommerce.core.offer.domain.OfferCode>Returns the offer codes that were created as part of this generator.Return date this generator was last updated.voidsetActiveStartDate(Date activeStartDate) Set the Active Start Date for a code group that is used if an offer code does not have an Active DatevoidsetAdditionalOffers(List<OfferCodeGenerationAdditionalOfferXref> additionalOffers) Sets additional offers that are associated to this generator.voidsetCodeFormat(String codeFormat) Sets a custom formatter for generating codes.voidsetCodeGenerationMethod(CodeGenerationMethodType codeGenerationMethod) Sets the CodeGenerationType being used to generate offer codes.voidsetCodeGenerationProgressMessage(String message) voidsetCodeGenerationStatus(CodeGenerationStatusType codeGenerationStatus) Sets the CodeGenerationStatusType being used to generate offer codes.voidsetCodeLength(Integer codeLength) Sets the code length the generator should use when generating the codes.voidsetCodePrefix(String codePrefix) Sets the codePrefixvoidsetCreateDate(Date createDate) Set the date this generator was created.voidsetDescription(String description) Sets the descriptionvoidsetEmailRegEx(String emailRegEx) Sets EmailRegEx that is used to validate offerCodesvoidsetEndDate(Date endDate) Set the End Date for a code group that is used if an offer code does not have an End DatevoidSets the idvoidsetIgnoreGuessabilityError(boolean flag) Sets the system to ignore guessability warning.voidsetMaxUses(Integer maxUses) Sets the maximum number of orders that the code can be used in.voidsetNumberOfCodesGenerated(Integer numberOfCodesGenerated) Sets the number of codes to generate.voidsetNumberOfCodesToGenerate(Integer numberOfCodesToGenerate) Sets the number of codes to generate.voidsetOffer(org.broadleafcommerce.core.offer.domain.Offer offer) Sets the associated offer for which codes are being generated.voidsetOfferCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodes) Sets the offer codes that can be used to retrieve this Offer.voidsetUpdateDate(Date updatedDate) Set the date this generator was last updated.Methods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstance
-
Method Details
-
getId
Long getId()Returns the unique id- Returns:
-
setId
Sets the id- Parameters:
id-
-
getDescription
String getDescription()Returns the description- Returns:
-
setDescription
Sets the description- Parameters:
description-
-
getNumberOfCodesToGenerate
Integer getNumberOfCodesToGenerate()Number of codes that should be generated. Required.- Returns:
-
setNumberOfCodesToGenerate
Sets the number of codes to generate. -
getNumberOfCodesGenerated
int getNumberOfCodesGenerated()Returns the number of codes actually generated by this code generator.- Returns:
-
setNumberOfCodesGenerated
Sets the number of codes to generate. -
getOffer
org.broadleafcommerce.core.offer.domain.Offer getOffer()Returns the associated offer for which codes are being generated.- Returns:
-
setOffer
void setOffer(org.broadleafcommerce.core.offer.domain.Offer offer) Sets the associated offer for which codes are being generated.- Parameters:
offer-
-
getCodeGenerationStatus
CodeGenerationStatusType getCodeGenerationStatus()Returns the CodeGenerationType being used to generate offer codes. -
setCodeGenerationStatus
Sets the CodeGenerationStatusType being used to generate offer codes.- Parameters:
codeGenerationStatus-
-
getCodeGenerationMethod
CodeGenerationMethodType getCodeGenerationMethod()Returns the CodeGenerationType being used to generate offer codes. -
setCodeGenerationMethod
Sets the CodeGenerationType being used to generate offer codes.- Parameters:
codeGenerationMethod-
-
getCodePrefix
String getCodePrefix()Returns the code prefix the generator should use to prepend to any generated offer code. All codes will be prepended with this prefix.This setting is ignored for
CodeGenerationMethodType.SPECIFY_FORMAT.- Returns:
-
setCodePrefix
Sets the codePrefix- Parameters:
codePrefix-- See Also:
-
getCodeLength
Integer getCodeLength()Returns the length of the code the generator should generated (not including the length of the prefix).This setting is used only for
CodeGenerationMethodType.SPECIFY_LENGTH.- Returns:
-
setCodeLength
Sets the code length the generator should use when generating the codes.- Parameters:
codeLength-- See Also:
-
getMaxUses
Integer getMaxUses()Returns the maximum number of uses to set for each code generated.- Returns:
-
setMaxUses
Sets the maximum number of orders that the code can be used in. Use in conjunction withOffer.getMaxUsesPerOrder()to limit the number of times the offer can be used within the same order.- Parameters:
maxUses-- See Also:
-
getCodeFormat
String getCodeFormat()Returns the custom formatter for generating codes. Customer formatters allow for precise control of the code format.This setting is used only for
CodeGenerationMethodType.SPECIFY_FORMAT.For example, consider "CF-##-@@-**-1" which might generate the following code "CF-99-AB-Z3-1".
Each symbol is processed by the CodeGenerator.
The default implementation is as follows: # is replaced by a random number (not including 0, 1, or 5)
- Returns:
- See Also:
-
setCodeFormat
Sets a custom formatter for generating codes.- Parameters:
codeFormat-- See Also:
-
getIgnoreGuessabilityError
boolean getIgnoreGuessabilityError()If set, allows codes to be generated that might be easily guessed. System code generation is likely to fail for this mode when using random code generation as it will produce an excessive amount of collisions and fail.- Returns:
-
setIgnoreGuessabilityError
void setIgnoreGuessabilityError(boolean flag) Sets the system to ignore guessability warning.- Parameters:
flag-
-
getCreateDate
Date getCreateDate()Return date this generator was created.- Returns:
-
setCreateDate
Set the date this generator was created.- Parameters:
createDate-
-
getUpdateDate
Date getUpdateDate()Return date this generator was last updated.- Returns:
-
setUpdateDate
Set the date this generator was last updated.- Parameters:
updatedDate-
-
getCodeGenerationProgressMessage
String getCodeGenerationProgressMessage()Returns a String withgetNumberOfCodesGenerated()/#getNumberOfCodesRequested()If those values = just returnsgetNumberOfCodesGenerated()Gives the admin an easy way to return progress. This field is automatically updated when setCod
- Returns:
-
setCodeGenerationProgressMessage
- Parameters:
message-- See Also:
-
getOfferCodes
List<org.broadleafcommerce.core.offer.domain.OfferCode> getOfferCodes()Returns the offer codes that were created as part of this generator.- Returns:
-
setOfferCodes
Sets the offer codes that can be used to retrieve this Offer. These codes would be used in situations where this Offer is not automatically considered -
getAdditionalOffers
List<OfferCodeGenerationAdditionalOfferXref> getAdditionalOffers()Returns the additional offers that are associated to this generator.- Returns:
-
setAdditionalOffers
Sets additional offers that are associated to this generator. These offers will also be applied to an order whenever one of the associated codes is used. -
getEmailRegEx
String getEmailRegEx()Returns the EmailRegEx used to validate an offerCode- Returns:
-
setEmailRegEx
Sets EmailRegEx that is used to validate offerCodes -
getActiveStartDate
Date getActiveStartDate()Returns the Active Start Date for a code group that is used if an offer code does not have an Active Date -
setActiveStartDate
Set the Active Start Date for a code group that is used if an offer code does not have an Active Date -
getEndDate
Date getEndDate()Returns the End Date for a code group that is used if an offer code does not have an End Date -
setEndDate
Set the End Date for a code group that is used if an offer code does not have an End Date
-