diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..43962d8 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 5000, + "semi": true, + "singleQuote": false, + "tabWidth": 4, + "useTabs": true +} diff --git a/src/entity/remit_transactions.ts b/src/entity/remit_transactions.ts index 7127aed..3b6923f 100644 --- a/src/entity/remit_transactions.ts +++ b/src/entity/remit_transactions.ts @@ -8,6 +8,7 @@ import { RemitBeneficiary } from "./remit_beneficiaries"; import { RemitConfigPurpose } from "./remit_config_purposes"; import { RemitTransactionCurrencyType, RemitTransactionStatus } from "../types/remit"; import { RemitBeneficial } from "./remit_beneficials"; +import { RemitConfigRate } from "./remit_config_rates"; @Entity("remit_transactions", { schema: "remits" }) export class RemitTransaction { @@ -56,10 +57,20 @@ export class RemitTransaction { @Column({ nullable: false, - type: 'float8', + type: "float8", }) amount: Number; + @ManyToOne(() => RemitConfigRate, { onDelete: "RESTRICT", nullable: true }) + @JoinTable() + rate: RemitConfigRate; + + @Column({ + nullable: true, + type: "float8", + }) + total: Number; + @Column({ nullable: true, length: 4096, @@ -81,14 +92,14 @@ export class RemitTransaction { @Column({ nullable: true }) approved_at: Date; - @Column({ nullable: true, length: 256, }) + @Column({ nullable: true, length: 256 }) approved_by: string; @Column() @CreateDateColumn() created_at: Date; - @Column({ nullable: true, length: 256, }) + @Column({ nullable: true, length: 256 }) created_by: string; @Column({ nullable: true })