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

/// Base state for the [ClientCreateOrderBloc].
abstract class ClientCreateOrderState extends Equatable {
  const ClientCreateOrderState();

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

/// Initial state when order types haven't been loaded yet.
class ClientCreateOrderInitial extends ClientCreateOrderState {
  const ClientCreateOrderInitial();
}

/// State representing successfully loaded order types from the repository.
class ClientCreateOrderLoadSuccess extends ClientCreateOrderState {
  const ClientCreateOrderLoadSuccess(this.orderTypes);

  /// The list of available order types retrieved from the domain.
  final List<OrderType> orderTypes;

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

/// State representing a failure to load order types.
class ClientCreateOrderLoadFailure extends ClientCreateOrderState {
  const ClientCreateOrderLoadFailure(this.error);

  final String error;

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