/// Domain entity representing a voice call session with the IT0 Agent.
class VoiceSession {
  final String id;
  final String? websocketUrl;
  final VoiceSessionStatus status;
  final DateTime startedAt;
  final DateTime? endedAt;
  final Duration? duration;

  const VoiceSession({
    required this.id,
    this.websocketUrl,
    required this.status,
    required this.startedAt,
    this.endedAt,
    this.duration,
  });

  VoiceSession copyWith({
    String? id,
    String? websocketUrl,
    VoiceSessionStatus? status,
    DateTime? startedAt,
    DateTime? endedAt,
    Duration? duration,
  }) {
    return VoiceSession(
      id: id ?? this.id,
      websocketUrl: websocketUrl ?? this.websocketUrl,
      status: status ?? this.status,
      startedAt: startedAt ?? this.startedAt,
      endedAt: endedAt ?? this.endedAt,
      duration: duration ?? this.duration,
    );
  }
}

enum VoiceSessionStatus {
  ringing,
  connecting,
  active,
  ended,
  error,
}
