feat: add queue and assoc with whatsapps

This commit is contained in:
canove
2021-01-08 17:41:08 -03:00
parent a12c9db731
commit 9f99245dc4
14 changed files with 217 additions and 7 deletions

View File

@@ -10,9 +10,12 @@ import {
Default,
AllowNull,
HasMany,
Unique
Unique,
BelongsToMany
} from "sequelize-typescript";
import Queue from "./Queue";
import Ticket from "./Ticket";
import WhatsappQueue from "./WhatsappQueue";
@Table
class Whatsapp extends Model<Whatsapp> {
@@ -57,6 +60,9 @@ class Whatsapp extends Model<Whatsapp> {
@HasMany(() => Ticket)
tickets: Ticket[];
@BelongsToMany(() => Queue, () => WhatsappQueue)
queues: Array<Queue & { WhatsappQueue: WhatsappQueue }>;
}
export default Whatsapp;