Right now DiscountCoupon.code are unique only inside the same DiscountPolicy. But here in this bit we assume that coupon codes are unique globally. Which caused couple of failures when we created couple of coupon codes with same name as some old coupon codes.
So there is a confusion about the uniqueness of coupon codes. Are they unique -
- within a discount policy
- across multiple discount policies but within a single item (as
Item links to multiple discount policies)
- globally, across all discount policies
We'll need to update our logic accordingly.
/cc @jace @vidya-ram
Right now
DiscountCoupon.codeare unique only inside the sameDiscountPolicy. But here in this bit we assume that coupon codes are unique globally. Which caused couple of failures when we created couple of coupon codes with same name as some old coupon codes.So there is a confusion about the uniqueness of coupon codes. Are they unique -
Itemlinks to multiple discount policies)We'll need to update our logic accordingly.
/cc @jace @vidya-ram