48 lines
1.2 KiB
Dart
48 lines
1.2 KiB
Dart
import '../../models/all_coupons_model.dart';
|
|
|
|
abstract class CheckoutEvent {}
|
|
|
|
class FetchCheckoutCouponsEvent extends CheckoutEvent {}
|
|
|
|
class ApplyCouponEvent extends CheckoutEvent {
|
|
final AllCouponsModel coupon;
|
|
ApplyCouponEvent({required this.coupon});
|
|
}
|
|
/// 🆕 Apply Coupon to Backend Event
|
|
class ApplyCouponToBackendEvent extends CheckoutEvent {
|
|
final int bookingId;
|
|
final String couponCode;
|
|
|
|
ApplyCouponToBackendEvent({
|
|
required this.bookingId,
|
|
required this.couponCode,
|
|
});
|
|
}
|
|
|
|
class RemoveCouponEvent extends CheckoutEvent {
|
|
final int bookingId;
|
|
|
|
RemoveCouponEvent({required this.bookingId});
|
|
}
|
|
|
|
/// 🆕 Initiate Payment Event
|
|
/// Triggered when user clicks "Pay" button
|
|
class InitiatePaymentEvent extends CheckoutEvent {
|
|
final int bookingId;
|
|
|
|
InitiatePaymentEvent({required this.bookingId});
|
|
}
|
|
|
|
/// 🆕 Confirm Payment Event
|
|
/// Triggered after Stripe payment completes (success or failure)
|
|
class ConfirmPaymentEvent extends CheckoutEvent {
|
|
final int bookingId;
|
|
final String stripeStatus; // e.g., "succeeded", "requires_payment_method"
|
|
final String paymentStatus; // e.g., "success", "failed"
|
|
|
|
ConfirmPaymentEvent({
|
|
required this.bookingId,
|
|
required this.stripeStatus,
|
|
required this.paymentStatus,
|
|
});
|
|
} |