flykup_model_development 3.1.59 → 3.1.61
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 +4 -0
- package/models/shows.model.js +23 -0
- package/package.json +1 -1
package/models/order.modal.js
CHANGED
package/models/shows.model.js
CHANGED
|
@@ -72,6 +72,25 @@ 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 }, // For quick reference
|
|
90
|
+
sellingPrice: { type: Number, min: 0, default: null }, // Price at time of adding to show
|
|
91
|
+
createdAt: { type: Date, default: Date.now }
|
|
92
|
+
});
|
|
93
|
+
|
|
75
94
|
|
|
76
95
|
// Show Schema with FIXED validation
|
|
77
96
|
const showSchema = new Schema(
|
|
@@ -192,6 +211,10 @@ const showSchema = new Schema(
|
|
|
192
211
|
message: 'productOwnerSellerId is required when productId is provided'
|
|
193
212
|
}
|
|
194
213
|
},
|
|
214
|
+
bundleSales: {
|
|
215
|
+
type: [bundleSaleSchema],
|
|
216
|
+
default: []
|
|
217
|
+
},
|
|
195
218
|
|
|
196
219
|
auctionProducts: {
|
|
197
220
|
type: [
|