06112602ec
Version the NestJS TDLib gateway with Docker deployment, migrations, automated tests and platform integration documentation while excluding all account sessions, credentials, runtime databases and backups.
45 lines
766 B
TypeScript
45 lines
766 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
} from 'typeorm';
|
|
import { Tenant } from './tenant.entity';
|
|
|
|
@Entity('users')
|
|
export class User {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ length: 255 })
|
|
email: string;
|
|
|
|
@Column({ length: 255, select: false })
|
|
passwordHash: string;
|
|
|
|
@Column({ length: 255, nullable: true })
|
|
name: string;
|
|
|
|
@Column({ default: 'user' })
|
|
role: string;
|
|
|
|
@Column({ default: true })
|
|
isActive: boolean;
|
|
|
|
@Column()
|
|
tenantId: string;
|
|
|
|
@ManyToOne(() => Tenant, (tenant) => tenant.users)
|
|
@JoinColumn({ name: 'tenantId' })
|
|
tenant: Tenant;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
}
|