fix(coupon): add expiration check and error handling for expired coupons

This commit is contained in:
Chang lue Tsen
2025-10-16 09:31:33 -04:00
parent 8b48286365
commit 1b76794251
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -57,6 +57,7 @@ const (
CouponAlreadyUsed uint32 = 50002 // Coupon has already been used
CouponNotApplicable uint32 = 50003 // Coupon does not match the order or conditions
CouponInsufficientUsage uint32 = 50004 // Coupon has insufficient remaining uses
CouponExpired uint32 = 50005 // Coupon is expired
)
// Subscribe
+1
View File
@@ -46,6 +46,7 @@ func init() {
CouponAlreadyUsed: "Coupon has already been used",
CouponNotApplicable: "Coupon does not match the order or conditions",
CouponInsufficientUsage: "Coupon has insufficient remaining uses",
CouponExpired: "Coupon is expired",
// Subscribe
SubscribeExpired: "Subscribe is expired",