add: reminder whatsapp sparepart monthly

This commit is contained in:
Muhammad Afif
2026-06-05 09:17:45 +07:00
parent 3d53bf4702
commit 40de826da9
6 changed files with 249 additions and 13 deletions

View File

@@ -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
};