changed electricals in quotation

master
Varun 9 months ago
parent 684dbcadec
commit 66119997b4

@ -1285,7 +1285,7 @@ exports.createquotationforSensor = async (req, reply) => {
const i_id = await generatequatationId();
const quatationId = `AWQU${i_id}`;
const { installationId } = req.params;
const { customerId, masters, slaves, motor_switches, electricals,master_type,sensor_type,switch_type } = req.body;
const { customerId, masters, slaves, motor_switches, electricals } = req.body;
// Create a new SensorQuotation document
@ -1297,9 +1297,7 @@ exports.createquotationforSensor = async (req, reply) => {
slaves,
motor_switches,
electricals,
switch_type,
master_type,
sensor_type
});
const savedQuotation = await newQuotation.save();

@ -290,13 +290,13 @@ const sensorquotationSchema = new mongoose.Schema({
quote_status: { type: String, default: null },
quoted_amount: { type: String, default: null },
comments: { type: String, default: null },
master_type: { type: String, default: null },
electricals: [{ type: String }],
master_type_quantity_price: { type: String, default: null },
master_type_total_price: { type: String, default: null },
sensor_type: { type: String , default: null},
sensor_type_quantity_price: { type: String , default: null},
sensor_type_total_price: { type: String , default: null},
switch_type: { 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 },

@ -1149,27 +1149,24 @@ fastify.post("/api/createquotationforSensor/:installationId", {
},
},
},
body: {
type: "object",
properties: {
customerId: { type: "string" },
masters: { type: "string" },
slaves: { type: "string" },
motor_switches: { type: "string" },
electricals: { type: "string" },
master_type: { type: "string" },
sensor_type: { type: "string" },
switch_type: { type: "string" },
motor_switches: { type: "string" },
electricals: {
type: "array",
items: { type: "string" },
description: "List of electrical items",
},
},
},
},
handler: storeController.createquotationforSensor,
})
});

Loading…
Cancel
Save