This commit is contained in:
2025-09-18 00:11:30 +07:00
parent 034d69600a
commit adf4026367
3 changed files with 50 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateCol
import { Status } from "../types/status";
import { TrxCompany } from "./trx_companies";
import { TrxConfigLevel } from "./trx_config_levels";
@Entity("trx_company_users", { schema: "trx" })
export class TrxCompanyUser {
@ -44,7 +45,10 @@ export class TrxCompanyUser {
})
name: string;
@ManyToOne(() => TrxCompany, { onDelete: "CASCADE" })
@OneToMany(() => TrxConfigLevel, (level) => level.id, { onDelete: "NO ACTION" })
level: TrxConfigLevel[];
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION" })
@JoinTable()
company: TrxCompany;

View File

@ -0,0 +1,44 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm";
import { Status } from "../types/status";
@Entity("trx_config_levels", { schema: "trx" })
export class TrxConfigLevel {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
nullable: true,
length: 256,
})
name: string;
@Column({ type: "smallint", default: 0 })
level: Number;
@Column({
nullable: false,
length: 64,
})
status: Status;
@Column()
@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;
}

View File

@ -14,6 +14,7 @@ export * from "../entity/trx_config_educations";
export * from "../entity/trx_config_identity_types";
export * from "../entity/trx_config_munisipos";
export * from "../entity/trx_config_nationalities";
export * from "../entity/trx_config_levels";
export * from "../entity/trx_config_occupations";
export * from "../entity/trx_config_products";
export * from "../entity/trx_config_purposes";