From 131dc6cbb556e2712c53a6b4b799dd465a0c79fe Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Tue, 6 Jan 2026 10:36:25 +0330 Subject: [PATCH] delte rest --- .../restaurants/providers/restaurants.service.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/restaurants/providers/restaurants.service.ts b/src/modules/restaurants/providers/restaurants.service.ts index a1f58c5..9731929 100644 --- a/src/modules/restaurants/providers/restaurants.service.ts +++ b/src/modules/restaurants/providers/restaurants.service.ts @@ -24,6 +24,9 @@ import { Delivery } from '../../delivery/entities/delivery.entity'; import { PaymentMethod } from '../../payments/entities/payment-method.entity'; import { Pager } from '../../pager/entities/pager.entity'; import { Schedule } from '../entities/schedule.entity'; +import { WalletTransaction } from '../../users/entities/wallet-transaction.entity'; +import { SmsLog } from '../../notifications/entities/smsLogs.entity'; +import { Notification } from '../../notifications/entities/notification.entity'; @Injectable() export class RestaurantsService { @@ -257,6 +260,12 @@ export class RestaurantsService { // Delete notification preferences await em.nativeDelete(NotificationPreference, { restaurant: id }); + // Delete notifications + await em.nativeDelete(Notification, { restaurant: id }); + + // Delete SMS logs + await em.nativeDelete(SmsLog, { restaurant: id }); + // Delete admin roles for this restaurant await em.nativeDelete(AdminRole, { restaurant: id }); @@ -266,6 +275,9 @@ export class RestaurantsService { // Delete pagers await em.nativeDelete(Pager, { restaurant: id }); + // Delete wallet transactions + await em.nativeDelete(WalletTransaction, { restaurant: id }); + // Finally, delete the restaurant itself await em.nativeDelete(Restaurant, { id }); });