/// 通话记录 Domain 实体
///
/// 全局共享实体，被 call / chat 等多个 Feature 共用。
/// 纯 Dart 类，零 Flutter / 零网络 / 零 DB 依赖。
class CallLog {
  final String id;
  final int? callerId;
  final int? receiverId;
  final int? chatId;
  final int? duration;
  final int? videoCall;
  final int? createdAt;
  final int? updatedAt;
  final int? endedAt;
  final int? status;
  final int? isDeleted;
  final int? deletedAt;
  final int? isRead;

  const CallLog({
    required this.id,
    this.callerId,
    this.receiverId,
    this.chatId,
    this.duration,
    this.videoCall,
    this.createdAt,
    this.updatedAt,
    this.endedAt,
    this.status,
    this.isDeleted,
    this.deletedAt,
    this.isRead,
  });

  CallLog copyWith({
    String? id,
    int? callerId,
    int? receiverId,
    int? chatId,
    int? duration,
    int? videoCall,
    int? createdAt,
    int? updatedAt,
    int? endedAt,
    int? status,
    int? isDeleted,
    int? deletedAt,
    int? isRead,
  }) {
    return CallLog(
      id: id ?? this.id,
      callerId: callerId ?? this.callerId,
      receiverId: receiverId ?? this.receiverId,
      chatId: chatId ?? this.chatId,
      duration: duration ?? this.duration,
      videoCall: videoCall ?? this.videoCall,
      createdAt: createdAt ?? this.createdAt,
      updatedAt: updatedAt ?? this.updatedAt,
      endedAt: endedAt ?? this.endedAt,
      status: status ?? this.status,
      isDeleted: isDeleted ?? this.isDeleted,
      deletedAt: deletedAt ?? this.deletedAt,
      isRead: isRead ?? this.isRead,
    );
  }
}