mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 16:51:33 +10:00
🚀 release: v3.0.0
This commit is contained in:
43
apps/server/src/users/entities/user.entity.ts
Normal file
43
apps/server/src/users/entities/user.entity.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import { Exclude } from 'class-transformer';
|
||||
import { Column, CreateDateColumn, Entity, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { Resume } from '@/resume/entities/resume.entity';
|
||||
|
||||
@Entity()
|
||||
export class User {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column({ unique: true })
|
||||
username: string;
|
||||
|
||||
@Column({ unique: true })
|
||||
email: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@Exclude()
|
||||
password?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@Exclude()
|
||||
resetToken?: string;
|
||||
|
||||
@OneToMany(() => Resume, (resume) => resume.user)
|
||||
resumes: Resume[];
|
||||
|
||||
@Column()
|
||||
provider: 'email' | 'google';
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn()
|
||||
updatedAt: Date;
|
||||
|
||||
constructor(partial: Partial<User>) {
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user