shuttlepro-shared 1.5.16 → 1.5.18
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 +27 -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,31 @@ 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
|
+
title: { type: String, default: "" },
|
|
129
|
+
},
|
|
130
|
+
default: null,
|
|
131
|
+
},
|
|
132
|
+
mergedConversations: {
|
|
133
|
+
type: [
|
|
134
|
+
{
|
|
135
|
+
id: { type: String, default: "" },
|
|
136
|
+
threadId: { type: String, default: "" },
|
|
137
|
+
title: { type: String, default: "" },
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
default: [],
|
|
141
|
+
},
|
|
142
|
+
mergedAt: { type: Date, default: null },
|
|
143
|
+
mergedBy: {
|
|
144
|
+
type: Schema.Types.ObjectId,
|
|
145
|
+
ref: "User",
|
|
146
|
+
default: null,
|
|
147
|
+
},
|
|
121
148
|
},
|
|
122
149
|
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
123
150
|
);
|