import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';

sealed class UserTableEvent extends Equatable {
  const UserTableEvent();
}

class GetRoles extends UserTableEvent {
  const GetRoles();
  @override
  List<Object?> get props => [];
}

class GetUsers extends UserTableEvent {
  const GetUsers();
  @override
  List<Object?> get props => [];
}

class ChangeUserStatus extends UserTableEvent {
  final String userId;
  final String newStatus;

  const ChangeUserStatus({required this.userId, required this.newStatus});

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

class SortUsersByNameAsc extends UserTableEvent {
  const SortUsersByNameAsc();

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

class SortUsersByNameDesc extends UserTableEvent {
  const SortUsersByNameDesc();

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

class StoreUsersEvent extends UserTableEvent {
  const StoreUsersEvent();

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

class DateNewestToOldestEvent extends UserTableEvent {
  const DateNewestToOldestEvent();

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

class DateOldestToNewestEvent extends UserTableEvent {
  const DateOldestToNewestEvent();

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

class SearchUsers extends UserTableEvent {
  final String query;
  SearchUsers(this.query);
  @override
  List<Object?> get props => [];
}

class ChangePage extends UserTableEvent {
  final int pageNumber;

  ChangePage(this.pageNumber);

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

class DeleteUserEvent extends UserTableEvent {
  final String userId;
  final BuildContext context;

  const DeleteUserEvent(this.userId, this.context);

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

class FilterUsersByRoleEvent extends UserTableEvent {
  final List<String>? selectedRoles;
  final String? sortOrder;

  const FilterUsersByRoleEvent({this.selectedRoles, this.sortOrder});
  List<Object?> get props => [selectedRoles, sortOrder];
}

class FilterUsersByJobEvent extends UserTableEvent {
  final List<String>? selectedJob;
  final String? sortOrder;

  const FilterUsersByJobEvent({this.selectedJob, this.sortOrder});
  List<Object?> get props => [selectedJob, sortOrder];
}

class FilterUsersByCreatedEvent extends UserTableEvent {
  final List<String>? selectedCreatedBy;

  final String? sortOrder;

  const FilterUsersByCreatedEvent({this.selectedCreatedBy, this.sortOrder});
  List<Object?> get props => [selectedCreatedBy, sortOrder];
}

class FilterUsersByDeActevateEvent extends UserTableEvent {
  final List<String>? selectedActivate;
  final String? sortOrder;

  const FilterUsersByDeActevateEvent({this.selectedActivate, this.sortOrder});
  List<Object?> get props => [selectedActivate, sortOrder];
}

class FilterOptionsEvent extends UserTableEvent {
  final String query;
  final List<String> fullOptions;

  FilterOptionsEvent({required this.query, required this.fullOptions});

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

class FilterClearEvent extends UserTableEvent {
  FilterClearEvent();
  @override
  List<Object?> get props => [];
}
