part of 'schedule_bloc.dart';

abstract class ScheduleEvent extends Equatable {
  const ScheduleEvent();
}

class ScheduleInitializeAddEvent extends ScheduleEvent {
  final bool isEditing;
  final ScheduleModes scheduleMode;
  final TimeOfDay? selectedTime;
  final List<bool>? selectedDays;
  final bool? functionOn;

  const ScheduleInitializeAddEvent({
    required this.isEditing,
    required this.scheduleMode,
    this.selectedTime,
    this.selectedDays,
    this.functionOn,
  });

  @override
  List<Object?> get props => [
        isEditing,
        scheduleMode,
        selectedTime,
        selectedDays,
        functionOn,
      ];
}

class ScheduleUpdateSelectedTimeEvent extends ScheduleEvent {
  final TimeOfDay selectedTime;

  const ScheduleUpdateSelectedTimeEvent(this.selectedTime);

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

class ScheduleUpdateSelectedDayEvent extends ScheduleEvent {
  final int index;
  final bool value;

  const ScheduleUpdateSelectedDayEvent(this.index, this.value);

  @override
  List<Object> get props => [index, value];
}

class ScheduleUpdateFunctionOnEvent extends ScheduleEvent {
  final bool isOn;

  const ScheduleUpdateFunctionOnEvent(this.isOn);

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

class ScheduleGetEvent extends ScheduleEvent {
  final String category;

  const ScheduleGetEvent({required this.category});

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

class ScheduleAddEvent extends ScheduleEvent {
  final String category;
  final String time;
  final List<String> selectedDays;
  final dynamic functionOn;
  final String? code;

  const ScheduleAddEvent({
    required this.category,
    required this.time,
    required this.selectedDays,
    required this.functionOn,
    required this.code,
  });

  @override
  List<Object?> get props => [category, time, selectedDays, functionOn, code];
}

class ScheduleEditEvent extends ScheduleEvent {
  final String scheduleId;
  final String category;
  final String time;
  final List<String> selectedDays;
  final bool functionOn;
  final String deviceType;

  const ScheduleEditEvent({
    required this.scheduleId,
    required this.category,
    required this.time,
    required this.selectedDays,
    required this.functionOn,
    required this.deviceType,
  });

  @override
  List<Object> get props => [
        scheduleId,
        category,
        time,
        selectedDays,
        functionOn,
        deviceType,
      ];
}

class ScheduleDeleteEvent extends ScheduleEvent {
  final String scheduleId;

  const ScheduleDeleteEvent(this.scheduleId);

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

class ScheduleUpdateEntryEvent extends ScheduleEvent {
  final String scheduleId;
  final bool functionOn;
  final bool enable;
  final String category;

  const ScheduleUpdateEntryEvent({
    required this.scheduleId,
    required this.functionOn,
    required this.enable,
    required this.category,
  });

  @override
  List<Object> get props => [scheduleId, functionOn, enable, category];
}

class UpdateScheduleModeEvent extends ScheduleEvent {
  final ScheduleModes scheduleMode;
  final String countdownCode;

  const UpdateScheduleModeEvent(
      {required this.scheduleMode, required this.countdownCode});

  @override
  List<Object> get props => [scheduleMode, countdownCode!];
}

class UpdateCountdownTimeEvent extends ScheduleEvent {
  final int hours;
  final int minutes;
  final int seconds;

  const UpdateCountdownTimeEvent({
    required this.hours,
    required this.minutes,
    required this.seconds,
  });

  @override
  List<Object> get props => [hours, minutes, seconds];
}

class UpdateInchingTimeEvent extends ScheduleEvent {
  final int hours;
  final int minutes;

  const UpdateInchingTimeEvent({
    required this.hours,
    required this.minutes,
  });

  @override
  List<Object> get props => [hours, minutes];
}

class StartScheduleEvent extends ScheduleEvent {
  final ScheduleModes mode;
  final int hours;
  final int minutes;
  final String countDownCode;

  const StartScheduleEvent({
    required this.mode,
    required this.hours,
    required this.minutes,
    required this.countDownCode,
  });

  @override
  List<Object?> get props => [mode, hours, minutes, countDownCode];
}

class StopScheduleEvent extends ScheduleEvent {
  final ScheduleModes mode;
  final String deviceId;
  final String countdownCode;

  const StopScheduleEvent({
    required this.mode,
    required this.deviceId,
    required this.countdownCode,
  });

  @override
  List<Object?> get props => [mode, deviceId, countdownCode];
}

class ScheduleDecrementCountdownEvent extends ScheduleEvent {
  const ScheduleDecrementCountdownEvent();

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

class ScheduleFetchStatusEvent extends ScheduleEvent {
  final String deviceId;
  final String countdownCode;

  const ScheduleFetchStatusEvent(
      {required this.deviceId, required this.countdownCode});

  @override
  List<Object> get props => [deviceId, countdownCode];
}

class DeleteScheduleEvent extends ScheduleEvent {
  final String scheduleId;

  const DeleteScheduleEvent(this.scheduleId);

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

class StatusUpdatedScheduleEvent extends ScheduleEvent {
  final String id;

  const StatusUpdatedScheduleEvent(this.id);

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