payservedb 6.4.6 → 6.4.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "6.4.6",
3
+ "version": "6.4.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -37,11 +37,17 @@ const CampaignSchema = new mongoose.Schema({
37
37
  trim: true,
38
38
  maxlength: 200
39
39
  },
40
- channels: [{
41
- type: String,
42
- enum: ['SMS'],
43
- required: true
44
- }],
40
+ channels: {
41
+ type: [String],
42
+ enum: ['SMS', 'Email'],
43
+ required: true,
44
+ validate: {
45
+ validator: function (value) {
46
+ return value && value.length > 0;
47
+ },
48
+ message: 'At least one channel must be selected'
49
+ }
50
+ },
45
51
  status: {
46
52
  type: String,
47
53
  enum: ['Draft', 'Ongoing', 'Completed'],
@@ -70,4 +76,4 @@ CampaignSchema.path('channels').validate(function (value) {
70
76
 
71
77
  const Campaign = mongoose.model('Campaign', CampaignSchema);
72
78
 
73
- module.exports =Campaign;
79
+ module.exports = Campaign;