flykup_model_development 3.1.19 → 3.1.21
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/order.modal.js +1 -1
- package/models/seller.model.js +15 -0
- package/models/user.model.js +12 -0
- package/package.json +1 -1
package/models/order.modal.js
CHANGED
|
@@ -477,7 +477,7 @@ const orderSchema = new mongoose.Schema(
|
|
|
477
477
|
logisticsResponse: mongoose.Schema.Types.Mixed,
|
|
478
478
|
shipmentBookingStatus: {
|
|
479
479
|
type: String,
|
|
480
|
-
enum: ['pending', 'booked', 'failed'],
|
|
480
|
+
enum: ['pending', 'booked', 'failed','cancelled'],
|
|
481
481
|
default: 'pending'
|
|
482
482
|
},
|
|
483
483
|
shipmentBookingError: String,
|
package/models/seller.model.js
CHANGED
|
@@ -294,6 +294,21 @@ const SellerSchema = new mongoose.Schema(
|
|
|
294
294
|
},
|
|
295
295
|
{ timestamps: true, strict: true }
|
|
296
296
|
);
|
|
297
|
+
// Add text index for seller fields
|
|
298
|
+
SellerSchema.index({
|
|
299
|
+
companyName: "text",
|
|
300
|
+
email: "text",
|
|
301
|
+
mobileNumber: "text",
|
|
302
|
+
productCategories: "text"
|
|
303
|
+
}, {
|
|
304
|
+
weights: {
|
|
305
|
+
companyName: 4,
|
|
306
|
+
email: 2,
|
|
307
|
+
mobileNumber: 1,
|
|
308
|
+
productCategories: 1
|
|
309
|
+
},
|
|
310
|
+
name: "seller_text_index"
|
|
311
|
+
});
|
|
297
312
|
|
|
298
313
|
const Seller = mongoose.models.sellers || mongoose.model("sellers", SellerSchema);
|
|
299
314
|
export default Seller;
|
package/models/user.model.js
CHANGED
|
@@ -167,6 +167,18 @@ UserSchema.methods.createJwtToken = function () {
|
|
|
167
167
|
{ expiresIn: "4d" }
|
|
168
168
|
);
|
|
169
169
|
};
|
|
170
|
+
UserSchema.index({
|
|
171
|
+
userName: "text",
|
|
172
|
+
name: "text",
|
|
173
|
+
emailId: "text"
|
|
174
|
+
}, {
|
|
175
|
+
weights: {
|
|
176
|
+
userName: 3,
|
|
177
|
+
name: 3,
|
|
178
|
+
emailId: 2
|
|
179
|
+
},
|
|
180
|
+
name: "user_text_index"
|
|
181
|
+
});
|
|
170
182
|
|
|
171
183
|
UserSchema.methods.comparePassword = async function (loginPassword) {
|
|
172
184
|
if (!this.password) return false;
|