mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
feat: add queue and assoc with whatsapps
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user