This commit is contained in:
2025-12-03 14:24:04 +07:00
parent b1a3804dd6
commit 164fbb6908
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,39 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
@Entity("trx_transaction_deal_codes", { schema: "trx" })
export class TrxTransactionDealCode {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
length: 256,
})
code: string;
@Column({
type: "float8",
default: 0,
})
rate: number;
@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

@ -9,6 +9,7 @@ import { TrxCustomerUser } from "./trx_customer_users";
import { TrxTransactionPosition, TrxTransactionStatus, TrxTransactionType } from "../types/trx";
import { TrxVerification } from "./trx_verifications";
import { TrxPurposes } from "./trx_purposes";
import { TrxTransactionDealCode } from "./trx_transaction_deal_codes";
@Entity("trx_transactions", { schema: "trx" })
export class TrxTransaction {
@ -28,6 +29,10 @@ export class TrxTransaction {
})
type: TrxTransactionType;
@ManyToOne(() => TrxTransactionDealCode, { onDelete: "NO ACTION" })
@JoinColumn()
deal_code: TrxTransactionDealCode;
@ManyToOne(() => TrxCustomer, { onDelete: "NO ACTION" })
@JoinColumn()
customer: TrxCustomer;

View File

@ -18,6 +18,7 @@ export * from "../entity/trx_banks";
export * from "../entity/trx_bank_swifts";
export * from "../entity/trx_receivers";
export * from "../entity/trx_transactions";
export * from "../entity/trx_transaction_deal_codes";
export * from "../entity/trx_transaction_slas";
export * from "../entity/trx_transaction_amls";
export * from "../entity/trx_transaction_signatures";