payservedb 5.3.7 → 5.3.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": "5.3.7",
3
+ "version": "5.3.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -56,10 +56,55 @@ const purchaseRequestSchema = new mongoose.Schema({
56
56
  enum: ['PO Raised', 'pending'],
57
57
  default: 'pending',
58
58
  index: true
59
- }
60
- }, {
61
- timestamps: true
62
- });
59
+ },
60
+ approvalWorkflowId: {
61
+ type: mongoose.Schema.Types.ObjectId,
62
+ ref: 'ApprovalWorkflow',
63
+ required: true
64
+ },
65
+ approvalStatus: {
66
+ type: String,
67
+ enum: ['pending', 'in_progress', 'approved', 'rejected'],
68
+ default: 'pending',
69
+ index: true
70
+ },
71
+ currentStep: {
72
+ type: Number,
73
+ default: 1,
74
+ min: 1
75
+ },
76
+ approvals: [{
77
+ stepNumber: {
78
+ type: Number,
79
+ required: true
80
+ },
81
+ stepName: {
82
+ type: String,
83
+ required: true
84
+ },
85
+ approvers: [{
86
+ userId: {
87
+ type: mongoose.Schema.Types.ObjectId,
88
+ ref: 'User',
89
+ required: true
90
+ },
91
+ status: {
92
+ type: String,
93
+ enum: ['pending', 'approved', 'rejected'],
94
+ default: 'pending'
95
+ },
96
+ actionDate: {
97
+ type: Date
98
+ },
99
+ comments: {
100
+ type: String,
101
+ trim: true
102
+ }
103
+ }]
104
+ }]
105
+ }, {
106
+ timestamps: true
107
+ });
63
108
 
64
109
  const PurchaseRequest = mongoose.model('PurchaseRequest', purchaseRequestSchema);
65
110