update
This commit is contained in:
@ -1,11 +1,17 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { TrxCurrency } from "./trx_currencies";
|
||||
import { TrxCurrencyRateType } from "../types/trx";
|
||||
|
||||
@Entity("trx_currency_rates", { schema: "trx" })
|
||||
export class TrxCurrencyRates {
|
||||
export class TrxCurrencyRate {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
type: TrxCurrencyRateType;
|
||||
|
||||
@ManyToOne(() => TrxCurrency, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
base: TrxCurrency;
|
||||
@ -19,6 +25,12 @@ export class TrxCurrencyRates {
|
||||
})
|
||||
rate: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
deal_code: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
69
src/entity/trx_receivers.ts
Normal file
69
src/entity/trx_receivers.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { Status } from "../types/status";
|
||||
import { TrxCustomerType } from "../types/trx";
|
||||
import { TrxBank } from "./trx_banks";
|
||||
import { TrxBankSwift } from "./trx_bank_swifts";
|
||||
|
||||
@Entity("trx_receivers", { schema: "trx" })
|
||||
export class TrxReceiver {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 4096,
|
||||
})
|
||||
address: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
phone: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
email: string;
|
||||
|
||||
@ManyToOne(() => TrxBank, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
bank: TrxBank;
|
||||
|
||||
@ManyToOne(() => TrxBankSwift, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
bank_swift: TrxBankSwift;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
account_number: 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;
|
||||
}
|
||||
82
src/entity/trx_transactions.ts
Normal file
82
src/entity/trx_transactions.ts
Normal file
@ -0,0 +1,82 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
|
||||
import { TrxCurrency } from "./trx_currencies";
|
||||
import { TrxCustomer } from "./trx_customers";
|
||||
import { TrxCustomerAccount } from "./trx_customer_accounts";
|
||||
import { TrxReceiver } from "./trx_receivers";
|
||||
import { TrxCurrencyRate } from "./trx_currency_rates";
|
||||
import { TrxCustomerCost } from "./trx_customer_costs";
|
||||
|
||||
@Entity("trx_transactions", { schema: "trx" })
|
||||
export class TrxTransactions {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@ManyToOne(() => TrxCustomer, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
customer: TrxCustomer;
|
||||
|
||||
@ManyToOne(() => TrxCustomerAccount, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
customer_account: TrxCustomerAccount;
|
||||
|
||||
@ManyToOne(() => TrxReceiver, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
receiver: TrxReceiver;
|
||||
|
||||
@ManyToOne(() => TrxCurrency, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
base: TrxCurrency;
|
||||
|
||||
@Column({
|
||||
type: "float8",
|
||||
})
|
||||
base_amount: number;
|
||||
|
||||
@ManyToOne(() => TrxCurrency, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
target: TrxCurrency;
|
||||
|
||||
@ManyToOne(() => TrxCurrencyRate, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
target_rate: TrxCurrency;
|
||||
|
||||
@Column({
|
||||
type: "float8",
|
||||
})
|
||||
target_amount: number;
|
||||
|
||||
@ManyToOne(() => TrxCustomerCost, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
customer_cost: TrxCustomerCost;
|
||||
|
||||
@Column({
|
||||
type: "float8",
|
||||
})
|
||||
cost_amount: 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;
|
||||
}
|
||||
@ -10,4 +10,5 @@ export * from "../entity/trx_currencies";
|
||||
export * from "../entity/trx_currency_rates";
|
||||
export * from "../entity/trx_banks";
|
||||
export * from "../entity/trx_bank_swifts";
|
||||
export * from "../entity/trx_receivers";
|
||||
export * from "../types/trx";
|
||||
|
||||
@ -38,6 +38,13 @@ export enum TrxCostType {
|
||||
"percentage" = "percentage",
|
||||
}
|
||||
|
||||
export enum TrxCurrencyRateType {
|
||||
"reguler" = "reguler",
|
||||
"deal" = "deal",
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
export enum TrxTransactionStatus {
|
||||
"verify" = "verify",
|
||||
"open" = "open",
|
||||
|
||||
Reference in New Issue
Block a user