import { ChannelType } from '../../value-objects/channel-type.vo';
import { Contact } from '../../entities/contact.entity';

export interface ChannelAdapterPort {
  readonly channelType: ChannelType;
  send(params: SendMessageParams): Promise<DeliveryResult>;
  onMessage?(callback: (msg: IncomingMessage) => void): void;
  isAvailable(): Promise<boolean>;
}

export interface SendMessageParams {
  to: Contact;
  content: string;
  priority: string;
  ttsText?: string;
  approvalAction?: {
    taskId: string;
    approveKeyword: string;
    rejectKeyword: string;
  };
}

export interface DeliveryResult {
  messageId: string;
  status: 'sent' | 'failed';
  error?: string;
}

export interface IncomingMessage {
  from: string;
  content: string;
  channel: ChannelType;
  timestamp: Date;
}
