update
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { BrilinkBalanceDestinationType, BrilinkBalanceMutationActvity, BrilinkBalanceMutationStatus, BrilinkBalanceMutationType, BrilinkBalanceSourceType } from '../types/brilink';
|
||||
import { BrilinkBalance } from './brilink_balances.ts';
|
||||
|
||||
@Entity('brilink_balance_mutations', { schema: 'brilinks' })
|
||||
export class BrilinkBalanceMutation {
|
||||
@ -41,6 +42,10 @@ export class BrilinkBalanceMutation {
|
||||
})
|
||||
source_id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkBalance, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
source_balance: BrilinkBalance
|
||||
|
||||
@Column({
|
||||
length: 1024,
|
||||
nullable: false,
|
||||
@ -59,6 +64,10 @@ export class BrilinkBalanceMutation {
|
||||
})
|
||||
destination_id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkBalance, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
destination_balance: BrilinkBalance
|
||||
|
||||
@Column({
|
||||
length: 1024,
|
||||
nullable: false,
|
||||
|
||||
117
src/entity/brilink_balance_topup.ts
Normal file
117
src/entity/brilink_balance_topup.ts
Normal file
@ -0,0 +1,117 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { BrilinkBalanceDestinationType, BrilinkBalanceMutationActvity, BrilinkBalanceMutationStatus, BrilinkBalanceMutationType, BrilinkBalanceSourceType } from '../types/brilink';
|
||||
import { BrilinkBalance } from './brilink_balances.ts';
|
||||
|
||||
@Entity('brilink_balance_topups', { schema: 'brilinks' })
|
||||
export class BrilinkBalanceTopup {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
nullable: false,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
request_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
request_by: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
source_type: BrilinkBalanceSourceType;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
nullable: false,
|
||||
})
|
||||
source_id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkBalance, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
source_balance: BrilinkBalance
|
||||
|
||||
@Column({
|
||||
length: 1024,
|
||||
nullable: false,
|
||||
})
|
||||
source_name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
destination_type: BrilinkBalanceDestinationType;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
nullable: false,
|
||||
})
|
||||
destination_id: string;
|
||||
|
||||
@Column({
|
||||
length: 1024,
|
||||
nullable: false,
|
||||
})
|
||||
destination_name: string;
|
||||
|
||||
@ManyToOne(() => BrilinkBalance, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
destination_balance: BrilinkBalance
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: BrilinkBalanceMutationStatus;
|
||||
|
||||
@Column({
|
||||
length: 128,
|
||||
nullable: true,
|
||||
})
|
||||
reference: string;
|
||||
|
||||
@Column({
|
||||
length: 1024,
|
||||
nullable: true,
|
||||
})
|
||||
remarks: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
approve_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
approve_at: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -127,6 +127,7 @@ import { BrilinkMerchantTerminalUser } from './entity/brilink_merchant_terminal_
|
||||
import { BrilinkTerminalUserRefreshToken } from './entity/brilink_merchant_terminal_user_refresh_token'
|
||||
import { BrilinkBalance } from './entity/brilink_balances.ts'
|
||||
import { BrilinkBalanceMutation } from './entity/brilink_balance_mutations'
|
||||
import { BrilinkBalanceTopup } from './entity/brilink_balance_topup'
|
||||
|
||||
import { BriapiConfig } from './entity/briapi_configs'
|
||||
import { BriapiLog } from './entity/briapi_logs'
|
||||
@ -261,6 +262,7 @@ export {
|
||||
BrilinkTerminalUserRefreshToken,
|
||||
BrilinkBalance,
|
||||
BrilinkBalanceMutation,
|
||||
BrilinkBalanceTopup,
|
||||
|
||||
RemitBank,
|
||||
RemitConfigTransaction,
|
||||
|
||||
@ -61,5 +61,6 @@ export enum BrilinkBalanceMutationStatus {
|
||||
"process" = "process",
|
||||
"success" = "success",
|
||||
"fail" = "fail",
|
||||
"reject" = "reject"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user