flykup_model_production 1.0.15 → 1.0.16

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.
@@ -252,7 +252,7 @@ const orderSchema = new mongoose.Schema(
252
252
  },
253
253
  sourceType: {
254
254
  type: String,
255
- enum: ['static', 'shoppable_video', 'livestream', 'auction', 'flash_sale', 'giveaway'],
255
+ enum: ['static', 'shoppable_video', 'livestream', 'auction', 'flash_sale', 'giveaway','bundle_sale','bundle_flash_sale'],
256
256
  required: true
257
257
  },
258
258
  sourceRefId: String,
@@ -351,6 +351,10 @@ cancelSource: {
351
351
  flashPrice: Number,
352
352
  originalPrice: Number
353
353
  }],
354
+ labelPrinted: {
355
+ type: Boolean,
356
+ default: false
357
+ },
354
358
  payment: {
355
359
  type: mongoose.Schema.Types.ObjectId,
356
360
  ref: 'orderPayment'
@@ -61,7 +61,9 @@ const paymentSchema = new mongoose.Schema({
61
61
  },
62
62
  paymentMethod: String,
63
63
  transactionTime: Date,
64
- sellerPayments: [{
64
+
65
+ // ✅ SELLER PAYMENTS FIELD - Now matching package model
66
+ sellerPayments: [{
65
67
  sellerId: {
66
68
  type: mongoose.Schema.Types.ObjectId,
67
69
  ref: 'users',
@@ -94,12 +96,124 @@ const paymentSchema = new mongoose.Schema({
94
96
 
95
97
  // Create indexes for better performance
96
98
  paymentSchema.index({ razorpayOrderId: 1 });
97
- // paymentSchema.index({ cfOrderId: 1 });
98
99
  paymentSchema.index({ orderId: 1 });
99
100
 
100
- // ❌ The pre-save middleware is no longer needed and should be removed.
101
-
102
101
  const OrderPayment =
103
102
  mongoose.models.OrderPayment || mongoose.model('orderPayment', paymentSchema);
104
103
 
105
- export default OrderPayment;
104
+ export default OrderPayment;
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ // import mongoose from 'mongoose';
116
+
117
+ // const paymentSchema = new mongoose.Schema({
118
+ // orderId: {
119
+ // type: mongoose.Schema.Types.ObjectId,
120
+ // ref: 'Order',
121
+ // required: true
122
+ // },
123
+ // userId: {
124
+ // type: mongoose.Schema.Types.ObjectId,
125
+ // ref: 'users',
126
+ // required: true
127
+ // },
128
+ // paymentGateway: {
129
+ // type: String,
130
+ // enum: ['RAZORPAY', 'CASHFREE'],
131
+ // required: true
132
+ // },
133
+
134
+ // // Razorpay-specific fields
135
+ // razorpayOrderId: {
136
+ // type: String,
137
+ // // ✅ This field is now required only if the gateway is RAZORPAY
138
+ // required: function() {
139
+ // return this.paymentGateway === 'RAZORPAY';
140
+ // }
141
+ // },
142
+ // razorpayPaymentId: {
143
+ // type: String,
144
+ // default: null
145
+ // },
146
+
147
+ // // Cashfree-specific fields
148
+ // cfPaymentSessionId: {
149
+ // type: String,
150
+ // // ✅ This field is now required only if the gateway is CASHFREE
151
+ // required: function() {
152
+ // return this.paymentGateway === 'CASHFREE';
153
+ // }
154
+ // },
155
+ // cfOrderId: {
156
+ // type: String,
157
+ // // ✅ This field is now required only if the gateway is CASHFREE
158
+ // required: function() {
159
+ // return this.paymentGateway === 'CASHFREE';
160
+ // }
161
+ // },
162
+
163
+ // amount: {
164
+ // type: Number,
165
+ // required: true
166
+ // },
167
+ // currency: {
168
+ // type: String,
169
+ // default: 'INR'
170
+ // },
171
+ // status: {
172
+ // type: String,
173
+ // enum: ['PENDING', 'SUCCESS', 'FAILED', 'REFUNDED'],
174
+ // default: 'PENDING'
175
+ // },
176
+ // paymentMethod: String,
177
+ // transactionTime: Date,
178
+ // sellerPayments: [{
179
+ // sellerId: {
180
+ // type: mongoose.Schema.Types.ObjectId,
181
+ // ref: 'users',
182
+ // required: true
183
+ // },
184
+ // payableAmount: { // Amount for products only
185
+ // type: Number,
186
+ // required: true,
187
+ // default: 0
188
+ // },
189
+ // deliveryCharge: { // Delivery fee for this seller's shipment
190
+ // type: Number,
191
+ // required: true,
192
+ // default: 0
193
+ // },
194
+ // totalAmount: { // The sum of payableAmount + deliveryCharge
195
+ // type: Number,
196
+ // required: true,
197
+ // default: 0
198
+ // },
199
+ // settlementStatus: {
200
+ // type: String,
201
+ // enum: ['PENDING', 'SETTLED', 'FAILED'],
202
+ // default: 'PENDING'
203
+ // }
204
+ // }]
205
+ // }, {
206
+ // timestamps: true
207
+ // });
208
+
209
+ // // Create indexes for better performance
210
+ // paymentSchema.index({ razorpayOrderId: 1 });
211
+ // // paymentSchema.index({ cfOrderId: 1 });
212
+ // paymentSchema.index({ orderId: 1 });
213
+
214
+ // // ❌ The pre-save middleware is no longer needed and should be removed.
215
+
216
+ // const OrderPayment =
217
+ // mongoose.models.OrderPayment || mongoose.model('orderPayment', paymentSchema);
218
+
219
+ // export default OrderPayment;
@@ -131,6 +131,10 @@ const ProductListingSchema = new Schema(
131
131
  type: Boolean,
132
132
  default: true,
133
133
  },
134
+ shopifySynced: {
135
+ type: Boolean,
136
+ default: false,
137
+ },
134
138
  ratingSummary: {
135
139
  averageRating: { type: Number, default: 0 },
136
140
  totalRatings: { type: Number, default: 0 },
@@ -0,0 +1,4 @@
1
+ Seller Name,Owner Name,Email,Mobile,Total Amount,Total Orders,Total Products,Account Number,IFSC Code,Bank Name
2
+ "HARISH A","HARISH A","thebrandspot@gmail.com","THEBRANDSPOT","1270","38","38","","",""
3
+ "Shanthi","Shanthi","shanthiaravindan81@gmail.com","+919500060775","450","1","1","","",""
4
+ "Gokul Krishnan","Gokul Krishnan","gkgokul1817@gmail.com","gokul_krishnan","55","1","1","","",""
@@ -0,0 +1,4 @@
1
+ Seller Name,Owner Name,Email,Mobile,Total Amount,Total Orders,Total Products,Account Number,IFSC Code,Bank Name
2
+ "HARISH A","HARISH A","thebrandspot@gmail.com","THEBRANDSPOT","1270","38","38","","",""
3
+ "Shanthi","Shanthi","shanthiaravindan81@gmail.com","+919500060775","450","1","1","","",""
4
+ "Gokul Krishnan","Gokul Krishnan","gkgokul1817@gmail.com","gokul_krishnan","55","1","1","","",""
@@ -72,6 +72,29 @@ const liveFlashSaleSchema = new Schema({
72
72
  default: Date.now
73
73
  }
74
74
  });
75
+ const bundleSaleSchema = new Schema({
76
+ _id: false,
77
+ bundleSaleId: {
78
+ type: Schema.Types.ObjectId,
79
+ ref: "bundlesales",
80
+ required: true
81
+ },
82
+ bundleOwnerSellerId: {
83
+ type: Schema.Types.ObjectId,
84
+ ref: 'sellers',
85
+ required: function() {
86
+ return this.bundleSaleId != null;
87
+ }
88
+ },
89
+ bundleTitle: { type: String }, // Quick reference title
90
+ bundleMRP: { type: Number, min: 0, default: null }, // Original MRP
91
+ sellingPrice: { type: Number, min: 0, default: null }, // Actual selling price
92
+ bundleImage: { // Bundle thumbnail image
93
+ key: { type: String, default: null },
94
+ url: { type: String, default: null }
95
+ },
96
+ createdAt: { type: Date, default: Date.now }
97
+ });
75
98
 
76
99
  // Show Schema with FIXED validation
77
100
  const showSchema = new Schema(
@@ -154,6 +177,12 @@ const showSchema = new Schema(
154
177
  enum: ['created', 'live', 'cancelled', 'ended'],
155
178
  default: 'created'
156
179
  },
180
+ viewerCount: {
181
+ type: Number,
182
+ default: 0,
183
+ min: 0
184
+ },
185
+
157
186
  likes: {
158
187
  type: Number,
159
188
  default: 0,
@@ -192,6 +221,10 @@ const showSchema = new Schema(
192
221
  message: 'productOwnerSellerId is required when productId is provided'
193
222
  }
194
223
  },
224
+ bundleSales: {
225
+ type: [bundleSaleSchema],
226
+ default: []
227
+ },
195
228
 
196
229
  auctionProducts: {
197
230
  type: [
@@ -306,7 +339,7 @@ showSchema.pre('validate', function(next) {
306
339
  next();
307
340
  });
308
341
 
309
- const Show = mongoose.model("shows", showSchema);
342
+ const Show = mongoose.models.shows || mongoose.model("shows", showSchema);
310
343
  export default Show;
311
344
 
312
345
 
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "flykup_model_production",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "private": false,