shuttlepro-shared 1.4.81 → 1.4.83

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/dump.rdb ADDED
Binary file
@@ -233,6 +233,7 @@ const AutomationCondition = new Schema({
233
233
  "withInShift",
234
234
  "afterShift",
235
235
  "orderConfirmation",
236
+ "bankDeposit",
236
237
  "orderPublish",
237
238
  "bankDeposit",
238
239
  "orderDelivery",
package/models/Chatbot.js CHANGED
@@ -77,6 +77,17 @@ const ChatbotSchema = new Schema(
77
77
  type: String,
78
78
  default: null,
79
79
  },
80
+ systemUrl: {
81
+ type: String,
82
+ default: null,
83
+ },
84
+ buttons: [
85
+ {
86
+ id: { type: String, default: "" },
87
+ label: { type: String, default: "" },
88
+ emoji: { type: String, default: "" },
89
+ },
90
+ ],
80
91
  },
81
92
  },
82
93
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
@@ -14,6 +14,11 @@ const CheckpointSchema = new Schema(
14
14
  ref: "Workspace",
15
15
  default: null,
16
16
  },
17
+ createdBy: {
18
+ type: Schema.Types.ObjectId,
19
+ ref: "User",
20
+ default: null,
21
+ },
17
22
  },
18
23
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
19
24
  );
@@ -0,0 +1,115 @@
1
+ const { Schema } = require("mongoose");
2
+
3
+ const EmailFeedbackReportSchema = new Schema(
4
+ {
5
+ workspaceId: {
6
+ type: Schema.Types.ObjectId,
7
+ ref: "Workspace",
8
+ required: true,
9
+ },
10
+ chatbotId: {
11
+ type: Schema.Types.ObjectId,
12
+ ref: "Chatbot",
13
+ required: true,
14
+ },
15
+ conversationId: {
16
+ type: Schema.Types.ObjectId,
17
+ ref: "Conversation",
18
+ required: true,
19
+ },
20
+ email: {
21
+ type: String,
22
+ required: true,
23
+ },
24
+ status: {
25
+ type: String,
26
+ enum: ["pending", "responded", "completed"],
27
+ default: "pending",
28
+ },
29
+ // Store the initial button click (good/bad)
30
+ initialResponse: {
31
+ buttonId: {
32
+ type: String, // "good" or "bad"
33
+ required: false,
34
+ },
35
+ buttonLabel: {
36
+ type: String,
37
+ required: false,
38
+ },
39
+ respondedAt: {
40
+ type: Date,
41
+ default: null,
42
+ },
43
+ },
44
+ // Store all answers if chatbot has follow-up questions
45
+ answers: [
46
+ {
47
+ question: {
48
+ type: String,
49
+ required: true,
50
+ },
51
+ answer: {
52
+ type: String,
53
+ required: true,
54
+ },
55
+ optionIndex: {
56
+ type: Number,
57
+ default: 0,
58
+ },
59
+ options: {
60
+ type: [String],
61
+ default: [],
62
+ },
63
+ answeredAt: {
64
+ type: Date,
65
+ default: Date.now,
66
+ },
67
+ },
68
+ ],
69
+ totalQuestions: {
70
+ type: Number,
71
+ default: 0,
72
+ },
73
+ completedQuestions: {
74
+ type: Number,
75
+ default: 0,
76
+ },
77
+ startedAt: {
78
+ type: Date,
79
+ default: Date.now,
80
+ },
81
+ completedAt: {
82
+ type: Date,
83
+ default: null,
84
+ },
85
+ // Store email message details
86
+ emailMessageId: {
87
+ type: String,
88
+ default: null,
89
+ },
90
+ emailSubject: {
91
+ type: String,
92
+ default: null,
93
+ },
94
+ // Store reference to order/workflow if applicable
95
+ orderId: {
96
+ type: String,
97
+ default: null,
98
+ },
99
+ workflowId: {
100
+ type: Schema.Types.ObjectId,
101
+ ref: "SocialWorkflow",
102
+ default: null,
103
+ },
104
+ },
105
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
106
+ );
107
+
108
+ // Index for faster queries
109
+ EmailFeedbackReportSchema.index({ workspaceId: 1, email: 1, createdAt: -1 });
110
+ EmailFeedbackReportSchema.index({ conversationId: 1 });
111
+ EmailFeedbackReportSchema.index({ chatbotId: 1 });
112
+ EmailFeedbackReportSchema.index({ status: 1 });
113
+ EmailFeedbackReportSchema.index({ workspaceId: 1, email: 1, orderId: 1 });
114
+
115
+ module.exports = EmailFeedbackReportSchema;
@@ -12,6 +12,17 @@ const EscalationLevelSchema = new Schema({
12
12
  type: Boolean,
13
13
  default: false,
14
14
  },
15
+ emailFeedbackChatbot: {
16
+ enabled: {
17
+ type: Boolean,
18
+ default: false,
19
+ },
20
+ chatbotId: {
21
+ type: Schema.Types.ObjectId,
22
+ ref: "Chatbot",
23
+ default: null,
24
+ },
25
+ },
15
26
  labels: [
16
27
  {
17
28
  type: Schema.Types.ObjectId,
@@ -0,0 +1,28 @@
1
+ const { Schema, model } = require("mongoose");
2
+
3
+ const OrderPreviewLogsSchema = new Schema(
4
+ {
5
+ workspaceId: {
6
+ type: Schema.Types.ObjectId,
7
+ ref: "Workspace",
8
+ default: null,
9
+ },
10
+ orderId: {
11
+ type: Schema.Types.ObjectId,
12
+ ref: "Order",
13
+ default: null,
14
+ },
15
+ userId: {
16
+ type: Schema.Types.ObjectId,
17
+ ref: "User",
18
+ default: null,
19
+ },
20
+ body: {
21
+ type: Schema.Types.Mixed,
22
+ default: {},
23
+ },
24
+ },
25
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
26
+ );
27
+
28
+ module.exports = model("OrderPreviewLogs", OrderPreviewLogsSchema);
package/models.js CHANGED
@@ -36,6 +36,7 @@ const DeviceInfo = require("./models/DeviceInfo");
36
36
  const Email = require("./models/Email");
37
37
  const EmailMessage = require("./models/EmailMessage");
38
38
  const EmailNotification = require("./models/EmailNotification");
39
+ const EmailFeedbackReport = require("./models/EmailFeedbackReport");
39
40
  const EscalationConfiguration = require("./models/EscalationConfiguration");
40
41
  const EscalationManager = require("./models/EscalationManager");
41
42
  const Faq = require("./models/Faq");
@@ -63,6 +64,7 @@ const Notification = require("./models/Notification");
63
64
  const NotificationSettings = require("./models/NotificationSettings");
64
65
  const Order = require("./models/Order");
65
66
  const OrderPdf = require("./models/OrderPdf");
67
+ const OrderPreviewLogs = require("./models/OrderPreviewLogs");
66
68
  const OrderProduct = require("./models/OrderProduct");
67
69
  const OrderQueue = require("./models/OrderQueue");
68
70
  const PostsAutomation = require("./models/PostsAutomation");
@@ -150,6 +152,7 @@ module.exports = {
150
152
  Email,
151
153
  EmailMessage,
152
154
  EmailNotification,
155
+ EmailFeedbackReport,
153
156
  EscalationConfiguration,
154
157
  EscalationManager,
155
158
  Faq,
@@ -177,6 +180,7 @@ module.exports = {
177
180
  NotificationSettings,
178
181
  Order,
179
182
  OrderPdf,
183
+ OrderPreviewLogs,
180
184
  OrderProduct,
181
185
  OrderQueue,
182
186
  PostsAutomation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.4.81",
3
+ "version": "1.4.83",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {