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

abstract class OneTimeOrderEvent extends Equatable {
  const OneTimeOrderEvent();

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

class OneTimeOrderVendorsLoaded extends OneTimeOrderEvent {
  const OneTimeOrderVendorsLoaded(this.vendors);
  final List<Vendor> vendors;

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

class OneTimeOrderVendorChanged extends OneTimeOrderEvent {
  const OneTimeOrderVendorChanged(this.vendor);
  final Vendor vendor;

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

class OneTimeOrderDateChanged extends OneTimeOrderEvent {
  const OneTimeOrderDateChanged(this.date);
  final DateTime date;

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

class OneTimeOrderLocationChanged extends OneTimeOrderEvent {
  const OneTimeOrderLocationChanged(this.location);
  final String location;

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

class OneTimeOrderPositionAdded extends OneTimeOrderEvent {
  const OneTimeOrderPositionAdded();
}

class OneTimeOrderPositionRemoved extends OneTimeOrderEvent {
  const OneTimeOrderPositionRemoved(this.index);
  final int index;

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

class OneTimeOrderPositionUpdated extends OneTimeOrderEvent {
  const OneTimeOrderPositionUpdated(this.index, this.position);
  final int index;
  final OneTimeOrderPosition position;

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

class OneTimeOrderSubmitted extends OneTimeOrderEvent {
  const OneTimeOrderSubmitted();
}
