50 lines
1.6 KiB
Dart
Raw Normal View History

2025-07-30 22:38:44 +07:00
part of 'checkout_bloc.dart';
@freezed
class CheckoutEvent with _$CheckoutEvent {
2025-09-01 22:12:56 +07:00
const factory CheckoutEvent.started(List<ProductQuantity> items) = _Started;
2025-07-30 22:38:44 +07:00
//add item
2025-08-04 17:42:39 +07:00
const factory CheckoutEvent.addItem(
Product product, ProductVariant? variant) = _AddItem;
2025-07-30 22:38:44 +07:00
//remove item
2025-08-04 17:42:39 +07:00
const factory CheckoutEvent.removeItem(
Product product, ProductVariant? variant) = _RemoveItem;
2025-08-02 11:06:41 +07:00
// Delete Item
2025-08-04 17:42:39 +07:00
const factory CheckoutEvent.deleteItem(
Product product, ProductVariant? variant) = _DeleteItem;
2025-07-30 22:38:44 +07:00
//add discount
const factory CheckoutEvent.addDiscount(Discount discount) = _AddDiscount;
//remove discount
const factory CheckoutEvent.removeDiscount() = _RemoveDiscount;
//add tax
const factory CheckoutEvent.addTax(int tax) = _AddTax;
//add service charge
const factory CheckoutEvent.addServiceCharge(int serviceCharge) =
_AddServiceCharge;
//remove tax
const factory CheckoutEvent.removeTax() = _RemoveTax;
//remove service charge
2025-08-02 11:06:41 +07:00
const factory CheckoutEvent.removeServiceCharge() = _RemoveServiceCharge;
2025-07-30 22:38:44 +07:00
//update order type
2025-08-02 11:06:41 +07:00
const factory CheckoutEvent.updateOrderType(OrderType orderType) =
_UpdateOrderType;
2025-07-30 22:38:44 +07:00
//update item notes
2025-08-02 11:06:41 +07:00
const factory CheckoutEvent.updateItemNotes(Product product, String notes) =
_UpdateItemNotes;
2025-07-30 22:38:44 +07:00
//save draft order
const factory CheckoutEvent.saveDraftOrder(
int tableNumber, String draftName, int discountAmount) = _SaveDraftOrder;
//load draft order
const factory CheckoutEvent.loadDraftOrder(DraftOrderModel data) =
_LoadDraftOrder;
2025-08-06 18:47:20 +07:00
// Update delivery type
const factory CheckoutEvent.updateDeliveryType(DeliveryModel delivery) =
_UpdateDeliveryType;
2025-07-30 22:38:44 +07:00
}