|
|
|
@ -289,7 +289,38 @@ const sensorquotationSchema = new mongoose.Schema({
|
|
|
|
|
qutation_total_price: { type: String, default: null },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const hardwareCartSchema = new mongoose.Schema({
|
|
|
|
|
productId: { type: String},
|
|
|
|
|
productName: { type: String },
|
|
|
|
|
description: { type: String, default: null },
|
|
|
|
|
GST: { type: Number, min: 0 },
|
|
|
|
|
unitPrice: { type: Number, min: 0 },
|
|
|
|
|
quantity: { type: Number, min: 1 },
|
|
|
|
|
grandTotal: { type: Number, min: 0 },
|
|
|
|
|
totalAmount: { type: Number, min: 0 }, // Amount before GST
|
|
|
|
|
serialId: { type: String, default: null },
|
|
|
|
|
category: { type: String, enum: ['slaves', 'master', 'switches'], default: 'slaves' },
|
|
|
|
|
discount: { type: Number, default: 0, min: 0 },
|
|
|
|
|
}, {
|
|
|
|
|
timestamps: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const serviceCartSchema = new mongoose.Schema({
|
|
|
|
|
installationId: {type: String},
|
|
|
|
|
productId: { type: String},
|
|
|
|
|
productName: { type: String },
|
|
|
|
|
description: { type: String, default: null },
|
|
|
|
|
GST: { type: Number, min: 0 },
|
|
|
|
|
unitPrice: { type: Number, min: 0 },
|
|
|
|
|
quantity: { type: Number, min: 1 },
|
|
|
|
|
grandTotal: { type: Number, min: 0 },
|
|
|
|
|
totalAmount: { type: Number, min: 0 }, // Amount before GST
|
|
|
|
|
serialId: { type: String, default: null },
|
|
|
|
|
category: { type: String, enum: ['slaves', 'master', 'switches'], default: 'slaves' },
|
|
|
|
|
discount: { type: Number, default: 0, min: 0 },
|
|
|
|
|
}, {
|
|
|
|
|
timestamps: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const Insensors = mongoose.model('Insensors', insensorsSchema);
|
|
|
|
|
const Store = mongoose.model("Store", storeSchema);
|
|
|
|
@ -300,6 +331,8 @@ const sensorquotationSchema = new mongoose.Schema({
|
|
|
|
|
const SensorQuotation = mongoose.model('SensorQuotationSchema', sensorquotationSchema);
|
|
|
|
|
|
|
|
|
|
const Install = mongoose.model("Install", installationschema);
|
|
|
|
|
const HardwareCart = mongoose.model("HardwareCart", hardwareCartSchema);
|
|
|
|
|
const ServiceCart = mongoose.model("ServiceCart", serviceCartSchema);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = { Install, ProfilePictureInstall, SensorQuotation,generateinstallationId,Store,ProfilePictureStore,WaterLeverSensor,MotorSwitchSensor,Insensors,generatequatationId};
|
|
|
|
|
module.exports = { Install, ProfilePictureInstall, SensorQuotation,generateinstallationId,Store,ProfilePictureStore,WaterLeverSensor,MotorSwitchSensor,Insensors,generatequatationId, HardwareCart, ServiceCart};
|
|
|
|
|