payservedb 5.4.8 → 5.4.9

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": "5.4.8",
3
+ "version": "5.4.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -4,31 +4,88 @@ const budgetSchema = new mongoose.Schema({
4
4
  facilityId: {
5
5
  type: mongoose.Schema.Types.ObjectId,
6
6
  ref: 'Facility',
7
+ required: true,
8
+ index: true
9
+ },
10
+ budgetName: {
11
+ type: String,
12
+ required: true,
13
+ trim: true
14
+ },
15
+ allocation: {
16
+ type: Number,
17
+ required: true
18
+ },
19
+ userName: {
20
+ type: String,
21
+ required: true
22
+ },
23
+ startDate: {
24
+ type: Date,
7
25
  required: true
8
26
  },
9
- categoryId: {
27
+ endDate: {
28
+ type: Date,
29
+ required: true
30
+ },
31
+ department: {
32
+ type: String,
33
+ required: true,
34
+ trim: true
35
+ },
36
+ overruns: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ approvalWorkflowId: {
10
41
  type: mongoose.Schema.Types.ObjectId,
11
- ref: 'BudgetCategory',
42
+ ref: 'ApprovalWorkflow',
12
43
  required: true
13
44
  },
14
- amount: {
45
+ approvalStatus: {
46
+ type: String,
47
+ enum: ['pending', 'in_progress', 'approved', 'rejected'],
48
+ default: 'pending',
49
+ index: true
50
+ },
51
+ currentStep: {
15
52
  type: Number,
16
- required: true
53
+ default: 1,
54
+ min: 1
17
55
  },
18
- period: {
19
- startDate: {
20
- type: Date,
56
+ approvals: [{
57
+ stepNumber: {
58
+ type: Number,
21
59
  required: true
22
60
  },
23
- endDate: {
24
- type: Date,
61
+ stepName: {
62
+ type: String,
25
63
  required: true
26
- }
27
- }
64
+ },
65
+ approvers: [{
66
+ userId: {
67
+ type: mongoose.Schema.Types.ObjectId,
68
+ ref: 'User',
69
+ required: true
70
+ },
71
+ status: {
72
+ type: String,
73
+ enum: ['pending', 'approved', 'rejected'],
74
+ default: 'pending'
75
+ },
76
+ actionDate: {
77
+ type: Date
78
+ },
79
+ comments: {
80
+ type: String,
81
+ trim: true
82
+ }
83
+ }]
84
+ }]
28
85
  }, {
29
86
  timestamps: true
30
87
  });
31
88
 
32
89
  const Budget = mongoose.model('Budget', budgetSchema);
33
90
 
34
- module.exports = Budget;
91
+ module.exports = Budget;