add: feature reminder custom device with cron-job
This commit is contained in:
@@ -269,6 +269,22 @@ const getReminderNotificationErrorByMonthlyDb = async (errorCode, monthly, devic
|
||||
const result = await pool.query(queryText, [errorCode, monthly, deviceId]);
|
||||
return result.recordset[0];
|
||||
};
|
||||
|
||||
const getReminderNotificationErrorByCustomDb = async (errorCode, custom, deviceId) => {
|
||||
const queryText = `
|
||||
SELECT a.*
|
||||
FROM notification_error a
|
||||
WHERE a.error_code_id = $1
|
||||
AND a.created_at = $2
|
||||
AND a.message_error_issue LIKE '%device_id: ' + CAST($3 AS VARCHAR) + '%'
|
||||
AND a.is_active = 1
|
||||
AND a.deleted_at IS NULL
|
||||
`;
|
||||
|
||||
const result = await pool.query(queryText, [errorCode, custom, deviceId]);
|
||||
return result.recordset[0];
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getNotificationByIdDb,
|
||||
getDeviceNotificationByIdDb,
|
||||
@@ -279,6 +295,7 @@ module.exports = {
|
||||
getDeviceChannelReminder,
|
||||
getReminderNotificationErrorByYearlyDb,
|
||||
getReminderNotificationErrorByMonthlyDb,
|
||||
getReminderNotificationErrorByCustomDb,
|
||||
updateNotificationErrorByChanelReminderDb
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user