13 lines
591 B
TypeScript
13 lines
591 B
TypeScript
import { INotificationsService } from "@/domain/notifications/notification.service.js";
|
|
import { IMonitorReactor } from "@/worker/reactors/reactor.interface.js";
|
|
import { MonitorEvaluation } from "@/worker/worker.interface.js";
|
|
export class NotificationReactor implements IMonitorReactor {
|
|
readonly name = "notification";
|
|
readonly blocking = false;
|
|
constructor(private notificationService: INotificationsService) {}
|
|
|
|
react = async (evaluation: MonitorEvaluation) => {
|
|
await this.notificationService.handleNotifications(evaluation.monitor, evaluation.check, evaluation.decision);
|
|
};
|
|
}
|