This commit is contained in:
fro1991
2025-10-19 15:42:28 +07:00
parent 9cb6f82039
commit ff20ac8f55
4 changed files with 81 additions and 6 deletions

View File

@ -1,6 +1,7 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Status } from "../types/status"; import { Status } from "../types/status";
import { TrxBank } from "./trx_banks"; import { TrxBank } from "./trx_banks";
import { TrxCountry } from "./trx_countries";
@Entity("trx_bank_swifts", { schema: "trx" }) @Entity("trx_bank_swifts", { schema: "trx" })
export class TrxBankSwift { export class TrxBankSwift {
@ -17,6 +18,34 @@ export class TrxBankSwift {
}) })
code: string; code: string;
@Column({
nullable: true,
length: 256,
})
institution: string;
@ManyToOne(() => TrxCountry, { onDelete: "NO ACTION" })
@JoinColumn()
country: TrxCountry;
@Column({
nullable: true,
length: 256,
})
city: string;
@Column({
nullable: true,
length: 256,
})
address: string;
@Column({
nullable: true,
length: 256,
})
location: string;
@Column({ @Column({
nullable: true, nullable: true,
length: 64, length: 64,

View File

@ -1,6 +1,7 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Status } from "../types/status"; import { Status } from "../types/status";
import { TrxBankType } from "../types/trx"; import { TrxBankType } from "../types/trx";
import { TrxCountry } from "./trx_countries";
@Entity("trx_banks", { schema: "trx" }) @Entity("trx_banks", { schema: "trx" })
export class TrxBank { export class TrxBank {
@ -19,11 +20,9 @@ export class TrxBank {
}) })
name: string; name: string;
@Column({ @ManyToOne(() => TrxCountry, { onDelete: "NO ACTION" })
nullable: false, @JoinColumn()
length: 256, country: TrxCountry;
})
country: string;
@Column({ @Column({
nullable: true, nullable: true,

View File

@ -0,0 +1,46 @@
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
@Entity("trx_countries", { schema: "trx" })
export class TrxCountry {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({
nullable: true,
length: 256,
})
name: string;
@Column({
nullable: true,
length: 2,
})
alpha_3: string;
@Column({
nullable: true,
length: 2,
})
alpha_2: 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

@ -50,6 +50,7 @@ export * from "../entity/trx_customer_users";
export * from "../entity/trx_customer_user_refresh_tokens"; export * from "../entity/trx_customer_user_refresh_tokens";
export * from "../entity/trx_customer_user_activities"; export * from "../entity/trx_customer_user_activities";
export * from "../entity/trx_customer_costs"; export * from "../entity/trx_customer_costs";
export * from "../entity/trx_countries";
export * from "../entity/trx_banks"; export * from "../entity/trx_banks";
export * from "../entity/trx_bank_swifts"; export * from "../entity/trx_bank_swifts";
export * from "../types/trx"; export * from "../types/trx";