import { Entity, Index, Property } from '@mikro-orm/core';
import { BaseEntity } from '../../../common/entities/base.entity';

@Entity({ tableName: 'schedules' })
@Index({ properties: ['restId'] })
export class Schedule extends BaseEntity {
  @Property({ type: 'int' })
  weekDay!: number;

  @Property({ type: 'time' })
  openTime!: string;

  @Property({ type: 'time' })
  closeTime!: string;

  @Property({ default: true })
  isActive: boolean = true;

  @Property()
  restId!: string;
}
