mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-09 22:57:24 +00:00
44 lines
837 B
TypeScript
44 lines
837 B
TypeScript
import { Column, Entity } from 'typeorm';
|
|
import { UserDto } from '../dtos';
|
|
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
|
|
|
@Entity({ name: 'user' })
|
|
export class UserEntity extends AbstractEntity<UserDto> {
|
|
@Column({
|
|
type: 'uuid',
|
|
default: () => 'gen_random_uuid()', // Use gen_random_uuid() for default value
|
|
nullable: false,
|
|
})
|
|
public uuid: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
unique: true,
|
|
})
|
|
email: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
})
|
|
public password: string;
|
|
|
|
@Column()
|
|
public firstName: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
})
|
|
public lastName: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
default: false,
|
|
})
|
|
public isUserVerified: boolean;
|
|
|
|
constructor(partial: Partial<UserEntity>) {
|
|
super();
|
|
Object.assign(this, partial);
|
|
}
|
|
}
|