database-connector 2.3.14 → 2.4.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.
Files changed (2) hide show
  1. package/models/Payment.js +7 -32
  2. package/package.json +1 -1
package/models/Payment.js CHANGED
@@ -11,8 +11,6 @@ const mongoose = require('mongoose');
11
11
  * - paymentStatus
12
12
  * - paymentAmount
13
13
  * - paymentCurrency
14
- * - paymentDate
15
- * - paymentTime
16
14
  * - paymentDetails
17
15
  * - token
18
16
  * properties:
@@ -51,16 +49,8 @@ const mongoose = require('mongoose');
51
49
  * description: Reference to payment method type (PaymentType)
52
50
  * paymentDate:
53
51
  * type: string
54
- * format: date
55
- * description: Date of payment
56
- * paymentTime:
57
- * type: string
58
52
  * format: date-time
59
- * description: Time of payment
60
- * totalPrice:
61
- * type: number
62
- * default: 0
63
- * description: Total price
53
+ * description: Payment date (defaults to current date/time)
64
54
  * token:
65
55
  * type: string
66
56
  * description: Payment token
@@ -75,11 +65,11 @@ const mongoose = require('mongoose');
75
65
  * creatorId: "507f1f77bcf86cd799439012"
76
66
  * ownerId: "507f1f77bcf86cd799439013"
77
67
  * gateway: "Stripe"
78
- * paymentStatus: "succeeded"
68
+ * paymentStatus: "completed"
79
69
  * paymentAmount: 150.00
80
70
  * paymentCurrency: "USD"
81
71
  * paymentMethodId: "507f1f77bcf86cd799439020"
82
- * totalPrice: 150.00
72
+ * paymentDate: "2025-12-07T10:30:00.000Z"
83
73
  * createdAt: "2025-12-07T10:30:00.000Z"
84
74
  * updatedAt: "2025-12-07T10:30:00.000Z"
85
75
  */
@@ -101,7 +91,6 @@ const paymentSchema = new mongoose.Schema(
101
91
  type: String,
102
92
  required: true,
103
93
  },
104
-
105
94
  paymentStatus: {
106
95
  type: String,
107
96
  required: true,
@@ -124,31 +113,17 @@ const paymentSchema = new mongoose.Schema(
124
113
  },
125
114
  paymentDate: {
126
115
  type: Date,
127
- required: true,
128
- },
129
- paymentTime: {
130
- type: Date,
131
- required: true,
116
+ required: false,
117
+ default: Date.now,
132
118
  },
133
119
  paymentDetails: {
134
120
  type: Object,
135
121
  required: true,
136
122
  },
137
- totalPrice: {
138
- type: Number,
139
- required: true,
140
- default: 0,
141
- },
142
- // transactions field removed: Transactions are no longer tracked as a separate model
143
- timestamps: {
144
- type: Date,
145
- required: true,
146
- default: Date.now()
147
- },
148
123
  token: {
149
124
  type: String,
150
- required: true
151
- }
125
+ required: true,
126
+ },
152
127
  },
153
128
  { timestamps: true }
154
129
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.3.14",
3
+ "version": "2.4.1",
4
4
  "description": "MongoDB models package with Mongoose schemas for e-commerce applications. Includes User, Product, Store, Order and more with built-in validation and virtual properties.",
5
5
  "main": "models/index.js",
6
6
  "scripts": {