diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index cbcf2f24..586dbfaf 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -1317,7 +1317,7 @@ exports.updateSensorQC = async (req, reply) => { // Ensure qccheck is handled properly if (filteredUpdateData.qccheck) { const qccheckLower = filteredUpdateData.qccheck.toLowerCase(); - filteredUpdateData.status = qccheckLower === 'Pass' ? 'available' : 'qcfailed'; + filteredUpdateData.status = qccheckLower === 'pass' ? 'available' : 'qcfailed'; } // Update qccheckdate with the current date in "DD-MMM-YYYY - HH:MM" format diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 57e541c8..7414b0f0 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -6221,7 +6221,7 @@ async function processIotData(hw_Id, data) { // Case 1: First time signal is lost if ( existingTank.slave_status !== "signal_lost1" && - existingTank.slave_status !== "not_working" + existingTank.slave_status !== "not_working1" ) { existingTank.slave_status = "signal_lost1"; existingTank.slave_disconnected_time = now.format('DD-MMM-YYYY - HH:mm:ss'); @@ -6240,7 +6240,7 @@ async function processIotData(hw_Id, data) { const minutesElapsed = now.diff(lostTime, 'minutes'); if (minutesElapsed >= 15) { - existingTank.slave_status = "not_working"; + existingTank.slave_status = "not_working1"; existingTank.slave_disconnected_time = now.format('DD-MMM-YYYY - HH:mm:ss'); await existingTank.save(); @@ -6257,7 +6257,7 @@ async function processIotData(hw_Id, data) { if (linkedTank) { for (const inputConnection of linkedTank.connections.inputConnections) { if (inputConnection.inputConnections === tank_name) { - inputConnection.slave_status = "not_working"; + inputConnection.slave_status = "not_working1"; await linkedTank.save(); console.log(`🔗 Linked tank [${linkedTank.tankName}] inputConnection updated to not_working`); } diff --git a/src/models/store.js b/src/models/store.js index b5a2291a..13ab1e19 100644 --- a/src/models/store.js +++ b/src/models/store.js @@ -444,6 +444,7 @@ const insensorsSchema = new mongoose.Schema({ connected_status: { type: String, enum: ["connected", "Not connected", "unknown"], default: "unknown" }, masterName: { type: String, default: null }, location: { type: String, default: null }, + tankhardwareId: { type: String, default: null }, motor_switches: [ { from_tank: { type: String, default: null },