class ConversationModel {
  final String id;
  final String title;
  final List<String> participantIds;
  final List<MessageModel> messages;
  final DateTime lastMessageAt;
  final int unreadCount;
  final String? childId;

  ConversationModel({
    required this.id,
    required this.title,
    required this.participantIds,
    required this.messages,
    required this.lastMessageAt,
    this.unreadCount = 0,
    this.childId,
  });

  MessageModel? get lastMessage => messages.isNotEmpty ? messages.last : null;
  bool get hasUnreadMessages => unreadCount > 0;
}

class MessageModel {
  final String id;
  final String content;
  final String senderId;
  final DateTime sentAt;
  final bool isFromAI;
  final MessageStatus status;

  MessageModel({
    required this.id,
    required this.content,
    required this.senderId,
    required this.sentAt,
    this.isFromAI = false,
    required this.status,
  });
}

enum MessageStatus {
  sent,
  delivered,
  read,
}