import 'package:equatable/equatable.dart';
import '../../../models/activity.dart';

/// Events pour les activités Google Places
abstract class GoogleActivityEvent extends Equatable {
  const GoogleActivityEvent();

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

/// Charger les activités Google Places
class LoadGoogleActivities extends GoogleActivityEvent {
  final String tripId;
  final String? destination;
  final double? latitude;
  final double? longitude;
  final ActivityCategory? category;

  const LoadGoogleActivities({
    required this.tripId,
    this.destination,
    this.latitude,
    this.longitude,
    this.category,
  });

  @override
  List<Object?> get props => [tripId, destination, latitude, longitude, category];
}

/// Charger plus d'activités Google (pagination)
class LoadMoreGoogleActivities extends GoogleActivityEvent {
  final String tripId;
  final String? destination;
  final double? latitude;
  final double? longitude;
  final ActivityCategory? category;
  final String? nextPageToken;

  const LoadMoreGoogleActivities({
    required this.tripId,
    this.destination,
    this.latitude,
    this.longitude,
    this.category,
    this.nextPageToken,
  });

  @override
  List<Object?> get props => [tripId, destination, latitude, longitude, category, nextPageToken];
}

/// Mettre à jour les activités Google
class UpdateGoogleActivities extends GoogleActivityEvent {
  final List<Activity> activities;
  final String? nextPageToken;
  final bool hasMoreData;
  final String query;

  const UpdateGoogleActivities({
    required this.activities,
    this.nextPageToken,
    required this.hasMoreData,
    required this.query,
  });

  @override
  List<Object?> get props => [activities, nextPageToken, hasMoreData, query];
}

/// Ajouter une activité Google à la DB
class AddGoogleActivityToDb extends GoogleActivityEvent {
  final Activity activity;

  const AddGoogleActivityToDb({required this.activity});

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

/// Rechercher des activités Google par catégorie
class SearchGoogleActivitiesByCategory extends GoogleActivityEvent {
  final String tripId;
  final String? destination;
  final double? latitude;
  final double? longitude;
  final ActivityCategory category;

  const SearchGoogleActivitiesByCategory({
    required this.tripId,
    this.destination,
    this.latitude,
    this.longitude,
    required this.category,
  });

  @override
  List<Object?> get props => [tripId, destination, latitude, longitude, category];
}

/// Effacer les résultats Google
class ClearGoogleActivities extends GoogleActivityEvent {
  const ClearGoogleActivities();
}