database-connector 2.1.1 → 2.1.2

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/Order.js +11 -2
  2. package/package.json +1 -1
package/models/Order.js CHANGED
@@ -252,8 +252,17 @@ const orderSchema = new mongoose.Schema(
252
252
 
253
253
  paymentInfos: {
254
254
  totalAmount: { type: Number, required: true },
255
- paymentMethodId: { type: Number, required: true, },
256
- paymentIntentId: { type: Number, required: false, default: null }
255
+ paymentMethodId: {
256
+ type: mongoose.Schema.Types.ObjectId,
257
+ required: true,
258
+ ref: 'PaymentType',
259
+ },
260
+ paymentIntentId: {
261
+ type: mongoose.Schema.Types.ObjectId,
262
+ required: false,
263
+ ref: 'Payment',
264
+ default: null
265
+ }
257
266
  },
258
267
  pickUp: { type: Boolean, required: true, default: null },
259
268
  delivery: { type: Boolean, required: true, default: null },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "database-connector",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
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": {