From 0c2923faacba79de0292c2dd5883d7510c88ecbb Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Tue, 10 Feb 2026 08:57:44 +0330 Subject: [PATCH] coupon --- src/modules/coupons/providers/coupon.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/coupons/providers/coupon.service.ts b/src/modules/coupons/providers/coupon.service.ts index 897c3e6..46985be 100644 --- a/src/modules/coupons/providers/coupon.service.ts +++ b/src/modules/coupons/providers/coupon.service.ts @@ -257,7 +257,7 @@ export class CouponService { return prefix + '-' + result; } - async generateCouponCode(restId: string): Promise { + async generateCouponCode(restId: string){ const restaurant = await this.restRepository.findOne({ id: restId }); if (!restaurant) { throw new NotFoundException(RestMessage.NOT_FOUND); @@ -266,6 +266,6 @@ export class CouponService { const existing = await this.couponRepository.findOne({ code, restaurant: { id: restId } }); if (existing) return this.generateCouponCode(restId); - return code; + return {code}; } }