//
// Copyright 2021 Vulcanize, Inc.
//

import { Entity, PrimaryColumn, Column, Index } from 'typeorm';
import { bigintTransformer } from '@cerc-io/util';

@Entity()
@Index(['blockNumber'])
export class MoveLiquidity {
  @PrimaryColumn('varchar')
    id!: string;

  @PrimaryColumn('varchar', { length: 66 })
    blockHash!: string;

  @Column('integer')
    blockNumber!: number;

  @Column('varchar')
    lender!: string;

  @Column('numeric', { transformer: bigintTransformer })
    tokenId!: bigint;

  @Column('varchar')
    pool!: string;

  @Column('integer')
    fromIndex!: number;

  @Column('integer')
    toIndex!: number;

  @Column('numeric', { transformer: bigintTransformer })
    _blockNumber!: bigint;

  @Column('numeric', { transformer: bigintTransformer })
    blockTimestamp!: bigint;

  @Column('varchar')
    transactionHash!: string;

  @Column('boolean', { default: false })
    isPruned!: boolean;

  @Column('boolean', { default: false })
    isRemoved!: boolean;
}
