|
|
@ -1695,6 +1695,11 @@ exports.createMasterSlaveData = async (req, reply) => {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// };
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function feetToCm(value) {
|
|
|
|
|
|
|
|
const v = parseFloat(value);
|
|
|
|
|
|
|
|
return !isNaN(v) ? parseFloat((v * 30.48).toFixed(2)) : null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.masterConnectedSlaveList = async (req, reply) => {
|
|
|
|
exports.masterConnectedSlaveList = async (req, reply) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -1781,7 +1786,10 @@ exports.masterConnectedSlaveList = async (req, reply) => {
|
|
|
|
latitude: masterOrderInfo.latitude,
|
|
|
|
latitude: masterOrderInfo.latitude,
|
|
|
|
height: tankDetails?.height || null,
|
|
|
|
height: tankDetails?.height || null,
|
|
|
|
length: tankDetails?.length || null,
|
|
|
|
length: tankDetails?.length || null,
|
|
|
|
width: tankDetails?.width || null
|
|
|
|
width: tankDetails?.width || null,
|
|
|
|
|
|
|
|
heightInCm: tankDetails?.height ? feetToCm(tankDetails.height) : null,
|
|
|
|
|
|
|
|
lengthInCm: tankDetails?.length ? feetToCm(tankDetails.length) : null,
|
|
|
|
|
|
|
|
widthInCm: tankDetails?.width ? feetToCm(tankDetails.width) : null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Step 7: Process slaves
|
|
|
|
// Step 7: Process slaves
|
|
|
@ -1812,7 +1820,10 @@ exports.masterConnectedSlaveList = async (req, reply) => {
|
|
|
|
typeOfWater: masterTypeOfWater === 'bore' ? 'bore' : (slave.typeOfWater || null),
|
|
|
|
typeOfWater: masterTypeOfWater === 'bore' ? 'bore' : (slave.typeOfWater || null),
|
|
|
|
height: slaveTankMeta?.height || null,
|
|
|
|
height: slaveTankMeta?.height || null,
|
|
|
|
length: slaveTankMeta?.length || null,
|
|
|
|
length: slaveTankMeta?.length || null,
|
|
|
|
width: slaveTankMeta?.width || null
|
|
|
|
width: slaveTankMeta?.width || null,
|
|
|
|
|
|
|
|
heightInCm: slaveTankMeta?.height ? feetToCm(slaveTankMeta.height) : null,
|
|
|
|
|
|
|
|
lengthInCm: slaveTankMeta?.length ? feetToCm(slaveTankMeta.length) : null,
|
|
|
|
|
|
|
|
widthInCm: slaveTankMeta?.width ? feetToCm(slaveTankMeta.width) : null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|