From ffc463a2b87511be61aafe782fbe395b84c9552c Mon Sep 17 00:00:00 2001 From: Varun Date: Thu, 5 Sep 2024 11:39:18 +0530 Subject: [PATCH] changes in quotation --- src/controllers/storeController.js | 7 +++++-- src/models/store.js | 6 ++++-- src/routes/storeRoute.js | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index 1b00ea19..0812881d 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -1077,7 +1077,7 @@ exports.createquotationforSensor = async (req, reply) => { try { // Extract parameters and body data from the request const { installationId } = req.params; - const { customerId, masters, slaves, motor_switches, electricals } = req.body; + const { customerId, masters, slaves, motor_switches, electricals,master_type,sensor_type,switch_type } = req.body; // Validate electricals field to ensure it's an array of objects @@ -1088,7 +1088,10 @@ exports.createquotationforSensor = async (req, reply) => { masters, slaves, motor_switches, - electricals, // This will store the array of electrical items (objects) + electricals, + switch_type, + master_type, + sensor_type// This will store the array of electrical items (objects) }); // Save the document to the database diff --git a/src/models/store.js b/src/models/store.js index 06325a24..c06a2455 100644 --- a/src/models/store.js +++ b/src/models/store.js @@ -260,8 +260,10 @@ const sensorquotationSchema = new mongoose.Schema({ quote_status: { type: String, default: null }, quoted_amount: { type: String, default: null }, comments: { type: String, default: null }, - electricals: { type: String }, - + master_type: { type: String, default: null }, + sensor_type: { type: String , default: null}, + switch_type: { type: String, default: null }, + }); diff --git a/src/routes/storeRoute.js b/src/routes/storeRoute.js index cde278c2..5629bebd 100644 --- a/src/routes/storeRoute.js +++ b/src/routes/storeRoute.js @@ -790,6 +790,9 @@ fastify.post("/api/createquotationforSensor/:installationId", { slaves: { type: "string" }, motor_switches: { type: "string" }, electricals: { type: "string" }, + master_type: { type: "string" }, + sensor_type: { type: "string" }, + switch_type: { type: "string" }, },