import { Table, Column, CreatedAt, UpdatedAt, Model, PrimaryKey, AutoIncrement, AllowNull, Unique, BelongsToMany } from "sequelize-typescript"; import User from "./User"; import UserQueue from "./UserQueue"; import Whatsapp from "./Whatsapp"; import WhatsappQueue from "./WhatsappQueue"; @Table class Queue extends Model { @PrimaryKey @AutoIncrement @Column id: number; @AllowNull(false) @Unique @Column name: string; @AllowNull(false) @Unique @Column color: string; @Column greetingMessage: string; @CreatedAt createdAt: Date; @UpdatedAt updatedAt: Date; @BelongsToMany(() => Whatsapp, () => WhatsappQueue) whatsapps: Array; @BelongsToMany(() => User, () => UserQueue) users: Array; } export default Queue;