// Carrier API types and interfaces

export interface CarrierCall {
  callSid: string;
  from: string;
  to: string;
  status: 'initiated' | 'ringing' | 'in-progress' | 'completed' | 'failed';
  startTime: Date;
  duration?: number;
  metadata?: Record<string, any>;
}

export interface CarrierSms {
  messageSid: string;
  from: string;
  to: string;
  body: string;
  direction: 'inbound' | 'outbound';
  status: 'queued' | 'sent' | 'delivered' | 'failed';
  timestamp: Date;
  metadata?: Record<string, any>;
}

export interface CarrierDecision {
  action: 'block' | 'flag' | 'allow';
  confidence: number;
  reasons: string[];
  executedAt: Date;
}

export interface CarrierApi {
  // Call operations
  getCall(callSid: string): Promise<CarrierCall>;
  blockCall(callSid: string): Promise<void>;
  flagCall(callSid: string): Promise<void>;
  allowCall(callSid: string): Promise<void>;
  
  // SMS operations
  getSms(messageSid: string): Promise<CarrierSms>;
  blockSms(messageSid: string): Promise<void>;
  flagSms(messageSid: string): Promise<void>;
  allowSms(messageSid: string): Promise<void>;
  
  // Health check
  isHealthy(): Promise<boolean>;
}
