Merge branch 'main' of https://git.shiblysolution.id/TCEL-ANATL/entity
This commit is contained in:
@ -64,14 +64,23 @@ export class User {
|
|||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@UpdateDateColumn()
|
@UpdateDateColumn()
|
||||||
updated_at: Date;
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@DeleteDateColumn()
|
@DeleteDateColumn()
|
||||||
deleted_at: Date;
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
|
||||||
hashPassword() {
|
hashPassword() {
|
||||||
this.password = bcrypt.hashSync(this.password, 8);
|
this.password = bcrypt.hashSync(this.password, 8);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +1,55 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, JoinColumn, ManyToOne, ManyToMany } from 'typeorm';
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, JoinColumn, ManyToOne, ManyToMany } from "typeorm";
|
||||||
|
|
||||||
import { Status } from '../types/status';
|
import { Status } from "../types/status";
|
||||||
import { Application } from './application';
|
import { Application } from "./application";
|
||||||
import { User } from './users';
|
import { User } from "./users";
|
||||||
|
|
||||||
@Entity('user_roles')
|
@Entity("user_roles")
|
||||||
export class UserRole {
|
export class UserRole {
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@ManyToOne(() => Application, { onDelete: "RESTRICT" })
|
@ManyToOne(() => Application, { onDelete: "RESTRICT" })
|
||||||
@JoinColumn({ name: 'application' })
|
@JoinColumn({ name: "application" })
|
||||||
application: Application
|
application: Application;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
unique: false,
|
unique: false,
|
||||||
length: 128
|
length: 128,
|
||||||
})
|
})
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
type: 'jsonb'
|
type: "jsonb",
|
||||||
})
|
})
|
||||||
roles: string[];
|
roles: string[];
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64
|
length: 64,
|
||||||
})
|
})
|
||||||
status: Status;
|
status: Status;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true, length: 256 })
|
||||||
@UpdateDateColumn()
|
created_by: string;
|
||||||
updated_at: Date;
|
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@DeleteDateColumn()
|
@UpdateDateColumn()
|
||||||
deleted_at: Date;
|
updated_at: Date;
|
||||||
}
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user