payservedb 5.9.7 → 5.9.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
package/src/models/budget.js
CHANGED
package/src/models/customer.js
CHANGED
|
@@ -25,18 +25,22 @@ const CustomerSchema = new mongoose.Schema({
|
|
|
25
25
|
type: String,
|
|
26
26
|
required: true
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
nextOfKin: [
|
|
29
|
+
{
|
|
30
|
+
name: {
|
|
31
|
+
type: String,
|
|
32
|
+
},
|
|
33
|
+
relationship: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
phoneNumber: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
email: {
|
|
40
|
+
type: String,
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
],
|
|
40
44
|
customerType: {
|
|
41
45
|
type: String,
|
|
42
46
|
required: true
|
|
@@ -5,25 +5,35 @@ const EmailSmsQueueSchema = new mongoose.Schema(
|
|
|
5
5
|
email: {
|
|
6
6
|
to: {
|
|
7
7
|
type: String,
|
|
8
|
-
required:
|
|
8
|
+
required: function () {
|
|
9
|
+
return this.type === "email";
|
|
10
|
+
},
|
|
9
11
|
},
|
|
10
12
|
subject: {
|
|
11
13
|
type: String,
|
|
12
|
-
required:
|
|
14
|
+
required: function () {
|
|
15
|
+
return this.type === "email";
|
|
16
|
+
},
|
|
13
17
|
},
|
|
14
18
|
text: {
|
|
15
19
|
type: String,
|
|
16
|
-
required:
|
|
20
|
+
required: function () {
|
|
21
|
+
return this.type === "email";
|
|
22
|
+
},
|
|
17
23
|
},
|
|
18
24
|
},
|
|
19
25
|
sms: {
|
|
20
26
|
to: {
|
|
21
27
|
type: String,
|
|
22
|
-
required:
|
|
28
|
+
required: function () {
|
|
29
|
+
return this.type === "sms";
|
|
30
|
+
},
|
|
23
31
|
},
|
|
24
32
|
message: {
|
|
25
33
|
type: String,
|
|
26
|
-
required:
|
|
34
|
+
required: function () {
|
|
35
|
+
return this.type === "sms";
|
|
36
|
+
},
|
|
27
37
|
},
|
|
28
38
|
},
|
|
29
39
|
type: {
|
|
@@ -48,6 +58,4 @@ const EmailSmsQueueSchema = new mongoose.Schema(
|
|
|
48
58
|
);
|
|
49
59
|
|
|
50
60
|
const EmailSmsQueue = mongoose.model("EmailSmsQueue", EmailSmsQueueSchema);
|
|
51
|
-
|
|
52
|
-
module.exports = EmailSmsQueue ;
|
|
53
|
-
|
|
61
|
+
module.exports = EmailSmsQueue;
|
|
@@ -1,104 +1,113 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
|
|
3
3
|
const goodsReceivedNoteSchema = new mongoose.Schema({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
facilityId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: 'Facility',
|
|
7
|
+
required: true,
|
|
8
|
+
index: true
|
|
9
|
+
},
|
|
10
|
+
poNumber: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
trim: true,
|
|
14
|
+
index: true
|
|
15
|
+
},
|
|
16
|
+
supplier: {
|
|
17
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
+
ref: 'Supplier',
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
poId: {
|
|
22
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
23
|
+
ref: 'PurchaseOrder',
|
|
24
|
+
required: true,
|
|
25
|
+
index: true
|
|
26
|
+
},
|
|
27
|
+
poQuantity: {
|
|
28
|
+
type: Number,
|
|
29
|
+
min: 0
|
|
30
|
+
},
|
|
31
|
+
quantityReceived: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: true,
|
|
34
|
+
min: 0
|
|
35
|
+
},
|
|
36
|
+
receivedBy: {
|
|
37
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
38
|
+
ref: 'User',
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
receivedDate: {
|
|
42
|
+
type: Date,
|
|
43
|
+
required: true,
|
|
44
|
+
default: Date.now
|
|
45
|
+
},
|
|
46
|
+
description: {
|
|
47
|
+
type: String,
|
|
48
|
+
trim: true
|
|
49
|
+
},
|
|
50
|
+
files: [{
|
|
51
|
+
fileName: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: true
|
|
9
54
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
trim: true,
|
|
14
|
-
index: true
|
|
55
|
+
fileType: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true
|
|
15
58
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
59
|
+
fileUrl: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: true
|
|
62
|
+
}
|
|
63
|
+
}],
|
|
64
|
+
approvalWorkflowId: {
|
|
65
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
66
|
+
ref: 'ApprovalWorkflow',
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
approvalStatus: {
|
|
70
|
+
type: String,
|
|
71
|
+
enum: ['pending', 'in_progress', 'approved', 'rejected'],
|
|
72
|
+
default: 'pending',
|
|
73
|
+
index: true
|
|
74
|
+
},
|
|
75
|
+
currentStep: {
|
|
76
|
+
type: Number,
|
|
77
|
+
default: 1,
|
|
78
|
+
min: 1
|
|
79
|
+
},
|
|
80
|
+
approvals: [{
|
|
81
|
+
stepNumber: {
|
|
82
|
+
type: Number,
|
|
83
|
+
required: true
|
|
21
84
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
min: 0
|
|
85
|
+
stepName: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: true
|
|
26
88
|
},
|
|
27
|
-
|
|
89
|
+
approvers: [{
|
|
90
|
+
userId: {
|
|
28
91
|
type: mongoose.Schema.Types.ObjectId,
|
|
29
92
|
ref: 'User',
|
|
30
93
|
required: true
|
|
31
|
-
},
|
|
32
|
-
receivedDate: {
|
|
33
|
-
type: Date,
|
|
34
|
-
required: true,
|
|
35
|
-
default: Date.now
|
|
36
|
-
},
|
|
37
|
-
description: {
|
|
38
|
-
type: String,
|
|
39
|
-
trim: true
|
|
40
|
-
},
|
|
41
|
-
files: [{
|
|
42
|
-
fileName: {
|
|
43
|
-
type: String,
|
|
44
|
-
required: true
|
|
45
|
-
},
|
|
46
|
-
fileType: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: true
|
|
49
|
-
},
|
|
50
|
-
fileUrl: {
|
|
51
|
-
type: String,
|
|
52
|
-
required: true
|
|
53
|
-
}
|
|
54
|
-
}],
|
|
55
|
-
approvalWorkflowId: {
|
|
56
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
57
|
-
ref: 'ApprovalWorkflow',
|
|
58
|
-
required: true
|
|
59
94
|
},
|
|
60
|
-
|
|
95
|
+
status: {
|
|
61
96
|
type: String,
|
|
62
|
-
enum: ['pending', '
|
|
63
|
-
default: 'pending'
|
|
64
|
-
index: true
|
|
97
|
+
enum: ['pending', 'approved', 'rejected'],
|
|
98
|
+
default: 'pending'
|
|
65
99
|
},
|
|
66
|
-
|
|
67
|
-
type:
|
|
68
|
-
default: 1,
|
|
69
|
-
min: 1
|
|
100
|
+
actionDate: {
|
|
101
|
+
type: Date
|
|
70
102
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
type: String,
|
|
78
|
-
required: true
|
|
79
|
-
},
|
|
80
|
-
approvers: [{
|
|
81
|
-
userId: {
|
|
82
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
83
|
-
ref: 'User',
|
|
84
|
-
required: true
|
|
85
|
-
},
|
|
86
|
-
status: {
|
|
87
|
-
type: String,
|
|
88
|
-
enum: ['pending', 'approved', 'rejected'],
|
|
89
|
-
default: 'pending'
|
|
90
|
-
},
|
|
91
|
-
actionDate: {
|
|
92
|
-
type: Date
|
|
93
|
-
},
|
|
94
|
-
comments: {
|
|
95
|
-
type: String,
|
|
96
|
-
trim: true
|
|
97
|
-
}
|
|
98
|
-
}]
|
|
99
|
-
}]
|
|
103
|
+
comments: {
|
|
104
|
+
type: String,
|
|
105
|
+
trim: true
|
|
106
|
+
}
|
|
107
|
+
}]
|
|
108
|
+
}]
|
|
100
109
|
}, {
|
|
101
|
-
|
|
110
|
+
timestamps: true
|
|
102
111
|
});
|
|
103
112
|
|
|
104
113
|
const GoodsReceivedNote = mongoose.model('GoodsReceivedNote', goodsReceivedNoteSchema);
|
|
@@ -8,7 +8,7 @@ const purchaseOrderInvoiceSchema = new mongoose.Schema({
|
|
|
8
8
|
},
|
|
9
9
|
purchaseOrderId: {
|
|
10
10
|
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
-
ref: '
|
|
11
|
+
ref: 'PurchaseOrder',
|
|
12
12
|
required: true,
|
|
13
13
|
index: true
|
|
14
14
|
},
|
|
@@ -23,6 +23,14 @@ const purchaseOrderInvoiceSchema = new mongoose.Schema({
|
|
|
23
23
|
required: true,
|
|
24
24
|
min: 0
|
|
25
25
|
},
|
|
26
|
+
quantityReceived: {
|
|
27
|
+
type: Number,
|
|
28
|
+
min: 0
|
|
29
|
+
},
|
|
30
|
+
quantityBalance: {
|
|
31
|
+
type: Number,
|
|
32
|
+
min: 0
|
|
33
|
+
},
|
|
26
34
|
totalAmount: {
|
|
27
35
|
type: Number,
|
|
28
36
|
required: true,
|
|
@@ -38,6 +46,11 @@ const purchaseOrderInvoiceSchema = new mongoose.Schema({
|
|
|
38
46
|
type: String,
|
|
39
47
|
trim: true
|
|
40
48
|
},
|
|
49
|
+
supplier: {
|
|
50
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
51
|
+
ref: 'Supplier',
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
41
54
|
files: [{
|
|
42
55
|
fileName: {
|
|
43
56
|
type: String,
|