import '../../domain/entities/payment_card.dart';

enum PaymentMethodsStatus { initial, loading, success, failure }

class PaymentMethodsState {
  final PaymentMethodsStatus status;
  final List<PaymentCard> cards;
  final int balance;
  final String? errorMessage;
  final bool isDeleting;
  final bool isSettingMain;

  PaymentMethodsState({
    this.status = PaymentMethodsStatus.initial,
    this.cards = const [],
    this.balance = 99,
    this.errorMessage,
    this.isDeleting = false,
    this.isSettingMain = false,
  });

  PaymentMethodsState copyWith({
    PaymentMethodsStatus? status,
    List<PaymentCard>? cards,
    int? balance,
    String? errorMessage,
    bool? isDeleting,
    bool? isSettingMain,
  }) =>
      PaymentMethodsState(
        status: status ?? this.status,
        cards: cards ?? this.cards,
        balance: balance ?? this.balance,
        errorMessage: errorMessage ?? this.errorMessage,
        isDeleting: isDeleting ?? this.isDeleting,
        isSettingMain: isSettingMain ?? this.isSettingMain,
      );
}
