feat: add more detailed history and group per day

This commit is contained in:
2026-08-07 05:07:41 +02:00
parent 1dd7e69aa8
commit 799c1c4045
23 changed files with 2506 additions and 346 deletions
+19 -9
View File
@@ -5,6 +5,8 @@ class ClosedTabItem {
final String productName;
final int quantity;
final int unitPriceInCents;
final DateTime? purchasedAt;
final DateTime? removedAt;
ClosedTabItem({
required this.id,
@@ -13,9 +15,13 @@ class ClosedTabItem {
required this.productName,
required this.quantity,
required this.unitPriceInCents,
this.purchasedAt,
this.removedAt,
});
int get lineTotalInCents => quantity * unitPriceInCents;
bool get isRemoved => removedAt != null;
int get lineTotalInCents => isRemoved ? 0 : quantity * unitPriceInCents;
@override
bool operator ==(Object other) =>
@@ -26,15 +32,19 @@ class ClosedTabItem {
productId == other.productId &&
productName == other.productName &&
quantity == other.quantity &&
unitPriceInCents == other.unitPriceInCents;
unitPriceInCents == other.unitPriceInCents &&
purchasedAt == other.purchasedAt &&
removedAt == other.removedAt;
@override
int get hashCode => Object.hash(
id,
closedTabId,
productId,
productName,
quantity,
unitPriceInCents,
);
id,
closedTabId,
productId,
productName,
quantity,
unitPriceInCents,
purchasedAt,
removedAt,
);
}