flykup_model_production 1.0.15 → 1.0.17
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/.gitattributes +2 -0
- package/.github/workflows/publish.yml +31 -0
- package/auth.js +14 -14
- package/config.js +1 -1
- package/db_connection.js +23 -23
- package/index.js +140 -140
- package/models/AadhaarVerification.js +131 -131
- package/models/AdminEmail.model.js +38 -38
- package/models/BankVerification.js +92 -92
- package/models/GSTVerification.js +89 -89
- package/models/LiveStreamInteraction.model.js +101 -101
- package/models/ProductInteraction.model.js +108 -108
- package/models/Review.model.js +121 -121
- package/models/SearchAnalytics.js +23 -23
- package/models/ShoppableInteraction.model.js +106 -106
- package/models/Wishlist.model.js +29 -29
- package/models/admin.model.js +42 -42
- package/models/appUpdate.model.js +19 -19
- package/models/assets.model.js +32 -32
- package/models/blockedRegion.models.js +27 -27
- package/models/chat.model.js +511 -511
- package/models/coHostInvitation.model.js +60 -60
- package/models/follow.model.js +38 -38
- package/models/loginlogs.model.js +26 -26
- package/models/notification.model.js +130 -129
- package/models/order.modal.js +385 -381
- package/models/orderPayment.model.js +219 -105
- package/models/productListing.model.js +322 -318
- package/models/profileInteractions.model.js +44 -44
- package/models/registerShow.model.js +29 -29
- package/models/sellerDraft.model.js +27 -27
- package/models/seller_settlements_2025-11-18 (1).csv +4 -0
- package/models/seller_settlements_2025-11-18.csv +4 -0
- package/models/shipper.model.js +126 -126
- package/models/shoppableVideo.model.js +237 -237
- package/models/shoppableVideoComment.model.js +57 -57
- package/models/shoppableVideoLike.model.js +29 -29
- package/models/shoppableVideoSave.model.js +27 -27
- package/models/shows.model.js +603 -570
- package/models/stock.model.js +105 -105
- package/models/ticket.model.js +115 -115
- package/models/user.model.js +7 -0
- package/package.json +18 -18
package/models/stock.model.js
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
// models/Stock.js - Simplified
|
|
2
|
-
import mongoose from "mongoose";
|
|
3
|
-
const { Schema } = mongoose;
|
|
4
|
-
|
|
5
|
-
const stockSchema = new mongoose.Schema(
|
|
6
|
-
{
|
|
7
|
-
sellerId: {
|
|
8
|
-
type: Schema.Types.ObjectId,
|
|
9
|
-
ref: "sellers",
|
|
10
|
-
},
|
|
11
|
-
productListingId: {
|
|
12
|
-
type: Schema.Types.ObjectId,
|
|
13
|
-
ref: "productlistings",
|
|
14
|
-
required: true,
|
|
15
|
-
unique: true
|
|
16
|
-
},
|
|
17
|
-
quantity: {
|
|
18
|
-
type: Number,
|
|
19
|
-
default: 0,
|
|
20
|
-
min: 0
|
|
21
|
-
},
|
|
22
|
-
title: String,
|
|
23
|
-
images: [{
|
|
24
|
-
key: String,
|
|
25
|
-
url: String
|
|
26
|
-
}],
|
|
27
|
-
// ❌ REMOVED: totalReserved, flashSaleReservations
|
|
28
|
-
lowStockThreshold: {
|
|
29
|
-
type: Number,
|
|
30
|
-
default: 10
|
|
31
|
-
},
|
|
32
|
-
reorderQuantity: {
|
|
33
|
-
type: Number,
|
|
34
|
-
default: 50
|
|
35
|
-
},
|
|
36
|
-
isInStock: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: true
|
|
39
|
-
},
|
|
40
|
-
lastRestocked: {
|
|
41
|
-
type: Date,
|
|
42
|
-
default: null
|
|
43
|
-
},
|
|
44
|
-
stockUpdateHistory: [{
|
|
45
|
-
change: Number,
|
|
46
|
-
previousQuantity: Number,
|
|
47
|
-
newQuantity: Number,
|
|
48
|
-
reason: String,
|
|
49
|
-
updatedAt: { type: Date, default: Date.now }
|
|
50
|
-
}]
|
|
51
|
-
},
|
|
52
|
-
{ timestamps: true }
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const Stock = mongoose.models.stocks || mongoose.model("stocks", stockSchema);
|
|
56
|
-
export default Stock;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// // models/Stock.js - Simplified version without flash sale reservations
|
|
60
|
-
// import mongoose from "mongoose";
|
|
61
|
-
// const { Schema } = mongoose;
|
|
62
|
-
|
|
63
|
-
// const stockSchema = new mongoose.Schema(
|
|
64
|
-
// {
|
|
65
|
-
// productListingId: {
|
|
66
|
-
// type: Schema.Types.ObjectId,
|
|
67
|
-
// ref: "productlistings",
|
|
68
|
-
// required: true,
|
|
69
|
-
// unique: true
|
|
70
|
-
// },
|
|
71
|
-
// quantity: {
|
|
72
|
-
// type: Number,
|
|
73
|
-
// default: 0,
|
|
74
|
-
// min: 0
|
|
75
|
-
// },
|
|
76
|
-
// // REMOVED: totalReserved field since we don't need reservations
|
|
77
|
-
// // REMOVED: flashSaleReservations array completely
|
|
78
|
-
// lowStockThreshold: {
|
|
79
|
-
// type: Number,
|
|
80
|
-
// default: 10
|
|
81
|
-
// },
|
|
82
|
-
// reorderQuantity: {
|
|
83
|
-
// type: Number,
|
|
84
|
-
// default: 50
|
|
85
|
-
// },
|
|
86
|
-
// isInStock: {
|
|
87
|
-
// type: Boolean,
|
|
88
|
-
// default: true
|
|
89
|
-
// },
|
|
90
|
-
// lastRestocked: {
|
|
91
|
-
// type: Date,
|
|
92
|
-
// default: null
|
|
93
|
-
// }
|
|
94
|
-
// },
|
|
95
|
-
// { timestamps: true }
|
|
96
|
-
// );
|
|
97
|
-
|
|
98
|
-
// // Indexes
|
|
99
|
-
// stockSchema.index({ productListingId: 1 });
|
|
100
|
-
// stockSchema.index({ isInStock: 1 });
|
|
101
|
-
// stockSchema.index({ quantity: 1 });
|
|
102
|
-
|
|
103
|
-
// const Stock = mongoose.models.stocks || mongoose.model("stocks", stockSchema);
|
|
104
|
-
// export default Stock;
|
|
105
|
-
|
|
1
|
+
// models/Stock.js - Simplified
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
const { Schema } = mongoose;
|
|
4
|
+
|
|
5
|
+
const stockSchema = new mongoose.Schema(
|
|
6
|
+
{
|
|
7
|
+
sellerId: {
|
|
8
|
+
type: Schema.Types.ObjectId,
|
|
9
|
+
ref: "sellers",
|
|
10
|
+
},
|
|
11
|
+
productListingId: {
|
|
12
|
+
type: Schema.Types.ObjectId,
|
|
13
|
+
ref: "productlistings",
|
|
14
|
+
required: true,
|
|
15
|
+
unique: true
|
|
16
|
+
},
|
|
17
|
+
quantity: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 0,
|
|
20
|
+
min: 0
|
|
21
|
+
},
|
|
22
|
+
title: String,
|
|
23
|
+
images: [{
|
|
24
|
+
key: String,
|
|
25
|
+
url: String
|
|
26
|
+
}],
|
|
27
|
+
// ❌ REMOVED: totalReserved, flashSaleReservations
|
|
28
|
+
lowStockThreshold: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 10
|
|
31
|
+
},
|
|
32
|
+
reorderQuantity: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 50
|
|
35
|
+
},
|
|
36
|
+
isInStock: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
lastRestocked: {
|
|
41
|
+
type: Date,
|
|
42
|
+
default: null
|
|
43
|
+
},
|
|
44
|
+
stockUpdateHistory: [{
|
|
45
|
+
change: Number,
|
|
46
|
+
previousQuantity: Number,
|
|
47
|
+
newQuantity: Number,
|
|
48
|
+
reason: String,
|
|
49
|
+
updatedAt: { type: Date, default: Date.now }
|
|
50
|
+
}]
|
|
51
|
+
},
|
|
52
|
+
{ timestamps: true }
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const Stock = mongoose.models.stocks || mongoose.model("stocks", stockSchema);
|
|
56
|
+
export default Stock;
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// // models/Stock.js - Simplified version without flash sale reservations
|
|
60
|
+
// import mongoose from "mongoose";
|
|
61
|
+
// const { Schema } = mongoose;
|
|
62
|
+
|
|
63
|
+
// const stockSchema = new mongoose.Schema(
|
|
64
|
+
// {
|
|
65
|
+
// productListingId: {
|
|
66
|
+
// type: Schema.Types.ObjectId,
|
|
67
|
+
// ref: "productlistings",
|
|
68
|
+
// required: true,
|
|
69
|
+
// unique: true
|
|
70
|
+
// },
|
|
71
|
+
// quantity: {
|
|
72
|
+
// type: Number,
|
|
73
|
+
// default: 0,
|
|
74
|
+
// min: 0
|
|
75
|
+
// },
|
|
76
|
+
// // REMOVED: totalReserved field since we don't need reservations
|
|
77
|
+
// // REMOVED: flashSaleReservations array completely
|
|
78
|
+
// lowStockThreshold: {
|
|
79
|
+
// type: Number,
|
|
80
|
+
// default: 10
|
|
81
|
+
// },
|
|
82
|
+
// reorderQuantity: {
|
|
83
|
+
// type: Number,
|
|
84
|
+
// default: 50
|
|
85
|
+
// },
|
|
86
|
+
// isInStock: {
|
|
87
|
+
// type: Boolean,
|
|
88
|
+
// default: true
|
|
89
|
+
// },
|
|
90
|
+
// lastRestocked: {
|
|
91
|
+
// type: Date,
|
|
92
|
+
// default: null
|
|
93
|
+
// }
|
|
94
|
+
// },
|
|
95
|
+
// { timestamps: true }
|
|
96
|
+
// );
|
|
97
|
+
|
|
98
|
+
// // Indexes
|
|
99
|
+
// stockSchema.index({ productListingId: 1 });
|
|
100
|
+
// stockSchema.index({ isInStock: 1 });
|
|
101
|
+
// stockSchema.index({ quantity: 1 });
|
|
102
|
+
|
|
103
|
+
// const Stock = mongoose.models.stocks || mongoose.model("stocks", stockSchema);
|
|
104
|
+
// export default Stock;
|
|
105
|
+
|
package/models/ticket.model.js
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
// models/Ticket.js
|
|
2
|
-
import mongoose, { Schema, model } from 'mongoose';
|
|
3
|
-
|
|
4
|
-
const replySchema = new mongoose.Schema({
|
|
5
|
-
message: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: true,
|
|
8
|
-
},
|
|
9
|
-
repliedBy: {
|
|
10
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
-
ref: 'users',
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
repliedByRole: {
|
|
15
|
-
type: String,
|
|
16
|
-
enum: ['Admin', 'Seller'],
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
repliedAt: {
|
|
20
|
-
type: Date,
|
|
21
|
-
default: Date.now,
|
|
22
|
-
},
|
|
23
|
-
attachments: [
|
|
24
|
-
{
|
|
25
|
-
type: String, // URLs or file paths for reply attachments
|
|
26
|
-
required: false,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const ticketSchema = new mongoose.Schema(
|
|
32
|
-
{
|
|
33
|
-
ticketId: {
|
|
34
|
-
type: String,
|
|
35
|
-
required: true,
|
|
36
|
-
unique: true,
|
|
37
|
-
},
|
|
38
|
-
raisedBy: {
|
|
39
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
40
|
-
ref: 'users',
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
raisedByRole: {
|
|
44
|
-
type: String,
|
|
45
|
-
enum: ['User', 'Seller'],
|
|
46
|
-
required: true,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
// NEW: Reference to the order this ticket is related to
|
|
50
|
-
orderId: {
|
|
51
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
52
|
-
ref: 'Order', // Assuming your order model is named 'orders'
|
|
53
|
-
required: false,
|
|
54
|
-
},
|
|
55
|
-
// NEW: Reference to the seller user associated with the order
|
|
56
|
-
sellerUserId: {
|
|
57
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
58
|
-
ref: 'users',
|
|
59
|
-
required: false,
|
|
60
|
-
},
|
|
61
|
-
ticketPurposeId: {
|
|
62
|
-
type: String,
|
|
63
|
-
required: true,
|
|
64
|
-
},
|
|
65
|
-
ticketPurposePage: {
|
|
66
|
-
type: String,
|
|
67
|
-
required: true,
|
|
68
|
-
},
|
|
69
|
-
attachments: [
|
|
70
|
-
{
|
|
71
|
-
type: String, // Assuming attachments are stored as URLs or file paths
|
|
72
|
-
required: false,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
issueType: {
|
|
76
|
-
type: String,
|
|
77
|
-
required: true,
|
|
78
|
-
},
|
|
79
|
-
description: {
|
|
80
|
-
type: String,
|
|
81
|
-
required: true,
|
|
82
|
-
},
|
|
83
|
-
status: {
|
|
84
|
-
type: String,
|
|
85
|
-
enum: ['Open', 'In Progress', 'Resolved', 'Closed'],
|
|
86
|
-
default: 'Open',
|
|
87
|
-
},
|
|
88
|
-
// New reply fields
|
|
89
|
-
sellerReply: {
|
|
90
|
-
type: replySchema,
|
|
91
|
-
required: false,
|
|
92
|
-
},
|
|
93
|
-
adminReply: {
|
|
94
|
-
type: replySchema,
|
|
95
|
-
required: false,
|
|
96
|
-
},
|
|
97
|
-
// Track multiple replies (conversation history)
|
|
98
|
-
replies: [replySchema],
|
|
99
|
-
// Last updated by (for tracking purposes)
|
|
100
|
-
lastUpdatedBy: {
|
|
101
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
102
|
-
ref: 'users',
|
|
103
|
-
required: false,
|
|
104
|
-
},
|
|
105
|
-
lastUpdatedByRole: {
|
|
106
|
-
type: String,
|
|
107
|
-
enum: ['User', 'Seller', 'Admin'],
|
|
108
|
-
required: false,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{ timestamps: true }
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
const Ticket = mongoose.models.Ticket || mongoose.model('Ticket', ticketSchema);
|
|
115
|
-
export default Ticket;
|
|
1
|
+
// models/Ticket.js
|
|
2
|
+
import mongoose, { Schema, model } from 'mongoose';
|
|
3
|
+
|
|
4
|
+
const replySchema = new mongoose.Schema({
|
|
5
|
+
message: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
repliedBy: {
|
|
10
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
+
ref: 'users',
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
repliedByRole: {
|
|
15
|
+
type: String,
|
|
16
|
+
enum: ['Admin', 'Seller'],
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
repliedAt: {
|
|
20
|
+
type: Date,
|
|
21
|
+
default: Date.now,
|
|
22
|
+
},
|
|
23
|
+
attachments: [
|
|
24
|
+
{
|
|
25
|
+
type: String, // URLs or file paths for reply attachments
|
|
26
|
+
required: false,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const ticketSchema = new mongoose.Schema(
|
|
32
|
+
{
|
|
33
|
+
ticketId: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
unique: true,
|
|
37
|
+
},
|
|
38
|
+
raisedBy: {
|
|
39
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'users',
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
raisedByRole: {
|
|
44
|
+
type: String,
|
|
45
|
+
enum: ['User', 'Seller'],
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
// NEW: Reference to the order this ticket is related to
|
|
50
|
+
orderId: {
|
|
51
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
52
|
+
ref: 'Order', // Assuming your order model is named 'orders'
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
// NEW: Reference to the seller user associated with the order
|
|
56
|
+
sellerUserId: {
|
|
57
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
58
|
+
ref: 'users',
|
|
59
|
+
required: false,
|
|
60
|
+
},
|
|
61
|
+
ticketPurposeId: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
ticketPurposePage: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
attachments: [
|
|
70
|
+
{
|
|
71
|
+
type: String, // Assuming attachments are stored as URLs or file paths
|
|
72
|
+
required: false,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
issueType: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: true,
|
|
78
|
+
},
|
|
79
|
+
description: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: true,
|
|
82
|
+
},
|
|
83
|
+
status: {
|
|
84
|
+
type: String,
|
|
85
|
+
enum: ['Open', 'In Progress', 'Resolved', 'Closed'],
|
|
86
|
+
default: 'Open',
|
|
87
|
+
},
|
|
88
|
+
// New reply fields
|
|
89
|
+
sellerReply: {
|
|
90
|
+
type: replySchema,
|
|
91
|
+
required: false,
|
|
92
|
+
},
|
|
93
|
+
adminReply: {
|
|
94
|
+
type: replySchema,
|
|
95
|
+
required: false,
|
|
96
|
+
},
|
|
97
|
+
// Track multiple replies (conversation history)
|
|
98
|
+
replies: [replySchema],
|
|
99
|
+
// Last updated by (for tracking purposes)
|
|
100
|
+
lastUpdatedBy: {
|
|
101
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
102
|
+
ref: 'users',
|
|
103
|
+
required: false,
|
|
104
|
+
},
|
|
105
|
+
lastUpdatedByRole: {
|
|
106
|
+
type: String,
|
|
107
|
+
enum: ['User', 'Seller', 'Admin'],
|
|
108
|
+
required: false,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{ timestamps: true }
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const Ticket = mongoose.models.Ticket || mongoose.model('Ticket', ticketSchema);
|
|
115
|
+
export default Ticket;
|
package/models/user.model.js
CHANGED
|
@@ -44,6 +44,7 @@ const UserSchema = new mongoose.Schema(
|
|
|
44
44
|
maxLength: 60,
|
|
45
45
|
index: true,
|
|
46
46
|
},
|
|
47
|
+
isMandate: { type: Boolean, default: false },
|
|
47
48
|
password: {
|
|
48
49
|
type: String,
|
|
49
50
|
required: function () {
|
|
@@ -60,6 +61,12 @@ const UserSchema = new mongoose.Schema(
|
|
|
60
61
|
},
|
|
61
62
|
default: null,
|
|
62
63
|
},
|
|
64
|
+
gender: {
|
|
65
|
+
type: String,
|
|
66
|
+
enum: ["male", "female", "other", "prefer-not-to-say"],
|
|
67
|
+
lowercase: true,
|
|
68
|
+
default: null
|
|
69
|
+
},
|
|
63
70
|
accessAllowed: { type: Boolean, default: true },
|
|
64
71
|
oAuth: {
|
|
65
72
|
type: String,
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "flykup_model_production",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "index.js",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"private": false,
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"bcrypt": "^5.1.0",
|
|
12
|
-
"crypto": "^1.0.1",
|
|
13
|
-
"dotenv": "^16.4.5",
|
|
14
|
-
"jsonwebtoken": "^9.0.0",
|
|
15
|
-
"mongoose": "^8.0.0",
|
|
16
|
-
"nanoid": "^5.1.5"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "flykup_model_production",
|
|
3
|
+
"version": "1.0.17",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"bcrypt": "^5.1.0",
|
|
12
|
+
"crypto": "^1.0.1",
|
|
13
|
+
"dotenv": "^16.4.5",
|
|
14
|
+
"jsonwebtoken": "^9.0.0",
|
|
15
|
+
"mongoose": "^8.0.0",
|
|
16
|
+
"nanoid": "^5.1.5"
|
|
17
|
+
}
|
|
18
|
+
}
|