mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
|
|
import { PayoutMode } from '../../types/payout-mode';
|
|
import { PayoutSnapshotEntity } from './payout-snapshot.entity';
|
|
|
|
@Entity({ name: 'payout_snapshot_entry' })
|
|
@Index('IDX_payout_snapshot_entry_snapshot_rank', ['snapshotId', 'rank'])
|
|
@Index('IDX_payout_snapshot_entry_address', ['address'])
|
|
export class PayoutSnapshotEntryEntity {
|
|
@PrimaryGeneratedColumn({ type: 'bigint' })
|
|
id: string;
|
|
|
|
@Column({ type: 'bigint' })
|
|
snapshotId: string;
|
|
|
|
@Column({ length: 16, type: 'varchar', default: 'pplns' })
|
|
payoutMode: PayoutMode;
|
|
|
|
@ManyToOne(() => PayoutSnapshotEntity, snapshot => snapshot.entries, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'snapshotId' })
|
|
snapshot: PayoutSnapshotEntity;
|
|
|
|
@Column({ length: 62, type: 'varchar' })
|
|
address: string;
|
|
|
|
@Column({ type: 'decimal' })
|
|
creditedDifficulty: number;
|
|
|
|
@Column({ type: 'bigint' })
|
|
acceptedShareCount: string;
|
|
|
|
@Column({ type: 'decimal' })
|
|
payoutWeight: number;
|
|
|
|
@Column({ type: 'bigint' })
|
|
grossPayoutSats: string;
|
|
|
|
@Column({ type: 'bigint' })
|
|
payoutSats: string;
|
|
|
|
@Column({ type: 'bigint', default: 0 })
|
|
balanceBeforeSats: string;
|
|
|
|
@Column({ type: 'bigint', default: 0 })
|
|
balanceAfterSats: string;
|
|
|
|
@Column({ type: 'boolean', default: true })
|
|
includedInCoinbase: boolean;
|
|
|
|
@Column({ length: 16, type: 'varchar', default: 'coinbase' })
|
|
rowType: 'coinbase' | 'pending';
|
|
|
|
@Column({ type: 'integer' })
|
|
rank: number;
|
|
|
|
@Column({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
|
|
createdAt: Date;
|
|
}
|