auto generate code when creating coupon, redeem coupon mech