import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Timestamp } from './timestamp';
import { Bid } from './bid.entity';

@Entity('bid_histories')
export class BidHistory extends Timestamp {
  @PrimaryGeneratedColumn('increment')
  id: number;

  @Column({ default: 0 })
  price: number;

  @ManyToOne(() => Bid, (bid) => bid.histories, { onDelete: 'CASCADE' })
  bid: Bid;
}
