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

enum BankAccountStatus { initial, loading, loaded, error }

class BankAccountState extends Equatable {
  final BankAccountStatus status;
  final List<BankAccount> accounts;
  final String? errorMessage;
  final bool showForm;

  const BankAccountState({
    this.status = BankAccountStatus.initial,
    this.accounts = const [],
    this.errorMessage,
    this.showForm = false,
  });

  BankAccountState copyWith({
    BankAccountStatus? status,
    List<BankAccount>? accounts,
    String? errorMessage,
    bool? showForm,
  }) {
    return BankAccountState(
      status: status ?? this.status,
      accounts: accounts ?? this.accounts,
      errorMessage: errorMessage,
      showForm: showForm ?? this.showForm,
    );
  }

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