add: progress authentication

This commit is contained in:
ilham
2021-12-06 09:12:52 +07:00
parent 5bbb650acd
commit 2b5abc7689
12 changed files with 154 additions and 40 deletions

View File

@@ -1,45 +1,25 @@
import {
Entity,
Column,
PrimaryGeneratedColumn,
UpdateDateColumn,
DeleteDateColumn,
VersionColumn,
CreateDateColumn,
PrimaryGeneratedColumn, BeforeInsert,
} from 'typeorm';
import { BaseModel } from '../../config/basemodel.entity';
import { hashPassword } from '../../helper/hash_password';
@Entity()
export class User {
export class User extends BaseModel {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column()
firstName: string;
username: string;
@Column()
lastName: string;
password: string;
@Column()
salt: string;
@Column({ default: true })
isActive: boolean;
@CreateDateColumn({
type: 'timestamp with time zone',
nullable: false,
})
createdAt: Date;
@UpdateDateColumn({
type: 'timestamp with time zone',
nullable: false,
})
updatedAt: Date;
@DeleteDateColumn({
type: 'timestamp with time zone',
nullable: true,
})
deletedAt: Date;
@VersionColumn()
version: number;
}