|
|
@ -1077,7 +1077,7 @@ exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Extract parameters and body data from the request
|
|
|
|
// Extract parameters and body data from the request
|
|
|
|
const { installationId } = req.params;
|
|
|
|
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
|
|
|
|
// Validate electricals field to ensure it's an array of objects
|
|
|
|
|
|
|
|
|
|
|
@ -1088,7 +1088,10 @@ exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
masters,
|
|
|
|
masters,
|
|
|
|
slaves,
|
|
|
|
slaves,
|
|
|
|
motor_switches,
|
|
|
|
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
|
|
|
|
// Save the document to the database
|
|
|
|