This commit is contained in:
2025-09-27 15:10:39 +07:00
parent d42d32e585
commit c2ee586d24
3 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,63 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm";
import { ActivityType } from "../types/action";
import { TrxCompanyUser } from "./trx_company_users";
@Entity("trx_company_user_activities")
export class TrxCompanyUserActivity {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => TrxCompanyUser, { onDelete: "NO ACTION", nullable: false })
@JoinColumn()
user: TrxCompanyUser;
@Index()
@Column({
type: "uuid",
})
refresh_token: string;
@Index()
@Column({
nullable: false,
length: 512,
})
module: string;
@Column({
nullable: false,
length: 2048,
})
description: string;
@Column({
nullable: true,
length: 1,
})
action: ActivityType;
@Column({
nullable: false,
length: 2048,
})
url: String;
@Column({
type: "text",
nullable: true,
})
data_body: String;
@Column()
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true })
@UpdateDateColumn()
updated_at: Date;
@Column({ nullable: true })
@DeleteDateColumn()
deleted_at: Date;
}

View File

@ -1,5 +1,6 @@
export * from "../entity/trx_companies"; export * from "../entity/trx_companies";
export * from "../entity/trx_company_users"; export * from "../entity/trx_company_users";
export * from "../entity/trx_company_user_activity";
export * from "../entity/trx_company_user_refresh_token"; export * from "../entity/trx_company_user_refresh_token";
export * from "../entity/trx_company_accounts"; export * from "../entity/trx_company_accounts";
export * from "../entity/trx_otp_email"; export * from "../entity/trx_otp_email";

View File

@ -30,3 +30,25 @@ export enum TrxConfigBankType {
"indonesia" = "indonesia", "indonesia" = "indonesia",
"domestic" = "domestic", "domestic" = "domestic",
} }
export enum TrxActivityType {
"Create" = "C",
"View" = "V",
"Update" = "U",
"Delete" = "D",
"Restore" = "T",
"Download" = "W",
"Login" = "L",
"Logout" = "O",
}
export enum TrxActivityTypeReverse {
"C" = "Create",
"V" = "View",
"U" = "Update",
"D" = "Delete",
"T" = "Restore",
"W" = "Download",
"L" = "Login",
"O" = "Logout",
}