shuttlepro-shared 1.5.15 → 1.5.17
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/Conversation.js +25 -0
- package/models/Workspace.js +1 -0
- package/package.json +1 -1
package/models/Conversation.js
CHANGED
|
@@ -69,6 +69,8 @@ const conversationSchema = new mongoose.Schema(
|
|
|
69
69
|
messageId: { type: String, default: "" },
|
|
70
70
|
profileId: { type: Schema.Types.ObjectId, ref: "Profile" },
|
|
71
71
|
conversationCloseTime: { type: String },
|
|
72
|
+
// Cycle start for Gmail/SMTP reopen (customer or agent after close)
|
|
73
|
+
lastCustomerReopenAt: { type: Date, default: null },
|
|
72
74
|
workspaceId: { type: Schema.Types.ObjectId, ref: "Workspace" },
|
|
73
75
|
postId: { type: String, default: "" },
|
|
74
76
|
postUrl: { type: String, default: "" },
|
|
@@ -118,6 +120,29 @@ const conversationSchema = new mongoose.Schema(
|
|
|
118
120
|
workflowQueueActive: { type: Boolean, default: false },
|
|
119
121
|
workflowInitiatedAt: { type: Date, default: null },
|
|
120
122
|
initialWorkflowMessageId: { type: String, default: "" },
|
|
123
|
+
// Soft-merge for Gmail/SMTP email chats only (provider threads stay separate)
|
|
124
|
+
mergedInto: {
|
|
125
|
+
type: {
|
|
126
|
+
id: { type: String, default: "" },
|
|
127
|
+
threadId: { type: String, default: "" },
|
|
128
|
+
},
|
|
129
|
+
default: null,
|
|
130
|
+
},
|
|
131
|
+
mergedConversations: {
|
|
132
|
+
type: [
|
|
133
|
+
{
|
|
134
|
+
id: { type: String, default: "" },
|
|
135
|
+
threadId: { type: String, default: "" },
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
default: [],
|
|
139
|
+
},
|
|
140
|
+
mergedAt: { type: Date, default: null },
|
|
141
|
+
mergedBy: {
|
|
142
|
+
type: Schema.Types.ObjectId,
|
|
143
|
+
ref: "User",
|
|
144
|
+
default: null,
|
|
145
|
+
},
|
|
121
146
|
},
|
|
122
147
|
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
123
148
|
);
|
package/models/Workspace.js
CHANGED
|
@@ -411,6 +411,7 @@ const workspaceSchema = new mongoose.Schema(
|
|
|
411
411
|
default: false,
|
|
412
412
|
},
|
|
413
413
|
productNavigationLink: { type: String, default: "" },
|
|
414
|
+
productCategory: { type: String, default: "" },
|
|
414
415
|
},
|
|
415
416
|
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
416
417
|
);
|