payservedb 8.7.3 → 8.7.5

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": "8.7.3",
3
+ "version": "8.7.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -43,10 +43,11 @@ const serviceRequestSchema = new mongoose.Schema({
43
43
  percentage: {
44
44
  type: Number,
45
45
  },
46
- isCommissionSelected: {
47
- type: Boolean,
48
- default: false
49
- }
46
+ raisedBy: {
47
+ type: String,
48
+ enum: ['ADMIN', 'RESIDENT'],
49
+ default: 'ADMIN'
50
+ },
50
51
  }, {
51
52
  timestamps: true
52
53
  });
@@ -1,39 +1,33 @@
1
1
  const mongoose = require('mongoose');
2
2
 
3
- // Define the schema for VasVendor
4
3
  const vasVendorSchema = new mongoose.Schema({
5
4
  facilityId: {
6
5
  type: mongoose.Schema.Types.ObjectId,
7
6
  ref: 'Facility',
8
- required: true,
7
+ required: true
9
8
  },
10
9
  name: {
11
10
  type: String,
12
11
  required: true,
13
12
  trim: true
14
13
  },
15
- location: {
16
- type: String,
17
- required: true,
18
- trim: true
19
- },
20
- jobDescription: {
14
+ address: {
21
15
  type: String,
22
- required: true,
23
16
  trim: true
24
17
  },
25
- offers: [{
26
- serviceId: {
27
- type: mongoose.Schema.Types.ObjectId,
28
- ref: 'Service', // Reference to the Service model
29
- required: true
30
- },
31
- amount: {
32
- type: Number,
33
- required: true,
34
- min: [0, 'Amount must be a positive number']
18
+ offers: [
19
+ {
20
+ serviceId: {
21
+ type: mongoose.Schema.Types.ObjectId,
22
+ ref: 'ValueAddedService',
23
+ required: true
24
+ },
25
+ amount: {
26
+ type: Number,
27
+ min: 0
28
+ }
35
29
  }
36
- }],
30
+ ],
37
31
  contactDetails: {
38
32
  name: {
39
33
  type: String,
@@ -45,12 +39,17 @@ const vasVendorSchema = new mongoose.Schema({
45
39
  },
46
40
  email: {
47
41
  type: String,
48
- required: true,
49
- match: [/.+\@.+\..+/, 'Please provide a valid email address']
42
+ match: [/.+\@.+\..+/, 'Please provide a valid email']
50
43
  }
51
- }
44
+ },
45
+ status: {
46
+ type: String,
47
+ enum: ["ACTIVE", "INACTIVE"],
48
+ default: "ACTIVE"
49
+ },
50
+ notes: String
52
51
  }, {
53
- timestamps: true // This will automatically add createdAt and updatedAt fields
52
+ timestamps: true
54
53
  });
55
54
 
56
55
  const VasVendor = mongoose.model('VasVendor', vasVendorSchema);