import type { MessageRow } from './message_repo.js';
import type { ContactIdentity, RoomInfo } from './room_resolver.js';

export interface WeixinDbInboundRow {
  channelId: number;
  row: MessageRow;
  room: RoomInfo;
  resolveContact?: (username: string) => ContactIdentity | undefined;
  resolveRoomSenderIdentity?: (roomUsername: string, realSenderId: string) => ContactIdentity | undefined;
}

/** 投影到 agent_channel.routeInboundMessage 入参 shape。 */
export interface WeixinDbPseudoMessage {
  from_user_id: string;
  room_id: string;
  room_name: string;
  sender_wxid?: string;
  sender_remark?: string;
  sender_nick_name?: string;
  sender_display_name?: string;
  message_id: string;
  item_list: Array<{ type: number; text_item: { text: string } }>;
  __weixin_db: true;
}
