update trx-portal
This commit is contained in:
40
src/entity/trx_authenticators.ts
Normal file
40
src/entity/trx_authenticators.ts
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||||
|
|
||||||
|
import { Status } from "../types/status";
|
||||||
|
|
||||||
|
@Entity("trx_authenticators", { schema: "trx" })
|
||||||
|
export class TrxAuthenticator {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
authenticator: string;
|
||||||
|
|
||||||
|
@Column({ nullable: false })
|
||||||
|
generated_at: Date;
|
||||||
|
|
||||||
|
@Column({ type: "boolean", nullable: true })
|
||||||
|
is_valid: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
}
|
||||||
@ -23,10 +23,6 @@ export class TrxCif {
|
|||||||
})
|
})
|
||||||
status: Status;
|
status: Status;
|
||||||
|
|
||||||
@ManyToOne(() => TrxCompanyUser, (company_user) => company_user.id, { onDelete: "RESTRICT" })
|
|
||||||
@JoinColumn()
|
|
||||||
company_user: TrxCompanyUser;
|
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|||||||
@ -45,9 +45,6 @@ export class TrxCompanyUser {
|
|||||||
})
|
})
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@OneToMany(() => TrxConfigLevel, (configLevel) => configLevel.user, { cascade: true })
|
|
||||||
level: TrxConfigLevel[];
|
|
||||||
|
|
||||||
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION" })
|
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION" })
|
||||||
@JoinTable()
|
@JoinTable()
|
||||||
company: TrxCompany;
|
company: TrxCompany;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
import { TrxCompanyUser } from "./trx_company_users";
|
import { TrxPartnerUser } from "./trx_partner_users";
|
||||||
|
|
||||||
@Entity("trx_config_levels", { schema: "trx" })
|
@Entity("trx_config_levels", { schema: "trx" })
|
||||||
export class TrxConfigLevel {
|
export class TrxConfigLevel {
|
||||||
@ -22,9 +22,6 @@ export class TrxConfigLevel {
|
|||||||
})
|
})
|
||||||
status: Status;
|
status: Status;
|
||||||
|
|
||||||
@ManyToOne(() => TrxCompanyUser, (user) => user.level, { onDelete: "CASCADE" })
|
|
||||||
user: TrxCompanyUser;
|
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import bcrypt from "bcryptjs";
|
||||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||||
|
|
||||||
@Entity("trx_otp_emails", { schema: "trx" })
|
@Entity("trx_otp_emails", { schema: "trx" })
|
||||||
@ -5,6 +6,13 @@ export class TrxOtpEmail {
|
|||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
unique: true,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
codeid: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
@ -13,7 +21,6 @@ export class TrxOtpEmail {
|
|||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
unique: true,
|
|
||||||
length: 64,
|
length: 64,
|
||||||
})
|
})
|
||||||
email: string;
|
email: string;
|
||||||
@ -40,4 +47,12 @@ export class TrxOtpEmail {
|
|||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@DeleteDateColumn()
|
@DeleteDateColumn()
|
||||||
deleted_at: Date;
|
deleted_at: Date;
|
||||||
|
|
||||||
|
hashOtp() {
|
||||||
|
this.otp = bcrypt.hashSync(this.otp, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfOtpMatch(unencryptedOtp: string) {
|
||||||
|
return bcrypt.compareSync(unencryptedOtp, this.otp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import bcrypt from "bcryptjs";
|
||||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||||
|
|
||||||
@Entity("trx_otp_numbers", { schema: "trx" })
|
@Entity("trx_otp_numbers", { schema: "trx" })
|
||||||
@ -5,6 +6,13 @@ export class TrxOtpNumber {
|
|||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
unique: true,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
codeid: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
@ -13,7 +21,6 @@ export class TrxOtpNumber {
|
|||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
unique: true,
|
|
||||||
length: 64,
|
length: 64,
|
||||||
})
|
})
|
||||||
number: string;
|
number: string;
|
||||||
@ -39,4 +46,12 @@ export class TrxOtpNumber {
|
|||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@DeleteDateColumn()
|
@DeleteDateColumn()
|
||||||
deleted_at: Date;
|
deleted_at: Date;
|
||||||
|
|
||||||
|
hashOtp() {
|
||||||
|
this.otp = bcrypt.hashSync(this.otp, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfOtpMatch(unencryptedOtp: string) {
|
||||||
|
return bcrypt.compareSync(unencryptedOtp, this.otp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
49
src/entity/trx_partner_accounts.ts
Normal file
49
src/entity/trx_partner_accounts.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne, JoinTable } from "typeorm";
|
||||||
|
|
||||||
|
import { Status } from "../types/status";
|
||||||
|
import { TrxPartner } from "./trx_partners";
|
||||||
|
import { TrxCif } from "./trx_cifs";
|
||||||
|
|
||||||
|
@Entity("trx_partner_accounts", { schema: "trx" })
|
||||||
|
export class TrxPartnerAccount {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
account_number: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxPartner, (partner) => partner.partner_account, { onDelete: "RESTRICT" })
|
||||||
|
@JoinColumn()
|
||||||
|
partner: TrxPartner;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxCif, { onDelete: "RESTRICT", nullable: true })
|
||||||
|
@JoinTable()
|
||||||
|
cif: TrxCif;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
}
|
||||||
63
src/entity/trx_partner_user_activities.ts
Normal file
63
src/entity/trx_partner_user_activities.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, JoinColumn, ManyToOne } from "typeorm";
|
||||||
|
|
||||||
|
import { ActivityType } from "../types/action";
|
||||||
|
import { TrxPartnerUser } from "./trx_partner_users";
|
||||||
|
|
||||||
|
@Entity("trx_partner_user_activities", { schema: "trx" })
|
||||||
|
export class TrxPartnerUserActivity {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxPartnerUser, { onDelete: "NO ACTION", nullable: false })
|
||||||
|
@JoinColumn()
|
||||||
|
user: TrxPartnerUser;
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({
|
||||||
|
type: "uuid",
|
||||||
|
})
|
||||||
|
refresh_token: string;
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 512,
|
||||||
|
})
|
||||||
|
module: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 2048,
|
||||||
|
})
|
||||||
|
description: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 1,
|
||||||
|
})
|
||||||
|
action: ActivityType;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 2048,
|
||||||
|
})
|
||||||
|
url: String;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: "text",
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
data_body: String;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
}
|
||||||
64
src/entity/trx_partner_user_refresh_tokens.ts
Normal file
64
src/entity/trx_partner_user_refresh_tokens.ts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from "typeorm";
|
||||||
|
|
||||||
|
@Entity("trx_partner_user_refresh_tokens", { schema: "trx" })
|
||||||
|
export class TrxPartnerUserRefreshToken {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
refresh_token: string;
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({
|
||||||
|
type: "uuid",
|
||||||
|
})
|
||||||
|
id_user: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 4096,
|
||||||
|
})
|
||||||
|
user_agent: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 128,
|
||||||
|
})
|
||||||
|
os: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
device: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
platform: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
browser: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 32,
|
||||||
|
})
|
||||||
|
remote_addr: string;
|
||||||
|
|
||||||
|
@Column("timestamp")
|
||||||
|
expired_at: Date;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
}
|
||||||
90
src/entity/trx_partner_users.ts
Normal file
90
src/entity/trx_partner_users.ts
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
import bcrypt from "bcryptjs";
|
||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, OneToMany, JoinTable } from "typeorm";
|
||||||
|
|
||||||
|
import { Status } from "../types/status";
|
||||||
|
import { TrxPartner } from "./trx_partners";
|
||||||
|
|
||||||
|
@Entity("trx_partner_users", { schema: "trx" })
|
||||||
|
export class TrxPartnerUser {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
email: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
phone: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
select: false,
|
||||||
|
})
|
||||||
|
password: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
username: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
unique: false,
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxPartner, { onDelete: "RESTRICT" })
|
||||||
|
@JoinTable()
|
||||||
|
partner: TrxPartner;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: "jsonb",
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
level: string[];
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "uuid",
|
||||||
|
select: false,
|
||||||
|
})
|
||||||
|
reset_token: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
hashPassword() {
|
||||||
|
this.password = bcrypt.hashSync(this.password, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfPasswordMatch(unencryptedPassword: string) {
|
||||||
|
return bcrypt.compareSync(unencryptedPassword, this.password);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,19 +1,34 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
|
import { TrxCompany } from "./trx_companies";
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
import { TrxConfigNationality } from "./trx_config_nationalities";
|
import { TrxCif } from "./trx_cifs";
|
||||||
import { TrxTransactionRemittance } from "./trx_transaction_remittance";
|
import { TrxPartnerType } from "../types/trx";
|
||||||
import { TrxConfigBank } from "./trx_config_banks";
|
import { TrxPartnerAccount } from "./trx_partner_accounts";
|
||||||
|
|
||||||
@Entity("trx_recepient_remittances", { schema: "trx" })
|
@Entity("trx_partners", { schema: "trx" })
|
||||||
export class TrxRecepientRemittance {
|
export class TrxPartner {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionRemittance, (transaction_remittance) => transaction_remittance.recepient_remittance, { onDelete: "CASCADE" })
|
@OneToMany(() => TrxPartnerAccount, (partner_account) => partner_account.partner, { cascade: true, nullable: false })
|
||||||
transaction_remittance: TrxTransactionRemittance;
|
partner_account: TrxPartnerAccount[];
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
length: 4096,
|
||||||
|
})
|
||||||
|
type: TrxPartnerType;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
code: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
name: string;
|
name: string;
|
||||||
@ -22,23 +37,21 @@ export class TrxRecepientRemittance {
|
|||||||
nullable: false,
|
nullable: false,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
iban: string;
|
pic_name: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
unique: true,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
phone: string;
|
pic_phone: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
|
|
||||||
@JoinColumn()
|
|
||||||
recepient_bank: TrxConfigBank;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
unique: false,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
account_number: string;
|
pic_email: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
@ -46,10 +59,6 @@ export class TrxRecepientRemittance {
|
|||||||
})
|
})
|
||||||
address: string;
|
address: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn()
|
|
||||||
nationality: TrxConfigNationality;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
@ -1,16 +1,36 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
import { TrxConfigNationality } from "./trx_config_nationalities";
|
import { TrxConfigNationality } from "./trx_config_nationalities";
|
||||||
import { TrxTransactionSwift } from "./trx_transaction_swift";
|
|
||||||
import { TrxConfigBank } from "./trx_config_banks";
|
import { TrxConfigBank } from "./trx_config_banks";
|
||||||
|
import { TrxTransaction } from "./trx_transactions";
|
||||||
|
|
||||||
@Entity("trx_recepient_swifts", { schema: "trx" })
|
@Entity("trx_recepients", { schema: "trx" })
|
||||||
export class TrxRecepientSwift {
|
export class TrxRecepient {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionSwift, (transaction_swift) => transaction_swift.recepient_swift, { onDelete: "CASCADE" })
|
@OneToOne(() => TrxTransaction, (transaction) => transaction.recepient, { onDelete: "CASCADE" })
|
||||||
transaction_swift: TrxTransactionSwift;
|
transaction: TrxTransaction;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
|
||||||
|
@JoinColumn()
|
||||||
|
bank: TrxConfigBank;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
|
||||||
|
@JoinColumn()
|
||||||
|
nationality: TrxConfigNationality;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
account_number: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
iban: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
@ -18,27 +38,17 @@ export class TrxRecepientSwift {
|
|||||||
})
|
})
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: false,
|
|
||||||
length: 256,
|
|
||||||
})
|
|
||||||
iban: string;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
phone: string;
|
phone: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
|
|
||||||
@JoinColumn()
|
|
||||||
recepient_bank: TrxConfigBank;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
account_number: string;
|
email: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
@ -46,10 +56,6 @@ export class TrxRecepientSwift {
|
|||||||
})
|
})
|
||||||
address: string;
|
address: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn()
|
|
||||||
nationality: TrxConfigNationality;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
@ -1,72 +0,0 @@
|
|||||||
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 { TrxTransactionDomestic } from "./trx_transaction_domestic";
|
|
||||||
import { TrxConfigBank } from "./trx_config_banks";
|
|
||||||
|
|
||||||
@Entity("trx_sender_domestics", { schema: "trx" })
|
|
||||||
export class TrxSenderDomestic {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionDomestic, (transaction) => transaction.sender_domestic, { onDelete: "CASCADE" })
|
|
||||||
transaction_domestic: TrxTransactionDomestic;
|
|
||||||
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
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 { TrxTransactionRemittance } from "./trx_transaction_remittance";
|
|
||||||
import { TrxConfigBank } from "./trx_config_banks";
|
|
||||||
|
|
||||||
@Entity("trx_sender_remittances", { schema: "trx" })
|
|
||||||
export class TrxSenderRemittance {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionRemittance, (transaction) => transaction.sender_remittance, { onDelete: "CASCADE" })
|
|
||||||
transaction_remittance: TrxTransactionRemittance;
|
|
||||||
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@ -1,16 +1,29 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
import { TrxConfigNationality } from "./trx_config_nationalities";
|
import { TrxConfigNationality } from "./trx_config_nationalities";
|
||||||
import { TrxTransactionDomestic } from "./trx_transaction_domestic";
|
import { TrxPartnerAccount } from "./trx_partner_accounts";
|
||||||
|
import { TrxTransaction } from "./trx_transactions";
|
||||||
import { TrxConfigBank } from "./trx_config_banks";
|
import { TrxConfigBank } from "./trx_config_banks";
|
||||||
|
|
||||||
@Entity("trx_recepient_domestics", { schema: "trx" })
|
@Entity("trx_senders", { schema: "trx" })
|
||||||
export class TrxRecepientDomestic {
|
export class TrxSender {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionDomestic, (transaction_domestic) => transaction_domestic.recepient_domestic, { onDelete: "CASCADE" })
|
@OneToOne(() => TrxTransaction, (transaction) => transaction.sender, { onDelete: "CASCADE" })
|
||||||
transaction_domestic: TrxTransactionDomestic;
|
transaction: TrxTransaction;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
|
||||||
|
@JoinColumn()
|
||||||
|
nationality: TrxConfigNationality;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxPartnerAccount, { onDelete: "NO ACTION", nullable: true })
|
||||||
|
@JoinColumn()
|
||||||
|
partner_account: TrxPartnerAccount;
|
||||||
|
|
||||||
|
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
|
||||||
|
@JoinColumn()
|
||||||
|
bank: TrxConfigBank;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
@ -24,21 +37,11 @@ export class TrxRecepientDomestic {
|
|||||||
})
|
})
|
||||||
phone: string;
|
phone: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigBank, { onDelete: "NO ACTION", nullable: false })
|
|
||||||
@JoinColumn()
|
|
||||||
recepient_bank: TrxConfigBank;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 256,
|
length: 256,
|
||||||
})
|
})
|
||||||
account_number: string;
|
email: string;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 256,
|
|
||||||
})
|
|
||||||
iban: string;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
@ -46,10 +49,6 @@ export class TrxRecepientDomestic {
|
|||||||
})
|
})
|
||||||
address: string;
|
address: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigNationality, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn()
|
|
||||||
nationality: TrxConfigNationality;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
50
src/entity/trx_swifts.ts
Normal file
50
src/entity/trx_swifts.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
|
import { TrxTransaction } from "./trx_transactions";
|
||||||
|
|
||||||
|
@Entity("trx_swifts", { schema: "trx" })
|
||||||
|
export class TrxSwift {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
invoice: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
bic: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 4096,
|
||||||
|
})
|
||||||
|
file: string;
|
||||||
|
|
||||||
|
@OneToOne(() => TrxTransaction, (transaction) => transaction.swift, { onDelete: "CASCADE" })
|
||||||
|
transaction: TrxTransaction;
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
@ -1,13 +1,10 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
import { TrxCompany } from "./trx_companies";
|
|
||||||
import { TrxConfigSourceIncome } from "./trx_config_source_incomes";
|
import { TrxConfigSourceIncome } from "./trx_config_source_incomes";
|
||||||
import { TrxSenderDomestic } from "./trx_sender_domestic";
|
|
||||||
import { TrxRecepientDomestic } from "./trx_recepient_domestic";
|
|
||||||
import { TrxTransaction } from "./trx_transactions";
|
import { TrxTransaction } from "./trx_transactions";
|
||||||
import { TrxTransactionTypeStatus, TrxTransactionCorrespondentFees, TrxTransactionStatus } from "./../types/trx";
|
import { TrxTransactionTypeStatus, TrxTransactionCorrespondentFees, TrxTransactionStatus } from "../types/trx";
|
||||||
|
|
||||||
@Entity("trx_transaction_domestics", { schema: "trx" })
|
@Entity("trx_transaction_amounts", { schema: "trx" })
|
||||||
export class TrxTransactionDomestic {
|
export class TrxTransactionAmount {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@ -42,23 +39,15 @@ export class TrxTransactionDomestic {
|
|||||||
sub_total: number;
|
sub_total: number;
|
||||||
|
|
||||||
@Column({ type: "float8", nullable: false, default: 0 })
|
@Column({ type: "float8", nullable: false, default: 0 })
|
||||||
rate_idr: number;
|
rate: number;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransaction, (transaction) => transaction.transaction_domestic, { onDelete: "CASCADE" })
|
@OneToOne(() => TrxTransaction, (transaction) => transaction.transaction_amount, { onDelete: "CASCADE" })
|
||||||
transaction: TrxTransaction;
|
transaction: TrxTransaction;
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigSourceIncome, { onDelete: "NO ACTION", nullable: true })
|
@ManyToOne(() => TrxConfigSourceIncome, { onDelete: "NO ACTION", nullable: true })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
source_income: TrxConfigSourceIncome;
|
source_income: TrxConfigSourceIncome;
|
||||||
|
|
||||||
@OneToOne(() => TrxSenderDomestic, (sender) => sender.transaction_domestic, { cascade: true })
|
|
||||||
@JoinColumn()
|
|
||||||
sender_domestic: TrxSenderDomestic;
|
|
||||||
|
|
||||||
@OneToOne(() => TrxRecepientDomestic, (recepient) => recepient.transaction_domestic, { cascade: true })
|
|
||||||
@JoinColumn()
|
|
||||||
recepient_domestic: TrxRecepientDomestic;
|
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
@ -1,82 +0,0 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
|
||||||
import { TrxCompany } from "./trx_companies";
|
|
||||||
import { TrxConfigSourceIncome } from "./trx_config_source_incomes";
|
|
||||||
import { TrxSenderRemittance } from "./trx_sender_remittance";
|
|
||||||
import { TrxRecepientRemittance } from "./trx_recepient_remittance";
|
|
||||||
import { TrxTransaction } from "./trx_transactions";
|
|
||||||
import { TrxTransactionTypeStatus, TrxTransactionCorrespondentFees, TrxTransactionStatus } from "./../types/trx";
|
|
||||||
|
|
||||||
@Entity("trx_transaction_remittances", { schema: "trx" })
|
|
||||||
export class TrxTransactionRemittance {
|
|
||||||
@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_remittance, { onDelete: "CASCADE" })
|
|
||||||
transaction: TrxTransaction;
|
|
||||||
|
|
||||||
@ManyToOne(() => TrxConfigSourceIncome, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn()
|
|
||||||
source_income: TrxConfigSourceIncome;
|
|
||||||
|
|
||||||
@OneToOne(() => TrxSenderRemittance, (sender) => sender.transaction_remittance, { cascade: true })
|
|
||||||
@JoinColumn()
|
|
||||||
sender_remittance: TrxSenderRemittance;
|
|
||||||
|
|
||||||
@OneToOne(() => TrxRecepientRemittance, (recepient) => recepient.transaction_remittance, { cascade: true })
|
|
||||||
@JoinColumn()
|
|
||||||
recepient_remittance: TrxRecepientRemittance;
|
|
||||||
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@ -1,30 +1,40 @@
|
|||||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||||
import { TrxCompany } from "./trx_companies";
|
import { TrxTransactionTransferStatus, TrxTransactionStatus } from "../types/trx";
|
||||||
import { TrxTransactionDomestic } from "./trx_transaction_domestic";
|
import { TrxPartner } from "./trx_partners";
|
||||||
import { TrxTransactionTransferStatus, TrxTransactionStatus } from "./../types/trx";
|
import { TrxAuthenticator } from "./trx_authenticators";
|
||||||
import { TrxTransactionRemittance } from "./trx_transaction_remittance";
|
import { TrxSender } from "./trx_senders";
|
||||||
import { TrxTransactionSwift } from "./trx_transaction_swift";
|
import { TrxRecepient } from "./trx_recepients";
|
||||||
|
import { TrxSwift } from "./trx_swifts";
|
||||||
|
import { TrxTransactionAmount } from "./trx_transaction_amounts";
|
||||||
|
|
||||||
@Entity("trx_transactions", { schema: "trx" })
|
@Entity("trx_transactions", { schema: "trx" })
|
||||||
export class TrxTransaction {
|
export class TrxTransaction {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@ManyToOne(() => TrxCompany, { onDelete: "NO ACTION", nullable: false })
|
@ManyToOne(() => TrxAuthenticator, { onDelete: "RESTRICT", nullable: true })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
company: TrxCompany;
|
authenticator: TrxAuthenticator;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionDomestic, (transaction_domestic) => transaction_domestic.transaction, { cascade: true })
|
@ManyToOne(() => TrxPartner, { onDelete: "RESTRICT", nullable: false })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
transaction_domestic: TrxTransactionDomestic;
|
partner: TrxPartner;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionRemittance, (transaction_remittance) => transaction_remittance.transaction, { cascade: true })
|
@OneToOne(() => TrxSender, (sender) => sender.transaction, { cascade: true })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
transaction_remittance: TrxTransactionRemittance;
|
sender: TrxSender;
|
||||||
|
|
||||||
@OneToOne(() => TrxTransactionSwift, (transaction_swift) => transaction_swift.transaction, { cascade: true })
|
@OneToOne(() => TrxRecepient, (recepient) => recepient.transaction, { cascade: true })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
transaction_swift: TrxTransactionSwift;
|
recepient: TrxRecepient;
|
||||||
|
|
||||||
|
@OneToOne(() => TrxTransactionAmount, (transaction_amount) => transaction_amount.transaction, { cascade: true })
|
||||||
|
@JoinColumn()
|
||||||
|
transaction_amount: TrxTransactionAmount;
|
||||||
|
|
||||||
|
@OneToOne(() => TrxSwift, (swift) => swift.transaction, { cascade: true })
|
||||||
|
@JoinColumn()
|
||||||
|
swift: TrxSwift;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
@ -40,12 +50,9 @@ export class TrxTransaction {
|
|||||||
type_transfer: TrxTransactionTransferStatus;
|
type_transfer: TrxTransactionTransferStatus;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: false,
|
||||||
length: 4096,
|
default: false,
|
||||||
})
|
})
|
||||||
signatures: String;
|
|
||||||
|
|
||||||
@Column({ type: "boolean", nullable: true })
|
|
||||||
is_maker_approved: boolean;
|
is_maker_approved: boolean;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 100, nullable: true })
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
@ -57,7 +64,10 @@ export class TrxTransaction {
|
|||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
maker_approved_at: Date;
|
maker_approved_at: Date;
|
||||||
|
|
||||||
@Column({ type: "boolean", nullable: true })
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
is_checker_approved: boolean;
|
is_checker_approved: boolean;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 100, nullable: true })
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
@ -69,7 +79,10 @@ export class TrxTransaction {
|
|||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
checker_approved_at: Date;
|
checker_approved_at: Date;
|
||||||
|
|
||||||
@Column({ type: "boolean", nullable: true })
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
is_signer_approved: boolean;
|
is_signer_approved: boolean;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 100, nullable: true })
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
@ -81,41 +94,29 @@ export class TrxTransaction {
|
|||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
signer_approved_at: Date;
|
signer_approved_at: Date;
|
||||||
|
|
||||||
@Column({ type: "boolean", nullable: true })
|
|
||||||
is_tl_approved: boolean;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 100, nullable: true })
|
|
||||||
tl_approved_by: string;
|
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 4096, nullable: true })
|
|
||||||
tl_note: string;
|
|
||||||
|
|
||||||
@Column({ nullable: true })
|
|
||||||
tl_approved_at: Date;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 4096,
|
length: 4096,
|
||||||
})
|
})
|
||||||
tl_signatures: String;
|
is_valid_otp: String;
|
||||||
|
|
||||||
@Column({ type: "boolean", nullable: true })
|
@Column({ type: "boolean", nullable: true })
|
||||||
is_spv_approved: boolean;
|
is_release: boolean;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 100, nullable: true })
|
@Column({ type: "varchar", length: 100, nullable: true })
|
||||||
spv_approved_by: string;
|
release_by: string;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 4096, nullable: true })
|
@Column({ type: "varchar", length: 4096, nullable: true })
|
||||||
spv_note: string;
|
release_note: string;
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
spv_approved_at: Date;
|
release_at: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 4096,
|
length: 256,
|
||||||
})
|
})
|
||||||
spv_signatures: String;
|
release_file: string;
|
||||||
|
|
||||||
@Column({ type: "varchar", length: 4096, nullable: true })
|
@Column({ type: "varchar", length: 4096, nullable: true })
|
||||||
remark: string;
|
remark: string;
|
||||||
|
|||||||
@ -31,14 +31,15 @@ export * from "../entity/trx_region_administrativus";
|
|||||||
export * from "../entity/trx_region_aldeias";
|
export * from "../entity/trx_region_aldeias";
|
||||||
export * from "../entity/trx_region_sucos";
|
export * from "../entity/trx_region_sucos";
|
||||||
export * from "../entity/trx_registration";
|
export * from "../entity/trx_registration";
|
||||||
export * from "../entity/trx_sender_remittance";
|
|
||||||
export * from "../entity/trx_recepient_remittance";
|
|
||||||
export * from "../entity/trx_sender_domestic";
|
|
||||||
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_transactions";
|
||||||
export * from "../entity/trx_transaction_swift";
|
export * from "../entity/trx_transaction_amounts";
|
||||||
export * from "../entity/trx_sender_swift";
|
export * from "../entity/trx_senders";
|
||||||
export * from "../entity/trx_recepient_swift";
|
export * from "../entity/trx_recepients";
|
||||||
|
export * from "../entity/trx_swifts";
|
||||||
|
export * from "../entity/trx_authenticators";
|
||||||
|
export * from "../entity/trx_partners";
|
||||||
|
export * from "../entity/trx_partner_accounts";
|
||||||
|
export * from "../entity/trx_partner_user_activities";
|
||||||
|
export * from "../entity/trx_partner_user_refresh_tokens";
|
||||||
|
export * from "../entity/trx_partner_users";
|
||||||
export * from "../types/trx";
|
export * from "../types/trx";
|
||||||
|
|||||||
@ -15,6 +15,11 @@ export enum TrxTransactionTypeStatus {
|
|||||||
"rtgs" = "rtgs",
|
"rtgs" = "rtgs",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum TrxPartnerType {
|
||||||
|
"company" = "company",
|
||||||
|
"personal" = "personal",
|
||||||
|
}
|
||||||
|
|
||||||
export enum TrxTransactionTransferStatus {
|
export enum TrxTransactionTransferStatus {
|
||||||
"remittance" = "remittance",
|
"remittance" = "remittance",
|
||||||
"swift" = "swift",
|
"swift" = "swift",
|
||||||
|
|||||||
Reference in New Issue
Block a user