import 'package:equatable/equatable.dart'; /// Entité de domaine représentant une notification. /// /// Cette entité est pure et indépendante de la couche de données. /// Elle représente une notification dans le domaine métier. class Notification extends Equatable { const Notification({ required this.id, required this.title, required this.message, required this.type, required this.timestamp, this.isRead = false, this.eventId, this.userId, this.metadata, }); final String id; final String title; final String message; final NotificationType type; final DateTime timestamp; final bool isRead; final String? eventId; final String? userId; final Map? metadata; @override List get props => [ id, title, message, type, timestamp, isRead, eventId, userId, metadata, ]; /// Crée une copie de cette notification avec des valeurs modifiées. Notification copyWith({ String? id, String? title, String? message, NotificationType? type, DateTime? timestamp, bool? isRead, String? eventId, String? userId, Map? metadata, }) { return Notification( id: id ?? this.id, title: title ?? this.title, message: message ?? this.message, type: type ?? this.type, timestamp: timestamp ?? this.timestamp, isRead: isRead ?? this.isRead, eventId: eventId ?? this.eventId, userId: userId ?? this.userId, metadata: metadata ?? this.metadata, ); } } /// Type de notification. enum NotificationType { event, friend, reminder, other, }