shuttlepro-shared 1.3.30 → 1.3.32

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.
Files changed (55) hide show
  1. package/models/Activity.js +28 -0
  2. package/models/AgentActivity.js +5 -2
  3. package/models/Attribute.js +130 -0
  4. package/models/Automation.js +238 -0
  5. package/models/Card.js +50 -1
  6. package/models/Catalogue.js +22 -0
  7. package/models/Category.js +129 -0
  8. package/models/ChatMemberSession.js +21 -0
  9. package/models/ChatMessage.js +43 -0
  10. package/models/Color.js +10 -0
  11. package/models/Column.js +6 -0
  12. package/models/Conversation.js +1 -0
  13. package/models/Customer.js +2 -2
  14. package/models/DeviceInfo.js +13 -0
  15. package/models/EscalationConfiguration.js +123 -0
  16. package/models/EscalationManager.js +50 -0
  17. package/models/Faq.js +29 -0
  18. package/models/FeedbackResponse.js +72 -0
  19. package/models/FormTemplate.js +27 -0
  20. package/models/Integration.js +6 -0
  21. package/models/InternalComments.js +27 -0
  22. package/models/InternalThreads.js +20 -0
  23. package/models/JobDesign.js +32 -0
  24. package/models/JobQueue.js +17 -0
  25. package/models/LabelsPdf.js +12 -0
  26. package/models/Layout.js +12 -0
  27. package/models/Location.js +147 -0
  28. package/models/Logo.js +11 -0
  29. package/models/Notification.js +32 -0
  30. package/models/OrderPdf.js +29 -0
  31. package/models/PostsAutomation.js +66 -0
  32. package/models/Product.js +336 -0
  33. package/models/ProductAttachment.js +158 -0
  34. package/models/ProductAttribute.js +140 -0
  35. package/models/ProductCategory.js +128 -0
  36. package/models/ProductLabels.js +11 -0
  37. package/models/ProductShopify.js +13 -0
  38. package/models/ProductTag.js +124 -0
  39. package/models/ProductVariant.js +156 -0
  40. package/models/ServiceUsage.js +26 -0
  41. package/models/ShipperSetting.js +24 -0
  42. package/models/SocialGroup.js +127 -0
  43. package/models/SocialPost.js +40 -0
  44. package/models/SocialProfile.js +57 -0
  45. package/models/Tag.js +77 -0
  46. package/models/Template.js +76 -0
  47. package/models/TemplateFrame.js +37 -0
  48. package/models/TemplateTag.js +10 -0
  49. package/models/UserSession.js +47 -0
  50. package/models/VariantLocation.js +145 -0
  51. package/models/WhatsappFlow.js +0 -0
  52. package/models/Workflow.js +34 -0
  53. package/models/Workspace.js +3 -0
  54. package/models.js +148 -49
  55. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ const mongoose = require("mongoose");
2
+ const { Schema } = mongoose;
3
+
4
+ const ActivitySchema = new Schema(
5
+ {
6
+ trackingId: { type: String, default: "" },
7
+ date: { type: String, default: "" },
8
+ name: { type: String, default: "" },
9
+ type: { type: String, default: "" },
10
+ orderId: { type: String, default: "" },
11
+ emailId: { type: Schema.Types.ObjectId, ref: "Email" },
12
+ mailGroupId: { type: Schema.Types.ObjectId, ref: "MailGroup" },
13
+ templateId: { type: Schema.Types.ObjectId, ref: "DescriptionTemplate" },
14
+ message: { type: String, default: "" },
15
+ status: { type: String, default: "" },
16
+ customerName: { type: String, default: "" },
17
+ contact: { type: String, default: "" },
18
+ notificationTimer: { type: String, default: "" },
19
+ scheduledTime: { type: String, default: "" },
20
+ workspaceId: { type: String, default: "" },
21
+ subject: { type: String, default: "" },
22
+ userName: { type: String, default: "" },
23
+ },
24
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
25
+ );
26
+
27
+ const Activity = mongoose.model("Activity", ActivitySchema);
28
+ module.exports = Activity;
@@ -164,7 +164,9 @@ const findOneAndUpdateAgentActivity = async (
164
164
  );
165
165
 
166
166
  if (bsonSize <= 1000000) {
167
- return await AgentActivity.findOneAndUpdate(findQuery, updateQuery);
167
+ return await AgentActivity.findOneAndUpdate(findQuery, updateQuery, {
168
+ new: true,
169
+ });
168
170
  } else {
169
171
  const { breaks, activities, totalActivities, ...restData } =
170
172
  agentActivityForActivitiesUpdated.toObject();
@@ -175,7 +177,8 @@ const findOneAndUpdateAgentActivity = async (
175
177
 
176
178
  const agentActivityRecord = await AgentActivity.findOneAndUpdate(
177
179
  { ...findQuery, _id: newAgentActivity._id },
178
- updateQuery
180
+ updateQuery,
181
+ { new: true }
179
182
  );
180
183
 
181
184
  return agentActivityRecord;
@@ -0,0 +1,130 @@
1
+ const mongoose = require("mongoose");
2
+ const { Schema } = mongoose;
3
+ const AttributeSchema = new Schema(
4
+ {
5
+ name: { type: String, default: "" },
6
+ webAttributeId: { type: Number, default: null },
7
+ parentId: { type: Schema.Types.ObjectId, ref: "Attribute", default: null },
8
+ workspaceId: {
9
+ type: Schema.Types.ObjectId,
10
+ ref: "Workspace",
11
+ default: null,
12
+ },
13
+ oldId: { type: String, default: "" },
14
+ createdBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
15
+ updatedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
16
+ isDeleted: { type: Boolean, default: false },
17
+ isDefault: { type: Boolean, default: false },
18
+ },
19
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
20
+ );
21
+ AttributeSchema.virtual("values", {
22
+ ref: "Attribute",
23
+ localField: "_id",
24
+ foreignField: "parentId",
25
+ });
26
+
27
+ const Attribute = mongoose.model("Attribute", AttributeSchema);
28
+
29
+ const createNewAttribute = async (attributeData) => {
30
+ try {
31
+ return await Attribute.create(attributeData);
32
+ } catch (error) {
33
+ console.log(error);
34
+ return null;
35
+ }
36
+ };
37
+
38
+ const attributesInsertMany = async (data) => {
39
+ try {
40
+ return await Attribute.insertMany(data);
41
+ } catch (error) {
42
+ return [];
43
+ }
44
+ };
45
+
46
+ const findAttributeById = async (attributeId) => {
47
+ try {
48
+ return await Attribute.findById(attributeId);
49
+ } catch (error) {
50
+ console.log(error);
51
+ return null;
52
+ }
53
+ };
54
+
55
+ const updateAttributeById = async (criteria, updateData, options = {}) => {
56
+ try {
57
+ return await Attribute.findByIdAndUpdate(criteria, updateData, options);
58
+ } catch (error) {
59
+ console.log(error);
60
+ return null;
61
+ }
62
+ };
63
+
64
+ const deleteAttributeById = async (attributeId) => {
65
+ try {
66
+ return await Attribute.findByIdAndDelete(attributeId);
67
+ } catch (error) {
68
+ console.log(error);
69
+ return null;
70
+ }
71
+ };
72
+
73
+ const findAttribute = async (criteria) => {
74
+ try {
75
+ return await Attribute.findOne(criteria);
76
+ } catch (error) {
77
+ console.log(error);
78
+ return null;
79
+ }
80
+ };
81
+
82
+ const findAttributes = async (criteria) => {
83
+ try {
84
+ return await Attribute.find(criteria);
85
+ } catch (error) {
86
+ console.log(error);
87
+ return null;
88
+ }
89
+ };
90
+
91
+ const attributesByAggregation = async (pipeline) => {
92
+ try {
93
+ return await Attribute.aggregate(pipeline);
94
+ } catch (error) {
95
+ console.log(error);
96
+ return null;
97
+ }
98
+ };
99
+
100
+ const attributesUpdateMany = async (criteria, updateData, options = {}) => {
101
+ try {
102
+ return await Attribute.updateMany(criteria, updateData, options);
103
+ } catch (error) {
104
+ console.log(error);
105
+ return null;
106
+ }
107
+ };
108
+
109
+ const findAttributesWithPopulate = async (criteria, populate) => {
110
+ try {
111
+ return await Attribute.find(criteria).populate(populate);
112
+ } catch (error) {
113
+ console.log(error);
114
+ return null;
115
+ }
116
+ };
117
+
118
+ module.exports = {
119
+ Attribute,
120
+ createNewAttribute,
121
+ findAttributeById,
122
+ updateAttributeById,
123
+ deleteAttributeById,
124
+ findAttribute,
125
+ findAttributes,
126
+ attributesByAggregation,
127
+ attributesInsertMany,
128
+ attributesUpdateMany,
129
+ findAttributesWithPopulate,
130
+ };
@@ -0,0 +1,238 @@
1
+ const { repositories } = require("shuttlepro-shared");
2
+ const mongoose = require("mongoose");
3
+ const { Schema } = mongoose;
4
+
5
+ const userJoin = {
6
+ type: Schema.Types.ObjectId,
7
+ ref: "User",
8
+ default: null,
9
+ };
10
+
11
+ const descriptionJoin = {
12
+ type: Schema.Types.ObjectId,
13
+ ref: "DescriptionTemplate",
14
+ default: null,
15
+ };
16
+
17
+ const defaultStringType = {
18
+ type: String,
19
+ default: "",
20
+ };
21
+
22
+ const AutomationAction = new Schema({
23
+ addLabels: [
24
+ {
25
+ type: Schema.Types.ObjectId,
26
+ ref: "Label",
27
+ default: null,
28
+ },
29
+ ],
30
+ autoAssign: {
31
+ enabled: { type: Boolean, default: false },
32
+ membersId: [userJoin],
33
+ },
34
+ autoReply: {
35
+ enabled: { type: Boolean, default: false },
36
+ templateId: descriptionJoin,
37
+ delay: defaultStringType,
38
+ },
39
+ commentReplyPrivately: {
40
+ enabled: { type: Boolean, default: false },
41
+ templateId: descriptionJoin,
42
+ delay: defaultStringType,
43
+ },
44
+ conversationReply: {
45
+ enabled: { type: Boolean, default: false },
46
+ templateId: descriptionJoin,
47
+ delay: defaultStringType,
48
+ },
49
+ sendCollection: {
50
+ enabled: { type: Boolean, default: false },
51
+ template: { type: Object, default: null },
52
+ delay: defaultStringType,
53
+ },
54
+ autoTicket: {
55
+ enabled: { type: Boolean, default: false },
56
+ title: defaultStringType,
57
+ labelIds: [
58
+ {
59
+ type: Schema.Types.ObjectId,
60
+ ref: "Label",
61
+ default: null,
62
+ },
63
+ ],
64
+ alreadyTicketTemplateId: descriptionJoin,
65
+ templateId: descriptionJoin,
66
+ template: defaultStringType,
67
+ columnId: {
68
+ type: mongoose.Schema.Types.ObjectId,
69
+ ref: "Column",
70
+ },
71
+ priority: {
72
+ type: String,
73
+ enum: ["high", "medium", "low"],
74
+ },
75
+ ticketDue: defaultStringType,
76
+ assignId: {
77
+ type: mongoose.Schema.Types.Mixed,
78
+ default: null,
79
+ },
80
+ members: [userJoin],
81
+ },
82
+ escalation: {
83
+ enabled: { type: Boolean, default: false },
84
+ escalationIds: {
85
+ type: Schema.Types.ObjectId,
86
+ ref: "EscalationConfiguration",
87
+ },
88
+ },
89
+ notification: {
90
+ enabled: { type: Boolean, default: false },
91
+ notificationMemberIds: [userJoin],
92
+ },
93
+ orderConfirmation: {
94
+ enabled: { type: Boolean, default: false },
95
+ integrationId: {
96
+ id: defaultStringType,
97
+ type: defaultStringType,
98
+ accountTitle: defaultStringType,
99
+ businessId: defaultStringType,
100
+ name: defaultStringType,
101
+ },
102
+ workflow: {},
103
+ otherConfirmationMode: {
104
+ type: String,
105
+ enum: ["ivr", "sms", ""],
106
+ default: "",
107
+ },
108
+ },
109
+ orderPublish: {
110
+ enabled: { type: Boolean, default: false },
111
+ integrationId: {
112
+ id: defaultStringType,
113
+ type: defaultStringType,
114
+ accountTitle: defaultStringType,
115
+ businessId: defaultStringType,
116
+ name: defaultStringType,
117
+ },
118
+ workflow: {},
119
+ otherConfirmationMode: {
120
+ type: String,
121
+ enum: ["ivr", "sms", ""],
122
+ default: "",
123
+ },
124
+ },
125
+ orderReview: {
126
+ enabled: { type: Boolean, default: false },
127
+ integrationId: {
128
+ id: defaultStringType,
129
+ type: defaultStringType,
130
+ accountTitle: defaultStringType,
131
+ businessId: defaultStringType,
132
+ name: defaultStringType,
133
+ },
134
+ flow: {},
135
+ },
136
+ });
137
+ const AutomationCondition = new Schema({
138
+ criteriaType: {
139
+ type: {
140
+ type: String,
141
+ required: true,
142
+ enum: [
143
+ "sender",
144
+ "content",
145
+ "order",
146
+ "time",
147
+ "ticketStatus",
148
+ "label",
149
+ "orderAutomation",
150
+ "post",
151
+ ],
152
+ },
153
+ keyValue: {
154
+ type: String,
155
+ required: true,
156
+ enum: [
157
+ "senderEmail",
158
+ "senderPhone",
159
+ "emailSubject",
160
+ "messageBody",
161
+ "orderTrackingUrl",
162
+ "withInBusinessHour",
163
+ "afterBusinessHour",
164
+ "allDay",
165
+ "closeTicket",
166
+ "openTicket",
167
+ "publishedPosts",
168
+ "label",
169
+ "orderConfirmation",
170
+ "orderPublish",
171
+ ],
172
+ },
173
+ subKeyValue: {
174
+ type: String,
175
+ required: false,
176
+ enum: ["trackingNo", "orderNumber", "both"],
177
+ },
178
+ },
179
+ values: [
180
+ {
181
+ type: String,
182
+ },
183
+ ],
184
+ contains: {
185
+ type: String,
186
+ enum: ["equalTo", "contains", "notEqualTo", "notContains"],
187
+ },
188
+ });
189
+ const AutomationIntegration = new Schema({
190
+ id: {
191
+ type: Schema.Types.ObjectId,
192
+ ref: "Integration",
193
+ required: true,
194
+ },
195
+ contentType: defaultStringType,
196
+ type: {
197
+ type: String,
198
+ required: true,
199
+ },
200
+ accountTitle: defaultStringType,
201
+ _id: false,
202
+ });
203
+
204
+ const AutomationSchema = new Schema(
205
+ {
206
+ title: {
207
+ type: String,
208
+ required: true,
209
+ },
210
+ event: {
211
+ type: String,
212
+ enum: ["newConversation", "message", "ticket", "order"],
213
+ default: "newConversation",
214
+ required: true,
215
+ },
216
+ integratedPlatformId: [AutomationIntegration],
217
+ workspaceId: defaultStringType,
218
+ enabled: {
219
+ type: Boolean,
220
+ default: true,
221
+ },
222
+ conditionGroups: [
223
+ {
224
+ conditionalMatch: {
225
+ type: String,
226
+ enum: ["any", "all"],
227
+ default: "any",
228
+ },
229
+ conditions: [AutomationCondition],
230
+ actions: AutomationAction,
231
+ },
232
+ ],
233
+ },
234
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
235
+ );
236
+
237
+ const Automation = mongoose.model("Automation", AutomationSchema);
238
+ module.exports = { Automation };
package/models/Card.js CHANGED
@@ -91,7 +91,20 @@ const cardSchema = new mongoose.Schema(
91
91
  },
92
92
  fieldType: {
93
93
  type: String,
94
- enum: DYNAMIC_FIELD_TYPES,
94
+ enum: [
95
+ "text",
96
+ "autocomplete",
97
+ "radio",
98
+ "text area",
99
+ "number",
100
+ "date",
101
+ "time",
102
+ "email",
103
+ "range",
104
+ "url",
105
+ "colour",
106
+ "file",
107
+ ],
95
108
  },
96
109
  fieldValueId: {
97
110
  type: mongoose.Schema.Types.Mixed,
@@ -107,6 +120,42 @@ const cardSchema = new mongoose.Schema(
107
120
  },
108
121
  },
109
122
  ],
123
+ assignId: {
124
+ type: mongoose.Schema.Types.Mixed,
125
+ default: null,
126
+ },
127
+ mergedTickets: {
128
+ type: [
129
+ {
130
+ id: { type: String, required: false },
131
+ ticketId: { type: String, required: false },
132
+ },
133
+ ],
134
+ default: [],
135
+ },
136
+ mergedInto: {
137
+ type: {
138
+ id: { type: String, required: false, default: "" },
139
+ ticketId: { type: String, required: false, default: "" },
140
+ },
141
+ default: null,
142
+ },
143
+ customerName: {
144
+ type: String,
145
+ default: "",
146
+ },
147
+ customerEmail: {
148
+ type: String,
149
+ default: "",
150
+ },
151
+ phoneNo: {
152
+ type: String,
153
+ default: "",
154
+ },
155
+ body: {
156
+ type: mongoose.Schema.Types.Mixed,
157
+ default: {},
158
+ },
110
159
  },
111
160
  { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
112
161
  );
@@ -0,0 +1,22 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const CatalogueSchema = new mongoose.Schema(
4
+ {
5
+ name: { type: String, default: "" },
6
+ workspaceId: { type: String, default: "" },
7
+ isDeleted: { type: Boolean, default: false },
8
+ isDefault: { type: Boolean, default: false },
9
+ images: {
10
+ type: [
11
+ {
12
+ url: { type: String, default: "" },
13
+ name: { type: String, default: "" },
14
+ },
15
+ ],
16
+ default: [],
17
+ },
18
+ },
19
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
20
+ );
21
+
22
+ module.exports = mongoose.model("Catalogue", CatalogueSchema);
@@ -0,0 +1,129 @@
1
+ const mongoose = require("mongoose");
2
+ const { Schema } = mongoose;
3
+ const CategorySchema = new Schema(
4
+ {
5
+ image: { type: String, default: "" },
6
+ publishedAt: { type: String, default: "" },
7
+ name: { type: String, default: "" },
8
+ description: { type: String, default: "" },
9
+ workspaceId: {
10
+ type: Schema.Types.ObjectId,
11
+ ref: "Workspace",
12
+ default: null,
13
+ },
14
+ oldId: { type: String, default: "" },
15
+ webCategoryId: { type: Number, default: null },
16
+ parentId: { type: Schema.Types.ObjectId, ref: "Category", default: null },
17
+ createdBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
18
+ updatedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
19
+ isDeleted: { type: Boolean, default: false },
20
+ },
21
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
22
+ );
23
+
24
+ CategorySchema.virtual("productCategories", {
25
+ ref: "ProductCategory",
26
+ localField: "_id",
27
+ foreignField: "categoryId",
28
+ });
29
+
30
+ const Category = mongoose.model("Category", CategorySchema);
31
+
32
+ const createNewCategory = async (categoryData) => {
33
+ try {
34
+ return await Category.create(categoryData);
35
+ } catch (error) {
36
+ return null;
37
+ }
38
+ };
39
+
40
+ const findCategoryById = async (categoryId) => {
41
+ try {
42
+ return await Category.findById(categoryId);
43
+ } catch (error) {
44
+ return null;
45
+ }
46
+ };
47
+
48
+ const updateCategoryById = async (criteria, updateData, options) => {
49
+ try {
50
+ return await Category.findByIdAndUpdate(criteria, updateData, options);
51
+ } catch (error) {
52
+ return null;
53
+ }
54
+ };
55
+
56
+ const deleteCategoryById = async (categoryId) => {
57
+ try {
58
+ return await Category.findByIdAndDelete(categoryId);
59
+ } catch (error) {
60
+ return null;
61
+ }
62
+ };
63
+
64
+ const findCategory = async (criteria = {}) => {
65
+ try {
66
+ return await Category.findOne(criteria);
67
+ } catch (error) {
68
+ return null;
69
+ }
70
+ };
71
+
72
+ const findCategories = async (criteria = {}) => {
73
+ try {
74
+ return await Category.find(criteria);
75
+ } catch (error) {
76
+ return [];
77
+ }
78
+ };
79
+
80
+ const categoriesByAggregation = async (aggregate = []) => {
81
+ try {
82
+ let categories = await Category.aggregate(aggregate);
83
+ return categories;
84
+ } catch (err) {
85
+ return [];
86
+ }
87
+ };
88
+
89
+ const categoriesUpdateMany = async (criteria, updateData, options = {}) => {
90
+ try {
91
+ return await Category.updateMany(criteria, updateData, options);
92
+ } catch (error) {
93
+ return null;
94
+ }
95
+ };
96
+
97
+ const findOneAndUpdateCategory = async (
98
+ findQuery,
99
+ updateData,
100
+ options = {}
101
+ ) => {
102
+ try {
103
+ return await Category.findOneAndUpdate(findQuery, updateData, options);
104
+ } catch (error) {
105
+ return null;
106
+ }
107
+ };
108
+
109
+ const findCategoryByPopulate = async (criteria = {}, populate = "") => {
110
+ try {
111
+ return await Category.findOne(criteria).populate(populate);
112
+ } catch (error) {
113
+ return null;
114
+ }
115
+ };
116
+
117
+ module.exports = {
118
+ Category,
119
+ createNewCategory,
120
+ findCategoryById,
121
+ updateCategoryById,
122
+ deleteCategoryById,
123
+ findCategory,
124
+ findCategories,
125
+ categoriesByAggregation,
126
+ categoriesUpdateMany,
127
+ findOneAndUpdateCategory,
128
+ findCategoryByPopulate,
129
+ };
@@ -0,0 +1,21 @@
1
+ const { Schema, model } = require("mongoose");
2
+
3
+ const ChatMemberSessionSchema = new Schema(
4
+ {
5
+ userId: {
6
+ type: Schema.Types.ObjectId,
7
+ ref: "ChatMember",
8
+ default: null,
9
+ },
10
+ startTime: { type: String, default: "" },
11
+ endTime: { type: String, default: "" },
12
+ workspaceId: {
13
+ type: Schema.Types.ObjectId,
14
+ ref: "Workspace",
15
+ default: null,
16
+ },
17
+ },
18
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
19
+ );
20
+
21
+ module.exports = model("ChatMemberSession", ChatMemberSessionSchema);
@@ -0,0 +1,43 @@
1
+ const { Schema, model } = require("mongoose");
2
+
3
+ const ChatMessageSchema = new Schema(
4
+ {
5
+ senderId: {
6
+ type: Schema.Types.ObjectId,
7
+ ref: "ChatMember",
8
+ default: null,
9
+ },
10
+ receiverId: {
11
+ type: Schema.Types.ObjectId,
12
+ ref: "User",
13
+ default: null,
14
+ },
15
+ message: { type: String, default: "" },
16
+ attachment: { type: Array, default: [] },
17
+ attachmentType: { type: String, default: "" },
18
+ sessionId: {
19
+ type: Schema.Types.ObjectId,
20
+ ref: "ChatMemberSession",
21
+ default: null,
22
+ },
23
+ workspaceId: {
24
+ type: String,
25
+ default: "",
26
+ },
27
+ type: {
28
+ type: String,
29
+ default: "",
30
+ },
31
+ complaintType: {
32
+ type: String,
33
+ default: "",
34
+ },
35
+ websiteName: {
36
+ type: String,
37
+ default: "",
38
+ },
39
+ },
40
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
41
+ );
42
+
43
+ module.exports = model("ChatMessage", ChatMessageSchema);
@@ -0,0 +1,10 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const colorSchema = new mongoose.Schema(
4
+ {
5
+ name: { type: String, default: "" },
6
+ },
7
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
8
+ );
9
+
10
+ module.exports = mongoose.model("Color", colorSchema);