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
+3 -4
View File
@@ -4,7 +4,6 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:kooltap/models/bar_tab.dart';
import 'package:kooltap/models/tab_item.dart';
import 'package:kooltap/services/bar_tab_service.dart';
import 'package:kooltap/services/product_service.dart';
import 'package:kooltap/viewmodels/bar_screen_view_model.dart';
import 'package:mocktail/mocktail.dart';
@@ -87,7 +86,7 @@ void main() {
expect(viewModel.isLoading, false);
});
test('propagates an insufficient-stock error from the transaction', () async {
test('propagates an error from the transaction', () async {
const item = TabItem(
id: 'item-1',
tabId: 'tab-1',
@@ -99,11 +98,11 @@ void main() {
when(
() => barTabService.adjustTabItemQuantity(tabItemId: 'item-1', delta: 1),
).thenAnswer((_) async => throw const InsufficientStockException());
).thenAnswer((_) async => throw const TabNotFoundException('tab-1'));
await expectLater(
viewModel.changeItemQuantity(item, 1),
throwsA(isA<InsufficientStockException>()),
throwsA(isA<TabNotFoundException>()),
);
expect(viewModel.loadError, isNull);