This commit is contained in:
2025-12-29 21:45:16 +03:30
parent 0f1f472adb
commit 85067f0373
4 changed files with 45 additions and 43 deletions
+2
View File
@@ -10,6 +10,7 @@ import { User } from '../users/entities/user.entity';
import { Delivery } from '../delivery/entities/delivery.entity'; import { Delivery } from '../delivery/entities/delivery.entity';
import { Order } from '../orders/entities/order.entity'; import { Order } from '../orders/entities/order.entity';
import { AuthModule } from '../auth/auth.module'; import { AuthModule } from '../auth/auth.module';
import { UserModule } from '../users/user.module';
import { JwtModule } from '@nestjs/jwt'; import { JwtModule } from '@nestjs/jwt';
import { UtilsModule } from '../utils/utils.module'; import { UtilsModule } from '../utils/utils.module';
import { CouponModule } from '../coupons/coupon.module'; import { CouponModule } from '../coupons/coupon.module';
@@ -34,6 +35,7 @@ import { WalletTransaction } from '../users/entities/wallet-transaction.entity';
Order, Order,
]), ]),
AuthModule, AuthModule,
UserModule,
JwtModule, JwtModule,
UtilsModule, UtilsModule,
CouponModule, CouponModule,
@@ -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 { BaseEntity } from '../../../common/entities/base.entity';
import { User } from './user.entity'; import { User } from './user.entity';
import { WalletTransactionReason, WalletTransactionType } from '../interface/wallet'; import { WalletTransactionReason, WalletTransactionType } from '../interface/wallet';
@@ -12,7 +12,7 @@ export class WalletTransaction extends BaseEntity {
@ManyToOne(() => User) @ManyToOne(() => User)
user!: User; user!: User;
@ManyToOne(() => User) @ManyToOne(() => Restaurant)
restaurant!: Restaurant; restaurant!: Restaurant;
@Property({ type: 'decimal', precision: 10, scale: 0 }) @Property({ type: 'decimal', precision: 10, scale: 0 })
+1 -1
View File
@@ -21,7 +21,7 @@ import { PointTransaction } from './entities/point-transaction.entity';
WalletTransaction, WalletTransaction,
PointTransaction PointTransaction
]), ]),
JwtModule, RestaurantsModule, WalletTransactionRepository], JwtModule, RestaurantsModule],
exports: [UserService, WalletService, UserRepository, WalletTransactionRepository], exports: [UserService, WalletService, UserRepository, WalletTransactionRepository],
}) })
export class UserModule { } export class UserModule { }
+40 -40
View File
@@ -42,46 +42,46 @@ export const restaurantsData: RestaurantData[] = [
plan: PlanEnum.Base, plan: PlanEnum.Base,
subscriptionId: 'sub_seed_zhivan_001', subscriptionId: 'sub_seed_zhivan_001',
}, },
{ // {
name: 'سپنتا', // name: 'سپنتا',
slug: 'sepanta', // slug: 'sepanta',
domain: 'https://dmenu-plus-front.dev.danakcorp.com/sepanta', // domain: 'https://dmenu-plus-front.dev.danakcorp.com/sepanta',
isActive: true, // isActive: true,
phone: '', // phone: '',
logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1641199914860_61d2b72b2e8bd97126a70b5f.png', // logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1641199914860_61d2b72b2e8bd97126a70b5f.png',
score: { // score: {
purchaseAmount: '100000', // purchaseAmount: '100000',
purchaseScore: '1', // purchaseScore: '1',
scoreAmount: '1', // scoreAmount: '1',
scoreCredit: '10000', // scoreCredit: '10000',
birthdayScore: '2', // birthdayScore: '2',
registerScore: '2', // registerScore: '2',
marriageDateScore: '2', // marriageDateScore: '2',
referrerScore: '2', // referrerScore: '2',
}, // },
plan: PlanEnum.Base, // plan: PlanEnum.Base,
subscriptionId: 'sub_seed_sepanta_001', // subscriptionId: 'sub_seed_sepanta_001',
}, // },
{ // {
name: 'اکافه', // name: 'اکافه',
slug: 'ocafe', // slug: 'ocafe',
domain: 'https://dmenu-plus-front.dev.danakcorp.com/ocafe', // domain: 'https://dmenu-plus-front.dev.danakcorp.com/ocafe',
isActive: true, // isActive: true,
phone: '', // phone: '',
logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1643274757715_61e509141601c7c7d9141989.png', // logo: 'https://dmenu.danakcorp.com/uploads/images/store/store_1643274757715_61e509141601c7c7d9141989.png',
score: { // score: {
purchaseAmount: '100000', // purchaseAmount: '100000',
purchaseScore: '1', // purchaseScore: '1',
scoreAmount: '1', // scoreAmount: '1',
scoreCredit: '10000', // scoreCredit: '10000',
birthdayScore: '2', // birthdayScore: '2',
registerScore: '2', // registerScore: '2',
marriageDateScore: '2', // marriageDateScore: '2',
referrerScore: '2', // referrerScore: '2',
}, // },
plan: PlanEnum.Base, // plan: PlanEnum.Base,
subscriptionId: 'sub_seed_ocafe_001', // subscriptionId: 'sub_seed_ocafe_001',
}, // },
// { // {
// name: 'رستوران ایزی دیزی', // name: 'رستوران ایزی دیزی',
// slug: 'easydizy', // slug: 'easydizy',