flykup_model_development 3.1.12 → 3.1.14

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.
@@ -182,7 +182,6 @@ const orderSchema = new mongoose.Schema(
182
182
  sourceRefId: String,
183
183
  deliveryCharge: {
184
184
  type: Number,
185
- default: 40
186
185
  },
187
186
  statusTimeline: {
188
187
  ordered: Date,
@@ -1,3 +1,7 @@
1
+
2
+
3
+
4
+
1
5
  // backend/models/ProductListing.js (or similar path)
2
6
  import mongoose from "mongoose";
3
7
  const { Schema } = mongoose;
@@ -17,7 +21,11 @@ const ProductListingSchema = new Schema(
17
21
  endsAt: { type: Date, default: null },
18
22
  startsAt: { type: Date, default: null }
19
23
  },
20
-
24
+ sku: {
25
+ type: String,
26
+ required: true,
27
+ index: true
28
+ },
21
29
  images: [
22
30
  {
23
31
  key: { type: String, maxLength: 255, default: null },
@@ -139,3 +147,181 @@ ProductListingSchema.index({ title: 'text', description: 'text', category: 'text
139
147
  // Safe export to prevent OverwriteModelError
140
148
  const ProductListing = mongoose.models.productlistings || mongoose.model("productlistings", ProductListingSchema);
141
149
  export default ProductListing;
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ // // backend/models/ProductListing.js (or similar path)
162
+ // import mongoose from "mongoose";
163
+ // const { Schema } = mongoose;
164
+
165
+ // const ProductListingSchema = new Schema(
166
+ // {
167
+ // sellerId: { type: Schema.Types.ObjectId, ref: "sellers" },
168
+ // stockId: { type: Schema.Types.ObjectId, ref: "stocks" },
169
+ // title: String,
170
+ // description: String,
171
+ // flashSale: {
172
+ // isActive: { type: Boolean, default: false },
173
+ // flashSaleId: { type: mongoose.Schema.Types.ObjectId, ref: 'FlashSale' },
174
+ // flashPrice: { type: Number, default: 0 },
175
+ // flashStock: { type: Number, default: 0 },
176
+ // originalPrice: { type: Number, default: 0 },
177
+ // endsAt: { type: Date, default: null },
178
+ // startsAt: { type: Date, default: null }
179
+ // },
180
+
181
+ // //new fields added
182
+
183
+ // returnPolicy: {
184
+ // hasReturn: { type: Boolean, default: false },
185
+ // returnType: {
186
+ // type: [String],
187
+ // enum: ['refund', 'replacement'],
188
+ // default: []
189
+ // },
190
+ // returnDays: { type: Number, min: 0, default: null },
191
+ // terms: [String] // Keep existing terms for backward compatibility
192
+ // },
193
+ // sku: {
194
+ // type: String,
195
+ // required: true,
196
+ // match: [/^[A-Za-z0-9-]{6,}$/, 'SKU must be at least 6 alphanumeric characters']
197
+ // },
198
+ // // ----------end of new fields added
199
+ // images: [
200
+ // {
201
+ // key: { type: String, maxLength: 255, default: null },
202
+ // }
203
+ // ],
204
+ // category: String,
205
+ // subcategory: String,
206
+ // hsnNo: String,
207
+ // MRP: {
208
+ // type: Number,
209
+ // min: 0,
210
+ // default: null,
211
+ // },
212
+ // productPrice: {
213
+ // type: Number,
214
+ // min: 0,
215
+ // default: null,
216
+ // },
217
+ // startingPrice: {
218
+ // type: Number,
219
+ // min: 0,
220
+ // default: null,
221
+ // },
222
+ // reservedPrice: {
223
+ // type: Number,
224
+ // min: 0,
225
+ // default: null,
226
+ // },
227
+
228
+ // // --- ADDED/UPDATED FIELDS FROM FRONTEND ---
229
+ // brand: { type: String, default: null }, // ADDED
230
+ // manufacturer: String,
231
+ // manufacturerAddress: String, // ADDED in frontend, already exists here
232
+ // countryOfOrigin: String,
233
+ // netQuantity: { type: String, default: null }, // ADDED (String to accommodate units like '500g')
234
+ // packagingType: { type: String, default: null }, // ADDED
235
+ // weight: { // For shipping calculations
236
+ // value: { type: Number, default: null },
237
+ // unit: { type: String, default: null },
238
+ // },
239
+ // dimensions: { // For shipping calculations
240
+ // length: { type: Number, default: null },
241
+ // width: { type: Number, default: null },
242
+ // height: { type: Number, default: null },
243
+ // },
244
+ // expiryDate: { type: Date, default: null }, // ADDED in frontend, already exists here (changed to allow null)
245
+ // shelfLife: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
246
+ // batchNumber: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
247
+ // gstRate: { type: Number, default: null }, // Changed to allow null if needed
248
+ // sellerName: String,
249
+ // sellerContact: { type: String, default: null }, // ADDED
250
+ // sellerGSTIN: { type: String, default: null }, // ADDED
251
+ // returnPolicy: [String],
252
+ // warranty: {
253
+ // hasWarranty: { type: Boolean, default: false }, // Default added
254
+ // duration: { type: String, default: null }, // Default added
255
+ // },
256
+ // fssaiLicenseNo: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
257
+ // bisCertification: { type: String, default: null }, // ADDED in frontend, already exists here (changed to allow null)
258
+ // importerName: { type: String, default: null }, // Default added
259
+ // importerAddress: { type: String, default: null }, // Default added
260
+ // importerGSTIN: { type: String, default: null }, // Default added
261
+ // eWasteCompliance: { type: Boolean, default: false }, // Default added
262
+ // recyclablePackaging: { type: Boolean, default: false }, // Default added
263
+ // hazardousMaterials: { type: String, default: null }, // Default added
264
+ // allowDropshipping: {
265
+ // type: Boolean,
266
+ // default: false,
267
+ // index: true,
268
+ // },
269
+ // commissionRate: {
270
+ // type: Number,
271
+ // min: [0, 'Commission rate cannot be negative.'],
272
+ // // max: [100, 'Commission rate cannot exceed 100%.'], // Max was 25, changed to 100 based on frontend
273
+ // max: [100, 'Commission rate cannot exceed 100%.'],
274
+ // default: null,
275
+ // // Removed Mongoose-level required validation dependent on allowDropshipping
276
+ // // Let application logic handle this if needed, or adjust validator
277
+ // // required: [
278
+ // // function () { return this.allowDropshipping === true; },
279
+ // // 'Commission rate is required when allowing dropshipping.'
280
+ // // ],
281
+ // // validate: { ... } // Keep or remove validation as needed
282
+ // },
283
+ // hasReturn: {
284
+ // type: Boolean,
285
+ // default: false
286
+ // },
287
+ // returnDays: {
288
+ // type: Number,
289
+ // min: 0,
290
+ // default: null
291
+ // },
292
+ // size: {
293
+ // type: String,
294
+ // default: null
295
+ // },
296
+ // isActive: {
297
+ // type: Boolean,
298
+ // default: true,
299
+ // },ratingSummary: {
300
+ // averageRating: { type: Number, default: 0 },
301
+ // totalRatings: { type: Number, default: 0 },
302
+ // ratingDistribution: {
303
+ // 1: { type: Number, default: 0 },
304
+ // 2: { type: Number, default: 0 },
305
+ // 3: { type: Number, default: 0 },
306
+ // 4: { type: Number, default: 0 },
307
+ // 5: { type: Number, default: 0 }
308
+ // }
309
+ // },
310
+ // totalReviews: { type: Number, default: 0 }
311
+ // },
312
+
313
+
314
+
315
+ // { timestamps: true }
316
+ // );
317
+ // ProductListingSchema.index({ title: 'text', description: 'text', category: 'text' });
318
+ // ProductListingSchema.index({ sellerId: 1, sku: 1 }, { unique: true });
319
+
320
+ // // Safe export to prevent OverwriteModelError
321
+ // const ProductListing = mongoose.models.productlistings || mongoose.model("productlistings", ProductListingSchema);
322
+ // export default ProductListing;
323
+
324
+
325
+
326
+
327
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flykup_model_development",
3
- "version": "3.1.12",
3
+ "version": "3.1.14",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "private": false,
package/test.html ADDED
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>HLS Player</title>
5
+ </head>
6
+ <body>
7
+ <video width="640" height="360" controls autoplay>
8
+ <source src="https://d2jp9e7w3mhbvf.cloudfront.net/optimized/baab3401-1115-4a9c-97d5-85fad47eb8bd/master.m3u8" type="application/x-mpegURL">
9
+ Your browser does not support the video tag.
10
+ </video>
11
+ </body>
12
+ </html>