shuttlepro-shared 1.4.97 → 1.4.99

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.
@@ -49,6 +49,10 @@ const activitySchema = new mongoose.Schema({
49
49
  sender: { type: String, required: "" },
50
50
  members: [],
51
51
  closedBy: {},
52
+ /** First outbound Meta (page/IG account) reply timestamp (ISO), before an agent owned the thread */
53
+ firstMetaReplyAt: { type: String, required: false },
54
+ /** True when Meta replied while conversation had no assignee (CRM / performance split) */
55
+ metaReplyBeforeAgent: { type: Boolean, default: false },
52
56
  });
53
57
 
54
58
  const totalActivitySchema = new mongoose.Schema({
@@ -11,6 +11,11 @@ const CategorySchema = new Schema(
11
11
  ref: "Workspace",
12
12
  default: null,
13
13
  },
14
+ websiteId: {
15
+ type: Schema.Types.ObjectId,
16
+ ref: "Website",
17
+ default: null,
18
+ },
14
19
  oldId: { type: String, default: "" },
15
20
  webCategoryId: { type: Number, default: null },
16
21
  parentId: { type: Schema.Types.ObjectId, ref: "Category", default: null },
@@ -19,6 +19,11 @@ const LocationSchema = new Schema(
19
19
  ref: "Workspace",
20
20
  default: null,
21
21
  },
22
+ websiteId: {
23
+ type: Schema.Types.ObjectId,
24
+ ref: "Website",
25
+ default: null,
26
+ },
22
27
  legacy: { type: Boolean, default: false },
23
28
  name: { type: String, default: "" },
24
29
  isDeleted: { type: Boolean, default: false },
package/models/Order.js CHANGED
@@ -109,6 +109,11 @@ const OrderSchema = new Schema(
109
109
  ref: "Workspace",
110
110
  default: null,
111
111
  },
112
+ websiteId: {
113
+ type: Schema.Types.ObjectId,
114
+ ref: "Website",
115
+ default: null,
116
+ },
112
117
  orderType: { type: String, default: "" },
113
118
  barCode: { type: String, default: "" },
114
119
  quantity: { type: Number, default: 0 },
@@ -182,6 +187,8 @@ const OrderSchema = new Schema(
182
187
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
183
188
  );
184
189
 
190
+ OrderSchema.index({ workspaceId: 1, websiteId: 1, webOrderId: 1 });
191
+
185
192
  OrderSchema.virtual("checkPoints", {
186
193
  ref: "Checkpoint",
187
194
  localField: "_id",
package/models/Product.js CHANGED
@@ -61,6 +61,8 @@ const ProductSchema = new Schema(
61
61
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
62
62
  );
63
63
 
64
+ ProductSchema.index({ workspaceId: 1, websiteId: 1, webProductId: 1 });
65
+
64
66
  ProductSchema.virtual("productCategories", {
65
67
  ref: "ProductCategory",
66
68
  localField: "_id",
@@ -11,6 +11,7 @@ const ProductQueueSchema = new mongoose.Schema(
11
11
  userId: { type: String, default: "" },
12
12
  workspaceName: { type: String, default: "" },
13
13
  workspaceId: { type: String, default: "" },
14
+ websiteId: { type: String, default: "" },
14
15
  webhookData: { type: String, default: "" },
15
16
  websiteId: { type: String, default: "" },
16
17
  },
@@ -359,6 +359,10 @@ const workspaceSchema = new mongoose.Schema(
359
359
  tokens: { type: Number, default: 0 },
360
360
  limit: { type: Number, default: 0 },
361
361
  },
362
+ enableInternalChat: {
363
+ type: Boolean,
364
+ default: false,
365
+ },
362
366
  hideMarketingTemplates: {
363
367
  type: Boolean,
364
368
  default: false,
@@ -380,6 +384,10 @@ const workspaceSchema = new mongoose.Schema(
380
384
  type: Boolean,
381
385
  default: false,
382
386
  },
387
+ enableInternalChat: {
388
+ type: Boolean,
389
+ default: false,
390
+ },
383
391
  },
384
392
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
385
393
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.4.97",
3
+ "version": "1.4.99",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {