|
|
|
@ -370,7 +370,7 @@ const iotpriceSchema = new mongoose.Schema({
|
|
|
|
|
cost: { type: Number, default: null },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const orderSchema = new mongoose.Schema({
|
|
|
|
|
const estimationorderSchema = new mongoose.Schema({
|
|
|
|
|
orderId: { type: String, unique: true, required: true },
|
|
|
|
|
customerId: { type: String, required: true },
|
|
|
|
|
items: { type: Array, required: true },
|
|
|
|
@ -382,6 +382,7 @@ const orderSchema = new mongoose.Schema({
|
|
|
|
|
const sensorquotationSchema = new mongoose.Schema({
|
|
|
|
|
customerId: { type: String },
|
|
|
|
|
surveyId: { type: String, default: null },
|
|
|
|
|
storeId: { type: String, default: null },
|
|
|
|
|
installationId: { type: String, default: null },
|
|
|
|
|
quatationId: { type: String, default: null },
|
|
|
|
|
masters: { type: String },
|
|
|
|
@ -405,9 +406,13 @@ const sensorquotationSchema = new mongoose.Schema({
|
|
|
|
|
wire: { type: String, default: null },
|
|
|
|
|
switch: { type: String, default: null },
|
|
|
|
|
text: { type: String, default: null },
|
|
|
|
|
available_quantity: { type: String, default: null },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
master_type_quantity_price: { type: String, default: null },
|
|
|
|
|
master_available_quantity: { type: String, default: null },
|
|
|
|
|
slave_available_quantity: { type: String, default: null },
|
|
|
|
|
sensor_available_quantity: { type: String, default: null },
|
|
|
|
|
master_type_total_price: { type: String, default: null },
|
|
|
|
|
sensor_type_quantity_price: { type: String , default: null},
|
|
|
|
|
sensor_type_total_price: { type: String , default: null},
|
|
|
|
@ -416,6 +421,56 @@ const sensorquotationSchema = new mongoose.Schema({
|
|
|
|
|
qutation_total_price: { type: String, default: null },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const orderSchema = new mongoose.Schema({
|
|
|
|
|
customerId: { type: String },
|
|
|
|
|
surveyId: { type: String, default: null },
|
|
|
|
|
storeId: { type: String, default: null },
|
|
|
|
|
installationId: { type: String, default: null },
|
|
|
|
|
quatationId: { type: String, default: null },
|
|
|
|
|
masters: { type: String },
|
|
|
|
|
masters_quantity_price: { type: String },
|
|
|
|
|
masters_total_price: { type: String },
|
|
|
|
|
slaves: { type: String },
|
|
|
|
|
sensors: { type: String },
|
|
|
|
|
slaves_quantity_price: { type: String },
|
|
|
|
|
slaves_total_price: { type: String },
|
|
|
|
|
motor_switches: { type: String },
|
|
|
|
|
motor_switches_quantity_price: { type: String },
|
|
|
|
|
motor_switches_total_price: { type: String },
|
|
|
|
|
quote_status: { type: String, default: null },
|
|
|
|
|
quoted_amount: { type: String, default: null },
|
|
|
|
|
comments: { type: String, default: null },
|
|
|
|
|
datetime: { type: String, default: null },
|
|
|
|
|
updated_at: { type: String, default: null },
|
|
|
|
|
electricals: [
|
|
|
|
|
{
|
|
|
|
|
type: { type: String, default: null },
|
|
|
|
|
wire: { type: String, default: null },
|
|
|
|
|
switch: { type: String, default: null },
|
|
|
|
|
text: { type: String, default: null },
|
|
|
|
|
available_quantity: { type: String, default: null },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
master_type_quantity_price: { type: String, default: null },
|
|
|
|
|
master_available_quantity: { type: String, default: null },
|
|
|
|
|
slave_available_quantity: { type: String, default: null },
|
|
|
|
|
sensor_available_quantity: { type: String, default: null },
|
|
|
|
|
master_type_total_price: { type: String, default: null },
|
|
|
|
|
sensor_type_quantity_price: { type: String, default: null },
|
|
|
|
|
sensor_type_total_price: { type: String, default: null },
|
|
|
|
|
switch_type_quantity_price: { type: String, default: null },
|
|
|
|
|
switch_type_total_price: { type: String, default: null },
|
|
|
|
|
qutation_total_price: { type: String, default: null },
|
|
|
|
|
status: { type: String, default: "pending" }, // Status field added
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const hardwareCartSchema = new mongoose.Schema({
|
|
|
|
|
productId: { type: String},
|
|
|
|
|
productName: { type: String },
|
|
|
|
@ -510,7 +565,9 @@ const salesSchema = new mongoose.Schema({
|
|
|
|
|
const Iotprice = mongoose.model('Iotprice', iotpriceSchema);
|
|
|
|
|
const Insensors = mongoose.model('Insensors', insensorsSchema);
|
|
|
|
|
|
|
|
|
|
const Order = mongoose.model('Orders', orderSchema);
|
|
|
|
|
const Order = mongoose.model('Order', orderSchema);
|
|
|
|
|
const EstimationOrder = mongoose.model('EstimationOrder', estimationorderSchema);
|
|
|
|
|
|
|
|
|
|
const Store = mongoose.model("Store", storeSchema);
|
|
|
|
|
const WaterLeverSensor = mongoose.model('WaterLeverSensor', waterLeverSensorInSchema);
|
|
|
|
|
const ProfilePictureStore = mongoose.model('ProfilePictureStore', profilePictureStoreSchema);
|
|
|
|
@ -527,4 +584,4 @@ const Iotprice = mongoose.model('Iotprice', iotpriceSchema);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {Order,Iotprice,Sales, Install,Survey, ProfilePictureInstall, SensorQuotation,generateinstallationId,Store,ProfilePictureStore,WaterLeverSensor,MotorSwitchSensor,Insensors,generatequatationId, HardwareCart, ServiceCart};
|
|
|
|
|
module.exports = {Order,EstimationOrder,Iotprice,Sales, Install,Survey, ProfilePictureInstall, SensorQuotation,generateinstallationId,Store,ProfilePictureStore,WaterLeverSensor,MotorSwitchSensor,Insensors,generatequatationId, HardwareCart, ServiceCart};
|
|
|
|
|