part of 'customers_list_cubit.dart';

enum CustomersListStatus {
  initial,
  loading,
  filesLoading,
  filesUploading,
  success,
  failure,
}

class CustomersListState extends Equatable {
  final CustomersListStatus status;
  final List<CustomerModel> customers;
  final CustomerModel? lastCreatedCustomer;
  final String? errorMessage;

  const CustomersListState({
    this.status = CustomersListStatus.initial,
    this.customers = const [],
    this.lastCreatedCustomer,
    this.errorMessage,
  });

  CustomersListState copyWith({
    CustomersListStatus? status,
    List<CustomerModel>? customers,
    CustomerModel? lastCreatedCustomer,
    String? errorMessage,
  }) {
    return CustomersListState(
      status: status ?? this.status,
      customers: customers ?? this.customers,
      lastCreatedCustomer: lastCreatedCustomer ?? this.lastCreatedCustomer,
      errorMessage: errorMessage ?? this.errorMessage,
    );
  }

  @override
  List<Object?> get props => [
    status,
    customers,
    lastCreatedCustomer,
    errorMessage,
  ];
}
