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

import { Entity, PrimaryColumn, Column, Index } from 'typeorm';
import { decimalTransformer, bigintTransformer, bigintArrayTransformer } from '@cerc-io/util';
import { Decimal } from 'decimal.js';

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

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

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

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

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

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

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

  @Column('numeric', { array: true, transformer: bigintArrayTransformer })
    tokenIds!: bigint[];

  @Column('numeric', { transformer: decimalTransformer })
    lpAwarded!: Decimal;

  @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;
}
