From 73516cd35f909787d8893116b0c792689686d36c Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Thu, 5 Jun 2025 10:58:02 +0530 Subject: [PATCH] remove the building deatils --- src/controllers/installationController.js | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/controllers/installationController.js b/src/controllers/installationController.js index 2df8a445..e91214e5 100644 --- a/src/controllers/installationController.js +++ b/src/controllers/installationController.js @@ -6531,8 +6531,29 @@ exports.getDisconnectedCustomerDetails = async (req, reply) => { // } // } - const sensorHardwareId = sensor.hardwareId?.trim().toLowerCase(); + // const sensorHardwareId = sensor.hardwareId?.trim().toLowerCase(); + // for (const issue of unresolvedIssues) { + // const allIssueHardwareIds = [ + // ...(issue.hardwareIds?.map(id => id?.trim().toLowerCase()) || []), + // issue.hardwareId?.trim().toLowerCase() + // ]; + + // if ( + // (sensorHw && allIssueHardwareIds.includes(sensorHw)) || + // (sensorConnected && allIssueHardwareIds.includes(sensorConnected)) || + // (sensorHardwareId && allIssueHardwareIds.includes(sensorHardwareId)) + // ) { + // for (const hw of allIssueHardwareIds) { + // if (hw && !existingCategorizedHardwareIds.has(hw)) { + // customerHardwareMap[custId].add(hw); + // } + // } + // } + // } + for (const issue of unresolvedIssues) { + if (issue.movedToCategory === true) continue; // ✅ extra safeguard + const allIssueHardwareIds = [ ...(issue.hardwareIds?.map(id => id?.trim().toLowerCase()) || []), issue.hardwareId?.trim().toLowerCase() @@ -6552,6 +6573,7 @@ exports.getDisconnectedCustomerDetails = async (req, reply) => { } + } // Debug: Log map of matched customer hardware