feat: add payment method
This commit is contained in:
@@ -29,7 +29,7 @@ abstract class BarTabService {
|
||||
|
||||
/// Archives the tab's current items into history and clears them.
|
||||
/// The tab itself stays open under the same customer name.
|
||||
Future<void> closeTab(String tabId);
|
||||
Future<void> closeTab(String tabId, {String paymentMethod = 'cash'});
|
||||
|
||||
Future<List<ClosedTab>> getClosedTabs();
|
||||
|
||||
@@ -234,7 +234,7 @@ class DriftBarTabService implements BarTabService {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> closeTab(String tabId) async {
|
||||
Future<void> closeTab(String tabId, {String paymentMethod = 'cash'}) async {
|
||||
await database.transaction(() async {
|
||||
final tabQuery = database.select(database.barTabs)
|
||||
..where((tab) => tab.id.equals(tabId));
|
||||
@@ -261,6 +261,7 @@ class DriftBarTabService implements BarTabService {
|
||||
originalTabId: tabId,
|
||||
customerName: tabRow.customerName,
|
||||
closedAt: DateTime.now(),
|
||||
paymentMethod: Value(paymentMethod),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -325,6 +326,7 @@ class DriftBarTabService implements BarTabService {
|
||||
originalTabId: row.originalTabId,
|
||||
customerName: row.customerName,
|
||||
closedAt: row.closedAt,
|
||||
paymentMethod: row.paymentMethod,
|
||||
items: itemRows.map<ClosedTabItem>(_mapClosedItemRow).toList(),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user