From 6e9f468d186f61c680db55ba2b424d0d0e326f49 Mon Sep 17 00:00:00 2001 From: "fazri.is" Date: Tue, 6 Jan 2026 02:06:36 +0700 Subject: [PATCH 1/2] update --- src/entity/users.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/entity/users.ts b/src/entity/users.ts index c229805..77619fb 100644 --- a/src/entity/users.ts +++ b/src/entity/users.ts @@ -64,14 +64,23 @@ export class User { @CreateDateColumn() created_at: Date; + @Column({ nullable: true, length: 256 }) + created_by: string; + @Column({ nullable: true }) @UpdateDateColumn() 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; + hashPassword() { this.password = bcrypt.hashSync(this.password, 8); } From 6988b59827f7f514f493e7fd07d11a9014021f6c Mon Sep 17 00:00:00 2001 From: "fazri.is" Date: Tue, 6 Jan 2026 02:19:37 +0700 Subject: [PATCH 2/2] update --- src/entity/users_roles.ts | 81 ++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/src/entity/users_roles.ts b/src/entity/users_roles.ts index 10058c8..3f6aafc 100644 --- a/src/entity/users_roles.ts +++ b/src/entity/users_roles.ts @@ -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 { Application } from './application'; -import { User } from './users'; +import { Status } from "../types/status"; +import { Application } from "./application"; +import { User } from "./users"; -@Entity('user_roles') +@Entity("user_roles") export class UserRole { - @PrimaryGeneratedColumn('uuid') - id: string; + @PrimaryGeneratedColumn("uuid") + id: string; - @ManyToOne(() => Application, { onDelete: "RESTRICT" }) - @JoinColumn({ name: 'application' }) - application: Application + @ManyToOne(() => Application, { onDelete: "RESTRICT" }) + @JoinColumn({ name: "application" }) + application: Application; - @Column({ - nullable: false, - unique: false, - length: 128 - }) - name: string; + @Column({ + nullable: false, + unique: false, + length: 128, + }) + name: string; - @Column({ - nullable: false, - type: 'jsonb' - }) - roles: string[]; + @Column({ + nullable: false, + type: "jsonb", + }) + roles: string[]; - @Column({ - nullable: false, - length: 64 - }) - status: Status; + @Column({ + nullable: false, + length: 64, + }) + status: Status; - @Column() - @CreateDateColumn() - created_at: Date; + @Column() + @CreateDateColumn() + created_at: Date; - @Column({ nullable: true }) - @UpdateDateColumn() - updated_at: Date; + @Column({ nullable: true, length: 256 }) + created_by: string; - @Column({ nullable: true }) - @DeleteDateColumn() - deleted_at: Date; -} \ No newline at end of file + @Column({ nullable: true }) + @UpdateDateColumn() + 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; +}