diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index 67accda7..28754f5a 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -1187,7 +1187,9 @@ const generateBatchNo = (type, hardwareIdCompany) => { const ddmmyy = `${date.getDate().toString().padStart(2, '0')}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getFullYear().toString().slice(-2)}`; const companyPrefix = hardwareIdCompany.slice(0, 2).toUpperCase(); const randomNumbers = Math.floor(100 + Math.random() * 900).toString(); // 3 random digits - + if (type === 'SENSOR') { + return `SN${ddmmyy}${companyPrefix}${randomNumbers}`; + } if (type === 'SLAVE') { return `SL${ddmmyy}${companyPrefix}${randomNumbers}`; }