flykup_model_development 3.0.0 → 3.0.1

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.
@@ -0,0 +1,66 @@
1
+ import mongoose from 'mongoose';
2
+
3
+ const paymentSchema = new mongoose.Schema({
4
+ orderId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: 'Order',
7
+ required: true
8
+ },
9
+ cfOrderId: {
10
+ type: String,
11
+ required: false,
12
+ default: null
13
+ },
14
+ cfPaymentSessionId: {
15
+ type: String,
16
+ required: false,
17
+ default: null
18
+ },
19
+ // Razorpay fields
20
+ razorpayOrderId: {
21
+ type: String,
22
+ required: false,
23
+ default: null
24
+ },
25
+ razorpayPaymentId: {
26
+ type: String,
27
+ required: false,
28
+ default: null
29
+ },
30
+ userId: {
31
+ type: mongoose.Schema.Types.ObjectId,
32
+ ref: 'users',
33
+ required: true
34
+ },
35
+ amount: {
36
+ type: Number,
37
+ required: true
38
+ },
39
+ currency: {
40
+ type: String,
41
+ default: 'INR'
42
+ },
43
+ status: {
44
+ type: String,
45
+ enum: ['PENDING', 'SUCCESS', 'FAILED',"REFUNDED"],
46
+ default: 'PENDING'
47
+ },
48
+ paymentMethod: String,
49
+ transactionId: String,
50
+ transactionTime: Date,
51
+ sellerPayments: [{
52
+ sellerId: {
53
+ type: mongoose.Schema.Types.ObjectId,
54
+ ref: 'users',
55
+ required: true
56
+ },
57
+ amount: Number,
58
+ settlementStatus: {
59
+ type: String,
60
+ enum: ['PENDING', 'SETTLED'],
61
+ default: 'PENDING'
62
+ }
63
+ }]
64
+ }, { timestamps: true });
65
+ const OrderPayment = mongoose.model('orderPayment', paymentSchema);
66
+ export default OrderPayment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flykup_model_development",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "private": false,