entity bugs

This commit is contained in:
2026-01-14 15:19:18 +03:30
parent 209a4fc723
commit aed4a1b333
12 changed files with 35 additions and 24 deletions
@@ -1,4 +1,4 @@
import { Entity, Property, ManyToOne, Index, Enum } from '@mikro-orm/core';
import { Entity, Property, ManyToOne, Index, Enum, PrimaryKey } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { User } from './user.entity';
import { CreditTransactionType } from '../interface/credit';
@@ -6,6 +6,9 @@ import { CreditTransactionType } from '../interface/credit';
@Entity({ tableName: 'credit_transactions' })
@Index({ properties: ['user'] })
export class CreditTransaction extends BaseEntity {
@PrimaryKey({ type: 'bigint', autoincrement: true })
id: bigint
@ManyToOne(() => User)
user!: User;
@@ -1,9 +1,12 @@
import { Entity, Property, ManyToOne } from '@mikro-orm/core';
import { Entity, Property, ManyToOne, PrimaryKey } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';
import { User } from './user.entity';
@Entity({ tableName: 'user_addresses' })
export class UserAddress extends BaseEntity {
@PrimaryKey({ type: 'bigint', autoincrement: true })
id: bigint
@ManyToOne(() => User)
user!: User;
+2 -2
View File
@@ -10,8 +10,8 @@ import { CreditTransaction } from '../entities/credit-transaction.entity';
@Injectable()
export class WalletService {
constructor(
private readonly walletTransactionRepository: CreditTransactionRepository,
private readonly pointTransactionRepository: CreditTransaction,
// private readonly walletTransactionRepository: CreditTransactionRepository,
) { }
// async getUserWalletTransactions(