- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8 - Actualizaciones de configuracion Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
1.9 KiB
TypeScript
34 lines
1.9 KiB
TypeScript
import { Repository } from 'typeorm';
|
|
import { Notification, NotificationTemplate, UserNotificationPreference } from '../entities';
|
|
import { CreateNotificationDto, SendTemplateNotificationDto, UpdatePreferencesDto } from '../dto';
|
|
import { EmailService } from '@modules/email';
|
|
export declare class NotificationsService {
|
|
private readonly notificationRepository;
|
|
private readonly templateRepository;
|
|
private readonly preferenceRepository;
|
|
private readonly emailService;
|
|
private readonly logger;
|
|
constructor(notificationRepository: Repository<Notification>, templateRepository: Repository<NotificationTemplate>, preferenceRepository: Repository<UserNotificationPreference>, emailService: EmailService);
|
|
create(dto: CreateNotificationDto, tenantId: string): Promise<Notification>;
|
|
sendFromTemplate(dto: SendTemplateNotificationDto, tenantId: string): Promise<Notification>;
|
|
findAllForUser(userId: string, tenantId: string, options?: {
|
|
page?: number;
|
|
limit?: number;
|
|
unreadOnly?: boolean;
|
|
}): Promise<{
|
|
data: Notification[];
|
|
total: number;
|
|
unread: number;
|
|
}>;
|
|
markAsRead(notificationId: string, userId: string, tenantId: string): Promise<Notification>;
|
|
markAllAsRead(userId: string, tenantId: string): Promise<number>;
|
|
delete(notificationId: string, userId: string, tenantId: string): Promise<void>;
|
|
getUnreadCount(userId: string, tenantId: string): Promise<number>;
|
|
findAllTemplates(): Promise<NotificationTemplate[]>;
|
|
findTemplateByCode(code: string): Promise<NotificationTemplate>;
|
|
getPreferences(userId: string, tenantId: string): Promise<UserNotificationPreference>;
|
|
updatePreferences(userId: string, tenantId: string, dto: UpdatePreferencesDto): Promise<UserNotificationPreference>;
|
|
private formatEmailHtml;
|
|
cleanupOldNotifications(daysToKeep?: number): Promise<number>;
|
|
}
|