2022-12-05 11:56:44 -06:00
|
|
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
|
|
|
|
import { TagEntity } from './tag.entity';
|
2022-02-03 10:06:44 -06:00
|
|
|
|
|
|
|
|
@Entity('users')
|
|
|
|
|
export class UserEntity {
|
|
|
|
|
@PrimaryGeneratedColumn('uuid')
|
2022-06-25 19:53:06 +02:00
|
|
|
id!: string;
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2022-07-04 20:20:43 +01:00
|
|
|
@Column({ default: '' })
|
2022-06-25 19:53:06 +02:00
|
|
|
firstName!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-07-04 20:20:43 +01:00
|
|
|
@Column({ default: '' })
|
2022-06-25 19:53:06 +02:00
|
|
|
lastName!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-07-04 20:20:43 +01:00
|
|
|
@Column({ default: false })
|
2022-06-25 19:53:06 +02:00
|
|
|
isAdmin!: boolean;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-02-03 10:06:44 -06:00
|
|
|
@Column()
|
2022-06-25 19:53:06 +02:00
|
|
|
email!: string;
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2022-11-14 21:24:25 -05:00
|
|
|
@Column({ default: '', select: false })
|
2022-06-25 19:53:06 +02:00
|
|
|
password?: string;
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2022-11-14 21:24:25 -05:00
|
|
|
@Column({ default: '', select: false })
|
2022-06-25 19:53:06 +02:00
|
|
|
salt?: string;
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2022-12-03 22:59:24 -05:00
|
|
|
@Column({ default: '', select: false })
|
|
|
|
|
oauthId!: string;
|
|
|
|
|
|
2022-07-04 20:20:43 +01:00
|
|
|
@Column({ default: '' })
|
2022-06-25 19:53:06 +02:00
|
|
|
profileImagePath!: string;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-07-04 20:20:43 +01:00
|
|
|
@Column({ default: true })
|
2022-06-27 15:13:07 -05:00
|
|
|
shouldChangePassword!: boolean;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-02-03 10:06:44 -06:00
|
|
|
@CreateDateColumn()
|
2022-06-25 19:53:06 +02:00
|
|
|
createdAt!: string;
|
2022-11-07 16:53:47 -05:00
|
|
|
|
|
|
|
|
@DeleteDateColumn()
|
|
|
|
|
deletedAt?: Date;
|
2022-12-05 11:56:44 -06:00
|
|
|
|
|
|
|
|
@OneToMany(() => TagEntity, (tag) => tag.user)
|
|
|
|
|
tags!: TagEntity[];
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|