skailan-conversations
Version:
Servicio de conversaciones y mensajería para Skailan
36 lines • 1.1 kB
JavaScript
export class Message {
id;
organizationId;
conversationId;
senderType;
senderId;
type;
content;
mediaUrl;
externalMessageId;
status;
timestamp;
createdAt;
constructor(id, organizationId, conversationId, senderType, // 'contact', 'user', 'system'
senderId, // Contact ID (from contacts service) or User ID (from core service)
type, // 'text', 'image', 'video', 'audio', 'document'
content, mediaUrl, externalMessageId, status, // 'sent', 'delivered', 'read', 'failed'
timestamp, createdAt) {
this.id = id;
this.organizationId = organizationId;
this.conversationId = conversationId;
this.senderType = senderType;
this.senderId = senderId;
this.type = type;
this.content = content;
this.mediaUrl = mediaUrl;
this.externalMessageId = externalMessageId;
this.status = status;
this.timestamp = timestamp;
this.createdAt = createdAt;
}
updateStatus(newStatus) {
this.status = newStatus;
}
}
//# sourceMappingURL=Message.js.map