mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
feat: start adding auto reply
This commit is contained in:
@@ -8,7 +8,8 @@ import {
|
||||
AutoIncrement,
|
||||
AllowNull,
|
||||
Unique,
|
||||
BelongsToMany
|
||||
BelongsToMany,
|
||||
HasMany
|
||||
} from "sequelize-typescript";
|
||||
import User from "./User";
|
||||
import UserQueue from "./UserQueue";
|
||||
@@ -33,6 +34,9 @@ class Queue extends Model<Queue> {
|
||||
@Column
|
||||
color: string;
|
||||
|
||||
@Column
|
||||
greetingMessage: string;
|
||||
|
||||
@CreatedAt
|
||||
createdAt: Date;
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ class Whatsapp extends Model<Whatsapp> {
|
||||
@Column
|
||||
retries: number;
|
||||
|
||||
@Column(DataType.TEXT)
|
||||
greetingMessage: string;
|
||||
|
||||
@Default(false)
|
||||
@AllowNull
|
||||
@Column
|
||||
@@ -63,6 +66,9 @@ class Whatsapp extends Model<Whatsapp> {
|
||||
|
||||
@BelongsToMany(() => Queue, () => WhatsappQueue)
|
||||
queues: Array<Queue & { WhatsappQueue: WhatsappQueue }>;
|
||||
|
||||
@HasMany(() => WhatsappQueue)
|
||||
whatsappQueues: WhatsappQueue[];
|
||||
}
|
||||
|
||||
export default Whatsapp;
|
||||
|
||||
@@ -4,13 +4,17 @@ import {
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
Model,
|
||||
ForeignKey
|
||||
ForeignKey,
|
||||
BelongsTo
|
||||
} from "sequelize-typescript";
|
||||
import Queue from "./Queue";
|
||||
import Whatsapp from "./Whatsapp";
|
||||
|
||||
@Table
|
||||
class WhatsappQueue extends Model<WhatsappQueue> {
|
||||
@Column
|
||||
optionNumber: number;
|
||||
|
||||
@ForeignKey(() => Whatsapp)
|
||||
@Column
|
||||
whatsappId: number;
|
||||
@@ -24,6 +28,9 @@ class WhatsappQueue extends Model<WhatsappQueue> {
|
||||
|
||||
@UpdatedAt
|
||||
updatedAt: Date;
|
||||
|
||||
@BelongsTo(() => Queue)
|
||||
queue: Queue;
|
||||
}
|
||||
|
||||
export default WhatsappQueue;
|
||||
|
||||
Reference in New Issue
Block a user