part of 'order_loader_bloc.dart';

@freezed
class OrderLoaderState with _$OrderLoaderState {
  const factory OrderLoaderState({
    required List<Order> orders,
    required Option<OrderFailure> failureOptionOrder,
    required String status,
    String? search,
    String? outletId,
    @Default(false) bool isFetching,
    @Default(false) bool hasReachedMax,
    @Default(1) int page,
    required DateTime dateFrom,
    required DateTime dateTo,
  }) = _OrderLoaderState;

  factory OrderLoaderState.initial() => OrderLoaderState(
    orders: [],
    failureOptionOrder: none(),
    dateFrom: DateTime.now(),
    dateTo: DateTime.now(),
    status: 'all',
  );
}
