flykup_model_development 3.1.28 → 3.1.30

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.
@@ -248,7 +248,7 @@ const orderSchema = new mongoose.Schema(
248
248
  },
249
249
  sourceType: {
250
250
  type: String,
251
- enum: ['static', 'shoppable_video', 'livestream', 'auction','flash_sale'],
251
+ enum: ['static', 'shoppable_video', 'livestream', 'auction', 'flash_sale', 'giveaway'],
252
252
  required: true
253
253
  },
254
254
  sourceRefId: String,
@@ -54,7 +54,22 @@ const ProductListingSchema = new Schema(
54
54
  min: 0,
55
55
  default: null,
56
56
  },
57
-
57
+ logisticsType: {
58
+ type: String,
59
+ enum: ["flykupLogistics", "selfShipment"],
60
+ default: null,
61
+ },
62
+ deliveryCharge: {
63
+ type: Number,
64
+ min: 0,
65
+ default: null,
66
+ },
67
+ estimatedDeliveryDate: {
68
+ type: Number, // Change from Date to Number
69
+ min: 0,
70
+ default: null,
71
+ },
72
+
58
73
  // --- ADDED/UPDATED FIELDS FROM FRONTEND ---
59
74
  brand: { type: String, default: null }, // ADDED
60
75
  manufacturer: String,
@@ -156,3 +171,172 @@ export default ProductListing;
156
171
 
157
172
 
158
173
 
174
+
175
+
176
+ // // backend/models/ProductListing.js (or similar path)
177
+ // import mongoose from "mongoose";
178
+ // const { Schema } = mongoose;
179
+
180
+ // const ProductListingSchema = new Schema(
181
+ // {
182
+ // sellerId: { type: Schema.Types.ObjectId, ref: "sellers" },
183
+ // stockId: { type: Schema.Types.ObjectId, ref: "stocks" },
184
+ // title: String,
185
+ // description: String,
186
+ // flashSale: {
187
+ // isActive: { type: Boolean, default: false },
188
+ // flashSaleId: { type: mongoose.Schema.Types.ObjectId, ref: 'FlashSale' },
189
+ // flashPrice: { type: Number, default: 0 },
190
+ // flashStock: { type: Number, default: 0 },
191
+ // originalPrice: { type: Number, default: 0 },
192
+ // endsAt: { type: Date, default: null },
193
+ // startsAt: { type: Date, default: null }
194
+ // },
195
+
196
+ // //new fields added
197
+
198
+ // returnPolicy: {
199
+ // hasReturn: { type: Boolean, default: false },
200
+ // returnType: {
201
+ // type: [String],
202
+ // enum: ['refund', 'replacement'],
203
+ // default: []
204
+ // },
205
+ // returnDays: { type: Number, min: 0, default: null },
206
+ // terms: [String] // Keep existing terms for backward compatibility
207
+ // },
208
+ // sku: {
209
+ // type: String,
210
+ // required: true,
211
+ // match: [/^[A-Za-z0-9-]{6,}$/, 'SKU must be at least 6 alphanumeric characters']
212
+ // },
213
+ // // ----------end of new fields added
214
+ // images: [
215
+ // {
216
+ // key: { type: String, maxLength: 255, default: null },
217
+ // }
218
+ // ],
219
+ // category: String,
220
+ // subcategory: String,
221
+ // hsnNo: String,
222
+ // MRP: {
223
+ // type: Number,
224
+ // min: 0,
225
+ // default: null,
226
+ // },
227
+ // productPrice: {
228
+ // type: Number,
229
+ // min: 0,
230
+ // default: null,
231
+ // },
232
+ // startingPrice: {
233
+ // type: Number,
234
+ // min: 0,
235
+ // default: null,
236
+ // },
237
+ // reservedPrice: {
238
+ // type: Number,
239
+ // min: 0,
240
+ // default: null,
241
+ // },
242
+
243
+ // // --- ADDED/UPDATED FIELDS FROM FRONTEND ---
244
+ // brand: { type: String, default: null }, // ADDED
245
+ // manufacturer: String,
246
+ // manufacturerAddress: String, // ADDED in frontend, already exists here
247
+ // countryOfOrigin: String,
248
+ // netQuantity: { type: String, default: null }, // ADDED (String to accommodate units like '500g')
249
+ // packagingType: { type: String, default: null }, // ADDED
250
+ // weight: { // For shipping calculations
251
+ // value: { type: Number, default: null },
252
+ // unit: { type: String, default: null },
253
+ // },
254
+ // dimensions: { // For shipping calculations
255
+ // length: { type: Number, default: null },
256
+ // width: { type: Number, default: null },
257
+ // height: { type: Number, default: null },
258
+ // },
259
+ // expiryDate: { type: Date, default: null }, // ADDED in frontend, already exists here (changed to allow null)
260
+ // shelfLife: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
261
+ // batchNumber: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
262
+ // gstRate: { type: Number, default: null }, // Changed to allow null if needed
263
+ // sellerName: String,
264
+ // sellerContact: { type: String, default: null }, // ADDED
265
+ // sellerGSTIN: { type: String, default: null }, // ADDED
266
+ // returnPolicy: [String],
267
+ // warranty: {
268
+ // hasWarranty: { type: Boolean, default: false }, // Default added
269
+ // duration: { type: String, default: null }, // Default added
270
+ // },
271
+ // fssaiLicenseNo: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
272
+ // bisCertification: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
273
+ // importerName: { type: String, default: null }, // Default added
274
+ // importerAddress: { type: String, default: null }, // Default added
275
+ // importerGSTIN: { type: String, default: null }, // Default added
276
+ // eWasteCompliance: { type: Boolean, default: false }, // Default added
277
+ // recyclablePackaging: { type: Boolean, default: false }, // Default added
278
+ // hazardousMaterials: { type: String, default: null }, // Default added
279
+ // allowDropshipping: {
280
+ // type: Boolean,
281
+ // default: false,
282
+ // index: true,
283
+ // },
284
+ // commissionRate: {
285
+ // type: Number,
286
+ // min: [0, 'Commission rate cannot be negative.'],
287
+ // // max: [100, 'Commission rate cannot exceed 100%.'], // Max was 25, changed to 100 based on frontend
288
+ // max: [100, 'Commission rate cannot exceed 100%.'],
289
+ // default: null,
290
+ // // Removed Mongoose-level required validation dependent on allowDropshipping
291
+ // // Let application logic handle this if needed, or adjust validator
292
+ // // required: [
293
+ // // function () { return this.allowDropshipping === true; },
294
+ // // 'Commission rate is required when allowing dropshipping.'
295
+ // // ],
296
+ // // validate: { ... } // Keep or remove validation as needed
297
+ // },
298
+ // hasReturn: {
299
+ // type: Boolean,
300
+ // default: false
301
+ // },
302
+ // returnDays: {
303
+ // type: Number,
304
+ // min: 0,
305
+ // default: null
306
+ // },
307
+ // size: {
308
+ // type: String,
309
+ // default: null
310
+ // },
311
+ // isActive: {
312
+ // type: Boolean,
313
+ // default: true,
314
+ // },ratingSummary: {
315
+ // averageRating: { type: Number, default: 0 },
316
+ // totalRatings: { type: Number, default: 0 },
317
+ // ratingDistribution: {
318
+ // 1: { type: Number, default: 0 },
319
+ // 2: { type: Number, default: 0 },
320
+ // 3: { type: Number, default: 0 },
321
+ // 4: { type: Number, default: 0 },
322
+ // 5: { type: Number, default: 0 }
323
+ // }
324
+ // },
325
+ // totalReviews: { type: Number, default: 0 }
326
+ // },
327
+
328
+
329
+
330
+ // { timestamps: true }
331
+ // );
332
+ // ProductListingSchema.index({ title: 'text', description: 'text', category: 'text' });
333
+ // ProductListingSchema.index({ sellerId: 1, sku: 1 }, { unique: true });
334
+
335
+ // // Safe export to prevent OverwriteModelError
336
+ // const ProductListing = mongoose.models.productlistings || mongoose.model("productlistings", ProductListingSchema);
337
+ // export default ProductListing;
338
+
339
+
340
+
341
+
342
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flykup_model_development",
3
- "version": "3.1.28",
3
+ "version": "3.1.30",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "private": false,