import 'package:equatable/equatable.dart';
import 'package:smart_hotel_app/models/bo/room_bo.dart';

class ServiceIndexState extends Equatable {
  final int pendingCount;
  final int occupiedRooms;
  final int vacantRooms;
  // final List<String> floors;
  final List<Map<int,String>>? floors;
  final List<String> areas;
  final String? selectedFloor;
  final String? selectedType;
  final String? selectedRoom;
  final String searchText;
  final List<Map<String, dynamic>> rooms;
  final List<AreaDeviceBO> areaDevices;
  final bool isLoading;
  final bool isLoadingAreaDevices;
  final String? error;
  final bool isPoweringOn;
  final bool isPoweringOff;

  const ServiceIndexState({
    this.pendingCount = 0,
    this.occupiedRooms = 0,
    this.vacantRooms = 0,
    this.floors = const [],
    this.areas = const [],
    this.selectedFloor,
    this.selectedType,
    this.selectedRoom,
    this.searchText = '',
    this.rooms = const [],
    this.areaDevices = const [],
    this.isLoading = false,
    this.isLoadingAreaDevices = false,
    this.error,
    this.isPoweringOn = false,
    this.isPoweringOff = false,
  });

  ServiceIndexState copyWith({
    int? pendingCount,
    int? occupiedRooms,
    int? vacantRooms,
    // List<String>? floors,
    List<Map<int,String>>? floors,
    List<String>? areas,
    String? selectedFloor,
    String? selectedType,
    String? selectedRoom,
    String? searchText,
    List<Map<String, dynamic>>? rooms,
    List<AreaDeviceBO>? areaDevices,
    bool? isLoading,
    bool? isLoadingAreaDevices,
    String? error,
    bool? isPoweringOn,
    bool? isPoweringOff,
  }) {
    return ServiceIndexState(
      pendingCount: pendingCount ?? this.pendingCount,
      occupiedRooms: occupiedRooms ?? this.occupiedRooms,
      vacantRooms: vacantRooms ?? this.vacantRooms,
      floors: floors ?? this.floors,
      areas: areas ?? this.areas,
      selectedFloor: selectedFloor ?? this.selectedFloor,
      selectedType: selectedType ?? this.selectedType,
      selectedRoom: selectedRoom ?? this.selectedRoom,
      searchText: searchText ?? this.searchText,
      rooms: rooms ?? this.rooms,
      areaDevices: areaDevices ?? this.areaDevices,
      isLoading: isLoading ?? this.isLoading,
      isLoadingAreaDevices: isLoadingAreaDevices ?? this.isLoadingAreaDevices,
      error: error ?? this.error,
      isPoweringOn: isPoweringOn ?? this.isPoweringOn,
      isPoweringOff: isPoweringOff ?? this.isPoweringOff,
    );
  }

  @override
  List<Object?> get props => [
        pendingCount,
        occupiedRooms,
        vacantRooms,
        floors,
        areas,
        selectedFloor,
        selectedType,
        selectedRoom,
        searchText,
        rooms,
        areaDevices,
        isLoading,
        isLoadingAreaDevices,
        error,
        isPoweringOn,
        isPoweringOff,
      ];
}