part of 'dashboard_bloc.dart';

abstract class DashboardEvent extends Equatable {
  const DashboardEvent();

  @override
  List<Object> get props => [];
}

class LoadDashboardData extends DashboardEvent {
  final String organizationId;
  final String userId;

  const LoadDashboardData({
    required this.organizationId,
    required this.userId,
  });

  @override
  List<Object> get props => [organizationId, userId];
}

class RefreshDashboardData extends DashboardEvent {
  final String organizationId;
  final String userId;

  const RefreshDashboardData({
    required this.organizationId,
    required this.userId,
  });

  @override
  List<Object> get props => [organizationId, userId];
}

class LoadDashboardStats extends DashboardEvent {
  final String organizationId;
  final String userId;

  const LoadDashboardStats({
    required this.organizationId,
    required this.userId,
  });

  @override
  List<Object> get props => [organizationId, userId];
}

class LoadRecentActivities extends DashboardEvent {
  final String organizationId;
  final String userId;
  final int limit;

  const LoadRecentActivities({
    required this.organizationId,
    required this.userId,
    this.limit = 10,
  });

  @override
  List<Object> get props => [organizationId, userId, limit];
}

class LoadUpcomingEvents extends DashboardEvent {
  final String organizationId;
  final String userId;
  final int limit;

  const LoadUpcomingEvents({
    required this.organizationId,
    required this.userId,
    this.limit = 5,
  });

  @override
  List<Object> get props => [organizationId, userId, limit];
}

/// Event déclenché par WebSocket pour rafraîchir le dashboard
class RefreshDashboardFromWebSocket extends DashboardEvent {
  final Map<String, dynamic> data;

  const RefreshDashboardFromWebSocket(this.data);

  @override
  List<Object> get props => [data];
}

/// Event pour gérer les changements de statut WebSocket
class WebSocketConnectionChanged extends DashboardEvent {
  final bool isConnected;

  const WebSocketConnectionChanged(this.isConnected);

  @override
  List<Object> get props => [isConnected];
}
