wisdom #48

Merged
bragaz_rexita merged 3 commits from wisdom into main 2026-04-30 02:48:06 +00:00
Showing only changes of commit 3b26e06ffe - Show all commits

View File

@@ -32,6 +32,7 @@ const {
const { ErrorHandler } = require("../helpers/error"); const { ErrorHandler } = require("../helpers/error");
const { deleteReminder } = require("./notifikasi-wa.service"); const { deleteReminder } = require("./notifikasi-wa.service");
const { getSparepartsByYearlyDb } = require("../db/sparepart.db");
class NotificationService { class NotificationService {
static async getAllNotification(param) { static async getAllNotification(param) {
@@ -135,6 +136,16 @@ class NotificationService {
notification.activity_logs = notificationLogs; notification.activity_logs = notificationLogs;
notification.is_reminder = false;
notification.spareparts_reminder = [];
if (notification.message_error_issue) {
const sparepartsReminder = await getSparepartsByYearlyDb(notification.error_code_id);
notification.spareparts_reminder = sparepartsReminder ?? [];
notification.is_reminder = true;
}
return notification; return notification;
} catch (error) { } catch (error) {
throw new ErrorHandler(error.statusCode, error.message); throw new ErrorHandler(error.statusCode, error.message);