@francesco_ksh/app-ksh-mgd-schemas 2.5.9 → 2.6.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.
package/models/Order.js CHANGED
@@ -127,6 +127,9 @@ const orderSchema = new Schema(
127
127
  carrierNotes: {
128
128
  type: String,
129
129
  },
130
+ wasBeingPromoted: {
131
+ type: Boolean,
132
+ },
130
133
  automatedDiscount: {
131
134
  discountTitle: {
132
135
  type: String,
@@ -40,20 +40,36 @@ const promotionSchema = new Schema(
40
40
  paymentMethod: {
41
41
  type: String,
42
42
  enum: ['accountBalance', 'paymentMethod'],
43
+ required: true,
43
44
  },
44
45
  stripePaymentId: {
45
46
  type: String,
47
+ default: null,
46
48
  },
47
49
  amount: {
48
50
  type: Number,
51
+ required: true,
52
+ min: 0,
49
53
  },
50
54
  daysIncluded: [
51
55
  {
52
56
  type: String,
57
+ required: true,
53
58
  },
54
59
  ],
55
60
  date: {
56
61
  type: Date,
62
+ default: Date.now,
63
+ },
64
+ status: {
65
+ type: String,
66
+ enum: ['succeeded', 'failed'], // Add enum restriction
67
+ required: true, // Consider making this required
68
+ },
69
+ error: {
70
+ // ADD THIS - missing field!
71
+ type: String,
72
+ default: null, // Only present when status is 'failed'
57
73
  },
58
74
  },
59
75
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@francesco_ksh/app-ksh-mgd-schemas",
3
- "version": "2.5.9",
3
+ "version": "2.6.1",
4
4
  "description": "Mongoose schema definitions",
5
5
  "main": "index.js",
6
6
  "repository": {