feat: add payment method
This commit is contained in:
@@ -115,18 +115,18 @@ class BarScreenViewModel extends ChangeNotifier {
|
||||
await _reloadTabs();
|
||||
}
|
||||
|
||||
Future<void> closeSelectedTab() async {
|
||||
Future<void> closeSelectedTab({String paymentMethod = 'cash'}) async {
|
||||
final tab = selectedTab;
|
||||
|
||||
if (tab == null) return;
|
||||
|
||||
await barTabService.closeTab(tab.id);
|
||||
await barTabService.closeTab(tab.id, paymentMethod: paymentMethod);
|
||||
|
||||
await _reloadTabs();
|
||||
}
|
||||
|
||||
Future<void> closeTab(String tabId) async {
|
||||
await barTabService.closeTab(tabId);
|
||||
Future<void> closeTab(String tabId, {String paymentMethod = 'cash'}) async {
|
||||
await barTabService.closeTab(tabId, paymentMethod: paymentMethod);
|
||||
|
||||
await _reloadTabs();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:kooltab2/database/app_database.dart';
|
||||
import 'package:kooltab2/services/bar_tab_service.dart';
|
||||
import 'package:kooltab2/services/pin_lock_service.dart';
|
||||
@@ -274,6 +275,7 @@ class DevMenuViewModel extends ChangeNotifier {
|
||||
'Sam', 'Tina', 'Umar', 'Vera', 'Wes', 'Xena',
|
||||
'Yves', 'Zara',
|
||||
];
|
||||
const paymentMethods = ['cash', 'payconiq'];
|
||||
|
||||
await database.transaction(() async {
|
||||
for (var i = 0; i < count; i++) {
|
||||
@@ -295,6 +297,7 @@ class DevMenuViewModel extends ChangeNotifier {
|
||||
originalTabId: uuid.v4(),
|
||||
customerName: customer,
|
||||
closedAt: closedAt,
|
||||
paymentMethod: Value(paymentMethods[(i * 3) % paymentMethods.length]),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user