import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm';
import { Place } from './place.entity';

@Entity()
export class AvailableDate {
  @PrimaryColumn()
  idPlace: number;

  @JoinColumn({ name: 'idPlace' })
  @ManyToOne(() => Place, (place) => place.availableDates, { nullable: false })
  place: Place;

  @Column()
  startDate: Date;
  @Column()
  endDate: Date;
}
