part of 'payment_form_bloc.dart';

@freezed
class PaymentFormState with _$PaymentFormState {
  factory PaymentFormState({
    required Order order,
    required List<OrderItem> pendingItems,
    required Option<Either<OrderFailure, Payment>> failureOrPayment,
    required Option<Either<OrderFailure, Payment>> failureOrPaymentSplitBill,
    PaymentMethod? paymentMethod,
    @Default(false) bool isSubmitting,
  }) = _PaymentFormState;

  factory PaymentFormState.initial() => PaymentFormState(
    order: Order.empty(),
    pendingItems: [],
    failureOrPayment: none(),
    failureOrPaymentSplitBill: none(),
  );
}
