import 'package:equatable/equatable.dart';
import 'package:krow_domain/krow_domain.dart';

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

class LoadAvailability extends AvailabilityEvent {
  final DateTime weekStart;
  final DateTime? preselectedDate; // Maintain selection after reload

  const LoadAvailability(this.weekStart, {this.preselectedDate});
  
  @override
  List<Object?> get props => [weekStart, preselectedDate];
}

class SelectDate extends AvailabilityEvent {
  final DateTime date;
  const SelectDate(this.date);
  @override
  List<Object?> get props => [date];
}

class ToggleDayStatus extends AvailabilityEvent {
  final DayAvailability day;
  const ToggleDayStatus(this.day);
  @override
  List<Object?> get props => [day];
}

class ToggleSlotStatus extends AvailabilityEvent {
  final DayAvailability day;
  final String slotId;
  const ToggleSlotStatus(this.day, this.slotId);
  @override
  List<Object?> get props => [day, slotId];
}

class NavigateWeek extends AvailabilityEvent {
  final int direction; // -1 or 1
  const NavigateWeek(this.direction);
  @override
  List<Object?> get props => [direction];
}

class PerformQuickSet extends AvailabilityEvent {
  final String type; // all, weekdays, weekends, clear
  const PerformQuickSet(this.type);
  @override
  List<Object?> get props => [type];
}
