diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index 78e0aae8..4fa50511 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -1621,6 +1621,7 @@ exports.createquotationforSensor = async (req, reply) => { const quatationId = `AWQU${i_id}`; const { surveyId } = req.params; const { customerId, masters, slaves, sensors, motor_switches, electricals,master_connections } = req.body; + // Format electricals field const formattedElectricals = electricals.map((item) => ({ @@ -1633,6 +1634,9 @@ exports.createquotationforSensor = async (req, reply) => { master_name: item.master_name || "", slaves: item.slaves || "", location: item.location || "", + googleLocation: item.googleLocation || "", + latitude: item.latitude || "", + longitude: item.longitude || "", tanks: Array.isArray(item.tanks) ? item.tanks.map(tank => ({ tankName: tank.tankName || "", diff --git a/src/models/store.js b/src/models/store.js index 9483a365..47afe5c4 100644 --- a/src/models/store.js +++ b/src/models/store.js @@ -525,6 +525,9 @@ const sensorquotationSchema = new mongoose.Schema({ master_name: { type: String, default: null }, slaves: { type: String, default: null }, location: { type: String, default: null }, + googleLocation: { type: String, default: null }, + longitude: { type : Number,default: 0.0}, + latitude: {type: Number,default: 0.0}, tanks: [ { tankName: { type: String, default: null }, diff --git a/src/routes/storeRoute.js b/src/routes/storeRoute.js index 18cb49fe..5038c582 100644 --- a/src/routes/storeRoute.js +++ b/src/routes/storeRoute.js @@ -1428,6 +1428,9 @@ fastify.post("/api/createquotationforSensor/:surveyId", { master_name: { type: "string", default: null }, slaves: { type: "string", default: null }, location: { type: "string", default: null }, + googleLocation: { type: "string", default: null }, + latitude: { type: 'number', default: 0.0 }, + longitude: { type: 'number', default: 0.0}, tanks: { type: "array", items: {