This commit is contained in:
2025-10-06 13:56:30 +07:00
parent 0c592794d5
commit 08c79bb8eb
5 changed files with 259 additions and 0 deletions

View File

@ -0,0 +1,79 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Status } from "../types/status";
import { TrxConfigNationality } from "./trx_config_nationalities";
import { TrxTransactionSwift } from "./trx_transaction_swift";
import { TrxConfigBank } from "./trx_config_banks";
@Entity("trx_recepient_swifts", { schema: "trx" })
export class TrxRecepientSwift {
@PrimaryGeneratedColumn("uuid")
id: string;
@OneToOne(() => TrxTransactionSwift, (transaction_swift) => transaction_swift.recepient_swift, { onDelete: "CASCADE" })
transaction_swift: TrxTransactionSwift;
@Column({
nullable: false,
length: 256,
})
name: string;
@Column({
nullable: false,
length: 256,
})
iban: string;
@Column({
nullable: false,
length: 256,
})
phone: string;
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
@JoinColumn()
recepient_bank: TrxConfigBank;
@Column({
nullable: false,
length: 256,
})
account_number: string;
@Column({
nullable: true,
length: 4096,
})
address: string;
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
nationality: TrxConfigNationality;
@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

@ -0,0 +1,72 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Status } from "../types/status";
import { TrxConfigNationality } from "./trx_config_nationalities";
import { TrxCompanyAccount } from "./trx_company_accounts";
import { TrxTransactionSwift } from "./trx_transaction_swift";
import { TrxConfigBank } from "./trx_config_banks";
@Entity("trx_sender_swifts", { schema: "trx" })
export class TrxSenderSwift {
@PrimaryGeneratedColumn("uuid")
id: string;
@OneToOne(() => TrxTransactionSwift, (transaction) => transaction.sender_swift, { onDelete: "CASCADE" })
transaction_swift: TrxTransactionSwift;
@Column({
nullable: false,
length: 256,
})
name: string;
@Column({
nullable: false,
length: 256,
})
phone: string;
@Column({
nullable: true,
length: 4096,
})
address: string;
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
nationality: TrxConfigNationality;
@ManyToOne(() => TrxCompanyAccount, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
company_account: TrxCompanyAccount;
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
@JoinColumn()
sender_bank: TrxConfigBank;
@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

@ -0,0 +1,100 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { TrxCompany } from "./trx_companies";
import { TrxConfigSourceIncome } from "./trx_config_source_incomes";
import { TrxSenderSwift } from "./trx_sender_swift";
import { TrxRecepientSwift } from "./trx_recepient_swift";
import { TrxTransaction } from "./trx_transactions";
import { TrxTransactionTypeStatus, TrxTransactionCorrespondentFees, TrxTransactionStatus } from "./../types/trx";
@Entity("trx_transaction_swifts", { schema: "trx" })
export class TrxTransactionSwift {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
nullable: false,
length: 256,
})
type_transaction: TrxTransactionTypeStatus;
@Column({
nullable: true,
length: 256,
})
correspondent_fees: string;
@Column({ type: "float8" })
amount_overbooking: number;
@Column({ type: "float8", nullable: true })
transfer_amount: number;
@Column({ type: "float8", nullable: true })
transfer_total: number;
@Column({ type: "float8", nullable: true })
commission: number;
@Column({ type: "float8", nullable: true })
cost_of_sender: number;
@Column({ type: "float8", nullable: true })
sub_total: number;
@Column({ type: "float8", nullable: false, default: 0 })
rate_idr: number;
@OneToOne(() => TrxTransaction, (transaction) => transaction.transaction_swift, { onDelete: "CASCADE" })
transaction: TrxTransaction;
@ManyToOne(() => TrxConfigSourceIncome, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
source_income: TrxConfigSourceIncome;
@OneToOne(() => TrxSenderSwift, (sender) => sender.transaction_swift, { cascade: true })
@JoinColumn()
sender_swift: TrxSenderSwift;
@OneToOne(() => TrxRecepientSwift, (recepient) => recepient.transaction_swift, { cascade: true })
@JoinColumn()
recepient_swift: TrxRecepientSwift;
@Column({
nullable: true,
length: 4096,
})
file: String;
@Column({
nullable: true,
length: 256,
})
bic: String;
@Column({
nullable: true,
length: 4096,
})
invoice: String;
@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

@ -3,6 +3,7 @@ import { TrxCompany } from "./trx_companies";
import { TrxTransactionDomestic } from "./trx_transaction_domestic";
import { TrxTransactionTransferStatus, TrxTransactionStatus } from "./../types/trx";
import { TrxTransactionRemittance } from "./trx_transaction_remittance";
import { TrxTransactionSwift } from "./trx_transaction_swift";
@Entity("trx_transactions", { schema: "trx" })
export class TrxTransaction {
@ -21,6 +22,10 @@ export class TrxTransaction {
@JoinColumn()
transaction_remittance: TrxTransactionRemittance;
@OneToOne(() => TrxTransactionSwift, (transaction_swift) => transaction_swift.transaction, { cascade: true })
@JoinColumn()
transaction_swift: TrxTransactionSwift;
@Column({
nullable: false,
length: 256,

View File

@ -36,4 +36,7 @@ export * from "../entity/trx_recepient_domestic";
export * from "../entity/trx_transaction_domestic";
export * from "../entity/trx_transaction_remittance";
export * from "../entity/trx_transactions";
export * from "../entity/trx_transaction_swift";
export * from "../entity/trx_sender_swift";
export * from "../entity/trx_recepient_swift";
export * from "../types/trx";