@common_ch/common 1.0.160 → 1.0.161

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.
@@ -33,6 +33,8 @@ aiSchema.pre('save', function (done) {
33
33
  };
34
34
  done();
35
35
  });
36
+ aiSchema.index({ name: 1 });
37
+ aiSchema.index({ status: 1 });
36
38
  aiSchema.statics.build = (attrs) => {
37
39
  return new Ai({
38
40
  _id: attrs._id,
@@ -36,6 +36,8 @@ const blogCategorySchema = new mongoose_1.default.Schema({
36
36
  });
37
37
  blogCategorySchema.set('versionKey', 'version');
38
38
  blogCategorySchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
39
+ blogCategorySchema.index({ title: 1 });
40
+ blogCategorySchema.index({ status: 1 });
39
41
  blogCategorySchema.statics.build = (attrs) => {
40
42
  return new BlogCategory(attrs);
41
43
  };
@@ -58,6 +58,8 @@ const blogSchema = new mongoose_1.default.Schema({
58
58
  });
59
59
  blogSchema.set('versionKey', 'version');
60
60
  blogSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
61
+ blogSchema.index({ 'categoryId': 1 });
62
+ blogSchema.index({ 'status': 1 });
61
63
  blogSchema.statics.build = (attrs) => {
62
64
  return new Blog(attrs);
63
65
  };
@@ -54,6 +54,8 @@ const discountSchema = new mongoose_1.default.Schema({
54
54
  discountSchema.set('versionKey', 'version');
55
55
  discountSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
56
56
  discountSchema.index({ code: 1 });
57
+ discountSchema.index({ plan: 1 });
58
+ discountSchema.index({ status: 1 });
57
59
  discountSchema.statics.build = (attrs) => {
58
60
  return new Discount(attrs);
59
61
  };
@@ -45,6 +45,9 @@ const feedbackSchema = new mongoose_1.default.Schema({
45
45
  });
46
46
  feedbackSchema.set('versionKey', 'version');
47
47
  feedbackSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
48
+ feedbackSchema.index({ userId: 1 });
49
+ feedbackSchema.index({ aiId: 1 });
50
+ feedbackSchema.index({ type: 1 });
48
51
  feedbackSchema.statics.build = (attrs) => {
49
52
  return new Feedback(attrs);
50
53
  };
@@ -58,6 +58,8 @@ const ImageSchema = new mongoose_1.default.Schema({
58
58
  });
59
59
  ImageSchema.set('versionKey', 'version');
60
60
  ImageSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
61
+ ImageSchema.index({ 'userId': 1 });
62
+ ImageSchema.index({ 'planId': 1 });
61
63
  ImageSchema.statics.build = (attrs) => {
62
64
  return new ImageModel(attrs);
63
65
  };
@@ -80,6 +80,7 @@ const messageSchema = new mongoose_1.default.Schema({
80
80
  // messageSchema.plugin(updateIfCurrentPlugin);
81
81
  messageSchema.index({ 'updatedAt': 1 });
82
82
  messageSchema.index({ 'threadChatgptId': 1 });
83
+ messageSchema.index({ 'userId': 1 });
83
84
  messageSchema.index({ 'threadChatgptId': 1, 'userId': 1 });
84
85
  messageSchema.statics.build = (attrs) => {
85
86
  return new Message(attrs);
@@ -71,6 +71,7 @@ const planSchema = new mongoose_1.default.Schema({
71
71
  });
72
72
  planSchema.set('versionKey', 'version');
73
73
  planSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
74
+ planSchema.index({ 'status': 1 });
74
75
  planSchema.statics.build = (attrs) => {
75
76
  return new Plan(attrs);
76
77
  };
@@ -70,6 +70,7 @@ const ticketSchema = new mongoose_1.default.Schema({
70
70
  });
71
71
  ticketSchema.set('versionKey', 'version');
72
72
  ticketSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
73
+ ticketSchema.index({ 'userId': 1 });
73
74
  ticketSchema.statics.build = (attrs) => {
74
75
  return new Ticket(attrs);
75
76
  };
@@ -64,6 +64,8 @@ const transactionSchema = new mongoose_1.default.Schema({
64
64
  });
65
65
  transactionSchema.set('versionKey', 'version');
66
66
  transactionSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
67
+ transactionSchema.index({ 'userId': 1 });
68
+ transactionSchema.index({ 'status': 1 });
67
69
  transactionSchema.statics.build = (attrs) => {
68
70
  return new Transaction(attrs);
69
71
  };
@@ -130,6 +130,10 @@ const userSchema = new mongoose_1.default.Schema({
130
130
  });
131
131
  userSchema.set('versionKey', 'version');
132
132
  // userSchema.plugin(updateIfCurrentPlugin);
133
+ userSchema.index({ 'status': 1 });
134
+ userSchema.index({ 'mobile': 1 });
135
+ userSchema.index({ 'username': 1 });
136
+ userSchema.index({ 'email': 1 });
133
137
  userSchema.statics.build = (attrs) => {
134
138
  return new User(attrs);
135
139
  };
@@ -59,6 +59,8 @@ const SpeechSchema = new mongoose_1.default.Schema({
59
59
  });
60
60
  SpeechSchema.set('versionKey', 'version');
61
61
  SpeechSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
62
+ SpeechSchema.index({ 'userId': 1 });
63
+ SpeechSchema.index({ 'planId': 1 });
62
64
  SpeechSchema.statics.build = (attrs) => {
63
65
  return new SpeechModel(attrs);
64
66
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common_ch/common",
3
- "version": "1.0.160",
3
+ "version": "1.0.161",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [