feat: make server owner of tabs

This commit is contained in:
2026-10-20 16:15:14 +02:00
parent 5754ae742d
commit 93acfe15a9
26 changed files with 3654 additions and 389 deletions
@@ -10,7 +10,6 @@ import '../models/payment_method.dart';
import '../models/product.dart';
import '../models/tab_item.dart';
import '../services/bar_tab_service.dart';
import '../services/product_service.dart';
/// Tabs come from a database stream, so every change (local or remote) shows
/// up without manual reloads. Actions report to Sentry and rethrow; the view
@@ -129,12 +128,9 @@ class BarScreenViewModel extends ChangeNotifier {
);
}
/// Running out of stock is an expected outcome, not a bug worth reporting.
Future<T> _guard<T>(String action, Future<T> Function() body) async {
try {
return await body();
} on InsufficientStockException {
rethrow;
} catch (e, stack) {
debugPrint('BarScreenViewModel: $action error: $e');
unawaited(Sentry.captureException(e, stackTrace: stack));