shuttlepro-shared 1.4.68 → 1.4.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/models/Chatbot.js +13 -1
- package/models/FeedbackBot.js +4 -1
- package/package.json +2 -2
package/models/Chatbot.js
CHANGED
|
@@ -20,7 +20,7 @@ const ChatbotSchema = new Schema(
|
|
|
20
20
|
},
|
|
21
21
|
type: {
|
|
22
22
|
type: String,
|
|
23
|
-
enum: ["chatbot", "agent", "interactive"],
|
|
23
|
+
enum: ["chatbot", "agent", "interactive", "feedback-bot"],
|
|
24
24
|
default: "chatbot",
|
|
25
25
|
},
|
|
26
26
|
interactiveId: {
|
|
@@ -62,6 +62,18 @@ const ChatbotSchema = new Schema(
|
|
|
62
62
|
],
|
|
63
63
|
},
|
|
64
64
|
],
|
|
65
|
+
feedbackConfig: {
|
|
66
|
+
templateId: {
|
|
67
|
+
type: Schema.Types.Mixed,
|
|
68
|
+
default: null,
|
|
69
|
+
},
|
|
70
|
+
questions: [
|
|
71
|
+
{
|
|
72
|
+
question: { type: String, default: "" },
|
|
73
|
+
options: [{ type: String, default: "" }],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
65
77
|
},
|
|
66
78
|
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
67
79
|
);
|
package/models/FeedbackBot.js
CHANGED
|
@@ -85,5 +85,8 @@ FeedbackBotSchema.index({ workspaceId: 1, phoneNumber: 1, createdAt: -1 });
|
|
|
85
85
|
FeedbackBotSchema.index({ conversationId: 1 });
|
|
86
86
|
FeedbackBotSchema.index({ chatbotId: 1 });
|
|
87
87
|
FeedbackBotSchema.index({ status: 1 });
|
|
88
|
+
// Index for order_id based queries (allows multiple feedback per conversation)
|
|
89
|
+
FeedbackBotSchema.index({ workspaceId: 1, phoneNumber: 1, orderId: 1 });
|
|
90
|
+
|
|
91
|
+
module.exports = FeedbackBotSchema;
|
|
88
92
|
|
|
89
|
-
module.exports = FeedbackBotSchema;
|