diff --git a/src/entity/remit_transaction_risk.ts b/src/entity/remit_transaction_risk.ts new file mode 100644 index 0000000..c9dca9a --- /dev/null +++ b/src/entity/remit_transaction_risk.ts @@ -0,0 +1,83 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinTable } from "typeorm"; +import { RemitTransaction } from "./remit_transactions"; + +@Entity("remit_transaction_risk", { schema: "remits" }) +export class RemitTransactionRisk { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ + nullable: false, + unique: true, + length: 256, + }) + code: string; + + @Column({ + nullable: false, + unique: true, + length: 256, + }) + reference: string; + + @ManyToOne(() => RemitTransaction, { onDelete: "RESTRICT" }) + @JoinTable() + transaction: RemitTransaction; + + @Column({ + nullable: true, + length: 256, + }) + category: String; + + @Column({ + nullable: true, + length: 256, + }) + name: String; + + @Column({ + nullable: true, + length: 256, + }) + ref_table: String; + + @Column({ + nullable: true, + length: 256, + }) + ref_id: String; + + @Column({ + nullable: true, + length: 256, + }) + ref_name: String; + + @Column({ + nullable: false, + type: "int2", + }) + ref_value: 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; +} diff --git a/src/entity/remit_transactions.ts b/src/entity/remit_transactions.ts index 2e3c55c..3faf105 100644 --- a/src/entity/remit_transactions.ts +++ b/src/entity/remit_transactions.ts @@ -119,6 +119,12 @@ export class RemitTransaction { }) callback_count: Number; + @Column({ + nullable: false, + type: "int2", + }) + risk_score: Number; + @Column({ nullable: true }) callback_at: Date; diff --git a/src/index.ts b/src/index.ts index cfe6d73..e8091a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -123,6 +123,7 @@ import { RemitIndoProvince } from "./entity/remit_indo_provinces"; import { RemitIndoCity } from "./entity/remit_indo_cities"; import { RemitPartnerCallback } from "./entity/remit_partner_callbacks"; import { RemitTransactionPartnerCallbackLog } from "./entity/remit_transaction_partner_callback_logs"; +import { RemitTransactionRisk } from "./entity/remit_transaction_risk"; import { RemitPartnerType, // @@ -422,6 +423,7 @@ export { RemitSender, RemitSenderIdentity, RemitTransaction, + RemitTransactionRisk, RemitIndoProvince, RemitIndoCity, RemitPartnerCallback,