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 Details

    • getId

      Long getId()
      Returns the unique id
      Returns:
    • setId

      void setId(Long id)
      Sets the id
      Parameters:
      id -
    • getDescription

      String getDescription()
      Returns the description
      Returns:
    • setDescription

      void setDescription(String description)
      Sets the description
      Parameters:
      description -
    • getNumberOfCodesToGenerate

      Integer getNumberOfCodesToGenerate()
      Number of codes that should be generated. Required.
      Returns:
    • setNumberOfCodesToGenerate

      void setNumberOfCodesToGenerate(Integer numberOfCodesToGenerate)
      Sets the number of codes to generate.
    • getNumberOfCodesGenerated

      int getNumberOfCodesGenerated()
      Returns the number of codes actually generated by this code generator.
      Returns:
    • setNumberOfCodesGenerated

      void setNumberOfCodesGenerated(Integer numberOfCodesGenerated)
      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

      void setCodeGenerationStatus(CodeGenerationStatusType codeGenerationStatus)
      Sets the CodeGenerationStatusType being used to generate offer codes.
      Parameters:
      codeGenerationStatus -
    • getCodeGenerationMethod

      CodeGenerationMethodType getCodeGenerationMethod()
      Returns the CodeGenerationType being used to generate offer codes.
    • setCodeGenerationMethod

      void setCodeGenerationMethod(CodeGenerationMethodType codeGenerationMethod)
      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

      void setCodePrefix(String codePrefix)
      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

      void setCodeLength(Integer codeLength)
      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

      void setMaxUses(Integer maxUses)
      Sets the maximum number of orders that the code can be used in. Use in conjunction with Offer.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

      void setCodeFormat(String codeFormat)
      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

      void setCreateDate(Date createDate)
      Set the date this generator was created.
      Parameters:
      createDate -
    • getUpdateDate

      Date getUpdateDate()
      Return date this generator was last updated.
      Returns:
    • setUpdateDate

      void setUpdateDate(Date updatedDate)
      Set the date this generator was last updated.
      Parameters:
      updatedDate -
    • getCodeGenerationProgressMessage

      String getCodeGenerationProgressMessage()
      Returns a String with getNumberOfCodesGenerated() / #getNumberOfCodesRequested() If those values = just returns getNumberOfCodesGenerated()

      Gives the admin an easy way to return progress. This field is automatically updated when setCod

      Returns:
    • setCodeGenerationProgressMessage

      void setCodeGenerationProgressMessage(String message)
      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

      void setOfferCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodes)
      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

      Returns the additional offers that are associated to this generator.
      Returns:
    • setAdditionalOffers

      void setAdditionalOffers(List<OfferCodeGenerationAdditionalOfferXref> additionalOffers)
      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

      void setEmailRegEx(String emailRegEx)
      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

      void setActiveStartDate(Date activeStartDate)
      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

      void setEndDate(Date endDate)
      Set the End Date for a code group that is used if an offer code does not have an End Date