Interface CouponCodesGenerator

All Known Implementing Classes:
DefaultCouponCodesGenerator

public interface CouponCodesGenerator
Interface to provide a unique method for generating a batch of coupon codes
  • Method Details

    • generateNextCouponCode

      String generateNextCouponCode(MultiCodeCouponModel coupon)
      generate next coupon code in the batch
      Parameters:
      coupon - instance of MultiCodeCouponModel to generate coupons for
      Returns:
      next coupon code, null otherwise
    • getCodeLengthMapping

      Map<Integer,Integer> getCodeLengthMapping()
      returns the ratio of clear-text to cipher-text based on total length of the coupon code.
       key: coupon code length.
       value: clear-text length.
       implicit: cipher-text length = (key - value)