split bill
This commit is contained in:
@@ -35,3 +35,37 @@ class PaymentItemRequest with _$PaymentItemRequest {
|
||||
factory PaymentItemRequest.empty() =>
|
||||
const PaymentItemRequest(orderItemId: '', amount: 0);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class PaymentSplitBillRequest with _$PaymentSplitBillRequest {
|
||||
const factory PaymentSplitBillRequest({
|
||||
required String orderId,
|
||||
required String paymentMethodId,
|
||||
required String customerId,
|
||||
required String customerName,
|
||||
required SplitType type, // e.g., "AMOUNT" or "ITEM"
|
||||
required int amount,
|
||||
required List<PaymentItemSplitBillRequest> items,
|
||||
}) = _PaymentSplitBillRequest;
|
||||
|
||||
factory PaymentSplitBillRequest.empty() => const PaymentSplitBillRequest(
|
||||
orderId: '',
|
||||
paymentMethodId: '',
|
||||
customerId: '',
|
||||
type: SplitType.unknown,
|
||||
amount: 0,
|
||||
items: [],
|
||||
customerName: '',
|
||||
);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class PaymentItemSplitBillRequest with _$PaymentItemSplitBillRequest {
|
||||
const factory PaymentItemSplitBillRequest({
|
||||
required String orderItemId,
|
||||
required int quantity,
|
||||
}) = _PaymentItemSplitBillRequest;
|
||||
|
||||
factory PaymentItemSplitBillRequest.empty() =>
|
||||
const PaymentItemSplitBillRequest(orderItemId: '', quantity: 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user