first commit

This commit is contained in:
2026-07-16 20:48:43 -03:00
commit 5696cee264
1111 changed files with 322270 additions and 0 deletions
@@ -0,0 +1,28 @@
import { io } from "../../index";
import SystemNotificationsList from "../SystemNotifications/SystemNotification";
import { CreateSystemNotificationParams } from "../SystemNotifications/SystemNotification.Interface";
import { INotificationsAdapter, NotificationDataSystem } from "./Notifications.Interface";
export class NotificationsSystemAdapter implements INotificationsAdapter<NotificationDataSystem> {
async send(data: NotificationDataSystem): Promise<void> {
const sendData: CreateSystemNotificationParams = {
userId: data.userId,
subject: data.subject,
conversationId: data.conversationId,
message: data.message,
type: data.type,
code: data.code,
};
const notif = await SystemNotificationsList.createNotification(sendData);
if (notif.userId) {
const countUnreadNotifications = await SystemNotificationsList.finUnreadNotifications({
userId: notif.userId,
sessionUser: notif.userId,
});
io.to(`user:${data.userId}`).emit("new_system_notification", countUnreadNotifications);
}
}
}