part of 'home_cubit.dart';

enum HomeStatus { initial, loading, loaded, error }

class HomeState extends Equatable {
  final HomeStatus status;
  final List<Shift> todayShifts;
  final List<Shift> tomorrowShifts;
  final List<Shift> recommendedShifts;
  final bool autoMatchEnabled;
  final bool isProfileComplete;
  final String? staffName;
  final String? errorMessage;

  const HomeState({
    required this.status,
    this.todayShifts = const [],
    this.tomorrowShifts = const [],
    this.recommendedShifts = const [],
    this.autoMatchEnabled = false,
    this.isProfileComplete = false,
    this.staffName,
    this.errorMessage,
  });

  const HomeState.initial() : this(status: HomeStatus.initial);

  HomeState copyWith({
    HomeStatus? status,
    List<Shift>? todayShifts,
    List<Shift>? tomorrowShifts,
    List<Shift>? recommendedShifts,
    bool? autoMatchEnabled,
    bool? isProfileComplete,
    String? staffName,
    String? errorMessage,
  }) {
    return HomeState(
      status: status ?? this.status,
      todayShifts: todayShifts ?? this.todayShifts,
      tomorrowShifts: tomorrowShifts ?? this.tomorrowShifts,
      recommendedShifts: recommendedShifts ?? this.recommendedShifts,
      autoMatchEnabled: autoMatchEnabled ?? this.autoMatchEnabled,
      isProfileComplete: isProfileComplete ?? this.isProfileComplete,
      staffName: staffName ?? this.staffName,
      errorMessage: errorMessage ?? this.errorMessage,
    );
  }

  @override
  List<Object?> get props => [
        status,
        todayShifts,
        tomorrowShifts,
        recommendedShifts,
        autoMatchEnabled,
        isProfileComplete,
        staffName,
        errorMessage,
      ];
}