fix: Make transactions atomic / AutoLogout

This commit is contained in:
2026-08-03 02:22:26 +02:00
parent 6060ca2713
commit 0997d110d4
14 changed files with 604 additions and 285 deletions
+12
View File
@@ -65,4 +65,16 @@ class InventoryViewModel extends ChangeNotifier {
rethrow;
}
}
void applyStockDelta(String productId, int delta) {
if (delta == 0) return;
final index = _products.indexWhere((product) => product.id == productId);
if (index == -1) return;
_products[index] = _products[index].copyWith(
stockQuantity: _products[index].stockQuantity + delta,
);
notifyListeners();
}
}