michangarrito/apps/backend/dist/modules/messaging/messaging.service.d.ts
rckrdmrd 97f407c661 [MIGRATION-V2] feat: Migrar michangarrito a estructura v2
- Prefijo v2: MCH
- TRACEABILITY-MASTER.yml creado
- Listo para integracion como submodulo

Workspace: v2.0.0 | SIMCO: v4.0.0
2026-01-10 11:28:54 -06:00

32 lines
1.6 KiB
TypeScript

import { Repository } from 'typeorm';
import { Conversation } from './entities/conversation.entity';
import { Message, MessageDirection, MessageType } from './entities/message.entity';
import { Notification } from './entities/notification.entity';
export declare class MessagingService {
private readonly conversationRepo;
private readonly messageRepo;
private readonly notificationRepo;
constructor(conversationRepo: Repository<Conversation>, messageRepo: Repository<Message>, notificationRepo: Repository<Notification>);
getConversations(tenantId: string): Promise<Conversation[]>;
getConversation(tenantId: string, id: string): Promise<Conversation>;
findOrCreateConversation(tenantId: string, phoneNumber: string, contactName?: string): Promise<Conversation>;
getMessages(conversationId: string, limit?: number): Promise<Message[]>;
addMessage(conversationId: string, direction: MessageDirection, content: string, type?: MessageType, metadata?: {
waMessageId?: string;
mediaUrl?: string;
mediaMimeType?: string;
}): Promise<Message>;
markAsRead(tenantId: string, conversationId: string): Promise<Conversation>;
getNotifications(tenantId: string, userId?: string, unreadOnly?: boolean): Promise<Notification[]>;
createNotification(tenantId: string, data: {
userId?: string;
notificationType: string;
channels: string[];
title: string;
body: string;
data?: Record<string, unknown>;
}): Promise<Notification>;
markNotificationRead(notificationId: string): Promise<Notification>;
getUnreadCount(tenantId: string, userId?: string): Promise<number>;
}