feat(reminders): получатели в отложенных/входящих, приватные сообщения чата, календарь, бейдж уведомлений

This commit is contained in:
2026-09-21 10:26:53 +03:00
parent 17e6ebf412
commit aa316141be
20 changed files with 312 additions and 36 deletions

View File

@@ -267,6 +267,18 @@ export class SocialStorage extends TasksStorage {
}
// User Notifications
async getUnreadNotificationCount(userId: number, organizationId: number): Promise<number> {
const [row] = await db
.select({ count: sql<number>`COUNT(*)::int` })
.from(userNotifications)
.where(and(
eq(userNotifications.userId, userId),
eq(userNotifications.organizationId, organizationId),
eq(userNotifications.isRead, false),
));
return row?.count ?? 0;
}
async getUserNotifications(userId: number, organizationId: number, isRead?: boolean): Promise<UserNotification[]> {
const conditions = [
eq(userNotifications.userId, userId),