added: proxy module

This commit is contained in:
2023-11-26 15:17:55 +03:00
parent f8d805d18e
commit 652e8c502e
6 changed files with 193 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Payment } from './payment.entity';
import { User } from './user.entity';
@Entity()
@@ -10,11 +11,11 @@ export class ProxyUser {
@PrimaryGeneratedColumn('uuid')
public uuid!: string;
@Column({ nullable: true })
public userName: string;
@Column({ nullable: false, unique: true })
public userName!: string;
@Column({ nullable: true })
public description: string;
public description?: string;
@Column({ nullable: false })
public link!: string;
@@ -27,5 +28,8 @@ export class ProxyUser {
@OneToOne(() => User, (user) => user.id, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: true })
@JoinColumn({ name: 'user_id' })
public user: User;
public user?: User;
@OneToMany(() => Payment, (payment) => payment.user)
public payments: Payment[];
}