@francesco_ksh/app-ksh-mgd-schemas 2.5.8 → 2.6.0

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.
@@ -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.8",
3
+ "version": "2.6.0",
4
4
  "description": "Mongoose schema definitions",
5
5
  "main": "index.js",
6
6
  "repository": {