update brilink
This commit is contained in:
124
src/entity/brilink_balance_mutations.ts
Normal file
124
src/entity/brilink_balance_mutations.ts
Normal file
@ -0,0 +1,124 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { BrilinkBalanceDestinationType, BrilinkBalanceMutationActvity, BrilinkBalanceMutationStatus, BrilinkBalanceMutationType, BrilinkBalanceSourceType } from '../types/brilink';
|
||||
|
||||
@Entity('brilink_balance_mutations', { schema: 'brilinks' })
|
||||
export class BrilinkBalanceMutation {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
unique: true
|
||||
})
|
||||
code: string
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
activity: BrilinkBalanceMutationActvity;
|
||||
|
||||
@Column({ nullable: true })
|
||||
activity_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
type: BrilinkBalanceMutationType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
source_type: BrilinkBalanceSourceType;
|
||||
|
||||
@Column({
|
||||
length: 256,
|
||||
nullable: false,
|
||||
})
|
||||
source_id: string;
|
||||
|
||||
@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;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
prev_balance: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
last_balance: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: BrilinkBalanceMutationStatus;
|
||||
|
||||
@Column({
|
||||
length: 128,
|
||||
nullable: true,
|
||||
})
|
||||
reference: string;
|
||||
|
||||
@Column({
|
||||
length: 1024,
|
||||
nullable: true,
|
||||
})
|
||||
remarks: string;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,25 +1,32 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
import { BrilinkMerchant } from './brilink_merchants';
|
||||
import { BrilinkBalanceCode, BrilinkBalanceType } from '../types/brilink';
|
||||
import { BrilinkMerchantTerminal } from './brilink_merchant_terminals';
|
||||
import { BrilinkMerchantBalance } from './brilink_merchant_balances';
|
||||
|
||||
@Entity('brilink_merchant_terminal_balances', { schema: 'brilinks' })
|
||||
export class BrilinkMerchantTerminalBalance {
|
||||
@Entity('brilink_balances', { schema: 'brilinks' })
|
||||
export class BrilinkBalance {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantTerminal, { onDelete: 'RESTRICT' })
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
type: BrilinkBalanceType
|
||||
|
||||
@ManyToOne(() => BrilinkMerchant, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant: BrilinkMerchant
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantTerminal, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
merchant_terminal: BrilinkMerchantTerminal
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantBalance, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant_balance: BrilinkMerchantBalance
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
length: 64
|
||||
})
|
||||
code: string;
|
||||
code: BrilinkBalanceCode
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
@ -1,92 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { BrilinkMerchantBalanceHistoryActvity, BrilinkMerchantBalanceHistoryStatus, BrilinkMerchantBalanceHistoryType } from '../types/brilink';
|
||||
import { BrilinkTerminal } from './brilink_terminals';
|
||||
import { BrizziCard } from './brizzi_cards';
|
||||
import { BrilinkMerchantBalance } from './brilink_merchant_balances';
|
||||
import { BrilinkMerchant } from './brilink_merchants';
|
||||
import { BrilinkMerchantTerminal } from './brilink_merchant_terminals';
|
||||
|
||||
@Entity('brilink_merchant_balance_histories', { schema: 'brilinks' })
|
||||
export class BrilinkMerchantBalanceHistory {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkMerchant, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant: BrilinkMerchant
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantBalance, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
balance: BrilinkMerchantBalance
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
activity: BrilinkMerchantBalanceHistoryActvity;
|
||||
|
||||
@Column({ nullable: true })
|
||||
activity_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
type: BrilinkMerchantBalanceHistoryType;
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantTerminal, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
merchant_terminal: BrilinkMerchantTerminal
|
||||
|
||||
@Column({
|
||||
length: 128,
|
||||
nullable: false,
|
||||
})
|
||||
reference: string;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
prev_balance: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
last_balance: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: BrilinkMerchantBalanceHistoryStatus
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
import { BrilinkMerchant } from './brilink_merchants';
|
||||
|
||||
@Entity('brilink_merchant_balances', { schema: 'brilinks' })
|
||||
export class BrilinkMerchantBalance {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkMerchant, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant: BrilinkMerchant
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
default: 0
|
||||
})
|
||||
balance: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
balance_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;
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
import { Column, CreateDateColumn, DeleteDateColumn, Entity, JoinTable, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
import { BrilinkMerchantBalanceHistoryActvity, BrilinkMerchantBalanceHistoryStatus, BrilinkMerchantBalanceHistoryType } from '../types/brilink';
|
||||
import { BrilinkMerchantTerminalBalance } from './brilink_merchant_terminal_balances';
|
||||
import { BrilinkMerchantTerminal } from './brilink_merchant_terminals';
|
||||
import { BrilinkTerminal } from './brilink_terminals';
|
||||
import { BrizziCard } from './brizzi_cards';
|
||||
import { BrilinkMerchantBalanceHistory } from './brilink_merchant_balance_histories';
|
||||
|
||||
@Entity('brilink_merchant_terminal_balance_histories', { schema: 'brilinks' })
|
||||
export class BrilinkMerchantTerminalBalanceHistory {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantTerminal, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant_terminal: BrilinkMerchantTerminal
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantTerminalBalance, { onDelete: 'RESTRICT' })
|
||||
@JoinTable()
|
||||
merchant_terminal_balance: BrilinkMerchantTerminalBalance
|
||||
|
||||
@ManyToOne(() => BrilinkMerchantBalanceHistory, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
merchant_balance_history: BrilinkMerchantBalanceHistory
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
activity: BrilinkMerchantBalanceHistoryActvity;
|
||||
|
||||
@Column({ nullable: true })
|
||||
activity_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
type: BrilinkMerchantBalanceHistoryType;
|
||||
|
||||
@ManyToOne(() => BrizziCard, { onDelete: 'RESTRICT', nullable: true })
|
||||
@JoinTable()
|
||||
card: BrizziCard
|
||||
|
||||
@Column({
|
||||
length: 128,
|
||||
nullable: false,
|
||||
})
|
||||
reference: string;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
prev_balance: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
type: 'float8',
|
||||
nullable: false,
|
||||
})
|
||||
last_balance: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: BrilinkMerchantBalanceHistoryStatus
|
||||
|
||||
@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;
|
||||
}
|
||||
22
src/index.ts
22
src/index.ts
@ -105,9 +105,13 @@ import {
|
||||
BrilinkTerminalType,
|
||||
BrilinkTerminalCondition,
|
||||
BrilinkTerminalOnline,
|
||||
BrilinkMerchantBalanceHistoryActvity,
|
||||
BrilinkMerchantBalanceHistoryStatus,
|
||||
BrilinkMerchantBalanceHistoryType
|
||||
BrilinkBalanceType,
|
||||
BrilinkBalanceCode,
|
||||
BrilinkBalanceMutationType,
|
||||
BrilinkBalanceMutationActvity,
|
||||
BrilinkBalanceSourceType,
|
||||
BrilinkBalanceDestinationType,
|
||||
BrilinkBalanceMutationStatus,
|
||||
} from './types/brilink'
|
||||
|
||||
import { BrilinkMerchant } from './entity/brilink_merchants'
|
||||
@ -119,10 +123,8 @@ import { BrilinkMerchantTerminalHistory } from './entity/brilink_merchant_termin
|
||||
import { BrilinkMerchantTerminalMenu } from './entity/brilink_merchant_terminal_menus'
|
||||
import { BrilinkMerchantTerminalUser } from './entity/brilink_merchant_terminal_users'
|
||||
import { BrilinkTerminalUserRefreshToken } from './entity/brilink_merchant_terminal_user_refresh_token'
|
||||
import { BrilinkMerchantBalance } from './entity/brilink_merchant_balances'
|
||||
import { BrilinkMerchantBalanceHistory } from './entity/brilink_merchant_balance_histories'
|
||||
import { BrilinkMerchantTerminalBalance } from './entity/brilink_merchant_terminal_balances'
|
||||
import { BrilinkMerchantTerminalBalanceHistory } from './entity/brilink_merchant_terminal_balance_histories'
|
||||
import { BrilinkBalance } from './entity/brilink_balances.ts'
|
||||
import { BrilinkBalanceMutation } from './entity/brilink_balance_mutations'
|
||||
|
||||
import { BriapiConfig } from './entity/briapi_configs'
|
||||
import { BriapiLog } from './entity/briapi_logs'
|
||||
@ -253,10 +255,8 @@ export {
|
||||
BrilinkMerchantTerminalMenu,
|
||||
BrilinkMerchantTerminalUser,
|
||||
BrilinkTerminalUserRefreshToken,
|
||||
BrilinkMerchantBalance,
|
||||
BrilinkMerchantBalanceHistory,
|
||||
BrilinkMerchantTerminalBalance,
|
||||
BrilinkMerchantTerminalBalanceHistory,
|
||||
BrilinkBalance,
|
||||
BrilinkBalanceMutation,
|
||||
|
||||
RemitBank,
|
||||
RemitConfigTransaction,
|
||||
|
||||
@ -22,19 +22,44 @@ export enum BrilinkTerminalOnline {
|
||||
"offline" = "offline"
|
||||
}
|
||||
|
||||
export enum BrilinkMerchantBalanceHistoryStatus {
|
||||
export enum BrilinkBalanceType {
|
||||
"merchant" = "merchant",
|
||||
"terminal" = "terminal"
|
||||
}
|
||||
|
||||
export enum BrilinkBalanceCode {
|
||||
"brizzi" = "brizzi",
|
||||
"remittance" = "remittance"
|
||||
}
|
||||
|
||||
export enum BrilinkBalanceMutationType {
|
||||
"credit" = "credit",
|
||||
"debit" = "debit",
|
||||
}
|
||||
|
||||
export enum BrilinkBalanceMutationActvity {
|
||||
"topup" = "topup",
|
||||
"transfer" = "transfer",
|
||||
"withdrawal" = "withdrawal",
|
||||
}
|
||||
|
||||
export enum BrilinkBalanceSourceType {
|
||||
"account" = "account",
|
||||
"merchant" = "merchant",
|
||||
"terminal" = "terminal",
|
||||
}
|
||||
|
||||
export enum BrilinkBalanceDestinationType {
|
||||
"account" = "account",
|
||||
"merchant" = "merchant",
|
||||
"terminal" = "terminal",
|
||||
"brizzi" = "brizzi"
|
||||
}
|
||||
|
||||
export enum BrilinkBalanceMutationStatus {
|
||||
"pending" = "pending",
|
||||
"process" = "process",
|
||||
"success" = "success",
|
||||
"fail" = "fail",
|
||||
}
|
||||
|
||||
export enum BrilinkMerchantBalanceHistoryActvity {
|
||||
"topup" = "topup",
|
||||
"transfer" = "transfer",
|
||||
}
|
||||
|
||||
export enum BrilinkMerchantBalanceHistoryType {
|
||||
"credit" = "credit",
|
||||
"debit" = "debit",
|
||||
}
|
||||
Reference in New Issue
Block a user