|
|
|
@ -1622,6 +1622,7 @@ exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
|
const { surveyId } = req.params;
|
|
|
|
|
const { customerId, masters, slaves, sensors, motor_switches, electricals,master_connections } = req.body;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Format electricals field
|
|
|
|
|
const formattedElectricals = electricals.map((item) => ({
|
|
|
|
|
type: item.type || "",
|
|
|
|
@ -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 || "",
|
|
|
|
|