flykup_model_production 1.0.12 → 1.0.13

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.
@@ -20,7 +20,8 @@ const notificationSchema = new mongoose.Schema(
20
20
  'admin_broadcast',
21
21
  'seller_broadcast',
22
22
  'live_stream_start',
23
- 'seller_order_update'
23
+ 'seller_order_update',
24
+ 'new_show_scheduled'
24
25
  ],
25
26
  required: true,
26
27
  },
@@ -61,16 +61,30 @@ const paymentSchema = new mongoose.Schema({
61
61
  },
62
62
  paymentMethod: String,
63
63
  transactionTime: Date,
64
- sellerPayments: [{
64
+ sellerPayments: [{
65
65
  sellerId: {
66
66
  type: mongoose.Schema.Types.ObjectId,
67
67
  ref: 'users',
68
68
  required: true
69
69
  },
70
- amount: Number,
70
+ payableAmount: { // Amount for products only
71
+ type: Number,
72
+ required: true,
73
+ default: 0
74
+ },
75
+ deliveryCharge: { // Delivery fee for this seller's shipment
76
+ type: Number,
77
+ required: true,
78
+ default: 0
79
+ },
80
+ totalAmount: { // The sum of payableAmount + deliveryCharge
81
+ type: Number,
82
+ required: true,
83
+ default: 0
84
+ },
71
85
  settlementStatus: {
72
86
  type: String,
73
- enum: ['PENDING', 'SETTLED','FAILED'],
87
+ enum: ['PENDING', 'SETTLED', 'FAILED'],
74
88
  default: 'PENDING'
75
89
  }
76
90
  }]
@@ -81,7 +95,7 @@ const paymentSchema = new mongoose.Schema({
81
95
  // Create indexes for better performance
82
96
  paymentSchema.index({ razorpayOrderId: 1 });
83
97
  // paymentSchema.index({ cfOrderId: 1 });
84
- // paymentSchema.index({ orderId: 1 });
98
+ paymentSchema.index({ orderId: 1 });
85
99
 
86
100
  // ❌ The pre-save middleware is no longer needed and should be removed.
87
101
 
@@ -191,7 +191,38 @@ isEligibleToPlay: {
191
191
  type: Boolean,
192
192
  default: false, // Default to true, can be set to false if video is not eligible for playback
193
193
  index: true // Index for quick lookups
194
- }
194
+ },
195
+ // Admin Approval Fields
196
+ approvalStatus: {
197
+ type: String,
198
+ enum: ['pending', 'approved', 'rejected'],
199
+ default: 'pending',
200
+ index: true
201
+ },
202
+ approvedBy: {
203
+ type: Schema.Types.ObjectId,
204
+ ref: 'Admin',
205
+ default: null
206
+ },
207
+ approvedAt: {
208
+ type: Date,
209
+ default: null
210
+ },
211
+ rejectionReason: {
212
+ type: String,
213
+ default: null,
214
+ trim: true
215
+ },
216
+ rejectedBy: {
217
+ type: Schema.Types.ObjectId,
218
+ ref: 'Admin',
219
+ default: null
220
+ },
221
+ rejectedAt: {
222
+ type: Date,
223
+ default: null
224
+ },
225
+
195
226
  },
196
227
  { timestamps: true }
197
228
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flykup_model_production",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "private": false,