mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
23 lines
609 B
TypeScript
23 lines
609 B
TypeScript
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);
|
|
}
|
|
}
|