diff --git a/src/entity/trx_countries.ts b/src/entity/trx_countries.ts index 8b635f7..f0e8b44 100644 --- a/src/entity/trx_countries.ts +++ b/src/entity/trx_countries.ts @@ -13,15 +13,15 @@ export class TrxCountry { @Column({ nullable: true, - length: 2, + length: 10, }) - alpha_3: string; + alpha_2: string; @Column({ nullable: true, - length: 2, + length: 10, }) - alpha_2: string; + alpha_3: string; @Column() @CreateDateColumn() diff --git a/src/entity/trx_currencies.ts b/src/entity/trx_currencies.ts new file mode 100644 index 0000000..efccf02 --- /dev/null +++ b/src/entity/trx_currencies.ts @@ -0,0 +1,45 @@ +import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm"; +import { TrxCountry } from "./trx_countries"; + +@Entity("trx_currencies", { schema: "trx" }) +export class TrxCurrency { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => TrxCountry, { onDelete: "NO ACTION" }) + @JoinColumn() + country: TrxCountry; + + @Column({ + nullable: true, + length: 10, + }) + code: string; + + @Column({ + nullable: true, + length: 256, + }) + name: 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; +} diff --git a/src/schema/trx.ts b/src/schema/trx.ts index 87dc11d..76a5a17 100644 --- a/src/schema/trx.ts +++ b/src/schema/trx.ts @@ -51,6 +51,7 @@ export * from "../entity/trx_customer_user_refresh_tokens"; export * from "../entity/trx_customer_user_activities"; export * from "../entity/trx_customer_costs"; export * from "../entity/trx_countries"; +export * from "../entity/trx_currencies"; export * from "../entity/trx_banks"; export * from "../entity/trx_bank_swifts"; export * from "../types/trx";