import { Column, Entity, Index, ManyToOne, PrimaryColumn } from 'typeorm'; import { ApiProperty } from '@nestjs/swagger'; import { User } from './user.entity'; @Entity() export class Wallet { @PrimaryColumn() @ApiProperty() address: string; @Column({ nullable: true }) @ApiProperty({ type: String, nullable: true }) provider: string; @Column() @Index() @ApiProperty({ type: String }) userUid: string; @ManyToOne(() => User, user => user.wallets, { onDelete: 'CASCADE' }) @ApiProperty({ type: () => User }) user: User; }