add: reminder whatsapp sparepart monthly
This commit is contained in:
@@ -255,6 +255,23 @@ const getReminderNotificationErrorByYearlyDb = async (errorCode, chanel, year) =
|
||||
return result.recordset[0];
|
||||
};
|
||||
|
||||
const getReminderNotificationErrorByMonthlyDb = async (errorCode, monthly) => {
|
||||
const queryText = `
|
||||
SELECT a.*
|
||||
|
||||
FROM notification_error a
|
||||
|
||||
WHERE a.error_code_id = $1
|
||||
AND MONTH(a.created_at) = $2
|
||||
AND a.message_error_issue LIKE 'reminder%'
|
||||
AND a.is_active = 1
|
||||
AND a.deleted_at IS NULL
|
||||
`;
|
||||
|
||||
const result = await pool.query(queryText, [errorCode, monthly]);
|
||||
return result.recordset[0];
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
getNotificationByIdDb,
|
||||
getDeviceNotificationByIdDb,
|
||||
@@ -264,6 +281,7 @@ module.exports = {
|
||||
getUsersNotificationErrorDb,
|
||||
getDeviceChannelReminder,
|
||||
getReminderNotificationErrorByYearlyDb,
|
||||
getReminderNotificationErrorByMonthlyDb,
|
||||
updateNotificationErrorByChanelReminderDb
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user