26 lines
745 B
TypeScript
26 lines
745 B
TypeScript
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { ColumnBigIntTransformer } from '../../../utils/ColumnBigIntTransformer';
|
|
import { Invoice } from './Invoice';
|
|
|
|
@Entity('invoice_payments')
|
|
export class InvoicePayment {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@ManyToOne(() => Invoice, invoice => invoice.payments, { onDelete: 'CASCADE' })
|
|
@JoinColumn()
|
|
invoice: Invoice;
|
|
|
|
@Column({ length: 64, unique: true })
|
|
txHash: string;
|
|
|
|
@Column({ type: 'bigint', transformer: new ColumnBigIntTransformer() })
|
|
amountAtomic: string;
|
|
|
|
@Column({ type: 'int', default: 0 })
|
|
confirmations: number;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
}
|