payservedb 7.9.7 → 7.9.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
|
@@ -44,6 +44,26 @@ const inspectionItemSchema = new mongoose.Schema({
|
|
|
44
44
|
default: 1,
|
|
45
45
|
min: [1, 'Default quantity must be at least 1']
|
|
46
46
|
},
|
|
47
|
+
serialNumber: {
|
|
48
|
+
type: String,
|
|
49
|
+
trim: true,
|
|
50
|
+
default: null
|
|
51
|
+
},
|
|
52
|
+
cost: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 0,
|
|
55
|
+
min: [0, 'Cost cannot be negative']
|
|
56
|
+
},
|
|
57
|
+
currencyId: {
|
|
58
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
59
|
+
ref: 'Currency',
|
|
60
|
+
required: false,
|
|
61
|
+
default: null
|
|
62
|
+
},
|
|
63
|
+
images: [{
|
|
64
|
+
type: String,
|
|
65
|
+
trim: true
|
|
66
|
+
}],
|
|
47
67
|
active: {
|
|
48
68
|
type: Boolean,
|
|
49
69
|
default: true
|
|
@@ -52,6 +72,12 @@ const inspectionItemSchema = new mongoose.Schema({
|
|
|
52
72
|
type: mongoose.Schema.Types.ObjectId,
|
|
53
73
|
ref: 'Facility',
|
|
54
74
|
required: true
|
|
75
|
+
},
|
|
76
|
+
unitId: {
|
|
77
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
78
|
+
ref: 'Unit',
|
|
79
|
+
required: false,
|
|
80
|
+
default: null
|
|
55
81
|
}
|
|
56
82
|
}, {
|
|
57
83
|
timestamps: true
|
|
@@ -61,6 +87,9 @@ const inspectionItemSchema = new mongoose.Schema({
|
|
|
61
87
|
inspectionItemSchema.index({ facilityId: 1 });
|
|
62
88
|
inspectionItemSchema.index({ facilityId: 1, category: 1 });
|
|
63
89
|
inspectionItemSchema.index({ facilityId: 1, active: 1 });
|
|
90
|
+
inspectionItemSchema.index({ facilityId: 1, unitId: 1 });
|
|
91
|
+
inspectionItemSchema.index({ unitId: 1, active: 1 });
|
|
92
|
+
inspectionItemSchema.index({ currencyId: 1 });
|
|
64
93
|
|
|
65
94
|
// Create InspectionItem model
|
|
66
95
|
const InspectionItem = mongoose.model('InspectionItem', inspectionItemSchema);
|