feat: New Open Tab dialog with search and optional customer email. Drinks are now grouped per order. Payments trigger cha-ching and money rain.

This commit is contained in:
2026-10-28 02:11:32 +01:00
parent 1aee0541c4
commit 29ceb51177
41 changed files with 2771 additions and 812 deletions
+13 -1
View File
@@ -8,7 +8,15 @@ class ServerUnit {
final DateTime addedAt;
final DateTime? removedAt;
const ServerUnit({required this.id, required this.addedAt, this.removedAt});
/// The order it was rung up in; null for drinks from older app versions.
final String? orderId;
const ServerUnit({
required this.id,
required this.addedAt,
this.removedAt,
this.orderId,
});
factory ServerUnit.fromJson(Map<String, dynamic> json) {
return ServerUnit(
@@ -18,6 +26,7 @@ class ServerUnit {
final String value => DateTime.parse(value).toLocal(),
_ => null,
},
orderId: json['orderId'] as String?,
);
}
}
@@ -58,6 +67,7 @@ class ServerTabLine {
class ServerTab {
final String id;
final String customerName;
final String? email;
final DateTime openedAt;
final int version;
final List<ServerTabLine> lines;
@@ -65,6 +75,7 @@ class ServerTab {
const ServerTab({
required this.id,
required this.customerName,
this.email,
required this.openedAt,
required this.version,
this.lines = const [],
@@ -74,6 +85,7 @@ class ServerTab {
return ServerTab(
id: json['id'] as String,
customerName: json['customerName'] as String,
email: json['email'] as String?,
openedAt: DateTime.parse(json['openedAt'] as String).toLocal(),
version: json['version'] as int? ?? 0,
lines: [