From 661bbfe003eeca6ca6279509f85e7c04dc513ef7 Mon Sep 17 00:00:00 2001 From: maaz519 Date: Wed, 27 May 2026 16:53:30 +0530 Subject: [PATCH] feat(types): NormalizedMessage, NormalizedReaction, ForwardJobData; accountId on IngestJobData --- packages/types/src/message.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/types/src/message.ts b/packages/types/src/message.ts index c8d0a5c..e244660 100644 --- a/packages/types/src/message.ts +++ b/packages/types/src/message.ts @@ -9,6 +9,25 @@ export type MessageStatus = export type ApprovalDecision = 'APPROVED' | 'REJECTED'; +// Platform-neutral normalized message — zero Baileys/Telegram types here +export interface NormalizedMessage { + platformMsgId: string; + sourceGroupJid: string; + senderJid: string; + senderName?: string; + content: string; + accountId: string; // which bot account received this message +} + +// Platform-neutral normalized reaction (e.g. WhatsApp emoji reaction) +export interface NormalizedReaction { + reactorJid: string; + targetMsgId: string; // platformMsgId of the message being reacted to + sourceGroupJid: string; + emoji: string; + accountId: string; // which bot account received this reaction +} + export interface CanonicalMessage { messageId: string; platform: Platform; @@ -42,9 +61,19 @@ export interface SyncRoute { export interface IngestJobData { platformMsgId: string; platform: Platform; + accountId: string; // which bot account received this message sourceGroupId: string; senderJid: string; senderName?: string; content: string; tags: string[]; } + +export interface ForwardJobData { + messageId: string; // DB id of the approved Message record + content: string; + sourceGroupName: string; + senderName?: string; + toGroupJid: string; + fromAccountId: string; // which bot account to send the forward from +}