91 lines
2.2 KiB
TypeScript
91 lines
2.2 KiB
TypeScript
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';
|
|
|
|
@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(() => BrilinkTerminal, { onDelete: 'RESTRICT', nullable: true })
|
|
@JoinTable()
|
|
terminal: BrilinkTerminal
|
|
|
|
@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;
|
|
} |