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:
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user