import 'package:equatable/equatable.dart';

class ServiceIndexState extends Equatable {
  final int pendingCount;
  final int occupiedRooms;
  final int vacantRooms;
  final List<String> floors;
  final String? selectedFloor;
  final String? selectedType;
  final String? selectedRoom;
  final String searchText;
  final List<Map<String, dynamic>> rooms;

  const ServiceIndexState({
    this.pendingCount = 0,
    this.occupiedRooms = 0,
    this.vacantRooms = 0,
    this.floors = const [],
    this.selectedFloor,
    this.selectedType,
    this.selectedRoom,
    this.searchText = '',
    this.rooms = const [],
  });

  ServiceIndexState copyWith({
    int? pendingCount,
    int? occupiedRooms,
    int? vacantRooms,
    List<String>? floors,
    String? selectedFloor,
    String? selectedType,
    String? selectedRoom,
    String? searchText,
    List<Map<String, dynamic>>? rooms,
  }) {
    return ServiceIndexState(
      pendingCount: pendingCount ?? this.pendingCount,
      occupiedRooms: occupiedRooms ?? this.occupiedRooms,
      vacantRooms: vacantRooms ?? this.vacantRooms,
      floors: floors ?? this.floors,
      selectedFloor: selectedFloor ?? this.selectedFloor,
      selectedType: selectedType ?? this.selectedType,
      selectedRoom: selectedRoom ?? this.selectedRoom,
      searchText: searchText ?? this.searchText,
      rooms: rooms ?? this.rooms,
    );
  }

  @override
  List<Object?> get props => [
        pendingCount,
        occupiedRooms,
        vacantRooms,
        floors,
        selectedFloor,
        selectedType,
        selectedRoom,
        searchText,
        rooms,
      ];
}