From 85067f0373420c5eebe57c850c729a4f71dd148b Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Mon, 29 Dec 2025 21:45:16 +0330 Subject: [PATCH] fix bugs --- src/modules/cart/cart.module.ts | 2 + .../entities/wallet-transaction.entity.ts | 4 +- src/modules/users/user.module.ts | 2 +- src/seeders/data/restaurants.data.ts | 80 +++++++++---------- 4 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/modules/cart/cart.module.ts b/src/modules/cart/cart.module.ts index 8d0da8b..0549845 100644 --- a/src/modules/cart/cart.module.ts +++ b/src/modules/cart/cart.module.ts @@ -10,6 +10,7 @@ import { User } from '../users/entities/user.entity'; import { Delivery } from '../delivery/entities/delivery.entity'; import { Order } from '../orders/entities/order.entity'; import { AuthModule } from '../auth/auth.module'; +import { UserModule } from '../users/user.module'; import { JwtModule } from '@nestjs/jwt'; import { UtilsModule } from '../utils/utils.module'; import { CouponModule } from '../coupons/coupon.module'; @@ -34,6 +35,7 @@ import { WalletTransaction } from '../users/entities/wallet-transaction.entity'; Order, ]), AuthModule, + UserModule, JwtModule, UtilsModule, CouponModule, diff --git a/src/modules/users/entities/wallet-transaction.entity.ts b/src/modules/users/entities/wallet-transaction.entity.ts index c517e5f..087f9a2 100644 --- a/src/modules/users/entities/wallet-transaction.entity.ts +++ b/src/modules/users/entities/wallet-transaction.entity.ts @@ -1,4 +1,4 @@ -import { Entity, Index, Property, OneToMany, Collection, Cascade, ManyToOne, Enum } from '@mikro-orm/core'; +import { Entity, Index, Property, ManyToOne, Enum } from '@mikro-orm/core'; import { BaseEntity } from '../../../common/entities/base.entity'; import { User } from './user.entity'; import { WalletTransactionReason, WalletTransactionType } from '../interface/wallet'; @@ -12,7 +12,7 @@ export class WalletTransaction extends BaseEntity { @ManyToOne(() => User) user!: User; - @ManyToOne(() => User) + @ManyToOne(() => Restaurant) restaurant!: Restaurant; @Property({ type: 'decimal', precision: 10, scale: 0 }) diff --git a/src/modules/users/user.module.ts b/src/modules/users/user.module.ts index bfcfefc..750622f 100644 --- a/src/modules/users/user.module.ts +++ b/src/modules/users/user.module.ts @@ -21,7 +21,7 @@ import { PointTransaction } from './entities/point-transaction.entity'; WalletTransaction, PointTransaction ]), - JwtModule, RestaurantsModule, WalletTransactionRepository], + JwtModule, RestaurantsModule], exports: [UserService, WalletService, UserRepository, WalletTransactionRepository], }) export class UserModule { } diff --git a/src/seeders/data/restaurants.data.ts b/src/seeders/data/restaurants.data.ts index 158ce2d..d50c269 100644 --- a/src/seeders/data/restaurants.data.ts +++ b/src/seeders/data/restaurants.data.ts @@ -42,46 +42,46 @@ export const restaurantsData: RestaurantData[] = [ plan: PlanEnum.Base, subscriptionId: 'sub_seed_zhivan_001', }, - { - name: 'سپنتا', - slug: 'sepanta', - domain: 'https://dmenu-plus-front.dev.danakcorp.com/sepanta', - isActive: true, - phone: '', - logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1641199914860_61d2b72b2e8bd97126a70b5f.png', - score: { - purchaseAmount: '100000', - purchaseScore: '1', - scoreAmount: '1', - scoreCredit: '10000', - birthdayScore: '2', - registerScore: '2', - marriageDateScore: '2', - referrerScore: '2', - }, - plan: PlanEnum.Base, - subscriptionId: 'sub_seed_sepanta_001', - }, - { - name: 'اکافه', - slug: 'ocafe', - domain: 'https://dmenu-plus-front.dev.danakcorp.com/ocafe', - isActive: true, - phone: '', - logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1643274757715_61e509141601c7c7d9141989.png', - score: { - purchaseAmount: '100000', - purchaseScore: '1', - scoreAmount: '1', - scoreCredit: '10000', - birthdayScore: '2', - registerScore: '2', - marriageDateScore: '2', - referrerScore: '2', - }, - plan: PlanEnum.Base, - subscriptionId: 'sub_seed_ocafe_001', - }, + // { + // name: 'سپنتا', + // slug: 'sepanta', + // domain: 'https://dmenu-plus-front.dev.danakcorp.com/sepanta', + // isActive: true, + // phone: '', + // logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1641199914860_61d2b72b2e8bd97126a70b5f.png', + // score: { + // purchaseAmount: '100000', + // purchaseScore: '1', + // scoreAmount: '1', + // scoreCredit: '10000', + // birthdayScore: '2', + // registerScore: '2', + // marriageDateScore: '2', + // referrerScore: '2', + // }, + // plan: PlanEnum.Base, + // subscriptionId: 'sub_seed_sepanta_001', + // }, + // { + // name: 'اکافه', + // slug: 'ocafe', + // domain: 'https://dmenu-plus-front.dev.danakcorp.com/ocafe', + // isActive: true, + // phone: '', + // logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1643274757715_61e509141601c7c7d9141989.png', + // score: { + // purchaseAmount: '100000', + // purchaseScore: '1', + // scoreAmount: '1', + // scoreCredit: '10000', + // birthdayScore: '2', + // registerScore: '2', + // marriageDateScore: '2', + // referrerScore: '2', + // }, + // plan: PlanEnum.Base, + // subscriptionId: 'sub_seed_ocafe_001', + // }, // { // name: 'رستوران ایزی دیزی', // slug: 'easydizy',