mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
This commit adds the Payment and ProxyUser entities to the database.
This commit is contained in:
22
backend/libs/database/payment.entity.ts
Normal file
22
backend/libs/database/payment.entity.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
||||
import { ProxyUser } from './ProxyUser.entity';
|
||||
|
||||
@Entity()
|
||||
export class Payment {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
public id!: string;
|
||||
|
||||
@Column()
|
||||
public uuidUser!: string;
|
||||
|
||||
@Column({ type: 'timestamptz' })
|
||||
public payTime!: Date;
|
||||
|
||||
@ManyToOne(() => ProxyUser, { onDelete: 'CASCADE' }) // Assuming you want to cascade delete when a user is deleted
|
||||
@JoinColumn({ name: 'uuidUser' })
|
||||
user: ProxyUser;
|
||||
|
||||
constructor(props?: Partial<Payment>) {
|
||||
Object.assign(this, props);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user