import { FilterQuery } from "mongoose"; export type FindSystemNotificationsParams = { id?: string; userId?: string; companyId?: string; serviceId?: string; conversationId?: string; notificationDate?: Date; readed?: boolean; sessionUser: string; }; export type ToggleStateSystemNotificationsParams = { state: boolean; sessionUser: string; }; export type PaginateSystemNotificationsParams = { query?: string; userId?: string; companyId?: string; serviceId?: string; conversationId?: string; dateFrom?: Date; dateTo?: Date; readed?: boolean; page: number; limit: number; sessionUser: string; }; export type UnreadNotificationResults = { count: number; }; export type PaginateSystemNotificationsResults = { data: ISystemNotification[]; page: number; pages: number; }; export enum NotificationType { APPOINTMENT = 'APPOINTMENT', COMPANY = 'COMPANY', EMPLOYEE = 'EMPLOYEE', SCHEDULE = 'SCHEDULE', SCHEDULE_EXCEPTION = 'SCHEDULE_EXCEPTION', SCHEDULE_RESTRICTION = 'SCHEDULE_RESTRICTION', MESSAGE = 'MESSAGE', BILLING = 'BILLING', SYSTEM = 'SYSTEM' } export type CreateSystemNotificationParams = { userId?: string; companyId?: string; serviceId?: number; conversationId?: string; subject: string; message: string; type?: string; code?: string; }; export type CreateSystemNotificationBySystemParams = CreateSystemNotificationParams & { userId: string; systemToken: string; }; export type UpdateSystemNotificationParams = { id: string; readed: boolean; sessionUser: string; }; export type DeleteSystemNotificationParams = { id: string; sessionUser: string; }; export type DeleteSystemNotificationsByConversation = { conversationId: string; userId: string; sessionUser: string; }; export type DeleteNotificationsByUserParams = { userId: string; }; export type DeleteNotificationsByDateParams = { userId: string; dateFrom?: Date; dateTo?: Date; sessionUser: string; }; export interface ISystemNotification { id?: string; userId?: string; companyId?: string; serviceId?: string; conversationId?: string; subject: string; message: string; notificationDate: Date; readed: boolean; type?: string; code?: string; } export interface ISystemNotificationsAdapter { create(data: CreateSystemNotificationParams): Promise; update(data: UpdateSystemNotificationParams): Promise; delete(id: string): Promise; deleteMany(data: Omit): Promise; find(filters: FindSystemNotificationsParams): Promise; findOne(filters: FindSystemNotificationsParams): Promise; paginate(filters: PaginateSystemNotificationsParams): Promise; deleteByQuery(data: FilterQuery): Promise; } export interface ISystemNotificationsManager { notifications: ISystemNotificationsAdapter; createNotification(data: CreateSystemNotificationParams): Promise; createNotificationBySystem(data: CreateSystemNotificationBySystemParams): Promise; updateNotification(data: UpdateSystemNotificationParams): Promise; deleteNotification(data: DeleteSystemNotificationParams): Promise; deleteConversationNotifications(data: DeleteSystemNotificationsByConversation): Promise; paginateNotifications( data: PaginateSystemNotificationsParams ): Promise; finUnreadNotifications(data: FindSystemNotificationsParams): Promise; deleteNotificationsByUser(data: DeleteNotificationsByUserParams): Promise; setStateByUser(data: ToggleStateSystemNotificationsParams): Promise; deleteNotificationsByDate(data: DeleteNotificationsByDateParams): Promise; }