import {
  Table,
  AutoIncrement,
  Column,
  CreatedAt,
  UpdatedAt,
  Model,
  PrimaryKey,
  HasMany
} from "sequelize-typescript";

import SchedulingNotify from "./SchedulingNotify";
import Ticket from "./Ticket";

@Table
class StatusChatEnd extends Model<StatusChatEnd> {
  @PrimaryKey
  @AutoIncrement
  @Column
  id: number;

  @Column
  name: string;

  @Column
  farewellMessage: string;

  @Column
  isDefault: boolean;

  @CreatedAt
  createdAt: Date;

  @UpdatedAt
  updatedAt: Date;

  @HasMany(() => SchedulingNotify)
  SchedulingNotifies: SchedulingNotify[];

  @HasMany(() => Ticket)
  tickets: Ticket[];
}

export default StatusChatEnd;
