import {
  Entity,
  OneToMany,
  Column,
  UpdateDateColumn,
  CreateDateColumn
} from 'typeorm'
import { Catalogo } from './Catalogo'
import { Prestamo } from './Prestamo'

@Entity()
export class Mesa extends Catalogo {
  @Column({ default: false })
  activo: boolean

  @UpdateDateColumn()
  updatedAt: Date

  @CreateDateColumn()
  createdAt: Date

  @OneToMany(
    (type) => Prestamo,
    (prestamo) => prestamo.mesa
  )
  prestamos: Prestamo[]
}
