From bf72d68c0aa274845f1ed2b8a7081920c8f3e26d Mon Sep 17 00:00:00 2001 From: Raj Ranjan Date: Mon, 27 Nov 2023 21:01:01 +0530 Subject: [PATCH] coupon reset --- CouponService/couponService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CouponService/couponService.ts b/CouponService/couponService.ts index 2ba76bf..984f87e 100644 --- a/CouponService/couponService.ts +++ b/CouponService/couponService.ts @@ -10,7 +10,7 @@ type Coupon = { consumedAmount: number, expiry: number, amountPerCoupon: number, - + reset: boolean, } type CouponConfig = { @@ -82,7 +82,8 @@ export class CouponService { dbItemSet.add(coupon.id) // Only load new coupons into memory - if (this.coupons.get(coupon.id) === undefined) { + if (this.coupons.get(coupon.id) === undefined || coupon.reset) { + coupon.reset = false this.coupons.set(coupon.id, coupon) } } else {