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

abstract class ClockInEvent extends Equatable {
  const ClockInEvent();

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

class ClockInPageLoaded extends ClockInEvent {}

class ShiftSelected extends ClockInEvent {
  const ShiftSelected(this.shift);
  final Shift shift;

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

class DateSelected extends ClockInEvent {

  const DateSelected(this.date);
  final DateTime date;

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

class CheckInRequested extends ClockInEvent {

  const CheckInRequested({required this.shiftId, this.notes});
  final String shiftId;
  final String? notes;

  @override
  List<Object?> get props => <Object?>[shiftId, notes];
}

class CheckOutRequested extends ClockInEvent {

  const CheckOutRequested({this.notes, this.breakTimeMinutes});
  final String? notes;
  final int? breakTimeMinutes;

  @override
  List<Object?> get props => <Object?>[notes, breakTimeMinutes];
}

class CheckInModeChanged extends ClockInEvent {

  const CheckInModeChanged(this.mode);
  final String mode;

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

class CommuteModeToggled extends ClockInEvent {

  const CommuteModeToggled(this.isEnabled);
  final bool isEnabled;

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

class RequestLocationPermission extends ClockInEvent {}

class LocationUpdated extends ClockInEvent {

  const LocationUpdated({required this.position, required this.distance, required this.isVerified});
  final Position position;
  final double distance;
  final bool isVerified;
  
  @override
  List<Object?> get props => <Object?>[position, distance, isVerified];
}
