shuttlepro-shared 1.5.6 → 1.5.7
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/FeedbackBot.js +12 -0
- package/models/Shop.js +2 -1
- package/package.json +1 -1
package/models/FeedbackBot.js
CHANGED
|
@@ -66,6 +66,16 @@ const FeedbackBotSchema = new Schema(
|
|
|
66
66
|
type: Date,
|
|
67
67
|
default: null,
|
|
68
68
|
},
|
|
69
|
+
type: {
|
|
70
|
+
type: String,
|
|
71
|
+
enum: ["shop", "order"],
|
|
72
|
+
default: "order",
|
|
73
|
+
},
|
|
74
|
+
shopId: {
|
|
75
|
+
type: Schema.Types.ObjectId,
|
|
76
|
+
ref: "Shop",
|
|
77
|
+
default: null,
|
|
78
|
+
},
|
|
69
79
|
// Store reference to order/workflow if applicable
|
|
70
80
|
orderId: {
|
|
71
81
|
type: String,
|
|
@@ -91,6 +101,8 @@ FeedbackBotSchema.index({ chatbotId: 1 });
|
|
|
91
101
|
FeedbackBotSchema.index({ status: 1 });
|
|
92
102
|
// Index for order_id based queries (allows multiple feedback per conversation)
|
|
93
103
|
FeedbackBotSchema.index({ workspaceId: 1, phoneNumber: 1, orderId: 1 });
|
|
104
|
+
FeedbackBotSchema.index({ shopId: 1 });
|
|
105
|
+
FeedbackBotSchema.index({ type: 1 });
|
|
94
106
|
|
|
95
107
|
module.exports = FeedbackBotSchema;
|
|
96
108
|
|
package/models/Shop.js
CHANGED