payservedb 2.9.4 → 2.9.6
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/index.js +1 -1
- package/package.json +1 -1
- package/src/models/maintenancerequisition.js +8 -25
package/index.js
CHANGED
|
@@ -98,7 +98,7 @@ const models = {
|
|
|
98
98
|
Stocksandspare:require('./src/models/stocksandspare'),
|
|
99
99
|
ServiceVendor:require('./src/models/maintenance_service_vendor'),
|
|
100
100
|
MaintenanceServices:require('./src/models/maintenance_services'),
|
|
101
|
-
|
|
101
|
+
StockRequisition:require('./src/models/maintenancerequisition'),
|
|
102
102
|
LeaseAgreement:require('./src/models/leaseagreement'),
|
|
103
103
|
WorkOrder:require('./src/models/workorder'),
|
|
104
104
|
ServiceInvoice:require('./src/models/service_invoice'),
|
package/package.json
CHANGED
|
@@ -3,37 +3,20 @@ const mongoose = require('mongoose');
|
|
|
3
3
|
const requisitionSchema = new mongoose.Schema({
|
|
4
4
|
facilityId: {
|
|
5
5
|
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: 'Facility',
|
|
7
|
-
required: true,
|
|
6
|
+
ref: 'Facility',
|
|
7
|
+
required: [true, 'Facility ID is required']
|
|
8
8
|
},
|
|
9
|
-
|
|
9
|
+
stockId: {
|
|
10
10
|
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
-
ref: 'Stocksandspare',
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
vendorId: {
|
|
15
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
16
|
-
ref: 'ServiceVendor',
|
|
17
|
-
required: true,
|
|
11
|
+
ref: 'Stocksandspare',
|
|
12
|
+
required: [true, 'stock ID is required']
|
|
18
13
|
},
|
|
19
|
-
|
|
20
|
-
type: Date,
|
|
21
|
-
required: true,
|
|
22
|
-
default: Date.now,
|
|
23
|
-
},
|
|
24
|
-
quantity: {
|
|
25
|
-
type: Number,
|
|
26
|
-
required: true,
|
|
27
|
-
min: 1,
|
|
28
|
-
},
|
|
29
|
-
status: {
|
|
14
|
+
description: {
|
|
30
15
|
type: String,
|
|
31
|
-
enum: ['Pending', 'Approved', 'Rejected', 'Completed'],
|
|
32
16
|
required: true,
|
|
33
|
-
|
|
34
|
-
},
|
|
17
|
+
}
|
|
35
18
|
}, {
|
|
36
19
|
timestamps: true,
|
|
37
20
|
});
|
|
38
21
|
|
|
39
|
-
module.exports = mongoose.model('
|
|
22
|
+
module.exports = mongoose.model('StockRequisition', requisitionSchema);
|