import 'package:be_happy/domain/entities/payment_card.dart';

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

enum PaymentConfirmStatus { initial, loading, success, failure }

class PaymentConfirmState {
  final PaymentConfirmStatus status;
  final PaymentCard? selectedCard;
  final String? errorMessage;
  final bool paymentCompleted;
  final ScooterOrder? order;
  final bool useBalance;
  final int userBalance;

  const PaymentConfirmState({
    this.status = PaymentConfirmStatus.initial,
    this.errorMessage,
    this.selectedCard,
    this.paymentCompleted = false,
    this.order,
    this.useBalance = false,
    this.userBalance = 0,
  });

  PaymentConfirmState copyWith({
    PaymentConfirmStatus? status,
    String? errorMessage,
    PaymentCard? selectedCard,
    bool? paymentCompleted,
    ScooterOrder? order,
    bool? useBalance,
    int? userBalance,
  }) {
    return PaymentConfirmState(
      status: status ?? this.status,
      errorMessage: errorMessage ?? this.errorMessage,
      selectedCard: selectedCard ?? this.selectedCard,
      paymentCompleted: paymentCompleted ?? this.paymentCompleted,
      order: order ?? this.order,
      useBalance: useBalance ?? this.useBalance,
      userBalance: userBalance ?? this.userBalance,
    );
  }
}