shuttlepro-shared 1.2.17 → 1.2.19

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.
@@ -184,6 +184,7 @@ const findOneAndUpdateAgentActivity = async (
184
184
  return null;
185
185
  }
186
186
  };
187
+
187
188
  module.exports = {
188
189
  AgentActivity,
189
190
  findOneAndUpdateAgentActivity,
package/models/Chatbot.js CHANGED
@@ -10,6 +10,10 @@ const ChatbotSchema = new Schema(
10
10
  type: String,
11
11
  default: "",
12
12
  },
13
+ expiryTime: {
14
+ type: Number,
15
+ default: 300,
16
+ },
13
17
  },
14
18
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
15
19
  );
@@ -0,0 +1,71 @@
1
+ const mongoose = require("mongoose");
2
+ const { Schema } = mongoose;
3
+
4
+ const NewProductSchema = new Schema(
5
+ {
6
+ id: {
7
+ type: Schema.Types.ObjectId,
8
+ ref: "Product",
9
+ default: null,
10
+ },
11
+ name: { type: String, default: "" },
12
+ description: { type: String, default: "" },
13
+ sku: { type: String, default: "" },
14
+ price: { type: String, default: 0 },
15
+ quantity: { type: Number, default: 0 },
16
+ imageUrl: { type: String, default: "" },
17
+ costPrice: { type: String, default: 0 },
18
+ salePrice: { type: String, default: 0 },
19
+ webProductId: { type: Number, default: null },
20
+ variants: [],
21
+ attachments: [],
22
+ workspaceId: {
23
+ type: Schema.Types.ObjectId,
24
+ ref: "Workspace",
25
+ default: null,
26
+ },
27
+ },
28
+ {
29
+ timestamps: true,
30
+ toJSON: { virtuals: true },
31
+ toObject: { virtuals: true },
32
+ }
33
+ );
34
+
35
+ // Adding compound text index for name, sku, and variants
36
+ NewProductSchema.index({
37
+ name: "text",
38
+ sku: "text",
39
+ "variants.name": "text",
40
+ "variants.sku": "text",
41
+ });
42
+
43
+ // Adding separate indexes for frequent query conditions
44
+ NewProductSchema.index({
45
+ workspaceId: 1,
46
+ name: 1,
47
+ });
48
+
49
+ NewProductSchema.index({
50
+ workspaceId: 1,
51
+ sku: 1,
52
+ });
53
+
54
+ NewProductSchema.index({
55
+ workspaceId: 1,
56
+ "variants.name": 1,
57
+ });
58
+
59
+ NewProductSchema.index({
60
+ workspaceId: 1,
61
+ "variants.sku": 1,
62
+ });
63
+
64
+ // Index for attachments existence check
65
+ NewProductSchema.index({
66
+ attachments: 1,
67
+ });
68
+
69
+ const NewProduct = mongoose.model("NewProduct", NewProductSchema);
70
+
71
+ module.exports = NewProduct;
@@ -113,6 +113,7 @@ const workspaceSchema = new mongoose.Schema(
113
113
  queueTracking: { type: Boolean, default: false },
114
114
  orderConfiguration: { type: String, default: "" },
115
115
  defaultModule: { type: String, default: "dashboard" },
116
+ defaultShift: { type: String, default: "" },
116
117
  dynamicFieldsTemplate: [
117
118
  {
118
119
  groupName: { type: String, required: true, trim: true },
package/models.js CHANGED
@@ -38,7 +38,7 @@ const Profile = require("./models/Profile");
38
38
  const Chatbot = require("./models/Chatbot");
39
39
  const Step = require("./models/Step");
40
40
  const Role = require("./models/Role");
41
-
41
+ const NewProduct = require("./models/NewProduct");
42
42
  module.exports = {
43
43
  Website,
44
44
  ProductQueue,
@@ -80,4 +80,5 @@ module.exports = {
80
80
  Chatbot,
81
81
  Step,
82
82
  Role,
83
+ NewProduct,
83
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {